Here is the code I found. He should give you something to work with.
// Main message loop: do { while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } // Run game code here. gTradeApp->ExecuteNextAction(); } while (msg.message != WM_QUIT);
and WndProc
LRESULT CALLBACK WndProc(HWND aHWnd, UINT aMessage, WPARAM aWParam, LPARAM aLParam) { switch (aMessage) { case WM_COMMAND: return HandleCommand(aHWnd, aMessage, aWParam, aLParam); case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(aHWnd, aMessage, aWParam, aLParam); } return 0; }
James source share