Page 156 - DCAP408_WEB_PROGRAMMING
P. 156
Windows Programming
Notes ShowWindow (hWndToolbox, SW_SHOW);
ShowWindow(hWndMainFrame, nCmdShow);
while (GetMessage(&msg,NULL, 0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
//—————————————————————————————————————
LRESULT CALLBACK ToolboxProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM
lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return TRUE;
}
return FALSE;
}
//—————————————————————————————————————
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Msg,
WPARAM wParam, LPARAM lParam)
{
HMENU hMenu;
RECT rctMainWnd, rctToolbox;
UINT ToolboxMenuState;
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_VIEW_TOOLBOX:
hMenu = GetMenu(hWndMainFrame);
ToolboxMenuState = GetMenuState(hMenu,
IDM_VIEW_TOOLBOX, MF_BYCOMMAND);
150 LOVELY PROFESSIONAL UNIVERSITY