// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); GameInst.StartGame(hWnd); if (!hWnd) { return FALSE; } GameInst.FTurn(hWnd); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); DialogBox(hInst, MAKEINTRESOURCE(MY_ID_FPLAYER), hWnd, FPlayerDialog); DialogBox(hInst, MAKEINTRESOURCE(MY_ID_SPLAYER), hWnd, SPlayerDialog); return TRUE; }