Skip to content

Instantly share code, notes, and snippets.

@Fahrni
Last active May 28, 2016 05:41
Show Gist options
  • Save Fahrni/6578d38cd5ac6725133f635d9b6cd690 to your computer and use it in GitHub Desktop.
Save Fahrni/6578d38cd5ac6725133f635d9b6cd690 to your computer and use it in GitHub Desktop.
Window Proc built in C++ using ACL Window Library
static ACLWinMessageMap stcMsgMap[] =
// message sub msg/ctl id message handler method.
//
{ { WM_CREATE, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnCreate }
, { WM_DESTROY, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnDestroy }
, { WM_COMMAND, IDM_ABOUT, (PWINMSGHNDLR)&SampleWindow::OnAbout }
, { WM_COMMAND, IDM_EXIT, (PWINMSGHNDLR)&SampleWindow::OnExit }
, { WM_SIZE, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnResize }
}; // stcMsgMap
LRESULT SampleWindow::OnCreate
(
IN WPARAM wParam,
IN LPARAM lParam
)
{
// Handle creation of other windows and initialization
// of this window
return 0L;
} // ::OnCreate
LRESULT SampleWindow::OnDestroy
(
IN WPARAM wParam,
IN LPARAM lParam
)
{
// Tell the application it's time to go away.
::PostQuitMessage(0);
return 0L;
} // ::OnDestroy
LRESULT SampleWindow::OnAbout
(
IN WPARAM wParam,
IN LPARAM lParam
)
{
AboutDlg about(_hInstance, _hWnd);
about.Show();
return 0L;
} // ::OnAbout
LRESULT SampleWindow::OnExit
(
IN WPARAM wParam,
IN LPARAM lParam
)
{
ACLWinBase::Destroy();
return 0L;
} // ::OnExit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment