Windows NT 4.0 source code leak
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.

3790 lines
148 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. compstui.h
  5. Abstract:
  6. This module contains global header definition for the COMMON DRIVER UI
  7. Author:
  8. 19-Jun-1995 Mon 11:52:01 created -by- Daniel Chou (danielc)
  9. 17-Aug-1995 Thu 14:59:28 updated -by- Daniel Chou (danielc)
  10. Updated for the first draft.
  11. 23-Aug-1995 Wed 15:13:27 updated -by- Daniel Chou (danielc)
  12. Updated for second draft
  13. 29-Aug-1995 Tue 11:33:24 updated -by- Daniel Chou (danielc)
  14. Adding ExtChkBox for some TVOT_xxx type
  15. 31-Aug-1995 Thu 04:04:23 updated -by- Daniel Chou (danielc)
  16. Making UNICODE type
  17. 01-Sep-1995 Fri 17:29:18 updated -by- Daniel Chou (danielc)
  18. Change the API interface type, so that it can be dynamically called
  19. and generate the property pages to be merge with the shell
  20. 05-Sep-1995 Tue 11:52:43 updated -by- Daniel Chou (danielc)
  21. Rename to compspui.h and update the API entry structure
  22. 07-Sep-1995 Thu 14:46:55 updated -by- Daniel Chou (danielc)
  23. rename to compstui.h and update comments
  24. 07-Sep-1995 Thu 16:07:31 updated -by- Daniel Chou (danielc)
  25. Adding UNION type for pSel/Sel, pOldSel/OldSel
  26. 08-Sep-1995 Fri 09:23:38 updated -by- Daniel Chou (danielc)
  27. Remove TypeIdx from OPTITEM and use pOptType, and remove all
  28. pOptType passed in the CPSUICBPARAM and COMPROPSHEETUI structures
  29. 25-Sep-1995 Mon 19:39:45 updated -by- Daniel Chou (danielc)
  30. add other related stuff.
  31. 26-Sep-1995 Tue 11:02:26 updated -by- Daniel Chou (danielc)
  32. Add error codes for GETLASTERROR
  33. 27-Sep-1995 Wed 16:32:37 updated -by- Daniel Chou (danielc)
  34. Move hWndParent, pTitle, hInst and TitleIconID out from
  35. COMPROPSHEETUI to COMPROPSHEETUIHEADER.
  36. 28-Sep-1995 Thu 17:06:46 updated -by- Daniel Chou (danielc)
  37. Add hInstCaller to COMPROPSHEETUI and add _COMPSTUI_ and cplusplus
  38. stuff
  39. 28-Sep-1995 Thu 23:16:34 updated -by- Daniel Chou (danielc)
  40. change tick count for trackbar/scrollbar to multiply factor. and
  41. add the push button flag which can overwrite the update permission so
  42. it can let user view the current setting from push button's dialog
  43. display
  44. 07-Feb-1996 Wed 17:45:31 updated -by- Daniel Chou (danielc)
  45. Change the API CommonPropSheetUI to CommonPropertySheetUI so that it
  46. not using stack but message base, this way any caller can add/delete
  47. pages as they want without worry about how many pages been added from
  48. its children.
  49. [Environment:]
  50. NT Windows - Common Property Sheet UI DLL.
  51. [Notes:]
  52. Revision History:
  53. --*/
  54. #ifndef _COMPSTUI_
  55. #define _COMPSTUI_
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. #if (!defined(RC_INVOKED))
  60. //
  61. // For compilers that don't support nameless unions
  62. //
  63. #ifndef DUMMYUNIONNAME
  64. #ifdef NONAMELESSUNION
  65. #define DUMMYUNIONNAME u
  66. #define DUMMYUNIONNAME2 u2
  67. #define DUMMYUNIONNAME3 u3
  68. #define DUMMYUNIONNAME4 u4
  69. #else
  70. #define DUMMYUNIONNAME
  71. #define DUMMYUNIONNAME2
  72. #define DUMMYUNIONNAME3
  73. #define DUMMYUNIONNAME4
  74. #endif
  75. #endif
  76. //
  77. // Predefined ID for the TreeView Option Type
  78. //
  79. //
  80. #define TVOT_2STATES 0
  81. #define TVOT_3STATES 1
  82. #define TVOT_UDARROW 2
  83. #define TVOT_TRACKBAR 3
  84. #define TVOT_SCROLLBAR 4
  85. #define TVOT_LISTBOX 5
  86. #define TVOT_COMBOBOX 6
  87. #define TVOT_EDITBOX 7
  88. #define TVOT_PUSHBUTTON 8
  89. #define TVOT_CHKBOX 9
  90. #define TVOT_LAST TVOT_CHKBOX
  91. #define TVOT_NONE (TVOT_LAST + 1)
  92. //
  93. // Predefined ID for the TreeView Option Type
  94. //
  95. //
  96. // TVOT_2STATES:
  97. // Count = 2
  98. // pOptParam[0]=pointer to the State 1 OPTPARAM
  99. // pOptParam[1]=pointer to the State 2 OPTPARAM
  100. //
  101. // BegCtrlID = 2 States Group Box ID
  102. // BegCtrlID+1= 2 States static Text
  103. // BegCtrlID+2= state 1 Radio button ID
  104. // BegCtrlID+3= state 1 icon control ID
  105. // BegCtrlID+4= state 2 Radio button ID
  106. // BegCtrlID+5= state 2 icon control ID
  107. // BegCtrlID+6= Extended Check Box/Push Button control ID
  108. // BegCtrlID+7= Extended Check Box/Push Button Icon control ID
  109. //
  110. // * For TVOT_3STATES, TVOT_3STATES, each of OPTPARAM consisted
  111. //
  112. // Style =Ignored
  113. // pData =Pointer to the string to describe the state
  114. // IconID=Icons resource ID, or common UI standard icon ID
  115. // lParam=Ignored
  116. //
  117. // * OPTITEM's 'Sel' is the selection index range from 0 to 1
  118. // * On the non-treeview page, this must be a auto radio button
  119. //
  120. //
  121. // TVOT_3STATES:
  122. // Count = 3
  123. // pOptParam[0]=pointer to the State 1 OPTPARAM
  124. // pOptParam[1]=pointer to the State 2 OPTPARAM
  125. // pOptParam[2]=pointer to the State 3 OPTPARAM
  126. //
  127. // BegCtrlID = 3 States Group Box ID
  128. // BegCtrlID+1= 3 States static Text
  129. // BegCtrlID+2= state 1 Radio button ID
  130. // BegCtrlID+3= state 1 icon control ID
  131. // BegCtrlID+4= state 2 Radio button ID
  132. // BegCtrlID+5= state 2 icon control ID
  133. // BegCtrlID+6= state 3 Radio button ID
  134. // BegCtrlID+7= state 3 icon control ID
  135. // BegCtrlID+8= Extended Check Box/Push Button control ID
  136. // BegCtrlID+9= Extended Check Box/Push Button Icon control ID
  137. //
  138. // * For TVOT_2STATES, TVOT_3STATES, each of OPTPARAM consisted
  139. //
  140. // Style =Ignored
  141. // pData =Pointer to the string to describe the state
  142. // IconID=Icons resource ID, or common UI standard icon ID
  143. // lParam=Ignored
  144. //
  145. // * OPTITEM's 'Sel' is the selection index range from 0 to 1
  146. // * On the non-treeview page, this must be a auto radio button
  147. //
  148. // ** For TVOT_2STATES, TVOT_3STSATES the 'Sel' field in the OPTITEM has
  149. // following definitions
  150. //
  151. // State 1, Sel = 0
  152. // State 2, Sel = 1
  153. // State 3, Sel = 2
  154. //
  155. // for any selection which based on false/true, no/yes, off/ontrue/false,
  156. // none/select then state 1 (sel=0) must always be the NO, FALSE, OFF or
  157. // NONE type.
  158. //
  159. //
  160. // TVOT_UDARROW:
  161. // Count = 2
  162. // pOptParam[0]=Pointer to the text of postfix and ICONS
  163. // pOptParam[1]=Pointer to the help line text above the control and
  164. // IconID = (SHORT)Low range of the up-down control
  165. // lParam = (SHORT)High range of the up-down control
  166. //
  167. // * Low/High must in range of a 16-bit sign integer
  168. //
  169. // if pData pointed to no help text then common UI automatically
  170. // set the (# - #) as help line
  171. //
  172. // BegCtrlID = udarrow Group Box ID
  173. // BegCtrlID+1= udarrow title static title ID
  174. // BegCtrlID+2= udarrow's editbox ID
  175. // BegCtrlID+3= udarrow icon control ID
  176. // BegCtrlID+4= udarrow postfix static text ID
  177. // BegCtrlID+5= udarrow help static text ID
  178. // BegCtrlID+6= udarrow arrow ID
  179. // BegCtrlID+7= Extended Check Box/Push Button control ID
  180. // BegCtrlID+8= Extended Check Box/Push Button Icon control ID
  181. //
  182. // * OPTITEM's 'Sel' is the selection index between Low/High range
  183. // * Style field in the OPTPARAM is ignored
  184. //
  185. //
  186. // TVOT_TRACKBAR:
  187. // Count = 3
  188. // pOptParam[0]=Pointer to the text for the selection postfix and ICONS
  189. // pOptParam[1]=Pointer to the <Low Range Text> and
  190. // IconID = (SHORT)Low range of the trackbar control
  191. // lParam = (SHORT)High range of the trackbar control
  192. //
  193. // * Low/High must in range of a 16-bit sign integer
  194. //
  195. // pOptParam[2]=Pointer to the <High Range Text> and
  196. // IconID = 'Sel' multiply factor for display
  197. // lParam = Page Size (increment)
  198. //
  199. // if pData pointed to NULLt then common UI automatically
  200. // set the Low/High range.
  201. //
  202. // BegCtrlID = trackbar Group Box ID
  203. // BegCtrlID+1= trackbar static title ID
  204. // BegCtrlID+2= trackbar(horizontal) ID (static FRAME to define size)
  205. // BegCtrlID+3= trackbar icon control ID
  206. // BegCtrlID+4= trackbar low range text control ID
  207. // BegCtrlID+5= trackbar high range text control ID
  208. // BegCtrlID+6= trackbar postfix ID
  209. // BegCtrlID+7= Extended Check Box/Push Button control ID
  210. // BegCtrlID+8= Extended Check Box/Push Button Icon control ID
  211. //
  212. // * OPTITEM's 'Sel' is the selection index between Low/High range
  213. // * The multiply factor is used to multiply the current select with
  214. // this factor and display it. typically this is one
  215. // * the tick frequency is automatically to set to PageSize increment
  216. // * Style field in the OPTPARAM is ignored
  217. //
  218. //
  219. // TVOT_SCROLLBAR:
  220. // Count = 3
  221. // pOptParam[0]=Pointer to the text for the selection postfix and ICONS
  222. // pOptParam[1]=Pointer to the <Low Range Text> and
  223. // IconID = (SHORT)Low range of the scrollbar control
  224. // lParam = (SHORT)High range of the scroll control
  225. //
  226. // * Low/High must in range of a 16-bit sign integer
  227. //
  228. // pOptParam[2]=Pointer to the <High Range Text> and
  229. // IconID = 'Sel' multiply factor for display
  230. // lParam = Page Size (increment)
  231. //
  232. // if pData pointed to NULLt then common UI automatically
  233. // set the Low/High range.
  234. //
  235. //
  236. // BegCtrlID = scrollbar(horizontal) group box ID
  237. // BegCtrlID+1= scrollbar(horizontal) static text ID
  238. // BegCtrlID+2= scrollbar(horizontal) ID
  239. // BegCtrlID+3= scrollbar icon control ID
  240. // BegCtrlID+4= scrollbar low range text control ID
  241. // BegCtrlID+5= scrollbar high range text control ID
  242. // BegCtrlID+6= scrollbar postfix control ID
  243. // BegCtrlID+7= Extended Check Box/Push Button control ID
  244. // BegCtrlID+8= Extended Check Box/Push Button Icon control ID
  245. //
  246. // * OPTITEM's 'Sel' is the selection index between Low/High range
  247. // * The multiply factor is used to multiply the current select with
  248. // this factor and display it. typically this is one
  249. // * Style field in the OPTPARAM is ignored
  250. //
  251. //
  252. //
  253. // TVOT_LISTBOX:
  254. // TVOT_COMBOBOX:
  255. // Count = N
  256. // pOptParam[0]=pointer to the first OPTPARAM (pData=string pointer)
  257. // pOptParam[1]=pointer to the second OPTPARAM (pData=string pointer)
  258. // .
  259. // .
  260. // pOptParam[N-1]=pointer to the N item string
  261. //
  262. // BegCtrlID = Listbox/ComboBox group box ID
  263. // BegCtrlID+1= Listbox/ComboBox static title ID
  264. // BegCtrlID+2= Listbox/Combobox ID
  265. // BegCtrlID+3= Listbox/Combobox icon control ID
  266. // BegCtrlID+4= Extended Check Box/Push Button control ID
  267. // BegCtrlID+5= Extended Check Box/Push Button Icon control ID
  268. //
  269. // * for TVOT_LISTBOX, TVOT_COMBOBOX, the field used as
  270. //
  271. // Style =Ignored by the common UI
  272. // pData =Pointer to the name of item
  273. // IconID=Icon resource ID for the item
  274. // lParam=ignored by the common UI
  275. //
  276. // * Only SINGLE selection is supported, to do a multiple selction use
  277. // multiple OPTITEM and create a header for it
  278. //
  279. // * an OTLBCBS_SORT style can be specified in the OPTTYPE's LBCBStyle
  280. // field, and the listbox or combobox will be sorted according to the
  281. // item's string.
  282. //
  283. // * OPTITEM's 'Sel' is the selection index between Low/High range
  284. //
  285. // * for TVOT_LISTBOX, TVOT_COMBOBOX, when it get received the keyboard
  286. // focus then common UI will call callback function (only if
  287. // OPTIF_CALLBACK bit set) with reason of CPSUICB_REASON_LBCB_ACTIVE,
  288. // this give caller a chance to modify following structure flags/pdata
  289. // which associate with the current OPTITEM. The caller's callback
  290. // function can ONLY modify the flags/data specified here.
  291. //
  292. // OPTTYPE pointed by the pOptType from OPTITEM
  293. //
  294. // Style: OTS_LBCB_SORT
  295. // OTS_LBCB_INCL_ITEM_NONE
  296. //
  297. // OPTPARAMs pointed by the pOptParam from the OPTTYPE
  298. //
  299. // Flags: OPTPF_HIDE
  300. // OPTPF_DISABLED
  301. //
  302. // pData: change string name
  303. //
  304. //
  305. // * The TVOT_COMBOBOX typically only used in the tree-view if there is
  306. // only one selection available for that item, when there is only one
  307. // item then dropdown list will not enabled by the common UI
  308. //
  309. //
  310. //
  311. // TVOT_EDITBOX:
  312. // Count = 2
  313. // pOptParam[0]=Pointer to the text of postfix and ICONS
  314. // pOptParam[1]=Pointer to the help line text above the control and
  315. // IconID = Edit buffer sie in character pointed by pSel
  316. // this is including the NULL terminator.
  317. // lParam = ignored.
  318. //
  319. // BegCtrlID = editBox group Box ID
  320. // BegCtrlID+1= editBox static title ID
  321. // BegCtrlID+2= editbox ID
  322. // BegCtrlID+3= editbox icon control ID
  323. // BegCtrlID+4= editbox postfix ID
  324. // BegCtrlID+5= editbox help ID
  325. // BegCtrlID+6= Extended Check Box/Push Button control ID
  326. // BegCtrlID+7= Extended Check Box/Push Button Icon control ID
  327. //
  328. // * Style field is ignored
  329. //
  330. // * pSel in the OPTITEM is the pointer to the editing string, the pSel
  331. // must pointed to a buffer eqaul or larger than the count of the buffer
  332. // (pOptParam[1]->IconID) size
  333. //
  334. //
  335. // TVOT_PUSHBUTTON:
  336. // Count = 1
  337. //
  338. // BegCtrlID = push button group box ID
  339. // BegCtrlID+1= push button static text ID (Not used by common UI)
  340. // BegCtrlID+2= push button ID
  341. // BegCtrlID+3= push button icon control ID
  342. // BegCtrlID+4= Extended Check Box/Push Button control ID
  343. // BegCtrlID+5= Extended Check Box/Push Button Icon control ID
  344. //
  345. //
  346. // PUSHBUTTON_TYPE_xxx specified the action and content of pData in the
  347. // pOptParam[0] as describe in the following
  348. //
  349. // PUSHBUTTON_TYPE_DLGPROC
  350. //
  351. // This push button is designed to bring up caller's dialog box
  352. //
  353. // pOptParam[0].pData = Caller's DLGPROC
  354. // pOptParam[0].Style = PUSHBUTTON_TYPE_DLGPROC
  355. // pOptParam[0].IconID = Icon resource ID
  356. // pOptParam[0].lParam = Caller's DIALOG resource template ID
  357. // or handle to the DLGTEMPLATE depends
  358. // on the OPTPF_USE_HDLGTEMPLATE flag
  359. //
  360. //
  361. // The 'lParam' passed to the DLGPROC's WM_INITDIALOG is the
  362. // CPSUICBPARAM structure pointer, and the reason field is set
  363. // to CPSUICB_REASON_DLGPROC.
  364. //
  365. //
  366. // PUSHBUTTON_TYPE_CALLBACK
  367. //
  368. // This push button is designed to have caller process the item
  369. // which cannot accomplished with the dialog box along.
  370. //
  371. // pOptParam[0].pData = CPSUICALLBACK function pointer
  372. // pOptParam[0].Style = PUSHBUTTON_TYPE_CALLBACK
  373. // pOptParam[0].IconID = Icon resource ID
  374. // pOptParam[0].lParam = Not Used;
  375. //
  376. // Durning the callback the Reason field in CPSUICBPARAM will
  377. // set to CPSUICB_REASON_PUSHBUTTON.
  378. //
  379. // ** If pOptParam[0].pData callback function is NULL then common
  380. // UI will call the pfnCallBack pointer set in the
  381. // COMPROPSHEETUI structure if it is not NULL
  382. //
  383. // ** The callback function should put the result of the callback
  384. // in the pSel/Sel of OPTITEM associate with the push button
  385. //
  386. // PUSHBUTTON_TYPE_HTCLRADJ
  387. //
  388. // This push button is designed to bring up halftone color
  389. // adjustment dialog box.
  390. //
  391. // pOptParam[0].pData = pointer to COLORADJUSTMENT structure
  392. // pOptParam[0].Style = PUSHBUTTON_TYPE_HTCLRADJ
  393. // pOptParam[0].IconID = Icon resource ID
  394. // pOptParam[0].lParam = Not Used;
  395. //
  396. //
  397. // PUSHBUTTON_TYPE_HTSETUP
  398. //
  399. // This push button is designed to bring up device halftone
  400. // setup dialog box.
  401. //
  402. // pOptParam[0].pData = pointer to DEVHTADJDATA structure
  403. // pOptParam[0].Style = PUSHBUTTON_TYPE_HTSETUP
  404. // pOptParam[0].IconID = Icon resource ID
  405. // pOptParam[0].lParam = Not Used;
  406. //
  407. //
  408. // * 'Sel' field in the OPTITEM for the PUSHBUTTON is the last returned
  409. // LONG result from the called dialog box or funcitons. The result
  410. // only valid if OPTIF_CHANGEONCE flag is set. The common UI will set
  411. // OPTIF_CHANGEONCE if push button ever pushed.
  412. //
  413. // * Since common UI donot know the meaning of the return value and
  414. // content of the called parameter, it is up to the caller to use
  415. // callback function to determine the returned result.
  416. //
  417. // * When returned from the push button except push botton type
  418. // PUSHBUTTON_TYPE_CALLBACK common ui will call the callback function
  419. // if the OPTIF_CALLBACK flat is set. The callback reason is set to
  420. // CPSUICB_REASON_SEL_CHANGED.
  421. //
  422. // * If the passed in CPSUIF_UPDATE_PERMISSION Flags in the COMPROPSHEETUI
  423. // is clear then the callback function must ONLY display the dialog box
  424. // and not changed any OPTITEM data if OTS_PUSH_ENABLE_ALWAYS
  425. // flag is set in the OPTTYPE
  426. //
  427. //
  428. // TVOT_CHKBOX:
  429. // Count = 1
  430. //
  431. // pOptparam[0].Style = CHKBOXS_FALSE_TRUE False/True
  432. // CHKBOXS_NO_YES, No/YES
  433. // CHKBOXS_OFF_ON, Off/ON
  434. // CHKBOXS_FALSEPDATA False/pData
  435. // CHKBOXS_NO_PDATA No/pData
  436. // CHKBOXS_OFF_PDATA Off/pData
  437. // CHKBOXS_NONE_PDATA None/pData
  438. // pOptParam[0].pData = Only used if Style is CHKBOXS_NONE_PDATA
  439. // pOptParam[0].IconID = Icon resource ID
  440. // pOptParam[0].lParam = Ignored
  441. //
  442. //
  443. // BegCtrlID = check box group ID
  444. // BegCtrlID+1= Check Box static text (not used by common UI)
  445. // BegCtrlID+2= check box button ID
  446. // BegCtrlID+3= check box icon control ID
  447. // BegCtrlID+4= Extended Check Box/Push Button control ID
  448. // BegCtrlID+5= Extended Check Box/Push Button Icon control ID
  449. //
  450. //
  451. // * BegCtrlID only used if the OPTITEM/OPTTYPE is belong to the the DLGPAGE
  452. // which has non-common UI dialog box template (DlgTemplateID in the DLGPAGE
  453. // is not standard DP_STD_xxx common ui dialog box template). The common
  454. // UI used this ID to managed caller's dialog boxes item's selections and
  455. // initialization.
  456. //
  457. // * for each item, it has group box ID (BegCtrlID) and static text ctronl ID
  458. // (BegCtrlID + 1). The common UI will set the text in one of these two
  459. // control ID in followng seauence.
  460. //
  461. // 1) If group box control ID's window (BegCtrlID) is exist and the
  462. // OPTITEM's flag OPTIF_NO_GROUPBOX_NAME is not set then common UI will
  463. // set the pName from OPTITEM to the group box.
  464. //
  465. // 2) If the group box name is not set and static control ID's window
  466. // (BegCtrlID + 1) is exist then common UI will set the pName from
  467. // OPTITEM to the static text control.
  468. //
  469. // * for TVOT_TRACKBAR and TVOT_SCROLLBAR, if pName in the OPTITEM is set to
  470. // either group box or static text control then common UI will also append
  471. // the current selection position of trackbar or scroll bar to the pName.
  472. //
  473. // * If multiple OPTITEMs using the same POPTPARAM and need different
  474. // BegCtrlID for each control then then a separate OPTTYPE structure should
  475. // be generated but POPTPARAM pointed to the same OPTPARAM[]
  476. //
  477. // * If a BegCtrlID+N is not used then skip that ID in your dialog box
  478. // template
  479. //
  480. //
  481. #define CHKBOXS_FALSE_TRUE 0
  482. #define CHKBOXS_NO_YES 1
  483. #define CHKBOXS_OFF_ON 2
  484. #define CHKBOXS_FALSE_PDATA 3
  485. #define CHKBOXS_NO_PDATA 4
  486. #define CHKBOXS_OFF_PDATA 5
  487. #define CHKBOXS_NONE_PDATA 6
  488. #define PUSHBUTTON_TYPE_DLGPROC 0
  489. #define PUSHBUTTON_TYPE_CALLBACK 1
  490. #define PUSHBUTTON_TYPE_HTCLRADJ 2
  491. #define PUSHBUTTON_TYPE_HTSETUP 3
  492. #define MAX_RES_STR_CHARS 160
  493. //
  494. // Common Printer UI's LPTSTR
  495. //
  496. // All string pointer in common printer UI structures can be either a real
  497. // memory pointer or a string resource ID. These are applied to LPTSTR type.
  498. //
  499. // The LPTSTR is defined to identify that the pointer can be a real string
  500. // pointer or a resource ID (either common printer UI provided ID or caller's
  501. // own resource ID). common UI using following logic to get the final string.
  502. //
  503. // LPTSTR pData;
  504. //
  505. // if (HIWORD(pData) != 0) then pData is a NULL terminated string pointer
  506. //
  507. // ELSE
  508. //
  509. // LOWORD(pData)=Resource ID
  510. //
  511. // if (Resource ID is within the common UI string resource ID range)
  512. // then it load the string from common UI DLL
  513. //
  514. // ELSE
  515. //
  516. // it load string from caller's resource
  517. //
  518. //
  519. // * You can use MAKEINTRESOURCE(StrResID) to set this field
  520. //
  521. // * The MAX characters loaded by the common UI from the resource is defined
  522. // as MAX_RES_STR_CHARS
  523. //
  524. // * You cannot use LPTSTR as resource ID for the TVOT_EDITBOX style's
  525. // pSel in the OPTITEM, this pointer must be a real buffer pointer
  526. //
  527. //
  528. //
  529. // ICONs
  530. //
  531. // Common UI using two types of Icons, One is 32x32 and the other is 16x16
  532. // plus if any monochrome icon with 32x32 and 16x16 sizes.
  533. //
  534. // The 16x16 icon when displayed on the screen is using 16x17 pixel space,
  535. // this is ensure that downware adjacent icon is not crowded together.
  536. //
  537. // In common UI, if you need to passed a ICON ID, it can either passed a
  538. // common UI's predefined ID or caller's own ICON resource ID.
  539. //
  540. //
  541. // * You can use to imagedit or any other Window icon editor to create the
  542. // icon, each icon file should have one unique icon resource ID which is
  543. // not overlay with the standard common UI IDI_CPSUI_xxx identifier. For
  544. // each icon file, its should have both 32x32 and 16x16 size icon on
  545. // different display. (ie. monochrome).
  546. //
  547. // Common UI will try to load the correct size of icon from the icon
  548. // resource, but it will stretch them if the size is not found.
  549. //
  550. //
  551. //
  552. // Flags for the OPTTYPE
  553. //
  554. //
  555. #define OPTPF_HIDE 0x01
  556. #define OPTPF_DISABLED 0x02
  557. #define OPTPF_ICONID_AS_HICON 0x04
  558. #define OPTPF_OVERLAY_WARNING_ICON 0x08
  559. #define OPTPF_OVERLAY_STOP_ICON 0x10
  560. #define OPTPF_OVERLAY_NO_ICON 0x20
  561. #define OPTPF_USE_HDLGTEMPLATE 0x40
  562. typedef struct _OPTPARAM {
  563. WORD cbSize; // size of this structure
  564. BYTE Flags; // OPTPF_xxxx flags
  565. BYTE Style; // style use in this structure
  566. LPTSTR pData; // pointer to the data
  567. DWORD IconID; // iconID;
  568. LONG lParam; // parameter used
  569. DWORD dwReserved[2]; // reserved dword, must be 0
  570. } OPTPARAM, *POPTPARAM;
  571. //
  572. // OPTPARAM
  573. //
  574. // The OPTPARAM structure is used to describe each slectable item in the
  575. // common UI such as 'letter', 'legal' in the form slection list box
  576. //
  577. // cbSize - size of this structure
  578. //
  579. // Flags - defined as OPTPF_xxxx
  580. //
  581. // OPTPF_HIDE
  582. //
  583. // Specified hide this listed selection item and not
  584. // availabe for user to select. This only available to
  585. // following TVOT_xxx types
  586. //
  587. // TVOT_3STATES
  588. // TVOT_LISTBOX
  589. // TVOT_COMBOBOX
  590. //
  591. // If all the seclection items are OPTPF_HIDE then the
  592. // OPTITEM is automatically hided by the common UI, if
  593. // TVOT_3STATES has 2 states hide then an error is
  594. // returned
  595. //
  596. //
  597. // OPTPF_DISABLED
  598. //
  599. // Specified this listed selection item is disabled and
  600. // not availabe for user to select. This only available
  601. // to following TVOT_xxx types
  602. //
  603. // TVOT_2STATES
  604. // TVOT_3STATES
  605. // TVOT_LISTBOX
  606. // TVOT_COMBOBOX
  607. //
  608. //
  609. // OPTPF_ICONID_AS_HICON
  610. //
  611. // If this flag is set then IconID DWORD field is treated
  612. // as a handle to the icon rather then the resource ID
  613. //
  614. //
  615. // OPTPF_OVERLAY_WARNING_ICON
  616. //
  617. // If this bit is set then this OPTPARAM item's icon will
  618. // be overlaied by a common UI's IDI_CPSUI_WARNING icon.
  619. //
  620. //
  621. // OPTPF_OVERLAY_STOP_ICON
  622. //
  623. // If this bit is set then this OPTPARAM item's icon will
  624. // be overlaied by a common UI's IDI_CPSUI_STOP icon.
  625. //
  626. //
  627. // OPTPF_OVERLAY_NO_ICON
  628. //
  629. // If this bit is set then this OPTPARAM item's icon will
  630. // be overlaied by a common UI's IDI_CPSUI_NO icon.
  631. //
  632. //
  633. // Style - Style for the OPTPARAM, it depends on the TVOT_xxx type as
  634. // describe below
  635. //
  636. // TVOT_PUSBUTTON
  637. //
  638. // it can be one of PUSHBUTTON_TYPE_xxxx.
  639. //
  640. // other TVOT_xxxx
  641. //
  642. // this fields is not used.
  643. //
  644. //
  645. // pData - Is either a pointer to the item name (string) or it is
  646. // used to describe other data.
  647. //
  648. // * If the pData in the OPTPARAM is supposed to be a static
  649. // pointer to a string and the string is a common UI
  650. // standard resource ID then common UI will check if pData
  651. // is equal to IDS_CPSUI_NOTINSTALLED, if true then
  652. // common UI will overaly a not installed icon on top of
  653. // the OPTPARAM's Icon. This will not applied to the
  654. // TVOT_EDITBOX type since the pData is not a static text
  655. // pointer or a string resource ID.
  656. //
  657. // ** See LPTSTR description above
  658. //
  659. // IconID - This is the icon identifier, which can be a common strandard
  660. // IDI_CPSUI_xxx icon ID, caller's own icon resource ID, or a
  661. // handle to the caller defined icon if OPTPF_ICONID_AS_HICON
  662. // flag is set, in any case if the IconID is zero then it
  663. // indicated no icon.
  664. //
  665. // lParam - Extra data used by the OPTPARAM, it depends on the TVOT_xxx
  666. // type.
  667. //
  668. // dwReserved[]- Reserved DWORDs, must be 0
  669. //
  670. //
  671. #define OPTTF_TYPE_DISABLED 0x01
  672. #define OPTTF_NOSPACE_BEFORE_POSTFIX 0x02
  673. #define OTS_LBCB_SORT 0x0001
  674. #define OTS_LBCB_PROPPAGE_LBUSECB 0x0002
  675. #define OTS_LBCB_PROPPAGE_CBUSELB 0x0004
  676. #define OTS_LBCB_INCL_ITEM_NONE 0x0008
  677. #define OTS_LBCB_NO_ICON16_IN_ITEM 0x0010
  678. #define OTS_PUSH_INCL_SETUP_TITLE 0x0020
  679. #define OTS_PUSH_NO_DOT_DOT_DOT 0x0040
  680. #define OTS_PUSH_ENABLE_ALWAYS 0x0080
  681. typedef struct _OPTTYPE {
  682. WORD cbSize;
  683. BYTE Type; // TVOT_xxxx type of OPTIONS
  684. BYTE Flags; // OPTTF_xxx flags
  685. WORD Count; // Count of pOptParam passed
  686. WORD BegCtrlID; // start of item's group window ID
  687. POPTPARAM pOptParam; // pointer to the OPTPARAM
  688. WORD Style; // option type style as OTS_xxxx
  689. WORD wReserved[3]; // wReserved, must be 0
  690. DWORD dwReserved[3]; // DWORD reserved field (must be 0)
  691. } OPTTYPE, *POPTTYPE;
  692. //
  693. // OPTTYPE
  694. //
  695. // The OPTTYPE structure is used to describe a set of selection and its
  696. // select method, such as Form/Tray assignment. It has a pointer to a set
  697. // of selection item (OPTPARAM)
  698. //
  699. //
  700. // cbSize - size of this structure
  701. //
  702. // Type - Specified the option type using predefined ID as TVOT_xxxx
  703. //
  704. // Flags - currently only one flag is defined
  705. //
  706. //
  707. // OPTTF_TYPE_DISABLED
  708. //
  709. // The whole OPTTYPE's OPTPARAMs are disabled, and non of
  710. // the selection in the OPTTYPE can be selected
  711. //
  712. //
  713. // OPTTF_NOSPACE_BEFORE_POSTFIX
  714. //
  715. // This bit only valid if the OPTTYPE's pOptParam item
  716. // specified a postfix string as describe in the above
  717. // section. If this flag is set then it asked common UI
  718. // do not add a space character before the postfix string
  719. // when it combine the pName in the OPTITEM and postfix
  720. // string. Typeically this bit is not set for the
  721. // postfix string, but sometime it may be required not to
  722. // add a space character in front of it, such as '%'
  723. // postfix string.
  724. //
  725. //
  726. // Count - Count of item pointed by pOptParam. Some predefined number
  727. // must be set according to the TVOT_XXX description.
  728. //
  729. // BegCtrlID - Only used if the OPTITEM/OPTTYPE is belong to the the DLGPAGE
  730. // which has non-common UI dialog box template (DlgTemplateID
  731. // in the DLGPAGE is not standard DP_STD_xxx common ui dialog
  732. // box template). The common UI used this ID to managed
  733. // caller's dialog boxes item's selections and initialization.
  734. //
  735. // Each OPTITEM has predefined number of window ID which
  736. // associated with that item, the BegCtrlID specified the start
  737. // control window ID. Each control window ID in the OPTITEM
  738. // must have the control ID sequence as describe in the TVOT_xxx
  739. // above.
  740. //
  741. // pOptParam - Pointer to array of OPTPARAM to describe each selectable item
  742. //
  743. // Style - Specified the style of type of control box, certain style
  744. // only apply to centain type of TVOT_xxxx.
  745. //
  746. // OTS_LBCB_xxx only applied to TVOT_LISTBOX, TVOT_COMBOBOX
  747. // OTS_PUSH_xxx only applied to TVOT_PUSHBUTTON
  748. //
  749. //
  750. // OTS_LBCB_SORT
  751. //
  752. // Specified that the listbox or combobox item is sorted
  753. // in ascending order based on the pData string
  754. //
  755. //
  756. // OTS_LBCB_PROPAGE_LBUSECB
  757. //
  758. // Used when Type is TVOT_LISTBOX, if it specified and
  759. // this OPTTYPE also on the non-treeview user defined
  760. // property sheet page dialog then common UI assume
  761. // control is comobobox instead of listbox on the non-
  762. // treeview page
  763. //
  764. //
  765. // OTS_LBCB_PROPAGE_CBUSELB
  766. //
  767. // Used when Type is TVOT_COMBOBOX, if it specified and
  768. // this OPTTYPE also on the non-treeview user defined
  769. // property sheet page dialog then common UI assume
  770. // control is listbox instead of combobox on the non-
  771. // treeview page
  772. //
  773. //
  774. // OTS_LBCB_INCL_ITEM_NONE
  775. //
  776. // when this flag is specified, the common ui will
  777. // automatically add a 'None' selection to the listbox or
  778. // combobox. The 'Sel' will set to -1 if 'none' is
  779. // selection is selected by the user. It will also
  780. // validate the 'Sel' durning the initialization, any
  781. // out of range value will be set to -1 (None).
  782. //
  783. //
  784. // OTS_LBCB_NO_ICON16_IN_ITEM
  785. //
  786. // By default, each listbox, combox will have a small
  787. // icon (16x16) in front of item text. by specified this
  788. // bit, the listbox/combobox will not includes icons
  789. // in the listbox/combobox.
  790. //
  791. // If clear then it specified that in the listbox/combobox
  792. // to have 16x16 Icon added to the front of each item
  793. //
  794. //
  795. // OTS_PUSH_INCL_SETUP_TITLE
  796. //
  797. // If specified for the push button then it automatically
  798. // add the 'Setup' to the end of push botton text.
  799. //
  800. //
  801. // OTS_PUSH_NO_DOT_DOT_DOT
  802. //
  803. // If specified then common UI will not add '...' to the
  804. // end of the pName in the OPTITEM and push button name
  805. //
  806. //
  807. // OTS_PUSH_ENABLE_ALWAYS
  808. //
  809. // This flag specified that even update permissio is not
  810. // allowed, it still let user push the push button, if
  811. // this flag is set then callback function or dialog box
  812. // proc must disable all the control which let user
  813. // modified the content, but just let user view the
  814. // current setting.
  815. //
  816. //
  817. // wReserved[] - Reserved fields, must be 0
  818. //
  819. // dwReserved[]- Reserved fields, must be 0
  820. //
  821. //
  822. //
  823. // Following are flags for the EXTPUSH
  824. //
  825. #define EPF_PUSH_TYPE_DLGPROC 0x0001
  826. #define EPF_INCL_SETUP_TITLE 0x0002
  827. #define EPF_NO_DOT_DOT_DOT 0x0004
  828. #define EPF_ICONID_AS_HICON 0x0008
  829. #define EPF_OVERLAY_WARNING_ICON 0x0010
  830. #define EPF_OVERLAY_STOP_ICON 0x0020
  831. #define EPF_OVERLAY_NO_ICON 0x0040
  832. #define EPF_USE_HDLGTEMPLATE 0x0080
  833. typedef struct _EXTPUSH {
  834. WORD cbSize; // size of the structure
  835. WORD Flags; // EPCBF_xxx flags
  836. LPTSTR pTitle; // extended push botton title
  837. union {
  838. DLGPROC DlgProc; // pointer to the dialog box proc
  839. FARPROC pfnCallBack; // callback function pointer
  840. } DUMMYUNIONNAME;
  841. DWORD IconID; // icon to be used
  842. union {
  843. WORD DlgTemplateID; // dialog box template ID
  844. HANDLE hDlgTemplate; // handle to the dialog template
  845. } DUMMYUNIONNAME;
  846. DWORD dwReserved[3]; // reserved field, must be 0
  847. } EXTPUSH, *PEXTPUSH;
  848. //
  849. // EXTPUSH structure is used to describe the extened push button available
  850. // on OPTITEM/OPTITEM, each OPTTYPE can optional have either one extended check
  851. // box or one extended push button callback.
  852. //
  853. //
  854. // cbSize - size of this structure
  855. //
  856. // Flags - flags for the EXTPUSH as EPF_xxxx
  857. //
  858. // EPF_PUSH_TYPE_DLGPROC
  859. //
  860. // If this bit is set then it specified the extended
  861. // push button is type of DLGPROC and DlgProc and
  862. // DlgTemplateID is valid for common UI to call.
  863. //
  864. // If this bit is clear then it specfied the extended
  865. // push button is the callback style and pfnCallBack
  866. // should be called by the common UI
  867. //
  868. //
  869. // EPF_INCL_SETUP_TITLE
  870. //
  871. // If specified for the extended push button then it
  872. // automatically add the 'Setup' to the end of
  873. // extended push button's title
  874. //
  875. //
  876. // EPF_NO_DOT_DOT_DOT
  877. //
  878. // If specified then common UI will not add '...' to
  879. // the end of the pTitle in the EXTPUSH.
  880. //
  881. //
  882. // EPF_ICONID_AS_HICON
  883. //
  884. // If this flag is set then IconID DWORD field is
  885. // treated as a handle to the icon rather then the
  886. // resource ID.
  887. //
  888. //
  889. // EPF_OVERLAY_WARNING_ICON
  890. //
  891. // If this bit is set then this EXTPUSH's icon will be
  892. // overlaied by a common UI's IDI_CPSUI_WARNING icon.
  893. //
  894. //
  895. // EPF_OVERLAY_STOP_ICON
  896. //
  897. // If this bit is set then this EXTPUSH's icon will be
  898. // overlaied by a common UI's IDI_CPSUI_STOP icon.
  899. //
  900. //
  901. // EPF_OVERLAY_NO_ICON
  902. //
  903. // If this bit is set then this EXTPUSH's icon will be
  904. // overlaied by a common UI's IDI_CPSUI_NO icon.
  905. //
  906. //
  907. // pTitle - Pointed to extended push botton title
  908. //
  909. // ** See LPTSTR description above
  910. //
  911. // DlgProc - Pointer to the DLGPROC function supplied by the caller.
  912. // When user push the button the common UI will call
  913. // DialogBoxParam() with this fucction pointer and passed
  914. // CPSUICBPARAM structure pointer to the WM_INITDIALOG with
  915. // the Reason set to CPSUICB_REASON_EXTPUSH. If this
  916. // filed is NULL then common UI assumed that EXTPUSH is
  917. // disabled (OPTIF_EXT_DISABLED | OPTIF_EXT_HIDE), this
  918. // fields only used if EPF_PUSH_TYPE_DLGPROC flag is set
  919. //
  920. // pfnCallBack - Pointer to CPSUICALLBACK function, this only used if
  921. // EPF_PUSH_TYPE_DLGPROC bit is clear, duringing callback
  922. // it passed the CPSUICBPARAM pointer as parameter
  923. //
  924. // IconID - This is the icon identifier, which can be a common
  925. // strandard IDI_CPSUI_xxx icon ID, caller's own icon
  926. // resource ID, or a handle to the caller defined icon if
  927. // EPF_ICONID_AS_HICON flag is set, in any case if the
  928. // IconID is zero then it indicated no icon.
  929. //
  930. // DlgTemplateID - Specified the ressource ID for the dilaog box. If the
  931. // DlgTemplateID = 0 then common UI will call the DlgProc
  932. // with following parameter.
  933. //
  934. // DlgProc(hDlg, WM_USER, NULL, (LPARAM)pCPSUICBPaam);
  935. //
  936. // hDlgTemplate - Handle to the DLGTEMPLATE which will be use for pop up
  937. // dialog box
  938. //
  939. // wReserved[] - WORD reserved field, must be 0
  940. //
  941. // dwReserved[] - DWORD reserved field, must be 0
  942. //
  943. //
  944. //
  945. //
  946. // Following are flags for the EXTCHKBOX
  947. //
  948. #define ECBF_CHECKNAME_AT_FRONT 0x0001
  949. #define ECBF_CHECKNAME_ONLY_ENABLED 0x0002
  950. #define ECBF_ICONID_AS_HICON 0x0004
  951. #define ECBF_OVERLAY_WARNING_ICON 0x0008
  952. #define ECBF_OVERLAY_ECBICON_IF_CHECKED 0x0010
  953. #define ECBF_OVERLAY_STOP_ICON 0x0020
  954. #define ECBF_OVERLAY_NO_ICON 0x0040
  955. typedef struct _EXTCHKBOX {
  956. WORD cbSize; // size of the structure
  957. WORD Flags; // ECBF_xxx flags
  958. LPTSTR pTitle; // extended checkbox title
  959. LPTSTR pSeparator; // pointer to separator string for treeview
  960. LPTSTR pCheckedName; // string to be displayed when checked
  961. DWORD IconID; // icon to be used
  962. WORD wReserved[4]; // reserved word, must be 0
  963. DWORD dwReserved[2]; // reserved field, must be 0
  964. } EXTCHKBOX, *PEXTCHKBOX;
  965. //
  966. // EXTCHKBOX structure is used to describe the extened check box available on
  967. // OPTITEM/OPTITEM, each OPTTYPE can optional have one extended check box.
  968. // When using EXTCHKBOX the selection item can be checked or not checked
  969. // based on user input.
  970. //
  971. //
  972. // cbSize - size of this structure
  973. //
  974. // Flags - flags for the EXTCHKBOX as ECBF_xxxx
  975. //
  976. // ECBF_CHECKNAME_AT_FRONT
  977. //
  978. // This flag specified how to display item's name and its
  979. // checked name in the treeview display. If this flag is
  980. // set then the checked name is display in front of
  981. // separator name, otherwise the checked name is displayed
  982. // after the separator. For Example.
  983. //
  984. // Flag Set: pCheckedName pSeparator SelectName
  985. // Flag Clear: SelectName pSeparator pCheckedName
  986. //
  987. //
  988. // ECBF_CHECKNAME_ONLY_ENABLED
  989. //
  990. // If set then it specified that in the treeview display,
  991. // it will only show the pCheckedName if this extended
  992. // check box is visible and enabled. Some items may not
  993. // desired to display the pCheckedName if the extended
  994. // check box is disabled, such as Copy/Collate checkbox.
  995. //
  996. //
  997. // ECBF_ICONID_AS_HICON
  998. //
  999. // If this flag is set then IconID DWORD field is treated
  1000. // as a handle to the icon rather then the resource ID
  1001. //
  1002. //
  1003. // ECBF_OVERLAY_WARNING_ICON
  1004. //
  1005. // If this bit is set then this EXTCHKBOX's icon will
  1006. // be overlaied by a common UI's IDI_CPSUI_WARNING icon.
  1007. //
  1008. //
  1009. // ECBF_OVERLAY_ECBICON_IF_CHECKED
  1010. //
  1011. // This bit specified to overlay the ExtChkBox's Icon to
  1012. // the OPTITEM's icon (or OPTPARAM) if the the extended
  1013. // checked box is checked
  1014. //
  1015. //
  1016. // ECBF_OVERLAY_STOP_ICON
  1017. //
  1018. // If this bit is set then this EXTCHKBOX's icon will
  1019. // be overlaied by a common UI's IDI_CPSUI_STOP icon.
  1020. //
  1021. //
  1022. // ECBF_OVERLAY_NO_ICON
  1023. //
  1024. // If this bit is set then this EXTCHKBOX's icon will
  1025. // be overlaied by a common UI's IDI_CPSUI_NO icon.
  1026. //
  1027. //
  1028. // pTitle - Pointed to extended check box title
  1029. //
  1030. // ** See LPTSTR description above
  1031. //
  1032. // pSeparator - Pointer to the separator to be used in the treeview
  1033. // display or the static title control in the non-treeview
  1034. // page,
  1035. //
  1036. // pCheckedName- Pointed to the name to be displayed in the treeview if item
  1037. // is checked. pCheckedName is added according to the
  1038. // pSeparator and the ECBF_CHECKNAME_AT_FRONT flags.
  1039. //
  1040. // * If the pCheckedName is equal to IDS_CPSUI_NOTINSTALLED
  1041. // then common UI will automatically overaly a not installed
  1042. // icon on top of the extended check box Icon.
  1043. //
  1044. // ** See LPTSTR description above
  1045. //
  1046. // IconID - This is the icon identifier, which can be a common strandard
  1047. // IDI_CPSUI_xxx icon ID, caller's own icon resource ID, or a
  1048. // handle to the caller defined icon if ECBF_ICONID_AS_HICON
  1049. // flag is set, in any case if the IconID is zero then it
  1050. // indicated no icon.
  1051. //
  1052. // wReserved[] - WORD reserved field, must be 0
  1053. //
  1054. // dwReserved[]- DWORD reserved field, must be 0
  1055. //
  1056. //
  1057. // Following the the Flags for the OPTITEM
  1058. //
  1059. #define OPTIF_COLLAPSE 0x00000001L
  1060. #define OPTIF_HIDE 0x00000002L
  1061. #define OPTIF_CALLBACK 0x00000004L
  1062. #define OPTIF_CHANGED 0x00000008L
  1063. #define OPTIF_CHANGEONCE 0x00000010L
  1064. #define OPTIF_DISABLED 0x00000020L
  1065. #define OPTIF_ECB_CHECKED 0x00000040L
  1066. #define OPTIF_EXT_HIDE 0x00000080L
  1067. #define OPTIF_EXT_DISABLED 0x00000100L
  1068. #define OPTIF_SEL_AS_HICON 0x00000200L
  1069. #define OPTIF_EXT_IS_EXTPUSH 0x00000400L
  1070. #define OPTIF_NO_GROUPBOX_NAME 0x00000800L
  1071. #define OPTIF_OVERLAY_WARNING_ICON 0x00001000L
  1072. #define OPTIF_OVERLAY_STOP_ICON 0x00002000L
  1073. #define OPTIF_OVERLAY_NO_ICON 0x00004000L
  1074. #define OPTIF_INITIAL_TVITEM 0x00008000L
  1075. #define OPTIF_HAS_POIEXT 0x00010000L
  1076. #define OPTIF_MASK 0x0001ffffL
  1077. #define DMPUB_NONE 0
  1078. #define DMPUB_FIRST 1
  1079. #define DMPUB_ORIENTATION 1
  1080. #define DMPUB_SCALE 2
  1081. #define DMPUB_COPIES_COLLATE 3
  1082. #define DMPUB_DEFSOURCE 4
  1083. #define DMPUB_PRINTQUALITY 5
  1084. #define DMPUB_COLOR 6
  1085. #define DMPUB_DUPLEX 7
  1086. #define DMPUB_TTOPTION 8
  1087. #define DMPUB_FORMNAME 9
  1088. #define DMPUB_ICMMETHOD 10
  1089. #define DMPUB_ICMINTENT 11
  1090. #define DMPUB_MEDIATYPE 12
  1091. #define DMPUB_DITHERTYPE 13
  1092. #define DMPUB_LAST 13
  1093. #define DMPUB_USER 100
  1094. //
  1095. // DMPUB_xxxx is used in OPTITEM to identify if the item is a DEVMODE public
  1096. // field. Following it identify which field correspond to the DMPUB_xxxx
  1097. //
  1098. //
  1099. // DMPUB_ORIENTATION - dmOrientation
  1100. //
  1101. // DMPUB_SCALE - dmScale
  1102. //
  1103. // DMPUB_COPIES_COLLATE- dmCopies/dmCollate
  1104. //
  1105. // DMPUB_DEFSOURCE - dmDefSource (Should only used form by caller)
  1106. //
  1107. // DMPUB_PRINTQUALITY - dmPrintQuality
  1108. //
  1109. // DMPUB_COLOR - dmColor
  1110. //
  1111. // DMPUB_DUPLEX - dmDuplex
  1112. //
  1113. // DMPUB_TTOPTION - dmTTOption
  1114. //
  1115. // DMPUB_FORMNAME - dmFormName
  1116. //
  1117. // DMPUB_ICMMETHOD - dmICMMethod
  1118. //
  1119. // DMPUB_ICMINTENT - dmICMIntent
  1120. //
  1121. // DMPUB_MEDIATYPE - dmMediaType
  1122. //
  1123. // DMPUB_DITHERTYPE - dmDitherType
  1124. //
  1125. // DMPUB_USER - Anything greater than or equal to DMPUB_USER can be
  1126. // used by the caller.
  1127. //
  1128. //
  1129. // When common UI is called for the 'Document Properties' (DEVMODE), it will
  1130. // group some of public items together simillar to the following in the
  1131. // treeview. How it group is common UI version dependent and caller should not
  1132. // concern its placement
  1133. //
  1134. // Paper/Output (Add in by the common UI)
  1135. // Document Form (DMPUB_FORMNAME)
  1136. // Orientation (DMPUB_ORIENTATION)
  1137. // Source (DMPUB_DEFSOURCE)
  1138. // Media (DMPUB_MEDIATYPE)
  1139. // Number of Copies (DMPUB_COPIES_COLLATE)
  1140. // Duplex (DMPUB_DUPLEX)
  1141. //
  1142. // Graphic (Add in by the common UI)
  1143. // Print Quality (DMPUB_PRINTQUALITY)
  1144. // Color (DMPUB_COLOR)
  1145. // Image Color Matching (Add in by the common UI)
  1146. // ICM Method (DMPUB_ICMMETHOD)
  1147. // ICM Intent (DMPUB_ICMINTENT)
  1148. // Scaling (DMPUB_SCALE)
  1149. // Dithering (DMPUB_DITHERTYPE)
  1150. // TrueType Option (DMPUB_TTOPTION)
  1151. //
  1152. // Options
  1153. // Halftone Color Adjustment...
  1154. // ALL Other Caller's Document sticky options
  1155. //
  1156. //
  1157. // For 'Document Properties' the standard page 1 (user friendly page) will
  1158. // consist following items if it appear in the OPTITEM array passed by the
  1159. // caller. These items must have following predefined TVOT_xxx type
  1160. // defined here and specified in the OPTTYPE's Type field.
  1161. //
  1162. // All DMPUB_xxx (except >= DMPUB_USER) public ID must have following
  1163. // TVOT_xxxx type specified, else a CPDU_INVALID_DMPUB_TVOT error is returned
  1164. //
  1165. // DMPUB_ORIENTATION - TVOT_2STATES/TVOT_3STATES
  1166. // DMPUB_SCALE - TVOT_UDARROW
  1167. // DMPUB_COPIES_COLLATE - TVOT_UDARROW + EXTCHKBOX (Collate)
  1168. // DMPUB_DEFSOURCE - TVOT_LISTBOX
  1169. // DMPUB_PRINTQUALITY - TVOT_LISTBOX
  1170. // DMPUB_COLOR - TVOT_2STATES
  1171. // DMPUB_DUPLEX - TVOT_2STATES/TVOT_3STATES
  1172. // DMPUB_TTOPTION - TVOT_LISTBOX
  1173. // DMPUB_FORMNAME - TVOT_LISTBOX
  1174. // DMPUB_ICMMETHOD - TVOT_2STATES/TVOT_3STATES
  1175. // DMPUB_ICMINTENT - TVOT_2STATES/TVOT_3STATES
  1176. // DMPUB_MEDIATYPE - TVOT_LISTBOX
  1177. // DMPUB_DITHERTYPE - TVOT_LISTBOX
  1178. //
  1179. //
  1180. #define OIEXTF_ANSI_STRING 0x0001
  1181. typedef struct _OIEXT {
  1182. WORD cbSize;
  1183. WORD Flags;
  1184. HINSTANCE hInstCaller;
  1185. LPTSTR pHelpFile;
  1186. DWORD dwReserved[4];
  1187. } OIEXT, *POIEXT;
  1188. //
  1189. // OIEXT is a data structure used as extension to the OPTITEM data structure
  1190. //
  1191. //
  1192. // cbSize - sizeof this structure
  1193. //
  1194. // Flags - One or more of OIEXTF_xxxx may be specified.
  1195. //
  1196. // OIEXTF_ANSI_STRING
  1197. //
  1198. // Specified that LPTSTR in this data structure is a ansi
  1199. // string (not UNICODE). This bit only checked if the
  1200. // LPTSTR is not the resource string ID
  1201. //
  1202. // hInstCaller - DLL instance handle, when this hInst is not NULL then all
  1203. // resource string and icon loading for this OPTITEM and its
  1204. // OPTTYPE, OPTPARAM are loaded from this hInstCaller Handle.
  1205. // If this filed is NULL then it will use the hInstCaller handle
  1206. // specified in the COMPROPSHEETUI data structure
  1207. //
  1208. // pHelpFile - Resource string ID or pointer to the help file for this
  1209. // OPTITEM. If this pointer is NULL then help file for the
  1210. // help index is assume specified in the pHelpFile field in the
  1211. // COMPROPSHEETUI data structure.
  1212. //
  1213. // dwReserved - These fields are not used now, and must 0
  1214. //
  1215. typedef struct _OPTITEM {
  1216. WORD cbSize; // size of this structure
  1217. BYTE Level; // level in the tree view
  1218. BYTE DlgPageIdx; // Index to the pDlgPage
  1219. DWORD Flags; // OPTIF_xxxx flags
  1220. DWORD UserData; // caller's own data
  1221. LPTSTR pName; // name of the item
  1222. union {
  1223. LONG Sel; // current selection (index)
  1224. LPTSTR pSel; // current selection (pStr)
  1225. } DUMMYUNIONNAME;
  1226. union {
  1227. PEXTCHKBOX pExtChkBox; // Pointer to EXTCHKBOX structure
  1228. PEXTPUSH pExtPush; // Pointer to EXTPUSH
  1229. } DUMMYUNIONNAME2;
  1230. POPTTYPE pOptType; // pointer to OPTTYPE structure
  1231. DWORD HelpIndex; // Help file index
  1232. BYTE DMPubID; // Devmode public filed ID
  1233. BYTE UserItemID; // caller's own item ID
  1234. WORD wReserved; // reserved WORD field, must be 0
  1235. POIEXT pOIExt; // Optitem extension pointer
  1236. DWORD dwReserved[3]; // reserved DWORD fields (must be 0)
  1237. } OPTITEM, *POPTITEM;
  1238. //
  1239. // OPTITEM is to describe each treeview item's name, selection type and
  1240. // possible selection
  1241. //
  1242. // cbSize - sizeof this structure
  1243. //
  1244. // Level - The level in the treeview, the root should have lowest
  1245. // number and number should start with level 0. the maximum
  1246. // number of levels are 256.
  1247. //
  1248. // DlgPageIdx - Zero-based index to the DLGPAGE araay pointee by
  1249. // pDlgPage. The Maximum index is MAX_DLGPPAGE_COUNT, if
  1250. // pDlgPage is a standard CPSUI_PDLGPAGE_xxxx then this
  1251. // field is automatically set the common UI
  1252. //
  1253. // Flags - OPTIF_xxxx flags as describe above
  1254. //
  1255. // OPTIF_COLLAPSE
  1256. //
  1257. // Collaspe treeview item and its children so it is
  1258. // not expanded initially.
  1259. //
  1260. //
  1261. // OPTIF_HIDE
  1262. //
  1263. // Hide this item from the treeview
  1264. //
  1265. //
  1266. // OPTIF_CALLBACK
  1267. //
  1268. // Callback to the caller when user making some
  1269. // changes a pointer (pfnCallBack) must provided and
  1270. // process as defined by the common UI.
  1271. //
  1272. //
  1273. // OPTIF_CHANGED
  1274. //
  1275. // This item was changed and need to re-display. this
  1276. // flag only used when caller returned from callback
  1277. // funciton.
  1278. //
  1279. //
  1280. // OPTIF_CHANGEONCE
  1281. //
  1282. // This item has been changed at least once.
  1283. //
  1284. //
  1285. // OPTIF_DISABLED
  1286. //
  1287. // Disable this item so it become not selectable.
  1288. //
  1289. //
  1290. // OPTIF_ECB_CHECKED
  1291. //
  1292. // Specified the associated extended check box is
  1293. // in checked state.
  1294. //
  1295. //
  1296. // OPTIF_EXT_HIDE
  1297. //
  1298. // Hide the extended check box/extended push botton.
  1299. //
  1300. //
  1301. // OPTIF_EXT_DISABLED
  1302. //
  1303. // The Extended check box/push botton is disabled and
  1304. // not selectable
  1305. //
  1306. //
  1307. // OPTIF_SEL_AS_HICON
  1308. //
  1309. // This flag only used if this item has no type,
  1310. // pOptType=NULL that is, when pOptType is NULL then
  1311. // 'Sel' filed is the IconID. if flag is set then it
  1312. // indicate IconID (Sel) is the Icon handle rather
  1313. // than the icon resource ID.
  1314. //
  1315. //
  1316. // OPTIF_EXT_IS_EXTPUSH
  1317. //
  1318. // Specified that pExtPush should be used when this
  1319. // pointer is not NULL, if this pointer is not NULL
  1320. // and this flag is clear then pExtChkBox is assumed.
  1321. //
  1322. //
  1323. // OPTIF_NO_GROUPBOX_NAME
  1324. //
  1325. // Specified that do not overwrite the group box title
  1326. // text, if group box ID is defined. See the TVOT_xx
  1327. // description above.
  1328. //
  1329. //
  1330. // OPTIF_OVERLAY_WARNING_ICON
  1331. //
  1332. // If this bit is set then this header OPTITEM's icon
  1333. // will be overlaied by a common UI's
  1334. // IDI_CPSUI_WARNING icon. This bit only used if this
  1335. // item has no type, pOptType is NULL that is.
  1336. //
  1337. //
  1338. // OPTIF_OVERLAY_STOP_ICON
  1339. //
  1340. // If this bit is set then this header OPTITEM's icon
  1341. // will be overlaied by a common UI's IDI_CPSUI_STOP
  1342. // icon. This bit only used if this item has no type,
  1343. // pOptType is NULL that is.
  1344. //
  1345. //
  1346. // OPTIF_OVERLAY_NO_ICON
  1347. //
  1348. // If this bit is set then this header OPTITEM's icon
  1349. // will be overlaied by a common UI's IDI_CPSUI_NO
  1350. // icon. This bit only used if this item has no type,
  1351. // pOptType is NULL that is.
  1352. //
  1353. //
  1354. // OPTIF_INITIAL_TVITEM
  1355. //
  1356. // Specified that this item will be the initial item
  1357. // to be selected and display on the treeview page.
  1358. // If the selected item is currently a child or
  1359. // collapse then common UI will expand the selection
  1360. // then scroll it into view.
  1361. //
  1362. // If this flag is clear or the set item is in hide
  1363. // status common UI will pick the initial item to
  1364. // display.
  1365. //
  1366. // OPTIF_HAS_POIEXT
  1367. //
  1368. // Specified that pOIExt field is a valid pointer that
  1369. // points to OIEXT data structure. The pOIExt only
  1370. // used by the common UI if this bit is set.
  1371. //
  1372. //
  1373. // UserData - a 32-bit number used by the caller and common UI will not
  1374. // modify it.
  1375. //
  1376. // pName - Pointer to the item's name, such as 'Upper Tray',
  1377. // 'Memory' or it is used as data as describe in
  1378. // OPTPARAM/OPTTYPE structure
  1379. //
  1380. // ** See LPTSTR description above
  1381. //
  1382. // pSel
  1383. // Sel - Current selection for this item. This is a union field
  1384. // which can be a pointer to a string or a LONG index
  1385. // selection.
  1386. //
  1387. // ** If pOptType field is NULL then 'Sel' is the icon ID
  1388. // to be used for the header.
  1389. //
  1390. // pExtPush
  1391. // pExtChkBox - Pointer to either EXTPUSH or EXTCHKBOX data structure,
  1392. // if this pointer is NULL then this item does not have
  1393. // ectended check box/push botton associate with it.
  1394. //
  1395. // When an extended check box is associate with the
  1396. // OPTTYPE, the OPTIF_EXT_IS_EXTPUSH must not set, the
  1397. // OPTIF_ECB_CHECKED flag specified if the extended check
  1398. // box is checked or not checked.
  1399. //
  1400. // When an Extended push botton is associated with the
  1401. // OPTTYPE, the OPTIF_EXT_IS_EXTPUSH flag must set.
  1402. //
  1403. // The following flags are used in both EXTCHKBOX or
  1404. // EXTPUSH
  1405. //
  1406. // OPTIF_EXT_HIDE,
  1407. // OPTIF_EXT_DISABLED
  1408. // OPTIF_EXT_CHANGEONCE
  1409. //
  1410. //
  1411. // pOptType - Pointer to the OPTTYPE structure to describe the display
  1412. // and selections of the item. If this pointer is NULL
  1413. // then this this item does not have any selection. and it
  1414. // is used as sub-items' header.
  1415. //
  1416. // * When pOptType is NULL then the 'Sel' is the Icon ID.
  1417. //
  1418. //
  1419. // HelpIndex - a index to the help file for context sensitive help
  1420. // if HelpInex=0 then there is no help for this item
  1421. //
  1422. // DMPubID - specified if this item is one of the public fields in the
  1423. // DEVMODE structure and supported by the common UI.
  1424. //
  1425. // DMPUB_NONE - Not DEVMODE public fields
  1426. // DMPUB_ORIENTATION - dmOrientation
  1427. // DMPUB_SCALE - dmScale
  1428. // DMPUB_COPIES_COLLATE - dmCopies/dmCollate
  1429. // DMPUB_DEFSOURCE - dmDefSource
  1430. // DMPUB_PRINTQUALITY - dmPrintQuality
  1431. // DMPUB_COLOR - dmColor
  1432. // DMPUB_DUPLEX - dmDuplex
  1433. // DMPUB_TTOPTION - dmTTOption
  1434. // DMPUB_FORMNAME - dmFormName
  1435. // DMPUB_ICMMETHOD - dmICMMethod
  1436. // DMPUB_ICMINTENT - dmICMIntent
  1437. // DMPUB_MEDIATYPE - dmMediaType
  1438. // DMPUB_DITHERTYPE - dmDitherType
  1439. //
  1440. // ** for most of DMPUB_FIRST to DMPUB_LAST each OPTITEM's
  1441. // pName is automatically set to the standard
  1442. // IDS_CPSUI_xxx for the consistancy reason, the
  1443. // standard pName is set according to following table.
  1444. //
  1445. // DMPUB_ORIENTATION - IDS_CPSUI_ORIENTATION
  1446. // DMPUB_SCALE - IDS_CPSUI_SCALING
  1447. // DMPUB_COPIES_COLLATE - IDS_CPSUI_COPIES
  1448. // DMPUB_DEFSOURCE - IDS_CPSUI_SOURCE
  1449. // DMPUB_PRINTQUALITY - IDS_CPSUI_PRINTQUALITY
  1450. // IDS_CPSUI_RESOLUTION
  1451. // DMPUB_COLOR - IDS_CPSUI_COLOR_APPERANCE
  1452. // DMPUB_DUPLEX - IDS_CPSUI_DUPLEX
  1453. // DMPUB_TTOPTION - IDS_CPSUI_TTOPTION
  1454. // DMPUB_FORMNAME - IDS_CPSUI_FORMNAME
  1455. // DMPUB_ICMMETHOD - IDS_CPSUI_ICMMETHOD
  1456. // DMPUB_ICMINTENT - IDS_CPSUI_ICMINTENT
  1457. // DMPUB_MEDIATYPE - IDS_CPSUI_MEDIA
  1458. // DMPUB_DITHERTYPE - IDS_CPSUI_DITHERING
  1459. //
  1460. // for DMPUB_PRINTQUALITY, if the pName is not one of
  1461. // IDS_CPSUI_PRINTQUALITY or IDS_CPSUI_RESOLUTION then
  1462. // common UI will automatically default the pName to
  1463. // IDS_CPSUI_RESOLUTION.
  1464. //
  1465. // Each pData (OPTPARAM) selection in OPTPARAM which
  1466. // OPTITEM's pOptType pointed to should use as much
  1467. // as IDS_CPSUI_xxx standard name as possible.
  1468. //
  1469. //
  1470. // ** for DMPUB_COPIES_COLLATE the common UI automatically
  1471. // doing the following before the callback
  1472. //
  1473. // 1) Enable/Disable the collate extended check box if
  1474. // OPTIF_EXT_HIDE is not specified and pExtChkBox
  1475. // is not NULL in the OPTITEM.
  1476. //
  1477. // 2) Automatically change the postfix for this item
  1478. // to be 'Copy' if selection is one, and 'Copies'
  1479. // if selection is greater than one in the treeview
  1480. // page, and it will also set the postfix in
  1481. // standard document property page if the postfix
  1482. // ID is provided (BegCtrlID + 4)
  1483. //
  1484. //
  1485. // ** for DMPUB_COLOR the common UI automatically doing
  1486. // the following before the callback, the gray
  1487. // selection must be Sel=0 and Color slection must be
  1488. // Sel=1
  1489. //
  1490. // 1) Calling halftone color adjustment with current
  1491. // color/mono selection
  1492. //
  1493. // 2) Disable ICM when color is not selected
  1494. //
  1495. //
  1496. // ** Please see above DMPUB_xx description for details.
  1497. //
  1498. // UserItemID - This is a byte ID intented to be used by the caller to
  1499. // identify the item
  1500. //
  1501. // wReserved - WORD reserved. Must be zero
  1502. //
  1503. // pOIExt - Pointer to the OIEXT data structure to specified that
  1504. // it has a OPTITEM extenstion structure.
  1505. //
  1506. // dwReserved[] - DWORD reserved and must be 0
  1507. //
  1508. //
  1509. //
  1510. // predefined ID for call back reason
  1511. //
  1512. #define CPSUICB_REASON_SEL_CHANGED 0
  1513. #define CPSUICB_REASON_PUSHBUTTON 1
  1514. #define CPSUICB_REASON_ECB_CHANGED 2
  1515. #define CPSUICB_REASON_DLGPROC 3
  1516. #define CPSUICB_REASON_UNDO_CHANGES 4
  1517. #define CPSUICB_REASON_EXTPUSH 5
  1518. #define CPSUICB_REASON_APPLYNOW 6
  1519. #define CPSUICB_REASON_OPTITEM_SETFOCUS 7
  1520. #define CPSUICB_REASON_ITEMS_REVERTED 8
  1521. #define CPSUICB_REASON_ABOUT 9
  1522. //
  1523. // predefined ID for call back action
  1524. //
  1525. #define CPSUICB_ACTION_NONE 0
  1526. #define CPSUICB_ACTION_OPTIF_CHANGED 1
  1527. #define CPSUICB_ACTION_REINIT_ITEMS 2
  1528. #define CPSUICB_ACTION_NO_APPLY_EXIT 3
  1529. #define CPSUICB_ACTION_ITEMS_APPLIED 4
  1530. typedef struct _CPSUICBPARAM {
  1531. WORD cbSize; // size of this structure
  1532. WORD Reason; // CPSUICB_REASON_XXXXX callback reason
  1533. HWND hDlg; // handle of the dialog box
  1534. POPTITEM pOptItem; // pOptItem field from COMPROPSHEETUI
  1535. WORD cOptItem; // cOptItem field from COMPROPSHEETUI
  1536. WORD Flags; // flags field from COMPROPSHEETUI
  1537. POPTITEM pCurItem; // current selected item of callback
  1538. union {
  1539. LONG OldSel; // Last selection (index)
  1540. LPTSTR pOldSel; // Last selection (pStr)
  1541. } DUMMYUNIONNAME;
  1542. DWORD UserData; // UserData in the COMPROPSHEETUI struct.
  1543. DWORD Result; // OUT parameter for the APPLYNOW
  1544. } CPSUICBPARAM, *PCPSUICBPARAM;
  1545. typedef LONG (APIENTRY *_CPSUICALLBACK)(PCPSUICBPARAM pComPropSheetUICBParam);
  1546. #define CPSUICALLBACK LONG APIENTRY
  1547. //
  1548. // CPSUICBPARAM is used when commom UI callback to the caller, this structure
  1549. // describe the nature of callback and passed all necessary parameter for the
  1550. // caller to make changes in the pOptItem and passed an action back to the
  1551. // commom UI to redisplay the tree or page 1 data
  1552. //
  1553. //
  1554. // cbSize - must be CPSUICBPARAM
  1555. //
  1556. // Reason - defined the nature of the callback
  1557. //
  1558. // CPSUICB_REASON_SEL_CHANGED
  1559. //
  1560. // User make change to the pCurItem. if the item is
  1561. // DMPUB_COPIES_COLLATE then common UI automatically
  1562. // change the collate extended check box without callback
  1563. // to the caller of the extended check box changes
  1564. //
  1565. //
  1566. // CPSUICB_REASON_PUSHBUTTON
  1567. //
  1568. // User push the push button and push button item is set
  1569. // to PUSHBUTTON_TYPE_CALLBACK.
  1570. //
  1571. //
  1572. // CPSUICB_REASON_ECB_CHANGED
  1573. //
  1574. // User make change to the extended checked box (i.e. it
  1575. // eiterh checked or not checked) EXTCHKBOX in the
  1576. // pCurItem passed in the call back parameter.
  1577. //
  1578. //
  1579. // CPSUICB_REASON_DLGPROC
  1580. //
  1581. // The callback reason is PUSHBUTTON_TYPE_DLGPROC
  1582. //
  1583. //
  1584. // CPSUICB_REASON_UNDO_CHANGES
  1585. //
  1586. // This callback currently is not implmented.
  1587. //
  1588. //
  1589. // CPSUICB_REASON_EXTPUSH
  1590. //
  1591. // The callback is result of user push the extend push
  1592. // button.
  1593. //
  1594. //
  1595. // CPSUICB_REASON_APPLYNOW
  1596. //
  1597. // The user press the apply now button. Durning callback
  1598. // the pCurItem is set to equal to pOptItem in this
  1599. // structure and 'OldSel' is set to the active DlgPageIdx
  1600. // (compare to the OPTITEM's DlgPageIdx) which the page
  1601. // user hitting the apply now button if the page is
  1602. // non-treeview page, otherwise the 'OldSel' is set to -1
  1603. // (for treeview page) to indicate all valid item should
  1604. // be apply now, if the callback return
  1605. // CPSUICB_ACTION_NONE then the common UI will exit the
  1606. // property sheet and returned CPSUI_OK back to the
  1607. // caller, and if the callback function returned
  1608. // CPSUICB_ACTION_NO_APPLY_EXIT then common UI will not
  1609. // exit the property sheet and callback function must
  1610. // pop-up messages dialog box to tell user why it cannot
  1611. // exist the property sheet until certain action is take
  1612. // by the user.
  1613. //
  1614. //
  1615. // CPSUICB_REASON_OPTITEM_SETFOCUS
  1616. //
  1617. // This callback reason is used when an OPTITEM is getting
  1618. // the keyboard focus. and give the callback function a
  1619. // chance to examine the item.
  1620. //
  1621. //
  1622. // CPSUICB_REASON_ITEMS_REVERTED
  1623. //
  1624. // This callback reason is used when user changed items
  1625. // and decided to revert changes from the parent item in
  1626. // the treeview. The callback funciton is called after
  1627. // all revertable items are reverted to its original.
  1628. //
  1629. // The CPSUICBPARAM's pCurItem is same as pOptItem and
  1630. // 'OldSel' field is same as cOptItem field. for each of
  1631. // reverted item, the OPTIF_CHANGED bit will be set in the
  1632. // OPTITEM by the common UI to indicate the item is revert
  1633. // by the common UI. The callback function MUST NOT
  1634. // reset this bit if it is set.
  1635. //
  1636. //
  1637. // CPSUICB_REASON_ABOUT
  1638. //
  1639. // This callback reason is used when user hit 'About...'
  1640. // push button in the treeview page, and the flag
  1641. // CPSUIF_ABOUT_CALLBACK is set. The pCurItem is set to
  1642. // same as pOptItem and 'pOldSel' is a pointer pointed to
  1643. // original copy of COMPROPSHEETUI data structure which
  1644. // passed to the common UI.
  1645. //
  1646. //
  1647. // hDlg - The handle to the dialog box (Properties page TAB) current
  1648. // active for the callback.
  1649. //
  1650. // Durning the callback the caller must not change the
  1651. // DWL_USERDATA on hDlg, otherwise the common UI will be crash.
  1652. // If callback function need to get/set DWL_USERDATA it should
  1653. // call common UI's SetCPSUIUserData() and GetCPSUIUserData()
  1654. // functions instead.
  1655. //
  1656. // pCurItem - Pointed to POPTITEM which the callback is generated for.
  1657. //
  1658. // pOldSel
  1659. // OldSel - The last OPTITEM's pSel/Sel field before the change was made
  1660. // by the user. The pOldSel/OldSel only valid if the callback
  1661. // reason is CPSUICB_REASON_SEL_CHANGED, this give the callback
  1662. // function a chance to check against the previous item
  1663. // selection. This is a union field which can be a pointer to
  1664. // a string or a LONG index selection.
  1665. //
  1666. // UserData - a 32-bit user defined data in the COMPROPSHEETUI structure,
  1667. // commom UI will not changed it.
  1668. //
  1669. // Result - When the reason is CPSUICB_REASON_APPLYNOW, the callback
  1670. // function MUST set the requested result for the caller into
  1671. // 'Result' field when it returned a value other than the
  1672. // CPSUICB_ACTION_NO_APPLY_EXIT and common UI will send the
  1673. // 'Result' field value to this page's parent.
  1674. //
  1675. // The called function should save the current result of
  1676. // pOptItem. The default 'Result' is set to CPSUI_OK (1) from
  1677. // common UI. This function can alter this result before it
  1678. // return back to to the common UI.
  1679. //
  1680. //
  1681. // Return Values:
  1682. //
  1683. // CPSUICB_ACTION_NONE - No action need to be take by the
  1684. // common UI.
  1685. //
  1686. // CPSUICB_ACTION_OPTIF_CHANGED - Ask the common UI to examine the
  1687. // OPTIF_CHANGED flag in the OPTITEM
  1688. // data structure. if the flag is set
  1689. // then that item is assume need to be
  1690. // re-display because of OPTITEM's Flags
  1691. // field changed or item's selection
  1692. // changed. This is different from
  1693. // CPSUICB_ACTION_REINIT_ITEMS which
  1694. // it assume OPTTYPE or OPTPARAM data
  1695. // also changed.
  1696. //
  1697. //
  1698. // CPSUICB_ACTION_REINIT_ITEMS - Ask the common UI to examine the
  1699. // OPTIF_CHANGED flag in the OPTITEM
  1700. // data structure. if the flag is set
  1701. // then that item is assume need to be
  1702. // re-initialized in the dilaog box
  1703. // control. This happened if item's
  1704. // OPTTYPE or OPTPARAMs flag/pdata
  1705. // changed.
  1706. //
  1707. //
  1708. // CPSUICB_ACTION_NO_APPLY_EXIT - This return value only valid durning
  1709. // CPSUICB_REASON_APPLYNOW callback
  1710. // reason, it tell common UI it has
  1711. // some constraints in its OPTITEM which
  1712. // must correct or confirm by the user
  1713. // before exit. The callback function
  1714. // must display and/or have user taking
  1715. // some actions before return this
  1716. // action to the common UI
  1717. //
  1718. // CPSUICB_ACTION_ITEMS_APPLIED - When responsed to the
  1719. // CPSUICB_REASON_APPLYNOW, if the
  1720. // returned action is
  1721. // CPSUICB_ACTION_ITEMS_APPLIED then
  1722. // common UI will reset OPTIF_CHANGEONCE
  1723. // bit and save the new default for the
  1724. // future undo operations.
  1725. //
  1726. //
  1727. #define DP_STD_TREEVIEWPAGE 0xFFFF
  1728. #define DP_STD_DOCPROPPAGE 0xFFFE
  1729. #define MAX_DLGPAGE_COUNT 64
  1730. #define DPF_ICONID_AS_HICON 0x0001
  1731. #define DPF_USE_HDLGTEMPLATE 0x0002
  1732. typedef struct _DLGPAGE {
  1733. WORD cbSize; // size of this structure
  1734. WORD Flags; // DPF_xxxx flags
  1735. DLGPROC DlgProc; // caller's dialog box subclass procedue
  1736. LPTSTR pTabName; // pointer to the tab name
  1737. DWORD IconID; // icon to be used
  1738. union {
  1739. WORD DlgTemplateID; // dialog box template ID
  1740. HANDLE hDlgTemplate; // handle to the dialog template
  1741. } DUMMYUNIONNAME;
  1742. } DLGPAGE, *PDLGPAGE;
  1743. //
  1744. // DLGPAGE structure describe non-treeview page characteristics
  1745. //
  1746. //
  1747. // cbSize - size of this structure
  1748. //
  1749. // Flags - DPF_xxxx flags
  1750. //
  1751. // DPF_ICONID_AS_HICON
  1752. //
  1753. // If this flag is set then IconID DWORD field is
  1754. // treated as a handle to the icon rather then the
  1755. // resource ID
  1756. //
  1757. //
  1758. // DlgProc - caller's supplied DLGPROC for sub-class the page
  1759. // dialog box processing,
  1760. //
  1761. // if DlgProc is not NULL then common UI do the following
  1762. // according the the message received except for the
  1763. // DP_STD_xxx pages
  1764. //
  1765. //
  1766. // WM_INITDIALOG
  1767. //
  1768. // Common UI initialize the dialog box and then call
  1769. // DlgProc(WM_INITDIALOG) the DlgProc should return
  1770. // exactly the behavior for the WM_INITDIALOG
  1771. //
  1772. // The lParam in the WM_INITDIALOG data structure is
  1773. // a pointer to the PROPSHEETPAGE data structure.
  1774. //
  1775. // the lParam field in the PROPSHEETPAGE (lParam
  1776. // passed to the WM_INITDIALOG) is the UserData
  1777. // defined in COMPROPSHEETUI data structure
  1778. //
  1779. // To access to the PSPINFO data structure which
  1780. // associate with this page, use the common UI macro
  1781. // PPSPINFO_FROM_WM_INITDIALOG_LPARAM(lParam) where
  1782. // lParam is the parameter passed to the
  1783. // WM_INITDIALOG message.
  1784. //
  1785. // The subclass function should save these pointers
  1786. // for its later use, but it MUST NOT modified the
  1787. // content of the PSPINFO data structure or system
  1788. // may crashed.
  1789. //
  1790. //
  1791. // OTHER DIALOG MESSAGES
  1792. //
  1793. // Iit call DlgProc() and if it returned the value is
  1794. // non-zero then common UI assume DlgProc() processed
  1795. // the message and will not process this message.
  1796. //
  1797. // If the returned vlaue from DlgProc() is zero then
  1798. // common UI will process this message.
  1799. //
  1800. //
  1801. // * Durning the DlgProc the caller must not change the
  1802. // DWL_USERDATA on hDlg, otherwise the common UI will be
  1803. // crash. If caller need to get/set DWL_USERDATA it
  1804. // should call common UI's SetCPSUIUserData() and
  1805. // GetCPSUIUserData() instead.
  1806. //
  1807. // pTabName - Pointer to a string to describe the TAB title
  1808. //
  1809. // IconID - This is the icon identifier, which can be a common
  1810. // strandard IDI_CPSUI_xxx icon ID, caller's own icon
  1811. // resource ID, or a handle to the caller defined icon if
  1812. // DPF_ICONID_AS_HICON flag is set, in any case if the
  1813. // IconID is zero then it indicated no icon.
  1814. //
  1815. // DlgTemplateID - The template id to be use for the ProPage, it can be
  1816. // one of DP_STD_xxxx, the DP_STD_xxx has 240 x 240 dialog
  1817. // box units.
  1818. //
  1819. //
  1820. // DP_STD_TREEVIEWPAGE
  1821. //
  1822. // Specified that this page is a standard treeview
  1823. // page provided by the common ui. The treeview page
  1824. // is a page using treeview display all valid OPTITEM
  1825. // passed to the common UI. User can modify every
  1826. // valid selectable OPTITEM from the treeview page.
  1827. //
  1828. //
  1829. // DP_STD_DOCPROPPAGE
  1830. //
  1831. // Specified that this page is a standard document
  1832. // property page provided by the common UI
  1833. //
  1834. // hDlgTemplate - Handle to the DLGTEMPLATE which will be use for pop up
  1835. // dialog box
  1836. //
  1837. //
  1838. // wReserved[]
  1839. // dwReserved[] - Reserved fields, must be 0
  1840. //
  1841. //
  1842. // ** Tips of designing the dialog box controls
  1843. //
  1844. // When designing the dialog box controls, each OPTITEM is correspoonds
  1845. // to one input control plus one extended check box or extended push
  1846. // button. Since common UI will automatically disable and remove
  1847. // OPTIF_HIDE items item from the property sheet and dynamically move
  1848. // other controls, the following tips of designing the dialog box controls
  1849. // should follow.
  1850. //
  1851. // * Each item should have one input control plus optional of extended
  1852. // check box/push botton, one icon control and other static controls
  1853. //
  1854. // * Each item should occupied whole horizontal spaces of the property
  1855. // sheet, items must not overlay in vertical direction.
  1856. //
  1857. // * for TVOT_2STATES, TVOT_3STATES, if it araange radio buttons from
  1858. // left to right in state order (ie. from first state's OPTPARAM to
  1859. // last state's OPTPARAM) then the radio buttons and icons should
  1860. // aligned in the Y coordinate. If it arrange radio buttons from top
  1861. // to bottom (ie. from first state's OPTPARAM to last state's OPTPARAM)
  1862. // then the radio buttons and icons should aligned in the X coordinate.
  1863. //
  1864. // common UI will automatically hide/move the radio buttons to compact
  1865. // the dialog box controls. If radio buttons/icons are arranged in
  1866. // top/down order and there is other controls obscure in Y direction
  1867. // then radio buttons will only be re-arranged but not remove any white
  1868. // spaces in Y direction.
  1869. //
  1870. // * If multiple items shared one group box, then the group box must
  1871. // belongs to the first item (topmost in the dialog box group) in the
  1872. // group, the group box must large enough to cover all the items in
  1873. // side the group box.
  1874. //
  1875. //
  1876. #define CPSUIF_UPDATE_PERMISSION 0x0001
  1877. #define CPSUIF_ICONID_AS_HICON 0x0002
  1878. #define CPSUIF_ABOUT_CALLBACK 0x0004
  1879. #define CPSUI_PDLGPAGE_DOCPROP (PDLGPAGE)1
  1880. #define CPSUI_PDLGPAGE_ADVDOCPROP (PDLGPAGE)2
  1881. #define CPSUI_PDLGPAGE_PRINTERPROP (PDLGPAGE)3
  1882. #define CPSUI_PDLGPAGE_TREEVIWONLY (PDLGPAGE)4
  1883. typedef struct _COMPROPSHEETUI {
  1884. WORD cbSize; // size of this structure
  1885. WORD Flags; // CPSUIF_xxxx flags
  1886. HINSTANCE hInstCaller; // caller's hInstance
  1887. LPTSTR pCallerName; // pointer to the caller's name
  1888. DWORD UserData; // caller's own data
  1889. LPTSTR pHelpFile; // pointer to the help file
  1890. _CPSUICALLBACK pfnCallBack; // callback function pointer
  1891. POPTITEM pOptItem; // pointer to POPTITEM array
  1892. PDLGPAGE pDlgPage; // pointer to the DLGPAGE array
  1893. WORD cOptItem; // count of pOptItem array
  1894. WORD cDlgPage; // count of pDlgPage array
  1895. DWORD IconID; // icon to be used
  1896. LPTSTR pOptItemName; // pointer to the optitem's data name
  1897. WORD CallerVersion; // version for the caller apps
  1898. WORD OptItemVersion; // version for the optitem name
  1899. DWORD dwReserved[4]; // reserved, must be 0
  1900. } COMPROPSHEETUI, *PCOMPROPSHEETUI;
  1901. //
  1902. // COMPROPSHEETUI data structure is used when calling common UI to display dialog
  1903. // box of properties pages.
  1904. //
  1905. //
  1906. // Size - Must be sizeof (COMPROPSHEETUI)
  1907. //
  1908. // Flags - can be one or more of following
  1909. //
  1910. // CPSUIF_UPDATE_PERMISSION
  1911. //
  1912. // Specified the any valid pOptItem items are
  1913. // changeable by the user.
  1914. //
  1915. //
  1916. // CPSUIF_ICONID_AS_HICON
  1917. //
  1918. // If this flag is set then IconID DWORD field is
  1919. // treated as a handle to the icon rather then the
  1920. // resource ID
  1921. //
  1922. //
  1923. // CPSUIF_ABOUT_CALLBACK
  1924. //
  1925. // If this flag bit is set, then when user hit
  1926. // 'About...' button in the treeview tab, it will
  1927. // call the callback function with a reason of
  1928. // CPSUICB_REASON_ABOUT, and callback MUST handle
  1929. // the about which pop-up dialog box to show user
  1930. // the information about the caller and OPTITEMs.
  1931. //
  1932. // If this bit is not set then common UI will call
  1933. // the ShellAbout() with formatted caller Name and
  1934. // pOptItemName with version numbers.
  1935. //
  1936. //
  1937. // hInstCaller - the caller's handle to its instance. Commom UI use
  1938. // this handle to load caller's icon and other resources.
  1939. //
  1940. // pCallerName - Pointer to the caller's NULL terminated caller's
  1941. // name, most time this is driver's name,
  1942. // such as 'Postscript Driver'
  1943. //
  1944. // UserData - a 32-bit number used by the caller and common UI will
  1945. // not modify it. this 32-bit number is passed back to
  1946. // the caller durning the callback function
  1947. //
  1948. // pHelpFile - specified a standard microsoft help file (path/file)
  1949. // for using in the common UI. in OPTITEM specified
  1950. // HelpIndex for help in each item.
  1951. //
  1952. // pfnCallBack - Pointer to _CPSUICALLBACK callback function. Common
  1953. // UI only callback to the caller if an OPTIF_CALLBACK
  1954. // is set OPTITEM data structure's flag fields and the
  1955. // item selection is changed by the user.
  1956. //
  1957. // pOptItem - Pointer to array of OPTITEM structure to be displayed
  1958. // by the common UI
  1959. //
  1960. // pDlgPage - Pointer to array of DLGPAGE structure to describe
  1961. // each property sheet page infomation, the following
  1962. // are the standard common ui DLGPAGEs. When specified
  1963. // CPSUI_PDLGPAGE_xxxx, the common UI will automatically
  1964. // modify DlgPageIdx field in the OPTITEM, caller must
  1965. // set the iStartPage correctly.
  1966. //
  1967. // CPSUI_PDLGPAGE_DOCPROP
  1968. //
  1969. // specified this a common ui standard document
  1970. // property sheets. This includes two property
  1971. // sheets, 1) Page Setup 2) Advance (TreeView)
  1972. //
  1973. //
  1974. // CPSUI_PDLGPAGE_ADVDOCPROP
  1975. //
  1976. // Specified this is a treeview page only UI
  1977. // provided by the common UI, this only has one
  1978. // treeview page with tab of 'Advance'
  1979. //
  1980. //
  1981. // CPSUI_PDLGPAGE_PRINTERPROP
  1982. //
  1983. // Specified this is a common UI standard printer
  1984. // property sheet. This only has one treeview
  1985. // page with tab of 'Device Options'
  1986. //
  1987. //
  1988. // CPSUI_PDLGPAGE_TREEVIWONLY
  1989. //
  1990. // Specified this is a treeview page only UI
  1991. // provided by the common UI, this only has one
  1992. // treeview page
  1993. //
  1994. //
  1995. //
  1996. // cOptItem - Count of OPTITEM pointed by the pOptItem above
  1997. //
  1998. // cDlgPage - Count of DLGPAGE pointed by the pDlgPage. If
  1999. // pDlgPage is one of the CPSUI_PDLGPAGE_xxxx then this
  2000. // field is ignored by the common UI.
  2001. //
  2002. // IconID - This is the icon identifier, which can be a common
  2003. // strandard IDI_CPSUI_xxx icon ID, caller's own icon
  2004. // resource ID, or a handle to the caller defined icon
  2005. // if CPSUIF_ICONID_AS_HICON flag is set, in any case
  2006. // if the IconID is zero then it indicated no icon.
  2007. //
  2008. // pOptItemName - Pointer to the pOptItem data NULL terminated name,
  2009. // most time this is device name, such as 'HP 4si'
  2010. //
  2011. // CallerVersion - Version for the caller, the HIBYTE(CallerVersion) is
  2012. // the major version, and LOBYTE(CallerVersion) is the
  2013. // minor version, such as 0x310 display as 3.16, 0x3ff
  2014. // display as 3.255 and 0x30a display as 3.10
  2015. //
  2016. // OptItemVersion - Version for the OPTITEM's data, the
  2017. // HIBYTE(OptItemVersion) is the major version, and
  2018. // LOBYTE(OptItemVersion) is the minor version, such as
  2019. // 0x310 display as 3.16, 0x3ff display as 3.255 and
  2020. // 0x30a display as 3.10.
  2021. //
  2022. // dwReserved[4] - reserved fields, must be 0
  2023. //
  2024. //
  2025. // ** pTitlee and TitleBarIcon only used if CommonPrinterPropSheetUI()
  2026. // is the last one the Property sheet UI chain and call the PropertySheet()
  2027. //
  2028. //
  2029. #define CPSFUNC_ADD_HPROPSHEETPAGE 0
  2030. #define CPSFUNC_ADD_PROPSHEETPAGEW 1
  2031. #define CPSFUNC_ADD_PCOMPROPSHEETUIA 2
  2032. #define CPSFUNC_ADD_PCOMPROPSHEETUIW 3
  2033. #define CPSFUNC_ADD_PFNPROPSHEETUIA 4
  2034. #define CPSFUNC_ADD_PFNPROPSHEETUIW 5
  2035. #define CPSFUNC_DELETE_HCOMPROPSHEET 6
  2036. #define CPSFUNC_SET_HSTARTPAGE 7
  2037. #define CPSFUNC_GET_PAGECOUNT 8
  2038. #define CPSFUNC_SET_RESULT 9
  2039. #define CPSFUNC_GET_HPSUIPAGES 10
  2040. #define CPSFUNC_LOAD_CPSUI_STRINGA 11
  2041. #define CPSFUNC_LOAD_CPSUI_STRINGW 12
  2042. #define CPSFUNC_LOAD_CPSUI_ICON 13
  2043. #define CPSFUNC_GET_PFNPROPSHEETUI_ICON 14
  2044. #define CPSFUNC_ADD_PROPSHEETPAGEA 15
  2045. #define CPSFUNC_INSERT_PSUIPAGEA 16
  2046. #define CPSFUNC_INSERT_PSUIPAGEW 17
  2047. #define CPSFUNC_SET_PSUIPAGE_TITLEA 18
  2048. #define CPSFUNC_SET_PSUIPAGE_TITLEW 19
  2049. #define CPSFUNC_SET_PSUIPAGE_ICON 20
  2050. #define MAX_CPSFUNC_INDEX 20
  2051. #ifdef UNICODE
  2052. #define CPSFUNC_ADD_PCOMPROPSHEETUI CPSFUNC_ADD_PCOMPROPSHEETUIW
  2053. #define CPSFUNC_ADD_PFNPROPSHEETUI CPSFUNC_ADD_PFNPROPSHEETUIW
  2054. #define CPSFUNC_LOAD_CPSUI_STRING CPSFUNC_LOAD_CPSUI_STRINGW
  2055. #define CPSFUNC_ADD_PROPSHEETPAGE CPSFUNC_ADD_PROPSHEETPAGEW
  2056. #define CPSFUNC_INSERT_PSUIPAGE CPSFUNC_INSERT_PSUIPAGEW
  2057. #define CPSFUNC_SET_PSUIPAGE_TITLE CPSFUNC_SET_PSUIPAGE_TITLEW
  2058. #else
  2059. #define CPSFUNC_ADD_PCOMPROPSHEETUI CPSFUNC_ADD_PCOMPROPSHEETUIA
  2060. #define CPSFUNC_ADD_PFNPROPSHEETUI CPSFUNC_ADD_PFNPROPSHEETUIA
  2061. #define CPSFUNC_LOAD_CPSUI_STRING CPSFUNC_LOAD_CPSUI_STRINGA
  2062. #define CPSFUNC_ADD_PROPSHEETPAGE CPSFUNC_ADD_PROPSHEETPAGEA
  2063. #define CPSFUNC_INSERT_PSUIPAGE CPSFUNC_INSERT_PSUIPAGEA
  2064. #define CPSFUNC_SET_PSUIPAGE_TITLE CPSFUNC_SET_PSUIPAGE_TITLEA
  2065. #endif
  2066. //
  2067. // for the CPSFUNC_SET_RESULT
  2068. //
  2069. #define SR_OWNER 0
  2070. #define SR_OWNER_PARENT 1
  2071. typedef struct _SETRESULT_INFO {
  2072. WORD cbSize;
  2073. WORD wReserved;
  2074. HANDLE hSetResult;
  2075. DWORD Result;
  2076. } SETRESULT_INFO, *PSETRESULT_INFO;
  2077. //
  2078. // This is for CPSFUNC_INSERT_PSUIPAGE
  2079. //
  2080. #define HINSPSUIPAGE_FIRST (HANDLE)0xFFFFFFFE
  2081. #define HINSPSUIPAGE_LAST (HANDLE)0xFFFFFFFF
  2082. #define HINSPSUIPAGE_INDEX(i) (HANDLE)MAKELONG(i, 0);
  2083. #define PSUIPAGEINSERT_GROUP_PARENT 0
  2084. #define PSUIPAGEINSERT_PCOMPROPSHEETUI 1
  2085. #define PSUIPAGEINSERT_PFNPROPSHEETUI 2
  2086. #define PSUIPAGEINSERT_PROPSHEETPAGE 3
  2087. #define PSUIPAGEINSERT_HPROPSHEETPAGE 4
  2088. #define PSUIPAGEINSERT_DLL 5
  2089. #define MAX_PSUIPAGEINSERT_INDEX 5
  2090. #define IDX_2_HINSPSUIPAGE(i) ((HANDLE)MAKELONG(i, 0))
  2091. #define HINSPSUIPAGE_2_IDX(h) ((UINT)LOWORD(h))
  2092. #define INSPSUIPAGE_MODE_BEFORE 0
  2093. #define INSPSUIPAGE_MODE_AFTER 1
  2094. #define INSPSUIPAGE_MODE_FIRST_CHILD 2
  2095. #define INSPSUIPAGE_MODE_LAST_CHILD 3
  2096. #define INSPSUIPAGE_MODE_INDEX 4
  2097. typedef struct _INSERTPSUIPAGE_INFO {
  2098. WORD cbSize;
  2099. BYTE Type;
  2100. BYTE Mode;
  2101. DWORD dwData1;
  2102. DWORD dwData2;
  2103. DWORD dwData3;
  2104. } INSERTPSUIPAGE_INFO, *PINSERTPSUIPAGE_INFO;
  2105. //
  2106. // for the CPSFUNC_SET_HSTARTPAGE
  2107. //
  2108. #define SSP_TVPAGE 10000
  2109. #define SSP_STDPAGE 10001
  2110. typedef DWORD (CALLBACK *PFNCOMPROPSHEET)(HANDLE hComPropSheet,
  2111. UINT Function,
  2112. LPARAM lParam1,
  2113. LPARAM lParam2);
  2114. typedef struct _PSPINFO {
  2115. WORD cbSize;
  2116. WORD wReserved;
  2117. HANDLE hComPropSheet;
  2118. HANDLE hCPSUIPage;
  2119. PFNCOMPROPSHEET pfnComPropSheet;
  2120. } PSPINFO, *PPSPINFO;
  2121. //
  2122. // PPSPINFO_FROM_WM_INITDIALOG_LPARAM(lParam) macro retrieve a pointer to the
  2123. // PSPINFO data structure. the lParam must be the lParam passed to the
  2124. // WM_INITDIALOG, otherwise the system can failed
  2125. //
  2126. #define PPSPINFO_FROM_WM_INITDIALOG_LPARAM(lParam) \
  2127. (PPSPINFO)((LPBYTE)lParam + ((LPPROPSHEETPAGE)lParam)->dwSize)
  2128. //
  2129. // PSPINFO
  2130. //
  2131. // This structure is used durning property sheet page's WM_INITDIALOG message.
  2132. // At WM_INITDIALOG, the lParam is a pointer to the PROPSHEETPAGE, and
  2133. // lParam field in the PROPSHEETPAGE is a pointer to the PSPINFO. the
  2134. // original lParam in the PROPSHEETPAGE is saved in the lParam field in the
  2135. // PSPINFO data structure.
  2136. //
  2137. // When process WM_INITDIALOG message, it should save the lParam (PSPINFO
  2138. // structure pointer) for later to call common UI callback functions.
  2139. //
  2140. //
  2141. // cbSize - Size of this structure in bytes
  2142. //
  2143. // wReserved - Reserved, must be set to zero
  2144. //
  2145. // hComPropSheet - Handle to the parent page which is the hComPropSheet
  2146. // passed to the CPSFUNC_ADD_PROPSHEETPAGE
  2147. //
  2148. // hCPSUIPage - Handle to the this added common UI property sheet page.
  2149. //
  2150. // pfnComPropSheet - Pointer to the common UI callback function, using this
  2151. // function pointer to do CPSFUNC_xxxx
  2152. //
  2153. //
  2154. //
  2155. // PFNCOMPROPSHEET function descriptions
  2156. //
  2157. // For each function index, it passed a handle, a Function Index and two (2)
  2158. // long parameters, the 'hComPropSheet' handle passed must be the handle passed
  2159. // from common UI when common UI called the caller supplied function
  2160. //
  2161. // pfnPropSheetUI(pPropSheetUIData);
  2162. //
  2163. // Following are the description of each function index
  2164. //
  2165. //
  2166. // -------------------------------------------------------------------------
  2167. // Function = CPSFUNC_ADD_HPROPSHEETPAGE
  2168. //
  2169. // This function add a page to the hComPropSheet using handle to the
  2170. // PROPSHEETPAGE
  2171. //
  2172. //
  2173. // Parameters:
  2174. //
  2175. // lParam1 - is a handle to the PROPSHEETPAGE that created by the caller
  2176. // using CreatePropertySheetPage()
  2177. //
  2178. // lParam2 - Not used, must be 0
  2179. //
  2180. //
  2181. // Return Value:
  2182. //
  2183. // The return value is the handle of newly added common property sheet
  2184. // page, if return value is NULL then function failed.
  2185. //
  2186. //
  2187. // -------------------------------------------------------------------------
  2188. // Function = CPSFUNC_ADD_PROPSHEETPAGE
  2189. //
  2190. // This function add a page to the hComPropSheet using PROPSHEETPAGE
  2191. // data structure.
  2192. //
  2193. //
  2194. // Parameters:
  2195. //
  2196. // lParam1 - is a pointer to PROPSHEETPAGE data structure
  2197. //
  2198. // lParam2 - Not used.
  2199. //
  2200. //
  2201. // Return Value:
  2202. //
  2203. // The return value is the handle of newly added common property sheet
  2204. // page, if return value is NULL then function failed.
  2205. //
  2206. //
  2207. // -------------------------------------------------------------------------
  2208. // Function = CPSFUNC_ADD_PCOMPROPSHEETUI
  2209. //
  2210. // This function add propety page(s) to the hComPropSheet handle using
  2211. // COMPROPSHEETUI data structure.
  2212. //
  2213. //
  2214. // Parameters:
  2215. //
  2216. // lParam1 - is a pointer to COMPROPSHEETUI data structure
  2217. //
  2218. // lParam2 - pointer to a 32-bit location that received the total pages
  2219. // added by the COMPROPSHEETUI data structure if sucessful else
  2220. // it contains the ERR_CPSUI_xxx error codes.
  2221. //
  2222. //
  2223. // Return Value:
  2224. //
  2225. // The return value is the handle of newly added common property sheet
  2226. // page(s), if return value is NULL then function failed.
  2227. //
  2228. //
  2229. // -------------------------------------------------------------------------
  2230. // Function = CPSFUNC_ADD_PFNPROPSHEETUI
  2231. //
  2232. // This function add property page(s) to the hChild handle using
  2233. // lParam1 as PFNPROPSHEETUI function pointer and lParam2 as the function
  2234. // parameter. The common UI call supplied function as following
  2235. //
  2236. // PROPSHEETUI_INFO PSUIInfo;
  2237. //
  2238. // PSUIInfo.cbSize = sizeof(PROPSHEETUI_INFO);
  2239. // PSUIInfo.Version = PROPSHEETUI_INFO_VERSION;
  2240. // PSUIInfo.Flags = (Ansi) ? 0: PSUIINFO_UNICODE;
  2241. // PSUIInfo.Reason = PROPSHEETUI_REASON_INIT;
  2242. // PSUIInfo.hComPropSheet = hComPropSheet;
  2243. // PSUIInfo.pfnComPropSheet = ComPropSheetUICallBack;
  2244. // PSUIInfo.lParamInit = lParam2;
  2245. // PSUIInfo.UserData = 0;
  2246. // PSUIInfo.Result = 0;
  2247. //
  2248. // ((PFNPROPSHEETUI)lParam1)(&PSUIInfo, lParam2);
  2249. //
  2250. //
  2251. // If the pfnPropSheetUI() need to add/delete any common UI pages then
  2252. // it must use hComPropSheet as its handle when calling the
  2253. // ComPropSheetUICallBack().
  2254. //
  2255. //
  2256. // Parameters:
  2257. //
  2258. // lParam1 - a PFNPROPSHEETUI function pointer.
  2259. //
  2260. // lParam2 - a 32-bit data that will be used as lParam when calling
  2261. // PFNPROPSHEETUI function pointer.
  2262. //
  2263. //
  2264. // Return Value:
  2265. //
  2266. // The return value is the newly added property pages function handle, if
  2267. // return value is NULL then function failed or no page is added.
  2268. //
  2269. //
  2270. //
  2271. // -------------------------------------------------------------------------
  2272. // Function = CPSFUNC_DELETE_HCOMPROPSHEET
  2273. //
  2274. // This function delete child property page(s) from hComPropSheet parent
  2275. // using the child handle passed.
  2276. //
  2277. //
  2278. // Parameters:
  2279. //
  2280. // lParam1 - the handle of common property sheet pages that to be deleted.
  2281. // This handle must be the handle returned from CPSFUNC_ADD_xxx
  2282. // functions.
  2283. //
  2284. // lParam2 - not used, must be 0
  2285. //
  2286. // Return Value:
  2287. //
  2288. // The return value is greater than zero if function sucessful, and less
  2289. // or equal to zero if the function failed.
  2290. //
  2291. // -------------------------------------------------------------------------
  2292. // Function = CPSFUNC_GET_PAGECOUNT
  2293. //
  2294. // This function return total property sheet pages belongs to a common
  2295. // UI property sheet page handle hComPropSheet
  2296. //
  2297. //
  2298. // Parameters:
  2299. //
  2300. // lParam1 - not used, must be 0
  2301. //
  2302. // lParam2 - not used, must be 0.
  2303. //
  2304. //
  2305. // Return Value:
  2306. //
  2307. // The return value is total page count if function sucessful or zero if
  2308. // function failed.
  2309. //
  2310. //
  2311. // -------------------------------------------------------------------------
  2312. // Function = CPSFUNC_SET_RESULT
  2313. //
  2314. // This function set the result of property sheet page to its owner that
  2315. // added this page by CPSFUNC_ADD_xxx function indices
  2316. //
  2317. // Parameters:
  2318. //
  2319. // lParam1 - Handle to the common UI property sheet page that setting the
  2320. // result. If this handle is NULL then it is treated as
  2321. // equal to the hComPropSheet.
  2322. //
  2323. // lParam2 - a 32-bit DWORD result to be set.
  2324. //
  2325. //
  2326. // Return Value:
  2327. //
  2328. // > 0: Successful, return value is total count of parents set the result
  2329. // = 0: There is no owner or parent for the lParam1 handle.
  2330. // < 0: function failed because of invalid lParam1 handle.
  2331. //
  2332. //
  2333. // -------------------------------------------------------------------------
  2334. // Function = CPSFUNC_SET_HSTARTPAGE
  2335. //
  2336. //
  2337. // Parameters:
  2338. //
  2339. // lParam1 - the handle of common property sheet pages that to be set
  2340. // as initial page that appear when the property sheet dialog
  2341. // boxes is created. This handle must be the handle returned
  2342. // from CPSFUNC_ADD_xxx functions.
  2343. //
  2344. // lParam2 - a LONG number to specified the children index. if lParam1
  2345. // handle is a parent then lParam2 specified zero base children
  2346. // index for using as start page.
  2347. //
  2348. // It also can be one of following special index
  2349. //
  2350. // SSP_TVPAGE
  2351. //
  2352. // set to the treeview page, this only valid if lParam1
  2353. // handle was added by the CPSFUNC_ADD_PCOMPROPSHEETUI.
  2354. //
  2355. // SSP_STDPAGE
  2356. //
  2357. // Set to the standard document property sheet page
  2358. // (Page 1 user friendly page). this only valid if
  2359. // lParam1 handle was added by the
  2360. // CPSFUNC_ADD_PCOMPROPSHEETUI.
  2361. //
  2362. //
  2363. // Return Value:
  2364. //
  2365. // The return value is greater than zero if function sucessful, and less
  2366. // or equal to zero if the function failed.
  2367. //
  2368. //
  2369. // -------------------------------------------------------------------------
  2370. // Function = CPSFUNC_GET_HPSUIPAGES
  2371. //
  2372. // This function return array of children HPROPSHEETPAGE belongs to
  2373. // the parent hComPropSheet UI property sheet page handle hComPropSheet
  2374. //
  2375. //
  2376. // Parameters:
  2377. //
  2378. // lParam1 - Pointer to an array of HPROPSHEETPAGE that to be stored
  2379. // the handle upon return.
  2380. //
  2381. // lParam2 - Count of HPROPSHEETPAGE array pointed by the lParam1
  2382. //
  2383. //
  2384. // Return Value:
  2385. //
  2386. // The return value is total HPROPSHEETPAGE stored in the array pointed
  2387. // by the lParam1. To get all hPropSheetPage for any common property
  2388. // sheet handle's (hCPSUIPage) children, it can use following sequence.
  2389. //
  2390. // if ((cPage = pfnComPropSheet(hComPropSheet,
  2391. // CPSFUNC_GET_PAGECOUNT,
  2392. // (LPARAM)hCPSUIPage,
  2393. // 0L)) &&
  2394. // (phPage = ALLOCMEM(cPage * sizeof(HANDLE)))) {
  2395. //
  2396. // pfnComPropSheet(hCPSUIPage,
  2397. // CPSFUNC_GET_HPSUIPAGES,
  2398. // (LPARAM)phPage,
  2399. // (LPARAM)cPage);
  2400. // }
  2401. //
  2402. // -------------------------------------------------------------------------
  2403. // Function = CPSFUNC_LOAD_CPSUI_STRING
  2404. //
  2405. // This function load the common property sheet UI resource string
  2406. //
  2407. // Parameters:
  2408. //
  2409. // lParam1 - Pointer to LPTSTR string which will stored the loaded
  2410. // resource string from the common property sheet UI DLL.
  2411. //
  2412. // lParam2 - LOWORD(lParam2) = Count of characters (includes null
  2413. // terminator) which pointed by the lParam1
  2414. //
  2415. // HIWORD(lParam2) = Common property sheet UI predefined string
  2416. // resource ID as IDS_CPSUI_xxxx
  2417. //
  2418. //
  2419. // Return Value:
  2420. //
  2421. // > 0: Total characters stored in the string pointed by the lParam1, this
  2422. // is not includes the null terminator
  2423. // = 0: Invalid IDS_CPSUI_xxx passed from HIWORD(lParam)
  2424. // < 0: Either lParam1 is NULL or count of character is 0 from
  2425. // LOWORD(lParam2)
  2426. //
  2427. //
  2428. // -------------------------------------------------------------------------
  2429. // Function = CPSFUNC_LOAD_CPSUI_ICON
  2430. //
  2431. // This function load the common property sheet UI resource icon.
  2432. //
  2433. // Parameters:
  2434. //
  2435. // lParam1 - Common property sheet UI predefined icon resource ID as
  2436. // IDI_CPSUI_xxxx.
  2437. //
  2438. // lParam2 - LOWORD(lParam2) = cx icon size in pixel. If zero then
  2439. // SM_CXICON is used
  2440. // HIWORD(lParam2) = cy icon size in pixel. If zero then
  2441. // SM_CYICON is used
  2442. //
  2443. //
  2444. // Return Value:
  2445. //
  2446. // Return value is the handle to the hIcon if function succeed, a NULL
  2447. // if function failed. The caller must call DestroyIcon() when it no
  2448. // longer need to use the hIcon returned
  2449. //
  2450. //
  2451. // -------------------------------------------------------------------------
  2452. // Function = CPSFUNC_GET_PFNPROPSHEETUI_ICON
  2453. //
  2454. // This function let the caller return hIcon of its children pages that
  2455. // was added by CPSFUNC_ADD_PFNPROPSHEETUI
  2456. //
  2457. // Parameters:
  2458. //
  2459. // lParam1 - Handle of common property sheet pages that the hIcon will be
  2460. // queried. This handle must be the handle returned from
  2461. // CPSFUNC_ADD_PFNPROPSHEETUI function.
  2462. //
  2463. // lParam2 - LOWORD(lParam2) = cx icon size in pixel. If zero then
  2464. // SM_CXICON is used
  2465. // HIWORD(lParam2) = cy icon size in pixel. If zero then
  2466. // SM_CYICON is used
  2467. //
  2468. //
  2469. // Return Value:
  2470. //
  2471. // Return value is the handle to the hIcon if function succeed, a NULL
  2472. // if function failed. The caller must call DestroyIcon() when it no
  2473. // longer need to use the hIcon returned
  2474. //
  2475. //
  2476. // -------------------------------------------------------------------------
  2477. // Function = CPSFUNC_INSERT_PSUIPAGE
  2478. //
  2479. // This function let the caller insert common property sheet pages at
  2480. // set position. The hComPropSheet must be the parent handle.
  2481. //
  2482. // Parameters:
  2483. //
  2484. // lParam1 - Handle of common property sheet pages that the page position
  2485. // will be inserted. This handle must be the handle returned
  2486. // from previous CPSFUNC_ADD_xxx or CPSFUNC_INSERT_PSUIPAGE that
  2487. // added or inserted using the hComPropSheet if the Mode field
  2488. // in INSPSUIPAGE_INFO data structure is one of the follwing
  2489. //
  2490. // INSPSUIPAGE_MODE_BEFORE
  2491. // INSPSUIPAGE_MODE_AFTER - Common UI page handle
  2492. //
  2493. // INSPSUIPAGE_MODE_INDEX - the lParam1 is an zero based
  2494. // child index.
  2495. //
  2496. // INSPSUIPAGE_MODE_FIRST_CHILD
  2497. // INSPSUIPAGE_MODE_LAST_CHILD - The lParam1 is ignonred.
  2498. //
  2499. //
  2500. // If lParam1 is a valid common property sheet page handle then
  2501. // it is the child page handle of hComPropSheet that added by
  2502. // CPSFUNC_ADD_xxx or inserted by CPSFUNC_INSERT_PSUIPAGE.
  2503. //
  2504. // lParam2 - A pointer that points to INSERTPSUIPAGE_INFO data structure.
  2505. // Fields must set according to the following.
  2506. //
  2507. // cbSize - size of this structure
  2508. //
  2509. // Type - Type of page(s) to be inserted. It can be one
  2510. // of the following
  2511. //
  2512. // PSUIPAGEINSERT_GROUP_PARENT
  2513. //
  2514. // Insert a group parent that can be used to insert
  2515. // new pages under it. This is typically used when
  2516. // a set of common UI pages must be group together and
  2517. // can be deleted later using a single group parent
  2518. // handle without individual deleting each page.
  2519. //
  2520. // This handle can be nested. After this function
  2521. // returned the group parent handle, it can be used
  2522. // as hComPropSheet handle (first parameter in the
  2523. // common UI callback) as parent handle so insertion
  2524. // will be inserted at level below returned group
  2525. // parent handle.
  2526. //
  2527. //
  2528. // PSUIPAGEINSERT_PCOMPROPSHEETUI
  2529. //
  2530. // Insert pages using COMPROPSHEETUI data structure,
  2531. // dwData1 is a pointer to the COMPROPSHEETUI data
  2532. // structure.
  2533. //
  2534. //
  2535. // PSUIPAGEINSERT_PFNPROPSHEETUI
  2536. //
  2537. // Insert pages using PFNPROPSHEETUI function pointer.
  2538. // The dwData1 is a PFNPROPSHEETUI function pointer.
  2539. // The common UI will call this pfnPropSheetUI()
  2540. // function pointer with PROPSHEETUI_REASON_INIT to
  2541. // have it add pages.
  2542. //
  2543. // When common UI call pfnPropSheetUI() (dwData1) it
  2544. // also passed a 32-bit parameter from the dwData2
  2545. // field in INSERTPSUIPAGE_INFO data structure.
  2546. //
  2547. //
  2548. // PSUIPAGEINSERT_PROPSHEETPAGE
  2549. //
  2550. // Insert pages using PROPSHEETPAGE data structure.
  2551. // The dwData1 is a pointer to the PROPSHEETPAGE
  2552. // data structure.
  2553. //
  2554. //
  2555. // PSUIPAGEINSERT_HPROPSHEETPAGE
  2556. //
  2557. // Insert pages using HPROPSHEETPAGE handle. The
  2558. // dwData1 is a PROPSHEETPAGE handle which was
  2559. // created by CreatePropertySheetPage().
  2560. //
  2561. //
  2562. // PSUIPAGEINSERT_DLL
  2563. //
  2564. // Insert pages from a dynnmaic link library. The
  2565. // dwData1 is a pointer to a null terminated string
  2566. // that specified the dynamic link library file name.
  2567. //
  2568. // The dwData2 is a pointer to a null terminated ASCII
  2569. // string that specified the pfnPropSheetUI function
  2570. // name. (MUST BE ASCII STRING)
  2571. //
  2572. // Common UI will do a LoadLibrary((LPTSTR)dwData1),
  2573. // pfnPropSheetUI = GetProcAddress((LPTSTR)dwData2)
  2574. // then call the pfnPropSheetUI with a lParam from
  2575. // dwData3. The called reason from common UI is
  2576. // set to PROPSHEETUI_REASON_INIT.
  2577. //
  2578. // Using this method insert pages will guaranteed that
  2579. // library will be unload correctly.
  2580. //
  2581. //
  2582. // Mode - Insert Mode, it can be one of the following
  2583. //
  2584. //
  2585. // INSPSUIPAGE_MODE_BEFORE
  2586. //
  2587. // Insert pages before the common property sheet page
  2588. // handle specified by lParam1
  2589. //
  2590. //
  2591. // INSPSUIPAGE_MODE_AFTER
  2592. //
  2593. // Insert pages after the common property sheet page
  2594. // handle specified by lParam1
  2595. //
  2596. //
  2597. // INSPSUIPAGE_MODE_FIRST_CHILD
  2598. //
  2599. // Insert pages as the first child of hComPropSheet
  2600. // parent handle, the lParam1 is ignored
  2601. //
  2602. //
  2603. // INSPSUIPAGE_MODE_LAST_CHILD
  2604. //
  2605. // Insert pages as the last child of hComPropSheet
  2606. // parent handle, the lParam1 is ignored
  2607. //
  2608. //
  2609. // INSPSUIPAGE_MODE_INDEX
  2610. //
  2611. // Insert pages as a zero base child index of its
  2612. // parent handle specified by hComPropSheet.
  2613. //
  2614. // The lParam1 is the zero based index special handle
  2615. // that must generated by HINSPSUIPAGE_INDEX(Index)
  2616. // macro. If the index is greater than or equal to
  2617. // the total count of children then it will treat the
  2618. // mode same as INSPSUIPAGE_MODE_LAST_CHILD
  2619. //
  2620. //
  2621. // dwData1
  2622. // dwData2
  2623. // dwData3 - 32-bit data associate with the 'Type' field
  2624. // as following
  2625. //
  2626. //
  2627. // PSUIPAGEINSERT_GROUP_PARENT
  2628. //
  2629. // dwData1 = Not used, must be 0
  2630. // dwData2 = Not used, must be 0
  2631. // dwData3 = Not used, must be 0
  2632. //
  2633. //
  2634. // PSUIPAGEINSERT_PCOMPROPSHEETUI
  2635. //
  2636. // dwData1 = pointer to COMPORPSHEETUI data structure.
  2637. // dwData2 = at return if sucessful, it contains total
  2638. // page added. If failed, it contains the
  2639. // ERR_CPSUI_xxx codes
  2640. // dwData3 = Not used, must be 0
  2641. //
  2642. //
  2643. // PSUIPAGEINSERT_PFNPROPSHEETUI
  2644. //
  2645. // dwData1 = PFNPROPSHEETUI function pointer
  2646. // dwData2 = 32-bit parameter passed to pfnPropSheetUI
  2647. // dwData3 = Not used, must be 0
  2648. //
  2649. //
  2650. // PSUIPAGEINSERT_PROPSHEETPAGE
  2651. //
  2652. // dwData1 = Pointer to PROPSHEETPAGE data structure.
  2653. // dwData2 = not used, must be 0
  2654. // dwData3 = not used, must be 0
  2655. //
  2656. //
  2657. // PSUIPAGEINSERT_HPROPSHEETPAGE
  2658. //
  2659. // dwData1 = Is the HPROPSHEETPAGE handle that created
  2660. // by a call to CreatePropertySheetPage().
  2661. // dwData2 = not used, must be 0
  2662. // dwData3 = not used, must be 0
  2663. //
  2664. //
  2665. // PSUIPAGEINSERT_DLL
  2666. //
  2667. // dwData1 = Pointer to a null terminated dynamic link
  2668. // library filename.
  2669. // dwData2 = Pointer to a null terminated function
  2670. // name (PFNPROPSHEETUI) in the dynamin link
  2671. // library.
  2672. // dwData3 = 32-bit parameter passed to pfnPropSheetUI
  2673. // (PFNPROPSHEETUI) function from dwData2
  2674. //
  2675. //
  2676. // Return Value:
  2677. //
  2678. // The return value is the handle of newly added common property sheet
  2679. // page(s), if return value is NULL then function failed.
  2680. //
  2681. //
  2682. // -------------------------------------------------------------------------
  2683. // Function = CPSFUNC_SET_PSUIPAGE_TITLE
  2684. //
  2685. // This function let the caller set a new title for a particular common
  2686. // UI page title (on the property sheet page tab)
  2687. //
  2688. // Parameters:
  2689. //
  2690. // lParam1 - the handle of common property sheet pages that title to be
  2691. // set. This handle must be the handle returned from following
  2692. //
  2693. // CPSFUNC_ADD_PROPSHEETPAGE
  2694. // CPSFUNC_ADD_HPROPSHEETPAGE
  2695. // CPSFUNC_INSERT_PSUIPAGE with type of
  2696. // PSUIPAGEINSERT_PROPSHEETPAGE or
  2697. // PSUIPAGEINSERT_HPROPSHEETPAGE
  2698. //
  2699. // lParam2 - Pointer to a null terminated string for the new title
  2700. //
  2701. //
  2702. // Return Value:
  2703. //
  2704. // The return value is greater than zero if function sucessful, and less
  2705. // or equal to zero if the function failed.
  2706. //
  2707. // This function will returned 0 if the property sheet pages is not
  2708. // currently displayed.
  2709. //
  2710. //
  2711. // -------------------------------------------------------------------------
  2712. // Function = CPSFUNC_SET_PSUIPAGE_ICON
  2713. //
  2714. // This function let the caller set a new icon for a particular common
  2715. // UI page icon (on the property sheet page tab)
  2716. //
  2717. // Parameters:
  2718. //
  2719. // lParam1 - the handle of common property sheet pages that icon to be
  2720. // set. This handle must be the handle returned from following
  2721. //
  2722. // CPSFUNC_ADD_PROPSHEETPAGE
  2723. // CPSFUNC_ADD_HPROPSHEETPAGE
  2724. // CPSFUNC_INSERT_PSUIPAGE with type of
  2725. // PSUIPAGEINSERT_PROPSHEETPAGE or
  2726. // PSUIPAGEINSERT_HPROPSHEETPAGE
  2727. //
  2728. // lParam2 - Handle to Icon, this icon is best as 16x16 icon otherwise it
  2729. // will be stretch to 16x16 (pixel).
  2730. //
  2731. //
  2732. // Return Value:
  2733. //
  2734. // The return value is greater than zero if function sucessful, and less
  2735. // or equal to zero if the function failed.
  2736. //
  2737. // This function will returned 0 if the property sheet pages is not
  2738. // currently displayed.
  2739. //
  2740. // After this function is successful set the icon, the caller can destroy
  2741. // the hIcon using DestroyIcon() if the hIcon is created by CreateIcon().
  2742. // If the hIcon (lParam2) passed is using LoadIcon() then it does not need
  2743. // to destroy the icon.
  2744. //
  2745. //
  2746. // -------------------------------------------------------------------------
  2747. //
  2748. #define PROPSHEETUI_REASON_INIT 0
  2749. #define PROPSHEETUI_REASON_GET_INFO_HEADER 1
  2750. #define PROPSHEETUI_REASON_DESTROY 2
  2751. #define PROPSHEETUI_REASON_SET_RESULT 3
  2752. #define PROPSHEETUI_REASON_GET_ICON 4
  2753. #define MAX_PROPSHEETUI_REASON_INDEX 4
  2754. #define PROPSHEETUI_INFO_VERSION 0x0100
  2755. #define PSUIINFO_UNICODE 0x0001
  2756. typedef struct _PROPSHEETUI_INFO {
  2757. WORD cbSize;
  2758. WORD Version;
  2759. WORD Flags;
  2760. WORD Reason;
  2761. HANDLE hComPropSheet;
  2762. PFNCOMPROPSHEET pfnComPropSheet;
  2763. LPARAM lParamInit;
  2764. DWORD UserData;
  2765. DWORD Result;
  2766. } PROPSHEETUI_INFO, *PPROPSHEETUI_INFO;
  2767. //
  2768. // For the PROPSHEETUI_REASON_GET_ICON call which lParam is a pointer to
  2769. // PROPSHEETUI_GETICON_INFO
  2770. //
  2771. typedef struct _PROPSHEETUI_GETICON_INFO {
  2772. WORD cbSize;
  2773. WORD Flags;
  2774. WORD cxIcon;
  2775. WORD cyIcon;
  2776. HICON hIcon;
  2777. } PROPSHEETUI_GETICON_INFO, *PPROPSHEETUI_GETICON_INFO;
  2778. typedef LONG (FAR *PFNPROPSHEETUI)(PPROPSHEETUI_INFO pPSUIInfo,
  2779. LPARAM lParam);
  2780. //
  2781. // PFNPROPSHEETUI
  2782. //
  2783. // This function is user defined function which will be called by the common
  2784. // UI when a caller wish to include the executable property sheets.
  2785. //
  2786. // pPSUIInfo - Pointer to PROPSHEETUI_INFO below for description of
  2787. // PROPSHEETUI_INFO.
  2788. //
  2789. // If this pointer is NULL then this function is not called from
  2790. // common UI, and lParam should be used to determined the
  2791. // action and outcome of this funciton.
  2792. //
  2793. // lParam - A LPARAM intented for this funciton depends on the reason.
  2794. // If pPSUIInfo is NULL then this function is not called from
  2795. // common UI, the lParam is the parameter which agreed with
  2796. // the caller.
  2797. //
  2798. // if pPSUIInfo is not NULL then this function assume the call
  2799. // is from the common UI. lParam has following meanion depends
  2800. // on the reason field.
  2801. //
  2802. // PROPSHEETUI_REASON_INIT
  2803. //
  2804. // The lParam is either passed from CPSFUNC_ADD_PFNPROPSHEETUI
  2805. // callback function's second parameter (lParam2) or it is
  2806. // from CommonPropertySheetUI()'s lParam (seccond parameter)
  2807. // without any modification.
  2808. //
  2809. // The lParam MUST NOT be a variable or a pointer to memory
  2810. // block which resides on the caller function's stack, since
  2811. // after this function exit, the lParam will become invalid
  2812. // and can cause fatal system error.
  2813. //
  2814. // The lParam parameter is copied to the lParamInit field in
  2815. // PROPSHEETUI_INFO data structure. The lParamInit field
  2816. // will be passed to all subsequent pfnPropSheetUI() calls
  2817. // without any modification.
  2818. //
  2819. //
  2820. // PROPSHEETUI_REASON_GET_INFO_HEADER:
  2821. //
  2822. // lParam is a pointer to the PROPSHEETUI_INFO_HEADER data
  2823. // structure. this function must correctly fill this structure
  2824. // fields before it returned.
  2825. //
  2826. //
  2827. // PROPSHEETUI_REASON_DESTROY
  2828. //
  2829. // lParam is zero to indicate the destroy is cause either by a
  2830. // caller calling CPSFUNC_DELETE_HCOMPROPSHEET or failed
  2831. // in caller's CPSFUNC_ADD_xxxx.
  2832. //
  2833. // lParam is non zero to indicate the destroy is cause by
  2834. // exiting from the property sheet user interface.
  2835. //
  2836. //
  2837. // PROPSHEETUI_REASON_SET_RESULT
  2838. //
  2839. // lParam is a pointer to SETRESULT_INFO data structure.
  2840. // Fields in SETRESULT_INFO data structure is set to following
  2841. //
  2842. // hSetResult: Handle to the common UI property sheet
  2843. // pages which added by the CPSFUNC_ADD_xxx
  2844. // callback function indices.
  2845. //
  2846. // Result: The result from the hSetResult to be set.
  2847. // When return greater than zero then Result
  2848. // in this field is set to its parent.
  2849. //
  2850. //
  2851. // PROPSHEETUI_REASON_GET_ICON
  2852. //
  2853. // lParam is a pointer to PROPSHEETUI_GETICON_INFO data
  2854. // structure. Fields in PROPSHEETUI_GETICON_INFO data
  2855. // structure are set to following
  2856. //
  2857. // cxIcon = cx Icon size in pixel
  2858. // cyIcon = cy Icon size in pixel
  2859. // hIcon = Initial to NULL, and this function must put
  2860. // the created icon handle in this field before
  2861. // returned.
  2862. //
  2863. //
  2864. // PROPSHEETUI_INFO
  2865. //
  2866. // This structure is used when common UI calling the caller passed function
  2867. // entry point PFNPROPSHEETUI, the pfnPropSheetUI() return a LONG to
  2868. // indicate result of this function.
  2869. //
  2870. // When the pfnPropSheetUI() returned, it must also put the required result
  2871. // in the Result field, each PROPSHEETUI_REASON_xxx has different required
  2872. // result as describe below.
  2873. //
  2874. //
  2875. //
  2876. // cbSize - sizeof this structure (PROPSHEETUI_INFO)
  2877. //
  2878. // Version - the PROPSHEETUI_INFO data structure version. Current
  2879. // version is set to PROPSHEETUI_INFO_VERSION
  2880. //
  2881. // Flags - One or more following is may be defined
  2882. //
  2883. // PSUIINFO_UNICODE
  2884. //
  2885. // The caller's executable was original compiled was
  2886. // intented using unicode.
  2887. //
  2888. //
  2889. // Reason - Following reasons are defined.
  2890. //
  2891. // PROPSHEETUI_REASON_INIT
  2892. //
  2893. // When first time the pfnPropSheetUI() called, this
  2894. // reason is used to have the function initialize
  2895. // itself and use the pfnComPropSheet() function
  2896. // pointer provided to add new pages to the
  2897. // hComPropSheet handle passed. The UserData in this
  2898. // data structure is initially set equal to zero (0).
  2899. //
  2900. // * Return > 0 to indicate sucesful and <= 0 to
  2901. // indicate error.
  2902. //
  2903. // *NOTE*
  2904. //
  2905. // The lParam MUST NOT be a variable or a pointer to
  2906. // memory block which resides on the caller function's
  2907. // stack, since after this function exit, the lParam
  2908. // will become invalid and can cause fatal system
  2909. // error.
  2910. //
  2911. // If this function reason returned failed ( <= 0),
  2912. // this function (pfnPropSheetUI) will received a
  2913. // PROPSHEETUI_REASON_DESTROY function reason right
  2914. // after this function reason returned.
  2915. //
  2916. //
  2917. // PROPSHEETUI_REASON_GET_INFO_HEADER
  2918. //
  2919. // It is called after the PROPSHEETUI_REASON_INIT is
  2920. // successful returned. This reason is used to asked
  2921. // the function fill in the PROPSHEETUI_INFO_HEADER
  2922. // for pop-up the property sheet dialog boxes.
  2923. //
  2924. // lParam in this reason is a pointer to the
  2925. // PROPSHEETUI_INFO_HEADER data structure, following
  2926. // fields are requrested to be filled in.
  2927. //
  2928. // Flags - PSUIHDRF_xxx flags
  2929. // pTitle - The property sheet title
  2930. // hWndParent - handle to the parent of property
  2931. // sheet pages.
  2932. // hInst - Instance data handle for this
  2933. // function.
  2934. // hIcon
  2935. // IconID - Icon used on the title bar.
  2936. //
  2937. // * Return > 0 to indicate sucesful and pop-up the
  2938. // property sheet dialog boxes or returned <= 0 to
  2939. // indicate error (not property sheet UI appeared)
  2940. //
  2941. //
  2942. // PROPSHEETUI_REASON_DESTROY
  2943. //
  2944. // When the property sheet ready to dismissed or the
  2945. // caller is delete the common UI pages added by the
  2946. // pfnPropSheetUI(), the common UI will call this
  2947. // entry point to have it de-initialized itself and
  2948. // free up all the memory used for this function
  2949. // instance. The UserData field passed is the
  2950. // 'UserData' field which returned from previous
  2951. // PROPSHEETUI_REASON_xxxx.
  2952. //
  2953. // When this function called, all hComPropSheet's
  2954. // children are desotroyed and children's common UI
  2955. // handles are not longer valid.
  2956. //
  2957. // * Return > 0 to indicate sucesful and <= 0 to
  2958. // indicate error.
  2959. //
  2960. //
  2961. // PROPSHEETUI_REASON_SET_RESULT
  2962. //
  2963. // The reason is used when an added handle from
  2964. // CPSFUNC_ADD_xxxx whant to return the result to
  2965. // this pfnPropSheetUI() caller.
  2966. //
  2967. // The lParam in second parameter is a pointer to a
  2968. // SETRESULT_INFO data structure.
  2969. //
  2970. // hSetResult: specified the common UI property
  2971. // sheet page handle which added by
  2972. // this function using
  2973. // CPSFUNC_ADD_xxx indicies.
  2974. //
  2975. // Result: Specified the Result to be set to
  2976. // this pfnPropSheetUI() form the
  2977. // hSetResult property sheet page
  2978. // handle. If return value is greater
  2979. // than zero then the value in this
  2980. // Result field will be set to its
  2981. // parent if one exist, at this case
  2982. // this function can alter the Result
  2983. // field value for its parent.
  2984. //
  2985. // * Returned greater than zero to continue send to
  2986. // its parent, else it stop sending the Result filed
  2987. // value to its parent.
  2988. //
  2989. //
  2990. // PROPSHEETUI_REASON_GET_ICON
  2991. //
  2992. // The reason is used to retrived the Icon which
  2993. // represent this pfnPropSheetUI().
  2994. //
  2995. // lParam is a pointer to PROPSHEETUI_GETICON_INFO '
  2996. // data structure. Fields in PROPSHEETUI_GETICON_INFO
  2997. // data structure are set to following
  2998. //
  2999. // cxIcon = cx Icon size in pixel
  3000. // cyIcon = cy Icon size in pixel
  3001. // hIcon = Initial to NULL, and this function
  3002. // must put the created icon handle in
  3003. // this field before return.
  3004. //
  3005. //
  3006. // * Return > 0 to indicate sucesful (hIcon is the
  3007. // requested icon handle). Return = 0 to indicate
  3008. // no icon available, or return < 0 to indicate an
  3009. // error.
  3010. //
  3011. // *NOTE*
  3012. //
  3013. // * For all PROPSHEETUI_REASON_xxx, the function can set new
  3014. // user defined DWORD data in the PROPSHEETUI_INFO data
  3015. // structure's UserData field.
  3016. //
  3017. // * For all PROPSHEETUI_REASON_xxx, the function can set new
  3018. // pfnPropSheetUI() DWORD result in PROPSHEETUI_INFO data
  3019. // structure's Result field.
  3020. //
  3021. //
  3022. // hComPropSheet - Handle to the COMPROPSHEETPAGE which this function should
  3023. // used as hComPropSheet parameter when calling
  3024. // pfnComPropSheet() to add or delete common UI property
  3025. // sheet pages. The hComPropSheet is the instance handle to
  3026. // pfnPropSheetUI() function.
  3027. //
  3028. // pfnComPropSheet - Pointer to the common UI callback function which for the
  3029. // pfnPropSheetUI() to add, delete, set user data, for a
  3030. // completed set of callback, see CPSFUNC_xxx descriptions
  3031. // above.
  3032. //
  3033. // lParamInit - The lParam originally passed duning the the first call
  3034. // reason PROPSHEETUI_REASON_INIT. The lParamInit will be
  3035. // passed to each PROPSHEETUI_REASON_xxx calls.
  3036. //
  3037. // UserData - the UserData field is an IN and OUT parameter for each
  3038. // of the Reason,
  3039. //
  3040. // PROPSHEETUI_REASON_INIT
  3041. //
  3042. // IN: Initial set to zero (0).
  3043. //
  3044. // OUT: Specified new callee's own user data which
  3045. // will be passed back to other reason calls.
  3046. //
  3047. //
  3048. // PROPSHEETUI_REASON_DESTROY
  3049. // PROPSHEETUI_REASON_SET_RESULT
  3050. // PROPSHEETUI_REASON_GET_INFO_HEADER
  3051. //
  3052. // IN: The UserData specified at time when returned
  3053. // from the previous PROPSHEETUI_REASON_xxx
  3054. //
  3055. // OUT: Specified new callee's own user data which
  3056. // will be passed back to other reason calls.
  3057. //
  3058. //
  3059. // Result - The Result field is an IN and OUT parameter for each of
  3060. // the reason.
  3061. //
  3062. // PROPSHEETUI_REASON_INIT
  3063. //
  3064. // IN: Set to zero (0).
  3065. //
  3066. // OUT: Set to default result of this PropSheetUI()
  3067. // function.
  3068. //
  3069. //
  3070. // PROPSHEETUI_REASON_DESTROY
  3071. // PROPSHEETUI_REASON_GET_INFO_HEADER
  3072. // PROPSHEETUI_REASON_SET_RESULT
  3073. //
  3074. // IN: The current 'Result' returned from previous
  3075. // PROPSHEETUI_REASON_xxx function.
  3076. //
  3077. // OUT: Set the new result of this PropSheetUI()
  3078. // function.
  3079. //
  3080. //
  3081. #define PSUIHDRF_OBSOLETE 0x0001
  3082. #define PSUIHDRF_NOAPPLYNOW 0x0002
  3083. #define PSUIHDRF_PROPTITLE 0x0004
  3084. #define PSUIHDRF_USEHICON 0x0008
  3085. #define PSUIHDRF_DEFTITLE 0x0010
  3086. typedef struct _PROPSHEETUI_INFO_HEADER {
  3087. WORD cbSize;
  3088. WORD Flags;
  3089. LPTSTR pTitle;
  3090. HWND hWndParent;
  3091. HINSTANCE hInst;
  3092. union {
  3093. HICON hIcon;
  3094. DWORD IconID;
  3095. } DUMMYUNIONNAME;
  3096. } PROPSHEETUI_INFO_HEADER, *PPROPSHEETUI_INFO_HEADER;
  3097. //
  3098. // PROPSHEETUI_INFO_HEADER
  3099. //
  3100. // This data structure is used when common UI ready to pop-up the property
  3101. // sheet page dialog boxes and it asked caller to provide more information.
  3102. //
  3103. // Common property sheet UI passed this data structure as lParam when it call
  3104. // provided pfnPropSheetUI() with PROPSHEETUI_REASON_GET_INFO_HEADER reason.
  3105. //
  3106. //
  3107. // cbSize - size of this structure
  3108. //
  3109. // Flags - PSUIHDRF_xxxx flags
  3110. //
  3111. // PSUIHDRF_OBSOLETE
  3112. //
  3113. // Not used, must not set this bit
  3114. //
  3115. //
  3116. // PSUIHDRF_NOAPPLYNOW
  3117. //
  3118. // Remove 'Apply Now' button.
  3119. //
  3120. //
  3121. // PSUIHDRF_PROPTITLE
  3122. //
  3123. // Automatically include 'Properties' in the title bar
  3124. //
  3125. //
  3126. // PSUIHDRF_USEHICON
  3127. //
  3128. // If this bit is specified then hIcon union field is
  3129. // a valid handle to the icon otherwise the IconID is
  3130. // the either caller's resource ID or common UI standard
  3131. // icon ID.
  3132. //
  3133. // PSUIHDRF_DEFTITLE
  3134. //
  3135. // Automatically include 'Default' in the title bar, the
  3136. // 'Default' always added right after pTitle and before
  3137. // 'Properties' if PSUIHDRF_PROPTITLE flag is set.
  3138. //
  3139. // pTitle - Pointer to the NULL terminated caption name for the
  3140. // property sheets.
  3141. //
  3142. // ** See LPTSTR typedef description above
  3143. //
  3144. // hWndParent - The handle of the window which will be parent of the common
  3145. // UI property sheets, if NULL then current active window for
  3146. // the calling thread is used.
  3147. //
  3148. // hInst - the caller's handle to its instance. Commom UI use this
  3149. // handle to load caller's icon and other resources.
  3150. //
  3151. // hIcon
  3152. // IconID - Specified the icon which put on the title bar, it either a
  3153. // handle to the icon or a icon resource ID depends on the
  3154. // PSUIHDRF_USEHICON flag.
  3155. //
  3156. //
  3157. // LONG
  3158. // CommonPropertySheetUI(
  3159. // HWND hWndOwner,
  3160. // PFNPROPSHEETUI pfnPropSheetUI,
  3161. // LPARAM lParam,
  3162. // LPDWORD pResult
  3163. // );
  3164. //
  3165. //
  3166. // The CommonPropSheetUI is the main entry point for the common property sheet
  3167. // user interface. The original caller that wish to using common UI to pop-up
  3168. // property sheet will call this function and passed its own PFNPROPSHEETUI
  3169. // function address and a long parameter.
  3170. //
  3171. // If pfnPropSheetUI function return a LONG number greater than zero (0) then
  3172. // common UI will pop-up the property sheet page dialog boxes, when Property
  3173. // sheet pages is finished. (either hit Ok or Cancel) it will return the
  3174. // result of CPSUI_xxxx back to the caller.
  3175. //
  3176. // If pfnPropSheetUI function return a LONG number equal or less than zero (0)
  3177. // then it will return the CPSUI_CANCEL back to caller without pop-up the
  3178. // property sheet page dialog boxes.
  3179. //
  3180. //
  3181. // Parameters:
  3182. //
  3183. // hWndOwner - Window handle for the owner of this proerty sheet
  3184. // pages dialog boxes.
  3185. //
  3186. // pfnPropSheetUI - a PFNPROPSHEETUI function pointer which is used by
  3187. // the caller to add its property sheet pages.
  3188. //
  3189. // lParam - a long parameter will be passed to the pfnPropSheetUI
  3190. // funciton. The common UI called the pfnPropSheetUI as
  3191. //
  3192. // PROPSHEETUI_INFO PSUIInfo;
  3193. //
  3194. // pfnPropSheetUI(&PSUIInfo, lParam);
  3195. //
  3196. // The caller must use pfnComPropSheet() to add/delete
  3197. // pages. When it is done adding pages, it retuned
  3198. // greater than zero to indicate successful, and return
  3199. // less or equal to zero to indicate failure.
  3200. //
  3201. // pResult - a pointer to DWORD which received the final result
  3202. // of pfnPropSheetUI() funciton, this result is a copy
  3203. // from Result field of PROPSHEETUI_INFO data structure
  3204. // which passed to the pfnPropSheetUI() as the first
  3205. // parameter. The pResult only will be set if the
  3206. // returned value from CommonPropertySheetUI() is not
  3207. // ERR_CPSUI_xxx.
  3208. //
  3209. // if pResult is NULL then common UI will not return
  3210. // pfnPropSheetUI()'s result back.
  3211. //
  3212. //
  3213. // Return Value:
  3214. //
  3215. // LONG - < 0 - property page does not displayed and
  3216. // ERR_CPSUI_xxx is the error code
  3217. // CPSUI_OK - property page displayed.
  3218. // CPSUI_RESTARTWINDOWS - property page displayed and need to
  3219. // restart window to take effect
  3220. // CPSUI_REBOOTSYSTEM - property page dispalyed and need
  3221. // to reboot system to take effect
  3222. //
  3223. //
  3224. LONG
  3225. APIENTRY
  3226. CommonPropertySheetUIA(
  3227. HWND hWndOwner,
  3228. PFNPROPSHEETUI pfnPropSheetUI,
  3229. LPARAM lParam,
  3230. LPDWORD pResult
  3231. );
  3232. LONG
  3233. APIENTRY
  3234. CommonPropertySheetUIW(
  3235. HWND hWndOwner,
  3236. PFNPROPSHEETUI pfnPropSheetUI,
  3237. LPARAM lParam,
  3238. LPDWORD pResult
  3239. );
  3240. #ifdef UNICODE
  3241. #define CommonPropertySheetUI CommonPropertySheetUIW
  3242. #else
  3243. #define CommonPropertySheetUI CommonPropertySheetUIA
  3244. #endif
  3245. //
  3246. // GetCPSUIUserData() and SetCPSUIUserData() is used for the pages added
  3247. // by the CPSFUNC_ADD_PCOMPROPSHEETUI. The caller add this function and has
  3248. // sub class dialog procedure should not set DWL_USERDATA but calling these
  3249. // function instead, otherwise the system can failed.
  3250. //
  3251. DWORD
  3252. APIENTRY
  3253. GetCPSUIUserData(
  3254. HWND hDlg
  3255. );
  3256. BOOL
  3257. APIENTRY
  3258. SetCPSUIUserData(
  3259. HWND hDlg,
  3260. DWORD CPSUIUserData
  3261. );
  3262. #define CPSUI_CANCEL 0
  3263. #define CPSUI_OK 1
  3264. #define CPSUI_RESTARTWINDOWS 2
  3265. #define CPSUI_REBOOTSYSTEM 3
  3266. #define ERR_CPSUI_GETLASTERROR -1
  3267. #define ERR_CPSUI_ALLOCMEM_FAILED -2
  3268. #define ERR_CPSUI_INVALID_PDATA -3
  3269. #define ERR_CPSUI_INVALID_LPARAM -4
  3270. #define ERR_CPSUI_NULL_HINST -5
  3271. #define ERR_CPSUI_NULL_CALLERNAME -6
  3272. #define ERR_CPSUI_NULL_OPTITEMNAME -7
  3273. #define ERR_CPSUI_NO_PROPSHEETPAGE -8
  3274. #define ERR_CPSUI_TOO_MANY_PROPSHEETPAGES -9
  3275. #define ERR_CPSUI_CREATEPROPPAGE_FAILED -10
  3276. #define ERR_CPSUI_MORE_THAN_ONE_TVPAGE -11
  3277. #define ERR_CPSUI_MORE_THAN_ONE_STDPAGE -12
  3278. #define ERR_CPSUI_INVALID_PDLGPAGE -13
  3279. #define ERR_CPSUI_INVALID_DLGPAGE_CBSIZE -14
  3280. #define ERR_CPSUI_TOO_MANY_DLGPAGES -15
  3281. #define ERR_CPSUI_INVALID_DLGPAGEIDX -16
  3282. #define ERR_CPSUI_SUBITEM_DIFF_DLGPAGEIDX -17
  3283. #define ERR_CPSUI_NULL_POPTITEM -18
  3284. #define ERR_CPSUI_INVALID_OPTITEM_CBSIZE -19
  3285. #define ERR_CPSUI_INVALID_OPTTYPE_CBSIZE -20
  3286. #define ERR_CPSUI_INVALID_OPTTYPE_COUNT -21
  3287. #define ERR_CPSUI_NULL_POPTPARAM -22
  3288. #define ERR_CPSUI_INVALID_OPTPARAM_CBSIZE -23
  3289. #define ERR_CPSUI_INVALID_EDITBOX_PSEL -24
  3290. #define ERR_CPSUI_INVALID_EDITBOX_BUF_SIZE -25
  3291. #define ERR_CPSUI_INVALID_ECB_CBSIZE -26
  3292. #define ERR_CPSUI_NULL_ECB_PTITLE -27
  3293. #define ERR_CPSUI_NULL_ECB_PCHECKEDNAME -28
  3294. #define ERR_CPSUI_INVALID_DMPUBID -29
  3295. #define ERR_CPSUI_INVALID_DMPUB_TVOT -30
  3296. #define ERR_CPSUI_CREATE_TRACKBAR_FAILED -31
  3297. #define ERR_CPSUI_CREATE_UDARROW_FAILED -32
  3298. #define ERR_CPSUI_CREATE_IMAGELIST_FAILED -33
  3299. #define ERR_CPSUI_INVALID_TVOT_TYPE -34
  3300. #define ERR_CPSUI_INVALID_LBCB_TYPE -35
  3301. #define ERR_CPSUI_SUBITEM_DIFF_OPTIF_HIDE -36
  3302. #define ERR_CPSUI_INVALID_PUSHBUTTON_TYPE -38
  3303. #define ERR_CPSUI_INVALID_EXTPUSH_CBSIZE -39
  3304. #define ERR_CPSUI_NULL_EXTPUSH_DLGPROC -40
  3305. #define ERR_CPSUI_NO_EXTPUSH_DLGTEMPLATEID -41
  3306. #define ERR_CPSUI_NULL_EXTPUSH_CALLBACK -42
  3307. #define ERR_CPSUI_DMCOPIES_USE_EXTPUSH -43
  3308. #define ERR_CPSUI_ZERO_OPTITEM -44
  3309. #define ERR_CPSUI_FUNCTION_NOT_IMPLEMENTED -9999
  3310. #define ERR_CPSUI_INTERNAL_ERROR -10000
  3311. #endif // (!defined(RC_INVOKED))
  3312. //
  3313. //****************************************************************************
  3314. //* *
  3315. //* Common Property Sheet UI resource ID for the ICONs and STRINGs *
  3316. //* *
  3317. //* The Resource ID from 64000 to 65535 are reserved for common UI and must *
  3318. //* not used as caller resource ID else the string, icon loading will not be *
  3319. //* correct. *
  3320. //* *
  3321. //****************************************************************************
  3322. //
  3323. //
  3324. // Common UI standard 32x32, 16x16 color and monochrome Icon IDs
  3325. //
  3326. #define IDI_CPSUI_ICONID_FIRST 64000
  3327. #define IDI_CPSUI_EMPTY 64000
  3328. #define IDI_CPSUI_SEL_NONE 64001
  3329. #define IDI_CPSUI_WARNING 64002
  3330. #define IDI_CPSUI_NO 64003
  3331. #define IDI_CPSUI_YES 64004
  3332. #define IDI_CPSUI_FALSE 64005
  3333. #define IDI_CPSUI_TRUE 64006
  3334. #define IDI_CPSUI_OFF 64007
  3335. #define IDI_CPSUI_ON 64008
  3336. #define IDI_CPSUI_PAPER_OUTPUT 64009
  3337. #define IDI_CPSUI_ENVELOPE 64010
  3338. #define IDI_CPSUI_MEM 64011
  3339. #define IDI_CPSUI_FONTCARTHDR 64012
  3340. #define IDI_CPSUI_FONTCART 64013
  3341. #define IDI_CPSUI_STAPLER_ON 64014
  3342. #define IDI_CPSUI_STAPLER_OFF 64015
  3343. #define IDI_CPSUI_HT_HOST 64016
  3344. #define IDI_CPSUI_HT_DEVICE 64017
  3345. #define IDI_CPSUI_TT_PRINTASGRAPHIC 64018
  3346. #define IDI_CPSUI_TT_DOWNLOADSOFT 64019
  3347. #define IDI_CPSUI_TT_DOWNLOADVECT 64020
  3348. #define IDI_CPSUI_TT_SUBDEV 64021
  3349. #define IDI_CPSUI_PORTRAIT 64022
  3350. #define IDI_CPSUI_LANDSCAPE 64023
  3351. #define IDI_CPSUI_ROT_LAND 64024
  3352. #define IDI_CPSUI_AUTOSEL 64025
  3353. #define IDI_CPSUI_PAPER_TRAY 64026
  3354. #define IDI_CPSUI_PAPER_TRAY2 64027
  3355. #define IDI_CPSUI_PAPER_TRAY3 64028
  3356. #define IDI_CPSUI_TRANSPARENT 64029
  3357. #define IDI_CPSUI_COLLATE 64030
  3358. #define IDI_CPSUI_DUPLEX_NONE 64031
  3359. #define IDI_CPSUI_DUPLEX_HORZ 64032
  3360. #define IDI_CPSUI_DUPLEX_VERT 64033
  3361. #define IDI_CPSUI_RES_DRAFT 64034
  3362. #define IDI_CPSUI_RES_LOW 64035
  3363. #define IDI_CPSUI_RES_MEDIUM 64036
  3364. #define IDI_CPSUI_RES_HIGH 64037
  3365. #define IDI_CPSUI_RES_PRESENTATION 64038
  3366. #define IDI_CPSUI_MONO 64039
  3367. #define IDI_CPSUI_COLOR 64040
  3368. #define IDI_CPSUI_DITHER_NONE 64041
  3369. #define IDI_CPSUI_DITHER_COARSE 64042
  3370. #define IDI_CPSUI_DITHER_FINE 64043
  3371. #define IDI_CPSUI_DITHER_LINEART 64044
  3372. #define IDI_CPSUI_SCALING 64045
  3373. #define IDI_CPSUI_COPY 64046
  3374. #define IDI_CPSUI_HTCLRADJ 64047
  3375. #define IDI_CPSUI_HALFTONE_SETUP 64048
  3376. #define IDI_CPSUI_WATERMARK 64049
  3377. #define IDI_CPSUI_ERROR 64050
  3378. #define IDI_CPSUI_ICM_OPTION 64051
  3379. #define IDI_CPSUI_ICM_METHOD 64052
  3380. #define IDI_CPSUI_ICM_INTENT 64053
  3381. #define IDI_CPSUI_STD_FORM 64054
  3382. #define IDI_CPSUI_OUTBIN 64055
  3383. #define IDI_CPSUI_OUTPUT 64056
  3384. #define IDI_CPSUI_GRAPHIC 64057
  3385. #define IDI_CPSUI_ADVANCE 64058
  3386. #define IDI_CPSUI_DOCUMENT 64059
  3387. #define IDI_CPSUI_DEVICE 64060
  3388. #define IDI_CPSUI_DEVICE2 64061
  3389. #define IDI_CPSUI_PRINTER 64062
  3390. #define IDI_CPSUI_PRINTER2 64063
  3391. #define IDI_CPSUI_PRINTER3 64064
  3392. #define IDI_CPSUI_PRINTER4 64065
  3393. #define IDI_CPSUI_OPTION 64066
  3394. #define IDI_CPSUI_OPTION2 64067
  3395. #define IDI_CPSUI_STOP 64068
  3396. #define IDI_CPSUI_NOTINSTALLED 64069
  3397. #define IDI_CPSUI_WARNING_OVERLAY 64070
  3398. #define IDI_CPSUI_STOP_WARNING_OVERLAY 64071
  3399. #define IDI_CPSUI_GENERIC_OPTION 64072
  3400. #define IDI_CPSUI_GENERIC_ITEM 64073
  3401. #define IDI_CPSUI_RUN_DIALOG 64074
  3402. #define IDI_CPSUI_QUESTION 64075
  3403. #define IDI_CPSUI_FORMTRAYASSIGN 64076
  3404. #define IDI_CPSUI_PRINTER_FOLDER 64077
  3405. #define IDI_CPSUI_INSTALLABLE_OPTION 64078
  3406. #define IDI_CPSUI_PRINTER_FEATURE 64079
  3407. #define IDI_CPSUI_DEVICE_FEATURE 64080
  3408. #define IDI_CPSUI_FONTSUB 64081
  3409. #define IDI_CPSUI_POSTSCRIPT 64082
  3410. #define IDI_CPSUI_TELEPHONE 64083
  3411. #define IDI_CPSUI_DUPLEX_NONE_L 64084
  3412. #define IDI_CPSUI_DUPLEX_HORZ_L 64085
  3413. #define IDI_CPSUI_DUPLEX_VERT_L 64086
  3414. #define IDI_CPSUI_LF_PEN_PLOTTER 64087
  3415. #define IDI_CPSUI_SF_PEN_PLOTTER 64088
  3416. #define IDI_CPSUI_LF_RASTER_PLOTTER 64089
  3417. #define IDI_CPSUI_SF_RASTER_PLOTTER 64090
  3418. #define IDI_CPSUI_ROLL_PAPER 64091
  3419. #define IDI_CPSUI_PEN_CARROUSEL 64092
  3420. #define IDI_CPSUI_PLOTTER_PEN 64093
  3421. #define IDI_CPSUI_MANUAL_FEED 64094
  3422. #define IDI_CPSUI_FAX 64095
  3423. #define IDI_CPSUI_PAGE_PROTECT 64096
  3424. #define IDI_CPSUI_ENVELOPE_FEED 64097
  3425. #define IDI_CPSUI_FONTCART_SLOT 64098
  3426. #define IDI_CPSUI_ICONID_LAST 64098
  3427. //
  3428. // Common UI standard String IDs
  3429. //
  3430. #define IDS_CPSUI_STRID_FIRST 64700
  3431. #define IDS_CPSUI_SETUP 64700
  3432. #define IDS_CPSUI_MORE 64701
  3433. #define IDS_CPSUI_CHANGE 64702
  3434. #define IDS_CPSUI_OPTION 64703
  3435. #define IDS_CPSUI_OF 64704
  3436. #define IDS_CPSUI_RANGE_FROM 64705
  3437. #define IDS_CPSUI_TO 64706
  3438. #define IDS_CPSUI_COLON_SEP 64707
  3439. #define IDS_CPSUI_LEFT_ANGLE 64708
  3440. #define IDS_CPSUI_RIGHT_ANGLE 64709
  3441. #define IDS_CPSUI_SLASH_SEP 64710
  3442. #define IDS_CPSUI_PERCENT 64711
  3443. #define IDS_CPSUI_LBCB_NOSEL 64712
  3444. #define IDS_CPSUI_PROPERTIES 64713
  3445. #define IDS_CPSUI_DEFAULTDOCUMENT 64714
  3446. #define IDS_CPSUI_DOCUMENT 64715
  3447. #define IDS_CPSUI_ADVANCEDOCUMENT 64716
  3448. #define IDS_CPSUI_PRINTER 64717
  3449. #define IDS_CPSUI_AUTOSELECT 64718
  3450. #define IDS_CPSUI_PAPER_OUTPUT 64719
  3451. #define IDS_CPSUI_GRAPHIC 64720
  3452. #define IDS_CPSUI_OPTIONS 64721
  3453. #define IDS_CPSUI_ADVANCED 64722
  3454. #define IDS_CPSUI_STDDOCPROPTAB 64723
  3455. #define IDS_CPSUI_STDDOCPROPTVTAB 64724
  3456. #define IDS_CPSUI_DEVICEOPTIONS 64725
  3457. #define IDS_CPSUI_FALSE 64726
  3458. #define IDS_CPSUI_TRUE 64727
  3459. #define IDS_CPSUI_NO 64728
  3460. #define IDS_CPSUI_YES 64729
  3461. #define IDS_CPSUI_OFF 64730
  3462. #define IDS_CPSUI_ON 64731
  3463. #define IDS_CPSUI_DEFAULT 64732
  3464. #define IDS_CPSUI_ERROR 64733
  3465. #define IDS_CPSUI_NONE 64734
  3466. #define IDS_CPSUI_NOT 64735
  3467. #define IDS_CPSUI_EXIST 64736
  3468. #define IDS_CPSUI_NOTINSTALLED 64737
  3469. #define IDS_CPSUI_ORIENTATION 64738
  3470. #define IDS_CPSUI_SCALING 64739
  3471. #define IDS_CPSUI_NUM_OF_COPIES 64740
  3472. #define IDS_CPSUI_SOURCE 64741
  3473. #define IDS_CPSUI_PRINTQUALITY 64742
  3474. #define IDS_CPSUI_RESOLUTION 64743
  3475. #define IDS_CPSUI_COLOR_APPERANCE 64744
  3476. #define IDS_CPSUI_DUPLEX 64745
  3477. #define IDS_CPSUI_TTOPTION 64746
  3478. #define IDS_CPSUI_FORMNAME 64747
  3479. #define IDS_CPSUI_ICM 64748
  3480. #define IDS_CPSUI_ICMMETHOD 64749
  3481. #define IDS_CPSUI_ICMINTENT 64750
  3482. #define IDS_CPSUI_MEDIA 64751
  3483. #define IDS_CPSUI_DITHERING 64752
  3484. #define IDS_CPSUI_PORTRAIT 64753
  3485. #define IDS_CPSUI_LANDSCAPE 64754
  3486. #define IDS_CPSUI_ROT_LAND 64755
  3487. #define IDS_CPSUI_COLLATE 64756
  3488. #define IDS_CPSUI_COLLATED 64757
  3489. #define IDS_CPSUI_PRINTFLDSETTING 64758
  3490. #define IDS_CPSUI_DRAFT 64759
  3491. #define IDS_CPSUI_LOW 64760
  3492. #define IDS_CPSUI_MEDIUM 64761
  3493. #define IDS_CPSUI_HIGH 64762
  3494. #define IDS_CPSUI_PRESENTATION 64763
  3495. #define IDS_CPSUI_COLOR 64764
  3496. #define IDS_CPSUI_GRAYSCALE 64765
  3497. #define IDS_CPSUI_MONOCHROME 64766
  3498. #define IDS_CPSUI_SIMPLEX 64767
  3499. #define IDS_CPSUI_HORIZONTAL 64768
  3500. #define IDS_CPSUI_VERTICAL 64769
  3501. #define IDS_CPSUI_LONG_SIDE 64770
  3502. #define IDS_CPSUI_SHORT_SIDE 64771
  3503. #define IDS_CPSUI_TT_PRINTASGRAPHIC 64772
  3504. #define IDS_CPSUI_TT_DOWNLOADSOFT 64773
  3505. #define IDS_CPSUI_TT_DOWNLOADVECT 64774
  3506. #define IDS_CPSUI_TT_SUBDEV 64775
  3507. #define IDS_CPSUI_ICM_BLACKWHITE 64776
  3508. #define IDS_CPSUI_ICM_NO 64777
  3509. #define IDS_CPSUI_ICM_YES 64778
  3510. #define IDS_CPSUI_ICM_SATURATION 64779
  3511. #define IDS_CPSUI_ICM_CONTRAST 64780
  3512. #define IDS_CPSUI_ICM_COLORMETRIC 64781
  3513. #define IDS_CPSUI_STANDARD 64782
  3514. #define IDS_CPSUI_GLOSSY 64783
  3515. #define IDS_CPSUI_TRANSPARENCY 64784
  3516. #define IDS_CPSUI_REGULAR 64785
  3517. #define IDS_CPSUI_BOND 64786
  3518. #define IDS_CPSUI_COARSE 64787
  3519. #define IDS_CPSUI_FINE 64788
  3520. #define IDS_CPSUI_LINEART 64789
  3521. #define IDS_CPSUI_ERRDIFFUSE 64790
  3522. #define IDS_CPSUI_HALFTONE 64791
  3523. #define IDS_CPSUI_HTCLRADJ 64792
  3524. #define IDS_CPSUI_USE_HOST_HT 64793
  3525. #define IDS_CPSUI_USE_DEVICE_HT 64794
  3526. #define IDS_CPSUI_USE_PRINTER_HT 64795
  3527. #define IDS_CPSUI_OUTBINASSIGN 64796
  3528. #define IDS_CPSUI_WATERMARK 64797
  3529. #define IDS_CPSUI_FORMTRAYASSIGN 64798
  3530. #define IDS_CPSUI_UPPER_TRAY 64799
  3531. #define IDS_CPSUI_ONLYONE 64800
  3532. #define IDS_CPSUI_LOWER_TRAY 64801
  3533. #define IDS_CPSUI_MIDDLE_TRAY 64802
  3534. #define IDS_CPSUI_MANUAL_TRAY 64803
  3535. #define IDS_CPSUI_ENVELOPE_TRAY 64804
  3536. #define IDS_CPSUI_ENVMANUAL_TRAY 64805
  3537. #define IDS_CPSUI_TRACTOR_TRAY 64806
  3538. #define IDS_CPSUI_SMALLFMT_TRAY 64807
  3539. #define IDS_CPSUI_LARGEFMT_TRAY 64808
  3540. #define IDS_CPSUI_LARGECAP_TRAY 64809
  3541. #define IDS_CPSUI_CASSETTE_TRAY 64810
  3542. #define IDS_CPSUI_DEFAULT_TRAY 64811
  3543. #define IDS_CPSUI_FORMSOURCE 64812
  3544. #define IDS_CPSUI_MANUALFEED 64813
  3545. #define IDS_CPSUI_PRINTERMEM_KB 64814
  3546. #define IDS_CPSUI_PRINTERMEM_MB 64815
  3547. #define IDS_CPSUI_PAGEPROTECT 64816
  3548. #define IDS_CPSUI_HALFTONE_SETUP 64817
  3549. #define IDS_CPSUI_INSTFONTCART 64818
  3550. #define IDS_CPSUI_SLOT1 64819
  3551. #define IDS_CPSUI_SLOT2 64820
  3552. #define IDS_CPSUI_SLOT3 64821
  3553. #define IDS_CPSUI_SLOT4 64822
  3554. #define IDS_CPSUI_LEFT_SLOT 64823
  3555. #define IDS_CPSUI_RIGHT_SLOT 64824
  3556. #define IDS_CPSUI_STAPLER 64825
  3557. #define IDS_CPSUI_STAPLER_ON 64826
  3558. #define IDS_CPSUI_STAPLER_OFF 64827
  3559. #define IDS_CPSUI_STACKER 64828
  3560. #define IDS_CPSUI_MAILBOX 64829
  3561. #define IDS_CPSUI_COPY 64830
  3562. #define IDS_CPSUI_COPIES 64831
  3563. #define IDS_CPSUI_TOTAL 64832
  3564. #define IDS_CPSUI_MAKE 64833
  3565. #define IDS_CPSUI_PRINT 64834
  3566. #define IDS_CPSUI_FAX 64835
  3567. #define IDS_CPSUI_PLOT 64836
  3568. #define IDS_CPSUI_SLOW 64837
  3569. #define IDS_CPSUI_FAST 64838
  3570. #define IDS_CPSUI_ROTATED 64839
  3571. #define IDS_CPSUI_RESET 64840
  3572. #define IDS_CPSUI_ALL 64841
  3573. #define IDS_CPSUI_DEVICE 64842
  3574. #define IDS_CPSUI_SETTINGS 64843
  3575. #define IDS_CPSUI_REVERT 64844
  3576. #define IDS_CPSUI_CHANGES 64845
  3577. #define IDS_CPSUI_CHANGED 64846
  3578. #define IDS_CPSUI_WARNING 64847
  3579. #define IDS_CPSUI_ABOUT 64848
  3580. #define IDS_CPSUI_VERSION 64849
  3581. #define IDS_CPSUI_NO_NAME 64850
  3582. #define IDS_CPSUI_SETTING 64851
  3583. #define IDS_CPSUI_DEVICE_SETTINGS 64852
  3584. #define IDS_CPSUI_STRID_LAST 64852
  3585. #ifdef __cplusplus
  3586. }
  3587. #endif
  3588. #endif // _COMPSTUI