home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / prsht.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  12.3 KB  |  414 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * prsht.h - - Interface for the Windows Property Sheet Pages                  *
  4. *                                                                             *
  5. * Version 1.0                                                                 *
  6. *                                                                             *
  7. * Copyright (c) 1991-1995, Microsoft Corp.      All rights reserved.          *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11. #ifndef _PRSHT_H_
  12. #define _PRSHT_H_
  13.  
  14. //
  15. // Define API decoration for direct importing of DLL references.
  16. //
  17. #ifndef WINCOMMCTRLAPI
  18. #if !defined(_COMCTL32_) && defined(_WIN32)
  19. #define WINCOMMCTRLAPI DECLSPEC_IMPORT
  20. #else
  21. #define WINCOMMCTRLAPI
  22. #endif
  23. #endif // WINCOMMCTRLAPI
  24.  
  25. //
  26. // For compilers that don't support nameless unions
  27. //
  28. #ifndef DUMMYUNIONNAME
  29. #ifdef NONAMELESSUNION
  30. #define DUMMYUNIONNAME   u
  31. #define DUMMYUNIONNAME2  u2
  32. #define DUMMYUNIONNAME3  u3
  33. #else
  34. #define DUMMYUNIONNAME
  35. #define DUMMYUNIONNAME2
  36. #define DUMMYUNIONNAME3
  37. #endif
  38. #endif // DUMMYUNIONNAME
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if (WINVER >= 0x0400)
  45.  
  46. #define MAXPROPPAGES            100
  47.  
  48. struct _PSP;
  49. typedef struct _PSP FAR* HPROPSHEETPAGE;
  50.  
  51. typedef struct _PROPSHEETPAGEA FAR *LPPROPSHEETPAGEA;
  52. typedef struct _PROPSHEETPAGEW FAR *LPPROPSHEETPAGEW;
  53.  
  54. typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKA)(HWND hwnd, UINT uMsg, LPPROPSHEETPAGEA ppsp);
  55. typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKW)(HWND hwnd, UINT uMsg, LPPROPSHEETPAGEW ppsp);
  56.  
  57. #ifdef UNICODE
  58. #define LPFNPSPCALLBACK         LPFNPSPCALLBACKW
  59. #else
  60. #define LPFNPSPCALLBACK         LPFNPSPCALLBACKA
  61. #endif
  62.  
  63. #define PSP_DEFAULT             0x0000
  64. #define PSP_DLGINDIRECT         0x0001
  65. #define PSP_USEHICON            0x0002
  66. #define PSP_USEICONID           0x0004
  67. #define PSP_USETITLE            0x0008
  68. #define PSP_RTLREADING          0x0010
  69.  
  70. #define PSP_HASHELP             0x0020
  71. #define PSP_USEREFPARENT        0x0040
  72. #define PSP_USECALLBACK         0x0080
  73.  
  74. #define PSPCB_RELEASE           1
  75. #define PSPCB_CREATE            2
  76.  
  77.  
  78. typedef struct _PROPSHEETPAGEA {
  79.         DWORD           dwSize;
  80.         DWORD           dwFlags;
  81.         HINSTANCE       hInstance;
  82.         union {
  83.             LPCSTR          pszTemplate;
  84. #ifdef _WIN32
  85.             LPCDLGTEMPLATE  pResource;
  86. #else
  87.             const VOID FAR *pResource;
  88. #endif
  89.         } DUMMYUNIONNAME;
  90.         union {
  91.             HICON       hIcon;
  92.             LPCSTR      pszIcon;
  93.         } DUMMYUNIONNAME2;
  94.         LPCSTR          pszTitle;
  95.         DLGPROC         pfnDlgProc;
  96.         LPARAM          lParam;
  97.         LPFNPSPCALLBACKA pfnCallback;
  98.         UINT FAR * pcRefParent;
  99. } PROPSHEETPAGEA, FAR *LPPROPSHEETPAGEA;
  100. typedef const PROPSHEETPAGEA FAR *LPCPROPSHEETPAGEA;
  101.  
  102. typedef struct _PROPSHEETPAGEW {
  103.         DWORD           dwSize;
  104.         DWORD           dwFlags;
  105.         HINSTANCE       hInstance;
  106.         union {
  107.             LPCWSTR          pszTemplate;
  108. #ifdef _WIN32
  109.             LPCDLGTEMPLATE  pResource;
  110. #else
  111.             const VOID FAR *pResource;
  112. #endif
  113.         }DUMMYUNIONNAME;
  114.         union {
  115.             HICON       hIcon;
  116.             LPCWSTR      pszIcon;
  117.         }DUMMYUNIONNAME2;
  118.         LPCWSTR          pszTitle;
  119.         DLGPROC         pfnDlgProc;
  120.         LPARAM          lParam;
  121.         LPFNPSPCALLBACKW pfnCallback;
  122.         UINT FAR * pcRefParent;
  123. } PROPSHEETPAGEW, FAR *LPPROPSHEETPAGEW;
  124. typedef const PROPSHEETPAGEW FAR *LPCPROPSHEETPAGEW;
  125.  
  126. #ifdef UNICODE
  127. #define PROPSHEETPAGE           PROPSHEETPAGEW
  128. #define LPPROPSHEETPAGE         LPPROPSHEETPAGEW
  129. #define LPCPROPSHEETPAGE        LPCPROPSHEETPAGEW
  130. #else
  131. #define PROPSHEETPAGE           PROPSHEETPAGEA
  132. #define LPPROPSHEETPAGE         LPPROPSHEETPAGEA
  133. #define LPCPROPSHEETPAGE        LPCPROPSHEETPAGEA
  134. #endif
  135.  
  136.  
  137. #define PSH_DEFAULT             0x0000
  138. #define PSH_PROPTITLE           0x0001
  139. #define PSH_USEHICON            0x0002
  140. #define PSH_USEICONID           0x0004
  141. #define PSH_PROPSHEETPAGE       0x0008
  142. #define PSH_WIZARD              0x0020
  143. #define PSH_USEPSTARTPAGE       0x0040
  144. #define PSH_NOAPPLYNOW          0x0080
  145. #define PSH_USECALLBACK         0x0100
  146. #define PSH_HASHELP             0x0200
  147. #define PSH_MODELESS            0x0400
  148. #define PSH_RTLREADING          0x0800
  149.  
  150. typedef int (CALLBACK *PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM);
  151.  
  152. typedef struct _PROPSHEETHEADERA {
  153.         DWORD           dwSize;
  154.         DWORD           dwFlags;
  155.         HWND            hwndParent;
  156.         HINSTANCE       hInstance;
  157.         union {
  158.             HICON       hIcon;
  159.             LPCSTR      pszIcon;
  160.         }DUMMYUNIONNAME;
  161.         LPCSTR          pszCaption;
  162.  
  163.  
  164.         UINT            nPages;
  165.         union {
  166.             UINT        nStartPage;
  167.             LPCSTR      pStartPage;
  168.         }DUMMYUNIONNAME2;
  169.         union {
  170.             LPCPROPSHEETPAGEA ppsp;
  171.             HPROPSHEETPAGE FAR *phpage;
  172.         }DUMMYUNIONNAME3;
  173.         PFNPROPSHEETCALLBACK pfnCallback;
  174. } PROPSHEETHEADERA, FAR *LPPROPSHEETHEADERA;
  175. typedef const PROPSHEETHEADERA FAR *LPCPROPSHEETHEADERA;
  176.  
  177. typedef struct _PROPSHEETHEADERW {
  178.         DWORD           dwSize;
  179.         DWORD           dwFlags;
  180.         HWND            hwndParent;
  181.         HINSTANCE       hInstance;
  182.         union {
  183.             HICON       hIcon;
  184.             LPCWSTR     pszIcon;
  185.         }DUMMYUNIONNAME;
  186.         LPCWSTR         pszCaption;
  187.  
  188.  
  189.         UINT            nPages;
  190.         union {
  191.             UINT        nStartPage;
  192.             LPCWSTR     pStartPage;
  193.         }DUMMYUNIONNAME2;
  194.         union {
  195.             LPCPROPSHEETPAGEW ppsp;
  196.             HPROPSHEETPAGE FAR *phpage;
  197.         }DUMMYUNIONNAME3;
  198.         PFNPROPSHEETCALLBACK pfnCallback;
  199. } PROPSHEETHEADERW, FAR *LPPROPSHEETHEADERW;
  200. typedef const PROPSHEETHEADERW FAR *LPCPROPSHEETHEADERW;
  201.  
  202. #ifdef UNICODE
  203. #define PROPSHEETHEADER         PROPSHEETHEADERW
  204. #define LPPROPSHEETHEADER       LPPROPSHEETHEADERW
  205. #define LPCPROPSHEETHEADER      LPCPROPSHEETHEADERW
  206. #else
  207. #define PROPSHEETHEADER         PROPSHEETHEADERA
  208. #define LPPROPSHEETHEADER       LPPROPSHEETHEADERA
  209. #define LPCPROPSHEETHEADER      LPCPROPSHEETHEADERA
  210. #endif
  211.  
  212.  
  213. #define PSCB_INITIALIZED  1
  214. #define PSCB_PRECREATE    2
  215.  
  216. WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
  217. WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
  218. WINCOMMCTRLAPI BOOL           WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE);
  219. WINCOMMCTRLAPI int            WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
  220. WINCOMMCTRLAPI int            WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
  221.  
  222. #ifdef UNICODE
  223. #define CreatePropertySheetPage  CreatePropertySheetPageW
  224. #define PropertySheet            PropertySheetW
  225. #else
  226. #define CreatePropertySheetPage  CreatePropertySheetPageA
  227. #define PropertySheet            PropertySheetA
  228. #endif
  229.  
  230.  
  231.  
  232. typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
  233. typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
  234.  
  235.  
  236. typedef struct _PSHNOTIFY
  237. {
  238.     NMHDR hdr;
  239.     LPARAM lParam;
  240. } PSHNOTIFY, FAR *LPPSHNOTIFY;
  241.  
  242.  
  243. #define PSN_FIRST               (0U-200U)
  244. #define PSN_LAST                (0U-299U)
  245.  
  246.  
  247. #define PSN_SETACTIVE           (PSN_FIRST-0)
  248. #define PSN_KILLACTIVE          (PSN_FIRST-1)
  249. // #define PSN_VALIDATE            (PSN_FIRST-1)
  250. #define PSN_APPLY               (PSN_FIRST-2)
  251. #define PSN_RESET               (PSN_FIRST-3)
  252. // #define PSN_CANCEL              (PSN_FIRST-3)
  253. #define PSN_HELP                (PSN_FIRST-5)
  254. #define PSN_WIZBACK             (PSN_FIRST-6)
  255. #define PSN_WIZNEXT             (PSN_FIRST-7)
  256. #define PSN_WIZFINISH           (PSN_FIRST-8)
  257. #define PSN_QUERYCANCEL         (PSN_FIRST-9)
  258.  
  259.  
  260. #define PSNRET_NOERROR              0
  261. #define PSNRET_INVALID              1
  262. #define PSNRET_INVALID_NOCHANGEPAGE 2
  263.  
  264.  
  265. #define PSM_SETCURSEL           (WM_USER + 101)
  266. #define PropSheet_SetCurSel(hDlg, hpage, index) \
  267.         SendMessage(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
  268.  
  269.  
  270. #define PSM_REMOVEPAGE          (WM_USER + 102)
  271. #define PropSheet_RemovePage(hDlg, index, hpage) \
  272.         SendMessage(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
  273.  
  274.  
  275. #define PSM_ADDPAGE             (WM_USER + 103)
  276. #define PropSheet_AddPage(hDlg, hpage) \
  277.         SendMessage(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
  278.  
  279.  
  280. #define PSM_CHANGED             (WM_USER + 104)
  281. #define PropSheet_Changed(hDlg, hwnd) \
  282.         SendMessage(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
  283.  
  284.  
  285. #define PSM_RESTARTWINDOWS      (WM_USER + 105)
  286. #define PropSheet_RestartWindows(hDlg) \
  287.         SendMessage(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
  288.  
  289.  
  290. #define PSM_REBOOTSYSTEM        (WM_USER + 106)
  291. #define PropSheet_RebootSystem(hDlg) \
  292.         SendMessage(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
  293.  
  294.  
  295. #define PSM_CANCELTOCLOSE       (WM_USER + 107)
  296. #define PropSheet_CancelToClose(hDlg) \
  297.         SendMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
  298.  
  299.  
  300. #define PSM_QUERYSIBLINGS       (WM_USER + 108)
  301. #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
  302.         SendMessage(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
  303.  
  304.  
  305. #define PSM_UNCHANGED           (WM_USER + 109)
  306. #define PropSheet_UnChanged(hDlg, hwnd) \
  307.         SendMessage(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
  308.  
  309.  
  310. #define PSM_APPLY               (WM_USER + 110)
  311. #define PropSheet_Apply(hDlg) \
  312.         SendMessage(hDlg, PSM_APPLY, 0, 0L)
  313.  
  314.  
  315. #define PSM_SETTITLEA           (WM_USER + 111)
  316. #define PSM_SETTITLEW           (WM_USER + 120)
  317.  
  318. #ifdef UNICODE
  319. #define PSM_SETTITLE            PSM_SETTITLEW
  320. #else
  321. #define PSM_SETTITLE            PSM_SETTITLEA
  322. #endif
  323.  
  324. #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
  325.         SendMessage(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
  326.  
  327.  
  328. #define PSM_SETWIZBUTTONS       (WM_USER + 112)
  329. #define PropSheet_SetWizButtons(hDlg, dwFlags) \
  330.         PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
  331.  
  332.  
  333.  
  334. #define PSWIZB_BACK             0x00000001
  335. #define PSWIZB_NEXT             0x00000002
  336. #define PSWIZB_FINISH           0x00000004
  337. #define PSWIZB_DISABLEDFINISH   0x00000008
  338.  
  339.  
  340. #define PSM_PRESSBUTTON         (WM_USER + 113)
  341. #define PropSheet_PressButton(hDlg, iButton) \
  342.         SendMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
  343.  
  344.  
  345. #define PSBTN_BACK              0
  346. #define PSBTN_NEXT              1
  347. #define PSBTN_FINISH            2
  348. #define PSBTN_OK                3
  349. #define PSBTN_APPLYNOW          4
  350. #define PSBTN_CANCEL            5
  351. #define PSBTN_HELP              6
  352. #define PSBTN_MAX               6
  353.  
  354.  
  355.  
  356. #define PSM_SETCURSELID         (WM_USER + 114)
  357. #define PropSheet_SetCurSelByID(hDlg, id) \
  358.         SendMessage(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
  359.  
  360.  
  361. #define PSM_SETFINISHTEXTA      (WM_USER + 115)
  362. #define PSM_SETFINISHTEXTW      (WM_USER + 121)
  363.  
  364. #ifdef UNICODE
  365. #define PSM_SETFINISHTEXT       PSM_SETFINISHTEXTW
  366. #else
  367. #define PSM_SETFINISHTEXT       PSM_SETFINISHTEXTA
  368. #endif
  369.  
  370. #define PropSheet_SetFinishText(hDlg, lpszText) \
  371.         SendMessage(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
  372.  
  373.  
  374. #define PSM_GETTABCONTROL       (WM_USER + 116)
  375. #define PropSheet_GetTabControl(hDlg) \
  376.         (HWND)SendMessage(hDlg, PSM_GETTABCONTROL, 0, 0)
  377.  
  378. #define PSM_ISDIALOGMESSAGE     (WM_USER + 117)
  379. #define PropSheet_IsDialogMessage(hDlg, pMsg) \
  380.         (BOOL)SendMessage(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
  381.  
  382. #define PSM_GETCURRENTPAGEHWND  (WM_USER + 118)
  383. #define PropSheet_GetCurrentPageHwnd(hDlg) \
  384.         (HWND)SendMessage(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
  385.  
  386. #define ID_PSRESTARTWINDOWS     0x2
  387. #define ID_PSREBOOTSYSTEM       (ID_PSRESTARTWINDOWS | 0x1)
  388.  
  389.  
  390. #define WIZ_CXDLG               276
  391. #define WIZ_CYDLG               140
  392.  
  393. #define WIZ_CXBMP               80
  394.  
  395. #define WIZ_BODYX               92
  396. #define WIZ_BODYCX              184
  397.  
  398. #define PROP_SM_CXDLG           212
  399. #define PROP_SM_CYDLG           188
  400.  
  401. #define PROP_MED_CXDLG          227
  402. #define PROP_MED_CYDLG          215
  403.  
  404. #define PROP_LG_CXDLG           252
  405. #define PROP_LG_CYDLG           218
  406.  
  407. #endif // (WINVER >= 0x0400)
  408.  
  409. #ifdef __cplusplus
  410. }
  411. #endif
  412.  
  413. #endif
  414.