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