Skip to content

Instantly share code, notes, and snippets.

@Fahrni
Last active May 28, 2016 05:30
Show Gist options
  • Save Fahrni/cca128a6862d85d5a3c1eafcc077a531 to your computer and use it in GitHub Desktop.
Save Fahrni/cca128a6862d85d5a3c1eafcc077a531 to your computer and use it in GitHub Desktop.
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