/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 228, 97
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,237,24,50,14
PUSHBUTTON "Cancel",IDCANCEL,237,24,50,14
END
PAGE1 DIALOG DISCARDABLE 0, 0, 100, 47
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Tab 1"
FONT 10, "MS Sans Serif"
BEGIN
CONTROL "Radio1",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,4,13,58,8
CONTROL "Radio2",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,4,27,60,8
GROUPBOX "Page 1",IDC_STATIC,1,3,71,36
END
PAGE2 DIALOG DISCARDABLE 0, 0, 100, 24
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Tab 2"
FONT 16, "MS Sans Serif"
BEGIN
LTEXT "Page 2",-1,0,1,100,10
END
/////////////////////////////////////////////////////////////////////////////
// //property sheet example #pragma comment( lib, "user32.lib" ) #pragma comment( lib, "comctl32.lib" ) #include <windows.h> #include <commctrl.h> #define IDC_RADIO1 1 #define IDC_RADIO2 2
//the first property sheet page function
BOOL CALLBACK PageProc1(HWND hwnd , UINT msg , WPARAM wp , LPARAM lp)
{
LPNMHDR lpnmhdr; switch (msg)
{ case WM_COMMAND: switch (LOWORD(wp)) //respond to button click
{ case IDC_RADIO1:
MessageBox(hwnd,TEXT("Radio 1 Clicked"),TEXT("Tab1"),MB_OK); break; case IDC_RADIO2:
MessageBox(hwnd,TEXT("Radio 2 Clicked"),TEXT("Tab1"),MB_OK); break;
} break;
case WM_NOTIFY:
lpnmhdr = (NMHDR FAR *)lp; switch (lpnmhdr->code)
{ case PSN_APPLY: //sent when OK or Apply button pressed break;
case PSN_RESET: //sent when Cancel button pressed break;
case PSN_SETACTIVE://Notifies a page that it is about to be activated.
PropSheet_SetWizButtons(GetParent(hwnd), PSWIZB_NEXT); break; default: break;
} break; default: break;
} return FALSE;
} //the second property sheet page function
BOOL CALLBACK PageProc2(HWND hwnd , UINT msg , WPARAM wp , LPARAM lp) { return FALSE;
}
LRESULT CALLBACK WndProc(HWND hWnd , UINT msg , WPARAM wp , LPARAM lp) {
PROPSHEETPAGE psp;//stores information about each property page
PROPSHEETHEADER psh;//stores information about the propety sheet
HPROPSHEETPAGE hPsp[2];//used to individual create page for property sheet
switch (msg) { case WM_DESTROY:
PostQuitMessage(0); return0; case WM_CREATE:
InitCommonControls(); return0; //responds to right mouse button click by creating and displaying the property sheet case WM_RBUTTONUP:
psp.dwSize =sizeof (PROPSHEETPAGE);
psp.dwFlags = PSP_DEFAULT | PSP_USEICONID;
psp.pszIcon = TEXT("PAGEICON");
psp.hInstance = (HINSTANCE)GetWindowLong(hWnd , GWL_HINSTANCE);