Page 80 - DCAP408_WEB_PROGRAMMING
P. 80
Windows Programming
Notes DialogBox(hInst, MAKEINTRESOURCE(IDD_CONTROLS_DLG),
hWnd, reinterpret_cast<DLGPROC>(DlgProc));
return 0;
}
//—————————————————————————————————————
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg,
WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDC_CLOSE_BTN:
EndDialog(hWndDlg, 0);
return TRUE;
}
break;
case WM_CLOSE:
PostQuitMessage(WM_QUIT);
break;
}
return FALSE;
}
//—————————————————————————————————————
15. Test the application
Self Assessment
Fill in the blanks:
12. A ............................ is an object that permits the user to navigate either left and right or up
and down, either on a document or on a section of the window.
13. To ............................ a scroll bar as a Windows control, call the CreateWindow() or the
CreateWindowEx() functions and specify the class name as SCROLLBAR.
74 LOVELY PROFESSIONAL UNIVERSITY