I am learning Windows programming from Charles Petzold's Programming Windows 5th Edition. Well, I decided to take a look at www.winprog.org to take a look at the tutorial. Well, it seems to have contrasting code with Petzold. For instance
Well, I never learned that last field of the Window class (wc.hIconSm). What is that?Code://Step 1: Registering the Window Class wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = g_szClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
And their WndProc, I didn't learn with the WM_CLOSE. What is that when you have WM_DESTROY? Does it just go to WM_DESTROY?Code:// Step 4: the Window Procedure LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; }
Thanks.
--Garfield the Great



LinkBack URL
About LinkBacks


