tools/installer/Welcome.cpp
author Scott Ehlert <ds@alliedmods.net>
Sun Aug 24 05:05:04 2008 +0000 (2008-08-24)
changeset 2238 0879e1742145
parent 1952 b7aa2b626807
child 2289 44045ead61cd
permissions -rw-r--r--
Fixed build.

"Nice" improvement DS.
     1 #include "InstallerMain.h"
     2 #include "Welcome.h"
     3 #include "ChooseMethod.h"
     4 
     5 bool g_bIsFirstRun = true;
     6 
     7 INT_PTR CALLBACK WelcomeHandler(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     8 {
     9 	switch (message)
    10 	{
    11 	case WM_INITDIALOG:
    12 		{
    13 			if (!g_bIsFirstRun)
    14 			{
    15 				SetToGlobalPosition(hDlg);
    16 			}
    17 			else
    18 			{
    19 				g_bIsFirstRun = false;
    20 			}
    21 			return (INT_PTR)TRUE;
    22 		}
    23 	case WM_COMMAND:
    24 		{
    25 			if (LOWORD(wParam) == ID_WELCOME_EXIT
    26 				|| LOWORD(wParam) == ID_CLOSE)
    27 			{
    28 				UpdateGlobalPosition(hDlg);
    29 				EndDialog(hDlg, NULL);
    30 				return (INT_PTR)TRUE;
    31 			}
    32 			else if (LOWORD(wParam) == ID_WELCOME_NEXT)
    33 			{
    34 				UpdateGlobalPosition(hDlg);
    35 				EndDialog(hDlg, (INT_PTR)DisplayChooseMethod);
    36 				return (INT_PTR)TRUE;
    37 			}
    38 			break;
    39 		}
    40 	}
    41 
    42 	return (INT_PTR)FALSE;
    43 }
    44 
    45 void *DisplayWelcome(HWND hWnd)
    46 {
    47 	INT_PTR val;
    48 	
    49 	if ((val = DialogBox(
    50 		g_hInstance, 
    51 		MAKEINTRESOURCE(IDD_WELCOME),
    52 		hWnd,
    53 		WelcomeHandler)) == -1)
    54 	{
    55 		return NULL;
    56 	}
    57 
    58 	return (void *)val;
    59 }
    60