Instantly share code, notes, and snippets.

Embed
What would you like to do?
Old school Window Procedure
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