home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / PRSHT.H < prev    next >
C/C++ Source or Header  |  1997-02-14  |  13KB  |  444 lines

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