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