Updated welcome.exe.

svn path=/trunk/; revision=7154
This commit is contained in:
Eric Kohl 2003-12-21 14:38:25 +00:00
parent 22e7c1f6cb
commit d44ee8c1b1
13 changed files with 147 additions and 155 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.4 2003/11/16 21:46:46 sedwards Exp $ # $Id: Makefile,v 1.5 2003/12/21 14:38:25 ekohl Exp $
PATH_TO_TOP = ../../.. PATH_TO_TOP = ../../..
@ -10,14 +10,12 @@ TARGET_NAME = welcome
TARGET_INSTALLDIR = system32 TARGET_INSTALLDIR = system32
TARGET_CFLAGS = -D__USE_W32API TARGET_CFLAGS = -Wall -Werror
TARGET_SDKLIBS = kernel32.a gdi32.a user32.a TARGET_SDKLIBS = kernel32.a gdi32.a user32.a
TARGET_OBJECTS = $(TARGET_NAME).o TARGET_OBJECTS = $(TARGET_NAME).o
TARGET_CFLAGS = -Wall -Werror
include $(PATH_TO_TOP)/rules.mak include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk include $(TOOLS_PATH)/helper.mk

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

@ -3,7 +3,7 @@
#define IDS_DEFAULTTOPICTITLE 1001 #define IDS_DEFAULTTOPICTITLE 1001
#define IDS_DEFAULTTOPICDESC 1002 #define IDS_DEFAULTTOPICDESC 1002
#define IDS_FONTNAME 1003 #define IDS_FONTNAME 1003
//#define IDS_CHECKTEXT 1004 #define IDS_CHECKTEXT 1004
#define IDS_CLOSETEXT 1005 #define IDS_CLOSETEXT 1005
#define IDS_TOPICBUTTON0 1010 #define IDS_TOPICBUTTON0 1010
@ -65,10 +65,7 @@
/* Bitmaps */ /* Bitmaps */
#define IDB_TITLEBITMAP 101 #define IDB_TITLEBITMAP 101
#define IDB_DEFAULTTOPICBITMAP 102 #define IDB_DEFAULTTOPICBITMAP 102
#define IDB_TBACKGROUNDBITMAP 103
#define IDB_RBACKGROUNDBITMAP 104
#if 0
#define IDB_TOPICBITMAP0 110 #define IDB_TOPICBITMAP0 110
#define IDB_TOPICBITMAP1 111 #define IDB_TOPICBITMAP1 111
#define IDB_TOPICBITMAP2 112 #define IDB_TOPICBITMAP2 112
@ -79,8 +76,6 @@
#define IDB_TOPICBITMAP7 117 #define IDB_TOPICBITMAP7 117
#define IDB_TOPICBITMAP8 118 #define IDB_TOPICBITMAP8 118
#define IDB_TOPICBITMAP9 119 #define IDB_TOPICBITMAP9 119
#endif
#define IDC_CLOSEBUTTON 2000 #define IDC_CLOSEBUTTON 2000
#define IDC_CHECKBUTTON 2001 #define IDC_CHECKBUTTON 2001

View file

@ -1,6 +1,6 @@
/* /*
* ReactOS applications * ReactOS applications
* Copyright (C) 2001, 2002 ReactOS Team * Copyright (C) 2001, 2002, 2003 ReactOS Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -16,14 +16,20 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: welcome.c,v 1.3 2003/10/18 18:49:08 weiden Exp $ /* $Id: welcome.c,v 1.4 2003/12/21 14:38:25 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS welcome/autorun application * PROJECT: ReactOS welcome/autorun application
* FILE: subsys/system/welcome/welcome.c * FILE: subsys/system/welcome/welcome.c
* PROGRAMMERS: Eric Kohl (ekohl@rz-online.de) * PROGRAMMERS: Eric Kohl (ekohl@rz-online.de)
* Casper S. Hornstrup (chorns@users.sourceforge.net) * Casper S. Hornstrup (chorns@users.sourceforge.net)
*
* NOTE:
* This utility can be customized by modifying the resources.
* Please do NOT change the source code in order to customize this
* utility but change the resources!
*/ */
#include "../../../include/reactos/version.h" #include "../../../include/reactos/version.h"
#include <windows.h> #include <windows.h>
#include <string.h> #include <string.h>
@ -34,14 +40,16 @@
#define LIGHT_BLUE 0x00F0CAA6 #define LIGHT_BLUE 0x00F7EFD6
#define DARK_BLUE 0x00996633 #define DARK_BLUE 0x008C7B6B
#define TITLE_WIDTH 480
#define TITLE_HEIGHT 93
/* GLOBALS ******************************************************************/ /* GLOBALS ******************************************************************/
TCHAR szFrameClass [] = "WelcomeWindowClass"; TCHAR szFrameClass [] = TEXT("WelcomeWindowClass");
TCHAR szAppTitle [80]; TCHAR szAppTitle [80];
HINSTANCE hInstance; HINSTANCE hInstance;
@ -49,19 +57,18 @@ HINSTANCE hInstance;
HWND hwndMain = 0; HWND hwndMain = 0;
HWND hwndDefaultTopic = 0; HWND hwndDefaultTopic = 0;
HBITMAP hTitleBitmap = 0;
HBITMAP hTopBackgroundBitmap = 0;
HBITMAP hRightBackgroundBitmap = 0;
HDC hdcDisplay=0; HDC hdcDisplay=0;
HDC hdcMem = 0; HDC hdcMem = 0;
int nTopic = -1; int nTopic = -1;
int nDefaultTopic = -1; int nDefaultTopic = -1;
ULONG ulInnerWidth = 480; ULONG ulInnerWidth = TITLE_WIDTH;
ULONG ulInnerHeight = 360; ULONG ulInnerHeight = (TITLE_WIDTH * 3) / 4;
ULONG ulTitleHeight = TITLE_HEIGHT + 3;
HBITMAP hDefaultTopicBitmap; HBITMAP hTitleBitmap = 0;
HBITMAP hDefaultTopicBitmap = 0;
HBITMAP hTopicBitmap[10]; HBITMAP hTopicBitmap[10];
HWND hwndTopicButton[10]; HWND hwndTopicButton[10];
HWND hwndCloseButton; HWND hwndCloseButton;
@ -72,8 +79,6 @@ HFONT hfontTopicTitle;
HFONT hfontTopicDescription; HFONT hfontTopicDescription;
HFONT hfontCheckButton; HFONT hfontCheckButton;
HFONT hfontBannerTitle;
HBRUSH hbrLightBlue; HBRUSH hbrLightBlue;
HBRUSH hbrDarkBlue; HBRUSH hbrDarkBlue;
HBRUSH hbrRightPanel; HBRUSH hbrRightPanel;
@ -106,6 +111,7 @@ WinMain(HINSTANCE hInst,
RECT rcWindow; RECT rcWindow;
HICON hMainIcon; HICON hMainIcon;
DWORD dwStyle = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU | WS_VISIBLE; DWORD dwStyle = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU | WS_VISIBLE;
BITMAP BitmapInfo;
hInstance = hInst; hInstance = hInst;
@ -119,7 +125,7 @@ WinMain(HINSTANCE hInst,
wndclass.cbWndExtra = 0; wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance; wndclass.hInstance = hInstance;
wndclass.hIcon = hMainIcon; wndclass.hIcon = hMainIcon;
wndclass.hCursor = LoadCursor (NULL, (LPCTSTR)IDC_ARROW); wndclass.hCursor = LoadCursor (NULL, MAKEINTRESOURCE(IDC_ARROW));
wndclass.hbrBackground = 0; wndclass.hbrBackground = 0;
wndclass.lpszMenuName = NULL; wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szFrameClass; wndclass.lpszClassName = szFrameClass;
@ -129,6 +135,16 @@ WinMain(HINSTANCE hInst,
RegisterClassEx(&wndclass); RegisterClassEx(&wndclass);
hTitleBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TITLEBITMAP));
if (hTitleBitmap != NULL)
{
GetObject(hTitleBitmap, sizeof(BITMAP), &BitmapInfo);
ulInnerWidth = BitmapInfo.bmWidth;
ulInnerHeight = (ulInnerWidth * 3) / 4;
ulTitleHeight = BitmapInfo.bmHeight + 3;
}
ulInnerHeight -= GetSystemMetrics(SM_CYCAPTION);
rcWindow.top = 0; rcWindow.top = 0;
rcWindow.bottom = ulInnerHeight - 1; rcWindow.bottom = ulInnerHeight - 1;
rcWindow.left = 0; rcWindow.left = 0;
@ -144,7 +160,7 @@ WinMain(HINSTANCE hInst,
yPos = (GetSystemMetrics(SM_CYSCREEN) - yHeight) / 2; yPos = (GetSystemMetrics(SM_CYSCREEN) - yHeight) / 2;
rcTitlePanel.top = 0; rcTitlePanel.top = 0;
rcTitlePanel.bottom = 93; rcTitlePanel.bottom = ulTitleHeight;
rcTitlePanel.left = 0; rcTitlePanel.left = 0;
rcTitlePanel.right = ulInnerWidth - 1; rcTitlePanel.right = ulInnerWidth - 1;
@ -159,7 +175,7 @@ WinMain(HINSTANCE hInst,
rcRightPanel.right = ulInnerWidth - 1; rcRightPanel.right = ulInnerWidth - 1;
if (!LoadString(hInstance, (UINT)MAKEINTRESOURCE(IDS_APPTITLE), szAppTitle, 80)) if (!LoadString(hInstance, (UINT)MAKEINTRESOURCE(IDS_APPTITLE), szAppTitle, 80))
_tcscpy(szAppTitle, TEXT("ReactOS Welcome")); lstrcpy(szAppTitle, TEXT("ReactOS Welcome"));
/* Create main window */ /* Create main window */
hwndMain = CreateWindow(szFrameClass, hwndMain = CreateWindow(szFrameClass,
@ -199,7 +215,7 @@ ButtonSubclassWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
nTopic = i; nTopic = i;
SetFocus(hWnd); SetFocus(hWnd);
InvalidateRect(hwndMain, NULL, TRUE); InvalidateRect(hwndMain, &rcRightPanel, TRUE);
} }
} }
@ -212,8 +228,8 @@ RunApplication(int nTopic)
{ {
PROCESS_INFORMATION ProcessInfo; PROCESS_INFORMATION ProcessInfo;
STARTUPINFO StartupInfo; STARTUPINFO StartupInfo;
CHAR AppName[256]; TCHAR AppName[256];
CHAR CurrentDir[256]; TCHAR CurrentDir[256];
int nLength; int nLength;
InvalidateRect(hwndMain, NULL, TRUE); InvalidateRect(hwndMain, NULL, TRUE);
@ -222,17 +238,20 @@ RunApplication(int nTopic)
nLength = LoadString(hInstance, IDS_TOPICACTION0 + nTopic, AppName, 256); nLength = LoadString(hInstance, IDS_TOPICACTION0 + nTopic, AppName, 256);
if (nLength == 0) if (nLength == 0)
return(FALSE); return TRUE;
if (stricmp(AppName, "explorer.exe") == 0) if (!lstrcmpi(AppName, TEXT("<exit>")))
return FALSE;
if (lstrcmpi(AppName, TEXT("explorer.exe")) == 0)
{ {
strcat(AppName, " "); lstrcat(AppName, TEXT(" "));
strcat(AppName, CurrentDir); lstrcat(AppName, CurrentDir);
} }
memset(&StartupInfo, 0, sizeof(STARTUPINFO)); memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO); StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.lpTitle = "Test"; StartupInfo.lpTitle = TEXT("Test");
StartupInfo.dwFlags = STARTF_USESHOWWINDOW; StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_SHOWNORMAL; StartupInfo.wShowWindow = SW_SHOWNORMAL;
@ -244,9 +263,10 @@ RunApplication(int nTopic)
CloseHandle(ProcessInfo.hProcess); CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread); CloseHandle(ProcessInfo.hThread);
return(TRUE); return TRUE;
} }
static VOID static VOID
SubclassButton(HWND hWnd) SubclassButton(HWND hWnd)
{ {
@ -279,7 +299,7 @@ GetButtonHeight(HDC hDC,
static LRESULT static LRESULT
OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam) OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
char szText[80]; TCHAR szText[80];
int i,nLength; int i,nLength;
DWORD dwTop; DWORD dwTop;
DWORD dwHeight = 0; DWORD dwHeight = 0;
@ -288,15 +308,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
hbrDarkBlue = CreateSolidBrush(DARK_BLUE); hbrDarkBlue = CreateSolidBrush(DARK_BLUE);
hbrRightPanel = CreateSolidBrush(0x00FFFFFF); hbrRightPanel = CreateSolidBrush(0x00FFFFFF);
/* Banner fonts */ /* Topic title font */
hfontBannerTitle = CreateFont(-30,0,0,0,FW_BOLD,
FALSE,FALSE,FALSE,ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
FF_DONTCARE,
"Arial");
hfontTopicTitle = CreateFont(-18,0,0,0,FW_NORMAL, hfontTopicTitle = CreateFont(-18,0,0,0,FW_NORMAL,
FALSE,FALSE,FALSE,ANSI_CHARSET, FALSE,FALSE,FALSE,ANSI_CHARSET,
OUT_DEFAULT_PRECIS, OUT_DEFAULT_PRECIS,
@ -305,7 +317,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
FF_DONTCARE, FF_DONTCARE,
"Arial"); "Arial");
/* Topic description font */
hfontTopicDescription = CreateFont(-11,0,0,0,FW_THIN, hfontTopicDescription = CreateFont(-11,0,0,0,FW_THIN,
FALSE,FALSE,FALSE,ANSI_CHARSET, FALSE,FALSE,FALSE,ANSI_CHARSET,
OUT_DEFAULT_PRECIS, OUT_DEFAULT_PRECIS,
@ -314,6 +326,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
FF_DONTCARE, FF_DONTCARE,
"Arial"); "Arial");
/* Topic button font */
hfontTopicButton = CreateFont(-11,0,0,0,FW_BOLD, hfontTopicButton = CreateFont(-11,0,0,0,FW_BOLD,
FALSE,FALSE,FALSE,ANSI_CHARSET, FALSE,FALSE,FALSE,ANSI_CHARSET,
OUT_DEFAULT_PRECIS, OUT_DEFAULT_PRECIS,
@ -322,19 +335,18 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
FF_DONTCARE, FF_DONTCARE,
"Arial"); "Arial");
/* Load bitmaps */ /* Load title bitmap */
if (hTitleBitmap != 0)
hTitleBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TITLEBITMAP)); hTitleBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TITLEBITMAP));
/* Load topic bitmaps */
hDefaultTopicBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_DEFAULTTOPICBITMAP)); hDefaultTopicBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_DEFAULTTOPICBITMAP));
#if 0
for (i=0;i < 10; i++) for (i=0;i < 10; i++)
{ {
hTopicBitmap[i] = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TOPICBITMAP0+i)); hTopicBitmap[i] = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TOPICBITMAP0+i));
} }
#endif
hTopBackgroundBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_TBACKGROUNDBITMAP));
hRightBackgroundBitmap = LoadBitmap (hInstance, MAKEINTRESOURCE(IDB_RBACKGROUNDBITMAP));
hdcDisplay = CreateDC ("DISPLAY", NULL, NULL, NULL); hdcDisplay = CreateDC (TEXT("DISPLAY"), NULL, NULL, NULL);
hdcMem = CreateCompatibleDC (hdcDisplay); hdcMem = CreateCompatibleDC (hdcDisplay);
/* load and create buttons */ /* load and create buttons */
@ -349,7 +361,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
szText, szText,
rcLeftPanel.right - rcLeftPanel.left); rcLeftPanel.right - rcLeftPanel.left);
hwndTopicButton[i] = CreateWindow("BUTTON", hwndTopicButton[i] = CreateWindow(TEXT("BUTTON"),
szText, szText,
WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_MULTILINE | BS_OWNERDRAW, WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_MULTILINE | BS_OWNERDRAW,
rcLeftPanel.left, rcLeftPanel.left,
@ -377,7 +389,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
nLength = LoadString(hInstance, IDS_CLOSETEXT, szText, 80); nLength = LoadString(hInstance, IDS_CLOSETEXT, szText, 80);
if (nLength > 0) if (nLength > 0)
{ {
hwndCloseButton = CreateWindow("BUTTON", hwndCloseButton = CreateWindow(TEXT("BUTTON"),
szText, szText,
WS_VISIBLE | WS_CHILD | BS_FLAT, WS_VISIBLE | WS_CHILD | BS_FLAT,
rcRightPanel.right - 10 - 57, rcRightPanel.right - 10 - 57,
@ -396,7 +408,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
hwndCloseButton = 0; hwndCloseButton = 0;
} }
#if 0
/* Create checkbox */ /* Create checkbox */
nLength = LoadString(hInstance, IDS_CHECKTEXT,szText,80); nLength = LoadString(hInstance, IDS_CHECKTEXT,szText,80);
if (nLength > 0) if (nLength > 0)
@ -406,9 +418,9 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
CLIP_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, DEFAULT_QUALITY,
FF_DONTCARE, FF_DONTCARE,
"Tahoma"); TEXT("Tahoma"));
hwndCheckButton = CreateWindow("BUTTON", hwndCheckButton = CreateWindow(TEXT("BUTTON"),
szText, szText,
WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX, WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
rcLeftPanel.left + 8, rcLeftPanel.left + 8,
@ -426,7 +438,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
hwndCheckButton = 0; hwndCheckButton = 0;
hfontCheckButton = 0; hfontCheckButton = 0;
} }
#endif
return 0; return 0;
} }
@ -454,13 +466,9 @@ PaintBanner(HDC hdc, LPRECT rcPanel)
{ {
HBITMAP hOldBitmap; HBITMAP hOldBitmap;
HBRUSH hOldBrush; HBRUSH hOldBrush;
HFONT hOldFont;
RECT rcTitle;
int oldBkMode;
CHAR version[50];
/* Gradient background bitmap */ /* Title bitmap */
hOldBitmap = SelectObject(hdcMem, hTopBackgroundBitmap); hOldBitmap = SelectObject(hdcMem, hTitleBitmap);
BitBlt(hdc, BitBlt(hdc,
rcPanel->left, rcPanel->left,
rcPanel->top, rcPanel->top,
@ -469,27 +477,7 @@ PaintBanner(HDC hdc, LPRECT rcPanel)
hdcMem, 0, 0, SRCCOPY); hdcMem, 0, 0, SRCCOPY);
SelectObject(hdc, hOldBitmap); SelectObject(hdc, hOldBitmap);
hOldFont = SelectObject (hdc, hfontBannerTitle); /* Dark blue line */
SetTextColor(hdc, 0x00000000);
oldBkMode = GetBkMode(hdc);
SetBkMode(hdc, TRANSPARENT);
sprintf(version, "ReactOS %d.%d.%d",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL);
rcTitle.top = 5;
rcTitle.left = 15;
DrawTextA(hdc, version, -1, &rcTitle, DT_TOP | DT_CALCRECT);
DrawTextA(hdc, version, -1, &rcTitle, DT_TOP);
SetBkMode(hdc, oldBkMode);
SelectObject(hdc, hOldFont);
/* dark blue line */
hOldBrush = SelectObject(hdc, hbrDarkBlue); hOldBrush = SelectObject(hdc, hbrDarkBlue);
PatBlt(hdc, PatBlt(hdc,
rcPanel->left, rcPanel->left,
@ -516,7 +504,8 @@ OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
TCHAR szTopicTitle[80]; TCHAR szTopicTitle[80];
TCHAR szTopicDesc[256]; TCHAR szTopicDesc[256];
int nLength; int nLength;
//BITMAP bmpInfo; BITMAP bmpInfo;
TCHAR version[50];
hdc = BeginPaint(hWnd, &ps); hdc = BeginPaint(hWnd, &ps);
@ -531,25 +520,26 @@ OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
rcLeftPanel.right - rcLeftPanel.left, rcLeftPanel.right - rcLeftPanel.left,
rcLeftPanel.bottom - rcLeftPanel.top, rcLeftPanel.bottom - rcLeftPanel.top,
PATCOPY); PATCOPY);
SelectObject(hdc, hOldBrush);
/* Right panel */ /* Right panel */
/* Gradient background bitmap */ hOldBrush = SelectObject (hdc, WHITE_BRUSH);
hOldBitmap = SelectObject(hdcMem, hRightBackgroundBitmap); PatBlt(hdc,
BitBlt(hdc,
rcRightPanel.left, rcRightPanel.left,
rcRightPanel.top, rcRightPanel.top,
rcRightPanel.right - rcRightPanel.left, rcRightPanel.right - rcRightPanel.left,
rcRightPanel.bottom - rcRightPanel.top, rcRightPanel.bottom - rcRightPanel.top,
hdcMem, 0, 0, SRCCOPY); PATCOPY);
SelectObject(hdc, hOldBitmap); SelectObject(hdc, hOldBrush);
/* Draw dark verical line */
hPen = CreatePen(PS_SOLID, 0, DARK_BLUE); hPen = CreatePen(PS_SOLID, 0, DARK_BLUE);
hOldPen = SelectObject(hdc, hPen); hOldPen = SelectObject(hdc, hPen);
MoveToEx(hdc, rcRightPanel.left, rcRightPanel.top, NULL); MoveToEx(hdc, rcRightPanel.left, rcRightPanel.top, NULL);
LineTo(hdc, rcRightPanel.left, rcRightPanel.bottom); LineTo(hdc, rcRightPanel.left, rcRightPanel.bottom);
SelectObject(hdc, hOldPen); SelectObject(hdc, hOldPen);
DeleteObject(hPen); DeleteObject(hPen);
#if 0
/* Draw topic bitmap */ /* Draw topic bitmap */
if ((nTopic == -1) && (hDefaultTopicBitmap != 0)) if ((nTopic == -1) && (hDefaultTopicBitmap != 0))
{ {
@ -579,7 +569,7 @@ OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
0, 0,
SRCCOPY); SRCCOPY);
} }
#endif
if (nTopic == -1) if (nTopic == -1)
{ {
nLength = LoadString(hInstance, IDS_DEFAULTTOPICTITLE, szTopicTitle, 80); nLength = LoadString(hInstance, IDS_DEFAULTTOPICTITLE, szTopicTitle, 80);
@ -604,6 +594,21 @@ OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
SetBkMode(hdc, TRANSPARENT); SetBkMode(hdc, TRANSPARENT);
/* Draw version information */
wsprintf(version, TEXT("ReactOS %d.%d.%d"),
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL);
rcTitle.left = rcLeftPanel.left + 8;
rcTitle.right = rcLeftPanel.right - 5;
rcTitle.top = rcLeftPanel.bottom - 40;
rcTitle.bottom = rcLeftPanel.bottom - 5;
hOldFont = SelectObject(hdc, hfontTopicDescription);
DrawText(hdc, version, -1, &rcTitle, DT_BOTTOM | DT_CALCRECT | DT_SINGLELINE);
DrawText(hdc, version, -1, &rcTitle, DT_BOTTOM | DT_SINGLELINE);
SelectObject(hdc, hOldFont);
/* Draw topic title */ /* Draw topic title */
rcTitle.left = rcRightPanel.left + 12; rcTitle.left = rcRightPanel.left + 12;
rcTitle.right = rcRightPanel.right - 8; rcTitle.right = rcRightPanel.right - 8;
@ -643,7 +648,7 @@ OnDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
LPDRAWITEMSTRUCT lpDis = (LPDRAWITEMSTRUCT)lParam; LPDRAWITEMSTRUCT lpDis = (LPDRAWITEMSTRUCT)lParam;
HPEN hPen, hOldPen; HPEN hPen, hOldPen;
HBRUSH hOldBrush; HBRUSH hOldBrush;
CHAR szText[80]; TCHAR szText[80];
int iBkMode; int iBkMode;
if (lpDis->hwndItem == hwndCloseButton) if (lpDis->hwndItem == hwndCloseButton)
@ -659,6 +664,7 @@ OnDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
hOldBrush = SelectObject(lpDis->hDC, hbrRightPanel); hOldBrush = SelectObject(lpDis->hDC, hbrRightPanel);
else else
hOldBrush = SelectObject(lpDis->hDC, hbrLightBlue); hOldBrush = SelectObject(lpDis->hDC, hbrLightBlue);
PatBlt(lpDis->hDC, PatBlt(lpDis->hDC,
lpDis->rcItem.left, lpDis->rcItem.left,
lpDis->rcItem.top, lpDis->rcItem.top,
@ -694,7 +700,7 @@ OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
nTopic = -1; nTopic = -1;
SetFocus(hWnd); SetFocus(hWnd);
InvalidateRect(hwndMain, NULL, TRUE); InvalidateRect(hwndMain, &rcRightPanel, TRUE);
} }
return 0; return 0;
@ -718,7 +724,7 @@ static LRESULT
OnActivate(HWND hWnd, WPARAM wParam, LPARAM lParam) OnActivate(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
nTopic = -1; nTopic = -1;
InvalidateRect(hwndMain, NULL, TRUE); InvalidateRect(hwndMain, &rcRightPanel, TRUE);
return(0); return(0);
} }
@ -752,16 +758,11 @@ OnDestroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
if (hTopicBitmap[i] != 0) if (hTopicBitmap[i] != 0)
DeleteObject(hTopicBitmap[i]); DeleteObject(hTopicBitmap[i]);
} }
DeleteObject(hTopBackgroundBitmap);
DeleteObject(hRightBackgroundBitmap);
DeleteObject(hfontTopicTitle); DeleteObject(hfontTopicTitle);
DeleteObject(hfontTopicDescription); DeleteObject(hfontTopicDescription);
DeleteObject(hfontTopicButton); DeleteObject(hfontTopicButton);
DeleteObject(hfontBannerTitle);
if (hfontCheckButton != 0) if (hfontCheckButton != 0)
DeleteObject(hfontCheckButton); DeleteObject(hfontCheckButton);

View file

@ -3,14 +3,11 @@
/* Icons */ /* Icons */
IDI_MAIN ICON DISCARDABLE "res/icon.ico" IDI_MAIN ICON "res/welcome.ico"
/* Bitmaps */ /* Bitmaps */
IDB_TITLEBITMAP BITMAP DISCARDABLE "res/title.bmp" IDB_TITLEBITMAP BITMAP DISCARDABLE "res/title.bmp"
IDB_DEFAULTTOPICBITMAP BITMAP DISCARDABLE "res/default.bmp" //IDB_DEFAULTTOPICBITMAP BITMAP DISCARDABLE "res/default.bmp"
IDB_TBACKGROUNDBITMAP BITMAP DISCARDABLE "res/background-top.bmp"
IDB_RBACKGROUNDBITMAP BITMAP DISCARDABLE "res/background-right.bmp"
//IDB_TOPICBITMAP0 BITMAP DISCARDABLE "res/topic0.bmp" //IDB_TOPICBITMAP0 BITMAP DISCARDABLE "res/topic0.bmp"
//IDB_TOPICBITMAP1 BITMAP DISCARDABLE "res/topic1.bmp" //IDB_TOPICBITMAP1 BITMAP DISCARDABLE "res/topic1.bmp"
@ -33,16 +30,17 @@ BEGIN
IDS_DEFAULTTOPICTITLE "ReactOS" IDS_DEFAULTTOPICTITLE "ReactOS"
IDS_DEFAULTTOPICDESC "Welcome to React Operating System.\n\nClick a topic on the left." IDS_DEFAULTTOPICDESC "Welcome to React Operating System.\n\nClick a topic on the left."
// IDS_CHECKTEXT "Show this dialog again" // IDS_CHECKTEXT "Show this dialog again"
IDS_CLOSETEXT "Exit" // IDS_CLOSETEXT "Exit"
END END
/* Topic buttons */ /* Topic buttons */
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
BEGIN BEGIN
// IDS_TOPICBUTTON0 "Online Registration"
IDS_TOPICBUTTON0 "Install ReactOS" IDS_TOPICBUTTON0 "Install ReactOS"
IDS_TOPICBUTTON1 "Browse this CD" IDS_TOPICBUTTON1 "Browse this CD"
// IDS_TOPICBUTTON4 "E&xit" IDS_TOPICBUTTON2 "Exit"
// IDS_TOPICBUTTON3 "Empty Topic 3"
// IDS_TOPICBUTTON4 "Empty Topic 4"
// IDS_TOPICBUTTON5 "Empty Topic 5" // IDS_TOPICBUTTON5 "Empty Topic 5"
// IDS_TOPICBUTTON6 "Empty Topic 6" // IDS_TOPICBUTTON6 "Empty Topic 6"
// IDS_TOPICBUTTON7 "Empty Topic 7" // IDS_TOPICBUTTON7 "Empty Topic 7"
@ -53,10 +51,10 @@ END
/* Topic titles */ /* Topic titles */
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
BEGIN BEGIN
// IDS_TOPICTITLE0 "Online Registration"
IDS_TOPICTITLE0 "Install ReactOS" IDS_TOPICTITLE0 "Install ReactOS"
IDS_TOPICTITLE1 "Browse this CD" IDS_TOPICTITLE1 "Browse this CD"
// IDS_TOPICTITLE3 "Exit" IDS_TOPICTITLE2 "Exit"
// IDS_TOPICTITLE3 "Empty Topic Title 3"
// IDS_TOPICTITLE4 "Empty Topic Title 4" // IDS_TOPICTITLE4 "Empty Topic Title 4"
// IDS_TOPICTITLE5 "Empty Topic Title 5" // IDS_TOPICTITLE5 "Empty Topic Title 5"
// IDS_TOPICTITLE6 "Empty Topic Title 6" // IDS_TOPICTITLE6 "Empty Topic Title 6"
@ -68,10 +66,10 @@ END
/* Topic descriptions */ /* Topic descriptions */
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
BEGIN BEGIN
// IDS_TOPICDESC0 "Register your ReactOS now!\n\nWith registering your ReactOS you get a lot of additional benefits, like unsolicited product information, incompetent hotline services and huge amounts of third-party junk mail."
IDS_TOPICDESC0 "Create a new ReactOS installation on your computer or upgrade an existing installation." IDS_TOPICDESC0 "Create a new ReactOS installation on your computer or upgrade an existing installation."
IDS_TOPICDESC1 "Browse the CD." IDS_TOPICDESC1 "Browse the CD."
// IDS_TOPICDESC3 "Click to exit this application." IDS_TOPICDESC2 "Click to exit this application."
// IDS_TOPICDESC3 "Topic description 3.\n\nDescribe topic 3 here."
// IDS_TOPICDESC4 "Topic description 4.\n\nDescribe topic 4 here." // IDS_TOPICDESC4 "Topic description 4.\n\nDescribe topic 4 here."
// IDS_TOPICDESC5 "Topic description 5.\n\nDescribe topic 5 here." // IDS_TOPICDESC5 "Topic description 5.\n\nDescribe topic 5 here."
// IDS_TOPICDESC6 "Topic description 6.\n\nDescribe topic 6 here." // IDS_TOPICDESC6 "Topic description 6.\n\nDescribe topic 6 here."
@ -83,9 +81,9 @@ END
/* Topic actions */ /* Topic actions */
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
BEGIN BEGIN
// IDS_TOPICACTION0 "signup.exe"
IDS_TOPICACTION0 "setup.exe" IDS_TOPICACTION0 "setup.exe"
IDS_TOPICACTION1 "explorer.exe" IDS_TOPICACTION1 "explorer.exe"
IDS_TOPICACTION2 "<exit>" /* this quits the app */
// IDS_TOPICACTION3 "..." // IDS_TOPICACTION3 "..."
// IDS_TOPICACTION4 "..." // IDS_TOPICACTION4 "..."
// IDS_TOPICACTION5 "..." // IDS_TOPICACTION5 "..."