Last active
May 28, 2016 05:30
-
-
Save Fahrni/cca128a6862d85d5a3c1eafcc077a531 to your computer and use it in GitHub Desktop.
Old school Window Procedure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LRESULT CALLBACK WindowProc | |
( | |
HWND hwnd, | |
UINT message, | |
WPARAM wParam, | |
LPARAM lParam | |
) | |
{ | |
switch (message) | |
{ | |
case WM_CREATE: | |
// Sent when the Window is created | |
break; | |
case WM_COMMAND: | |
// Handle Menu item selection here | |
break; | |
case WM_DESTROY: | |
// Window is being destroyed | |
PostQuitMessage(0); | |
break; | |
default: | |
// If we don't handle the message, give it to the Windows | |
// supplied DefWindowProc | |
return DefWindowProc(hWnd, message, wParam, lParam); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment