NPos = GetRectID(LOWORD(lParam), HIWORD(lParam)) LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) MessageBox(hwndMain, _T("It's a draw!"), _T("Game Over"), MB_ICONEXCLAMATION|MB_OK) _T("Game Over"), MB_ICONEXCLAMATION|MB_OK) MessageBox(hwndMain, ((nWinner = EX) ? _T("X wins!") : _T("O wins!")), if the grid contains three consecutive X's or O's, declare a winner and start a new game ::ZeroMemory(m_nGameGrid, 9 * sizeof(int)) ::Ellipse(hdc, rect.left, rect.top, rect.right, rect.bottom) Void *oldBr = ::SelectObject(hdc, GetStockObject (NULL_BRUSH)) ::MoveToEx(hdc, rect.left, rect.bottom, NULL) ::MoveToEx(hdc, rect.left, rect.top, NULL) WS_OVERLAPPED|WS_SYSMENU|WS_CAPTION|WS_MINIMIZEBOX,įor(int i = 0 i m_rcSquares.left & x m_rcSquares.top & y < m_rcSquares.bottom) Wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION) Wndclass.hbrBackground = (HBRUSH) GetStockObject (LTGRAY_BRUSH) Wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) Wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) Wndclass.style = CS_HREDRAW | CS_VREDRAW Static TCHAR szAppName = _T("TicTacToeWin") Int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) Download the source code: WINAPITICTACTOE.zip #include
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |