Instantly share code, notes, and snippets.

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