Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

275 lines
7.2 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. apilayer.h
  5. Abstract:
  6. This module contains all API layer's definiton
  7. Author:
  8. 02-Jan-1996 Tue 13:28:08 created -by- Daniel Chou (danielc)
  9. [Environment:]
  10. NT Windows - Common Printer Driver UI DLL
  11. [Notes:]
  12. Revision History:
  13. --*/
  14. #ifndef CPSUI_APILAYER
  15. #define CPSUI_APILAYER
  16. //================= Internal Data structures =============================
  17. //
  18. #define TABTABLE_COUNT (MAXPROPPAGES + 3)
  19. #define TAB_MODE_INIT 0
  20. #define TAB_MODE_FIND 1
  21. #define TAB_MODE_INSERT 2
  22. #define TAB_MODE_DELETE 3
  23. #define TAB_MODE_DELETE_ALL 4
  24. #define GET_REAL_INSIDX(ptbl) ((ptbl)->TabInfo[(ptbl)->InsIdx].OrgInsIdx)
  25. #define DP_STD_INT_TVPAGE DP_STD_RESERVED_START
  26. #define COUNT_POSTSETCURSEL 32
  27. typedef struct _TABINFO {
  28. SHORT OrgInsIdx;
  29. WORD HandleIdx;
  30. HWND hDlg;
  31. } TABINFO, *PTABINFO;
  32. #define TTF_POST_SETCURSEL 0x0001
  33. typedef struct _TABTABLE {
  34. struct _TABTABLE *pTabTable;
  35. HWND hPSDlg;
  36. HWND hWndTab;
  37. WNDPROC WndProc;
  38. WORD cPostSetCurSel;
  39. SHORT iPostSetCurSel;
  40. WORD cTab;
  41. WORD CurSel;
  42. WORD InsIdx;
  43. WORD HandleIdx;
  44. TABINFO TabInfo[TABTABLE_COUNT];
  45. } TABTABLE, *PTABTABLE;
  46. #define CPSUIPAGE_ID 0x43444955
  47. #define CPF_ROOT 0x00000001
  48. #define CPF_PARENT 0x00000002
  49. #define CPF_PFNPROPSHEETUI 0x00000004
  50. #define CPF_COMPROPSHEETUI 0x00000008
  51. #define CPF_USER_GROUP 0x00000010
  52. #define CPF_DLL 0x00000020
  53. #define CPF_CALLER_HPSPAGE 0x00000040
  54. #define CPF_ANSI_CALL 0x00000080
  55. #define CPF_DONE_PROPSHEET 0x00000100
  56. #define CPF_DONE_PROPSHEETPROC 0x00000200
  57. #define CPF_SHOW_PROPSHEET 0x00000400
  58. #define CPF_DOCPROP 0x00000800
  59. #define CPF_ADVDOCPROP 0x00001000
  60. #define CPF_PRINTERPROP 0x00002000
  61. #define CPF_CALL_TV_DIRECT 0x00004000
  62. #define CPF_NO_PSN_APPLY 0x00008000
  63. #define CPF_HAS_CPSUI 0x00010000
  64. #define CPF_NO_APPLY_BUTTON 0x00020000
  65. #define CPF_ACTIVATED 0x00040000
  66. #define CPF_DLGPROC_CHANGED 0x00080000
  67. #define CPF_PSZ_PSTARTPAGE 0x00100000
  68. typedef struct _CPSUIPAGE;
  69. typedef struct _MYDATABLOCK {
  70. struct _MYDATABLOCK *pNext;
  71. DWORD ID;
  72. DWORD cb;
  73. } MYDATABLOCK, *PMYDATABLOCK;
  74. typedef struct _ROOTINFO {
  75. HWND hDlg;
  76. LPDWORD pResult;
  77. PTABTABLE pTabTable;
  78. struct _CPSUIPAGE *pStartPage;
  79. WORD cPage;
  80. WORD cCPSUIPage;
  81. DWORD DMPubHideBits;
  82. PMYDATABLOCK pMyDB;
  83. } ROOTINFO, *PROOTINFO;
  84. typedef struct _PFNINFO {
  85. HINSTANCE hInst;
  86. PFNPROPSHEETUI pfnPSUI;
  87. LPARAM lParamInit;
  88. ULONG_PTR UserData;
  89. ULONG_PTR Result;
  90. } PFNINFO, *PPFNINFO;
  91. typedef struct _CPSUIINFO {
  92. PTVWND pTVWnd;
  93. LONG Result;
  94. LONG TVPageIdx;
  95. LONG StdPageIdx1;
  96. LONG StdPageIdx2;
  97. } CPSUIINFO, PCPSUIINFO;
  98. typedef struct _HPAGEINFO {
  99. HWND hDlg;
  100. DLGPROC DlgProc;
  101. LPFNPSPCALLBACK pspCB;
  102. LPARAM lParam;
  103. HICON hIcon;
  104. DWORD dwSize;
  105. } HPAGEINFO, *PHPAGEINFO;
  106. typedef struct _CPSUIPAGE {
  107. DWORD ID;
  108. DWORD cLock;
  109. DWORD Flags;
  110. HANDLE hCPSUIPage;
  111. HANDLE hActCtx;
  112. struct _CPSUIPAGE *pParent;
  113. struct _CPSUIPAGE *pPrev;
  114. struct _CPSUIPAGE *pNext;
  115. union {
  116. struct _CPSUIPAGE *pChild;
  117. HPROPSHEETPAGE hPage;
  118. } DUMMYUNIONNAME;
  119. union {
  120. ROOTINFO RootInfo;
  121. PFNINFO pfnInfo;
  122. CPSUIINFO CPSUIInfo;
  123. HPAGEINFO hPageInfo;
  124. } DUMMYUNIONNAME2;
  125. } CPSUIPAGE, *PCPSUIPAGE;
  126. typedef BOOL (CALLBACK *CPSUIPAGEENUMPROC)(PCPSUIPAGE pRootPage,
  127. PCPSUIPAGE pCPSUIPage,
  128. LPARAM lParam);
  129. #define SET_APPLY_BUTTON(pTVWnd, hDlg) \
  130. { \
  131. if (!(*((pTVWnd)->pRootFlags) & CPF_NO_APPLY_BUTTON)) { \
  132. \
  133. if (CountRevertOptItem((pTVWnd), \
  134. NULL, \
  135. TreeView_GetRoot((pTVWnd)->hWndTV), \
  136. 0)) { \
  137. \
  138. PropSheet_Changed(GetParent(hDlg), hDlg); \
  139. \
  140. } else { \
  141. \
  142. PropSheet_UnChanged(GetParent(hDlg), hDlg); \
  143. } \
  144. } \
  145. }
  146. #define HINSPSUIPAGE_2_IDX(h) ((UINT)LOWORD(LODWORD(h)))
  147. #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
  148. //
  149. // Local structure
  150. //
  151. typedef struct _PSPEX {
  152. PROPSHEETPAGE psp;
  153. PSPINFO pspInfo;
  154. } PSPEX, *PPSPEX;
  155. typedef struct _PSHINFO {
  156. WCHAR CaptionName[MAX_RES_STR_CHARS];
  157. } PSHINFO, *PPSHINFO;
  158. typedef struct _PAGEPROCINFO {
  159. PTABTABLE pTabTable;
  160. HPROPSHEETPAGE *phPage;
  161. HANDLE *pHandle;
  162. WORD cPage;
  163. WORD iPage;
  164. } PAGEPROCINFO, *PPAGEPROCINFO;
  165. typedef struct _INSPAGEIDXINFO {
  166. PCPSUIPAGE pCPSUIPage;
  167. PTABTABLE pTabTable;
  168. } INSPAGEIDXINFO, *PINSPAGEIDXINFO;
  169. //
  170. // Function prototypes
  171. //
  172. DWORD
  173. FilterException(
  174. HANDLE hPage,
  175. LPEXCEPTION_POINTERS pExceptionPtr
  176. );
  177. BOOL
  178. CALLBACK
  179. SetInsPageIdxProc(
  180. PCPSUIPAGE pRootPage,
  181. PCPSUIPAGE pCPSUIPage,
  182. LPARAM lParam
  183. );
  184. LONG_PTR
  185. CALLBACK
  186. CPSUICallBack(
  187. HANDLE hComPropSheet,
  188. UINT Function,
  189. LPARAM lParam1,
  190. LPARAM lParam2
  191. );
  192. LONG
  193. AddComPropSheetPage(
  194. PCPSUIPAGE pCPSUIPage,
  195. UINT PageIdx
  196. );
  197. BOOL
  198. EnumCPSUIPagesSeq(
  199. PCPSUIPAGE pRootPage,
  200. PCPSUIPAGE pCPSUIPage,
  201. CPSUIPAGEENUMPROC CPSUIPageEnumProc,
  202. LPARAM lParam
  203. );
  204. BOOL
  205. GetPageActivationContext(
  206. PCPSUIPAGE pCPSUIPage,
  207. HANDLE *phActCtx
  208. );
  209. #endif // CPSUI_APILAYER