Source code of Windows XP (NT5)
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.

651 lines
21 KiB

  1. //
  2. // Internal data structures for property sheet support.
  3. //
  4. //
  5. // Wiz97 underwent a redesign between IE4 and IE5
  6. // so we have to treat them as two unrelated wizard styles that happen to
  7. // have frighteningly similar names. So prsht.h contains both
  8. // PSH_WIZARD97IE4 and PSH_WIZARD97IE5, and defines PSH_WIZARD97 to be
  9. // the one appropriate to the version of the header file being included.
  10. //
  11. // We redefine PSH_WIZARD97 to mean "Any form of Wizard97",
  12. //
  13. #undef PSH_WIZARD97
  14. #define PSH_WIZARD97 (PSH_WIZARD97IE4 | PSH_WIZARD97IE5)
  15. //
  16. // The history of PROPSHEETHEADER
  17. //
  18. // PROPSHEETHEADERSIZE_BETA
  19. //
  20. // This is the property sheet header that shipped in an early
  21. // Win95 beta (sometime between Sep 1993 and Sep 1994, maybe M5).
  22. //
  23. // It is just like the shipping Win95 property sheet header,
  24. // except that it lacks the PFNPROPSHEETCALLBACK at the end.
  25. // We grudgingly accept it but don't publicize the fact.
  26. //
  27. // For some reason, we have always supported this wacky
  28. // ancient unreleased PROPSHEETHEADER, so there's no point
  29. // in dropping support for it now... If you think it's not
  30. // worth retaining support for this ancient structure,
  31. // feel free to nuke it. But you become responsible for the
  32. // potential app compat bugs from Norton Utilities for
  33. // Windows 95 v1.0.
  34. //
  35. // PROPSHEETHEADERSIZE_V1
  36. //
  37. // This is the property sheet header that shipped in Win95,
  38. // NT4, and IE3. It is documented and lots of people use it.
  39. //
  40. // PROPSHEETHEADERSIZE_V1a
  41. //
  42. // This is an interim property sheet header that never shipped.
  43. // Support for it has been broken for a long time, so I dropped
  44. // the support altogether for IE5.
  45. //
  46. // PROPSHEETHEADERSIZE_V2
  47. //
  48. // This is the property sheet header that shipped in IE4.
  49. //
  50. #define PROPSHEETHEADERSIZE_BETA CCSIZEOF_STRUCT(PROPSHEETHEADER, H_ppsp)
  51. #define PROPSHEETHEADERSIZE_V1 CCSIZEOF_STRUCT(PROPSHEETHEADER, pfnCallback)
  52. #define PROPSHEETHEADERSIZE_V2 CCSIZEOF_STRUCT(PROPSHEETHEADER, H_pszbmHeader)
  53. #define IsValidPROPSHEETHEADERSIZE(dwSize) \
  54. ((dwSize) == PROPSHEETHEADERSIZE_BETA || \
  55. (dwSize) == PROPSHEETHEADERSIZE_V1 || \
  56. (dwSize) == PROPSHEETHEADERSIZE_V2)
  57. // PropertySheetPage structure sizes:
  58. #define MINPROPSHEETPAGESIZEA PROPSHEETPAGEA_V1_SIZE
  59. #define MINPROPSHEETPAGESIZEW PROPSHEETPAGEW_V1_SIZE
  60. #define MINPROPSHEETPAGESIZE PROPSHEETPAGE_V1_SIZE
  61. // - COMPATIBILITY CONSTRAINT -
  62. //
  63. // Shell32 prior to IE5 knows the internal structure of the HPROPSHEETPAGE,
  64. // so we have to give it what it wants. (shell32\bitbuck.c, docfind2.c)
  65. //
  66. // Win95 Golden - Shell32 expects the HPROPSHEETPAGE to be equal to
  67. // the lParam that is passed to the dialog proc's WM_INITDIALOG.
  68. // No special flags are passed in the PROPSHEETPAGE to indicate
  69. // that this assumption is being made.
  70. //
  71. // Win95 IE4 Integrated - Same as Win95 Golden, except that
  72. // the shell sets the PSP_SHPAGE bit in the PROPSHEETPAGE.dwFlags
  73. // to indicate that it wants this wacky behavior.
  74. //
  75. // WinNT Golden - Shell32 expects the HPROPSHEETPAGE to be equal
  76. // to a pointer to the internal PSP structure used by WinNT golden.
  77. // The internal PSP structure looked like a PROPSHEETPAGE, except
  78. // that it had two fields stuck in front. (One DWORD and one pointer.)
  79. // The NT shell passes the PSP_SHPAGE flag.
  80. //
  81. // WinNT IE4 Integrated - Same as WinNT Golden.
  82. //
  83. // Furthermore, all versions of Shell32 prior to IE5 call the internal
  84. // CreatePage function (shell32\docfind2.c)
  85. //
  86. // - Summary -
  87. //
  88. // passes expected expects
  89. // PSP_SHPAGE PSP CLASSICPREFIX
  90. // --------- ------- -------------
  91. // 95 Gold ANSI
  92. // 95/IE4 * ANSI
  93. // NT Gold * UNI *
  94. // NT/IE4 * UNI *
  95. //
  96. // Note that Win95 Gold does not set the PSP_SHPAGE flag, so we have
  97. // to assume that any ANSI caller might be a Win95 Gold shell32.
  98. //
  99. // WinNT is easier. We return the WinNT Golden UNICODE version of
  100. // the PSP if (and only if) the PSP_SHPAGE flag is set.
  101. //
  102. // The PSP_SHPAGE flag has been removed from the header file so nobody
  103. // can pass it ever again.
  104. //
  105. // So our structures look like this. The bracketed section is the
  106. // the memory block passed by the app to CreatePropertySheetPage
  107. // and whose layout cannot be altered.
  108. //
  109. // ANSI Comctl32, ANSI application:
  110. //
  111. // +---------------+
  112. // | PAGEPREFIX |
  113. // hpage95->/+---------------+
  114. // / | PROPSHEETPAGE |
  115. // | | (ANSI) |
  116. // | | |
  117. // | +---------------+
  118. // | | |
  119. // | | app goo |
  120. // \ | |
  121. // \+---------------+
  122. //
  123. // UNICODE Comctl32, ANSI application.
  124. //
  125. //
  126. // The authoritative page The shadow page
  127. //
  128. // +---------------+ + - - - - - - - +
  129. // | PAGEPREFIX | | PAGEPREFIX |
  130. // +---------------+ +---------------+ <- hpageNT
  131. // | CLASSICPREFIX |<-\/-----| CLASSICPREFIX |
  132. // +---------------+<-/\---->+---------------+\<- hpage95
  133. // | PROPSHEETPAGE | | PROPSHEETPAGE | \
  134. // | (UNICODE) | | (ANSI) | |
  135. // | | | | |
  136. // +---------------+ +---------------+ |
  137. // | | |
  138. // | app goo | |
  139. // | | /
  140. // +---------------+/
  141. //
  142. // (The dotted line around PAGEPREFIX
  143. // means that it is allocated but unused.)
  144. //
  145. //
  146. // UNICODE Comctl32, UNICODE application.
  147. //
  148. // +---------------+
  149. // | PAGEPREFIX |
  150. // hpageNT-> +---------------+
  151. // | CLASSICPREFIX |
  152. // hpage95->/+---------------+
  153. // / | PROPSHEETPAGE |
  154. // | | (UNICODE) |
  155. // | | |
  156. // | +---------------+
  157. // | | |
  158. // | | app goo |
  159. // \ | |
  160. // \+---------------+
  161. //
  162. // Are we confused yet? Let's try to explain.
  163. //
  164. // REQUIREMENT
  165. //
  166. // The app goo must be kept in the structure
  167. // corresponding to the character set of the application.
  168. //
  169. // Notice that if the application is ANSI, then the app goo
  170. // is kept with the ANSI version of PROPSHEETPAGE. If the
  171. // application is UNICODE, then the app goo is kept with the
  172. // UNICODE version of the PROPSHEETPAGE.
  173. //
  174. // It doesn't hurt to "accidentally" put a copy of the app goo
  175. // on the version the app doesn't use; that just wastes memory.
  176. //
  177. // REQUIREMENT
  178. //
  179. // If a UNICODE app passed PSP_SHPAGE, then the hpage must
  180. // point to the CLASSICPREFIX structure.
  181. //
  182. // To simplify matters (like HPROPSHEETPAGE validation), we
  183. // apply this rule even if the app didn't pass PSP_SHPAGE.
  184. //
  185. // DESIGN
  186. //
  187. // If the app is ANSI and we support UNICODE, then we create
  188. // a UNICODE copy of the ANSI property sheet structure,
  189. // and the ANSI PROPSHEETPAGE becomes a "shadow".
  190. // The UNICODE copy does not need to carry the app goo
  191. // since it will never be seen by the app.
  192. //
  193. // REQUIREMENT
  194. //
  195. // If an ANSI app creates a property sheet page, then the hpage
  196. // must point to the ANSI version of the PROPSHEETPAGE.
  197. // (Because the app might be shell32.)
  198. //
  199. // >> CAUTION <<
  200. //
  201. // The requirements on hpages rule means that any time an hpage
  202. // comes in from the outside world, we need to sniff it and decide
  203. // if it's the UNICODE version or the ANSI version; if it's
  204. // the ANSI version, then we switch the pointer to point to
  205. // the UNICODE version instead.
  206. //
  207. // REMARK
  208. //
  209. // Internally, we use only the UNICODE version of the PROPSHEETPAGE.
  210. // (Unless we're building Win95 ANSI-only, duh.) The ANSI version
  211. // (the "shadow") is just for show to keep the app happy. It is
  212. // the UNICODE version that is authoritative.
  213. //
  214. // Only the authoritative PROPSHEETPAGE needs to have the PAGEPREFIX,
  215. // but we put one on both sides to simplify memory management,
  216. // because it means that all PROPSHEETPAGEs look the same (both
  217. // authoritative and shadow).
  218. #define PSP_SHPAGE 0x00000200 // Ewww; see above
  219. #ifdef UNICODE
  220. //
  221. // CLASSICPREFIX
  222. //
  223. // This structure is allocated ahead of the PROPSHEETPAGE when we
  224. // create an HPROPSHEETPAGE. See the diagrams above. Sometimes
  225. // the HPROPSHEETPAGE points to this structure, sometimes it doesn't.
  226. // See the diagrams above.
  227. //
  228. // This structure can never change, due to backwards compatibility
  229. // constraints described above. (Okay, you can change it once you
  230. // decide to drop support for versions of NT less than 5, like that'll
  231. // ever happen.)
  232. //
  233. // pispMain
  234. //
  235. // Points to the main copy of the HPROPSHEETPAGE.
  236. //
  237. // pispShadow
  238. //
  239. // Points to that shadow copy of the HPROPSHEETPAGE, or NULL if
  240. // there is no shadow copy.
  241. typedef struct CLASSICPREFIX {
  242. union ISP *pispMain;
  243. union ISP *pispShadow;
  244. } CLASSICPREFIX, *PCLASSICPREFIX;
  245. #endif // UNICODE
  246. //
  247. // PAGEPREFIX
  248. //
  249. // Stuff that we track which isn't part of the CLASSICPREFIX.
  250. //
  251. // hpage is the HPROPSHEETPAGE that we give out to applications.
  252. //
  253. typedef struct PAGEPREFIX {
  254. HPROPSHEETPAGE hpage;
  255. DWORD dwInternalFlags;
  256. SIZE siz; // Page ideal size
  257. } PAGEPREFIX, *PPAGEPREFIX;
  258. //
  259. // Flag values for dwInternalFlags
  260. //
  261. #define PSPI_WX86 1
  262. #define PSPI_FETCHEDICON 2 // For debugging (GetPageInfoEx)
  263. #define PSPI_SIZEMASK 0xFFFF0000
  264. //
  265. // _PSP
  266. //
  267. // This is the structure than the compiler thinks an HPROPSHEETPAGE
  268. // points to. To make sure all our code goes through
  269. // InternalizeHPROPSHEETPAGE on the way in and
  270. // ExternalizeHPROPSHEETPAGE on the way out, we intentionally leave
  271. // it undefined.
  272. typedef struct _PSP PSP, *PPSP;
  273. //
  274. // ISP - Internal Sheet Page
  275. //
  276. // Our internal structure for tracking property sheet pages. This
  277. // is also what a native-character set HPROPSHEETPAGE points to.
  278. //
  279. // Note the "union with an array of one element that we index with
  280. // the value -1 in order to access it at negative offsets" trick.
  281. //
  282. // Note also that the CLASSICPREFIX goes above the HPROPSHEETPAGE
  283. // on Win95, but below it on WinNT. See discussion at the top of this
  284. // file.
  285. //
  286. // To save all the typing of union names and [-1]'s, access to fields
  287. // of an IPSP are encapsulated inside the _psp, _cpfx, and _pfx macros.
  288. typedef union ISP {
  289. struct {
  290. PAGEPREFIX pfx; // lives above the HPROPSHEETPAGE
  291. #ifdef UNICODE_WIN9x
  292. CLASSICPREFIX cpfx; // lives above the HPROPSHEETPAGE
  293. #endif
  294. } above[1];
  295. struct {
  296. #ifdef WINNT
  297. CLASSICPREFIX cpfx; // lives below the HPROPSHEETPAGE
  298. #endif
  299. PROPSHEETPAGE psp; // lives below the HPROPSHEETPAGE
  300. } below;
  301. } ISP, *PISP;
  302. #define _pfx above[-1].pfx
  303. #define _psp below.psp
  304. #ifdef WINNT
  305. #define _cpfx below.cpfx
  306. #else
  307. #define _cpfx above[-1].cpfx
  308. #endif
  309. #define GETORIGINALSIZE(psp) (((psp)->_pfx.dwInternalFlags & PSPI_SIZEMASK) >> 16)
  310. #define SETORIGINALSIZE(psp, iSize) ((psp)->_pfx.dwInternalFlags |= (iSize << 16))
  311. #define PropSheetBase(pisp) ((LPBYTE)(pisp) - sizeof((PISP)pisp)->above)
  312. //
  313. // Converting an HPROPSHEETPAGE into a PSP means sniffing at the
  314. // _cpfx.dwFlags and seeing if it's an ANSI page or a UNICODE page.
  315. //
  316. __inline
  317. PISP
  318. InternalizeHPROPSHEETPAGE(HPROPSHEETPAGE hpage)
  319. {
  320. PISP pisp = (PISP)hpage;
  321. #ifdef UNICODE
  322. return pisp->_cpfx.pispMain;
  323. #else // !UNICODE
  324. // ANSI Comctl32's HPROPSHEETPAGE is the real thing
  325. return pisp;
  326. #endif
  327. }
  328. #ifdef UNICODE
  329. #define ExternalizeHPROPSHEETPAGE(pisp) ((pisp)->_pfx.hpage)
  330. #else
  331. #define ExternalizeHPROPSHEETPAGE(pisp) ((HPROPSHEETPAGE)(pisp))
  332. #endif
  333. //
  334. // Used for GetPageInfo(), prpage.c
  335. //
  336. typedef struct {
  337. short PointSize;
  338. WCHAR szFace[LF_FACESIZE];
  339. BOOL bItalic;
  340. int iCharset;
  341. } PAGEFONTDATA, * PPAGEFONTDATA;
  342. //
  343. // PROPDATA
  344. //
  345. // The state of a property sheet.
  346. //
  347. typedef struct
  348. {
  349. HWND hDlg; // the dialog for this instance data
  350. PROPSHEETHEADER psh;
  351. HWND hwndCurPage; // current page hwnd
  352. HWND hwndTabs; // tab control window
  353. int nCurItem; // index of current item in tab control
  354. int idDefaultFallback; // the default id to set as DEFID if page doesn't have one
  355. int nReturn;
  356. UINT nRestart;
  357. int xSubDlg, ySubDlg; // dimensions of sub dialog
  358. int cxSubDlg, cySubDlg;
  359. BOOL fFlags;
  360. BOOL fFlipped; // Property sheet not mirrored but with flipped buttons
  361. // Wizard97 IE4 vs. IE5 discrepancy:
  362. //
  363. // Wizard 97 IE4 - "watermark" refers to the bitmap that is used to
  364. // paint the background of the dialog.
  365. // Wizard 97 IE5 - "watermark" refers to the bitmap that goes on
  366. // on the left-hand side of Welcome/Finish screens.
  367. //
  368. HBITMAP hbmWatermark;
  369. HBRUSH hbrWatermark;
  370. HPALETTE hplWatermark;
  371. int cyHeaderHeight;
  372. HFONT hFontBold;
  373. HBITMAP hbmHeader;
  374. HBRUSH hbrHeader;
  375. int ySubTitle; // The subtitle's starting Y position
  376. BOOL fAllowApply;
  377. // These fields are used by MLUI
  378. LANGID wFrameLang; // langid of propsheet frame
  379. int iFrameCharset; // charset of propsheet frame
  380. // These fields cache font metric information
  381. PAGEFONTDATA pfdCache; // Cached font descriptor
  382. SIZE sizCache; // Cached height and width go here
  383. SIZE sizMin; // Smallest we allow pages to get
  384. HPROPSHEETPAGE rghpage[MAXPROPPAGES];
  385. } PROPDATA, *LPPROPDATA;
  386. // defines for fFlags
  387. #define PD_NOERASE 0x0001
  388. #define PD_CANCELTOCLOSE 0x0002
  389. #define PD_DESTROY 0x0004
  390. #define PD_WX86 0x0008
  391. #define PD_FREETITLE 0x0010
  392. #define PD_SHELLFONT 0x0020 // Is the frame using SHELLFONT?
  393. #define PD_NEEDSHADOW 0x0040
  394. //
  395. // Helper macros
  396. //
  397. // UNIX does not support dummy unions, so we have to say
  398. // DUMMYUNION<n>_MEMBER all over the place.
  399. // So all these underscore macros do the grunky work for us.
  400. //
  401. // H_blah means "the field in the PROPSHEETHEADER named blah".
  402. // P_blah means "the field in the PROPSHEETPAGE named blah".
  403. //
  404. //
  405. #define H_hIcon DUMMYUNION_MEMBER(hIcon)
  406. #define H_pszIcon DUMMYUNION_MEMBER(pszIcon)
  407. #define H_nStartPage DUMMYUNION2_MEMBER(nStartPage)
  408. #define H_pStartPage DUMMYUNION2_MEMBER(pStartPage)
  409. #define H_phpage DUMMYUNION3_MEMBER(phpage)
  410. #define H_ppsp DUMMYUNION3_MEMBER(ppsp)
  411. #define H_hbmWatermark DUMMYUNION4_MEMBER(hbmWatermark)
  412. #define H_pszbmWatermark DUMMYUNION4_MEMBER(pszbmWatermark)
  413. #define H_hbmHeader DUMMYUNION5_MEMBER(hbmHeader)
  414. #define H_pszbmHeader DUMMYUNION5_MEMBER(pszbmHeader)
  415. #define P_pszTemplate DUMMYUNION_MEMBER(pszTemplate)
  416. #define P_pResource DUMMYUNION_MEMBER(pResource)
  417. #define P_hIcon DUMMYUNION2_MEMBER(hIcon)
  418. #define P_pszIcon DUMMYUNION2_MEMBER(pszIcon)
  419. //
  420. // HASCALLBACK - We should call the callback for this page.
  421. //
  422. #define HASCALLBACK(pisp) \
  423. (((pisp)->_psp.dwFlags & PSP_USECALLBACK) && \
  424. (pisp)->_psp.pfnCallback)
  425. //
  426. // HASREFPARENT - We should adjust the pcRefParent for this page.
  427. //
  428. #define HASREFPARENT(pisp) \
  429. (((pisp)->_psp.dwFlags & PSP_USEREFPARENT) && \
  430. (pisp)->_psp.pcRefParent)
  431. //
  432. // HASHEADERTITLE - We should display a header title for this page.
  433. //
  434. #define HASHEADERTITLE(pisp) \
  435. (((pisp)->_psp.dwFlags & PSP_USEHEADERTITLE) && \
  436. (pisp)->_psp.pszHeaderTitle)
  437. //
  438. // HASHEADERSUBTITLE - We should display a header subtitle for this page.
  439. //
  440. #define HASHEADERSUBTITLE(pisp) \
  441. (((pisp)->_psp.dwFlags & PSP_USEHEADERSUBTITLE) && \
  442. (pisp)->_psp.pszHeaderSubTitle)
  443. //
  444. // GETPISP - Obtain the PISP for this page. Once they have been
  445. // placed into the H_phpage, all the HPROPSHEETPAGEs are
  446. // already internalized, so we can just cast them over.
  447. //
  448. #define GETPISP(ppd, i) ((PISP)(ppd)->psh.H_phpage[i])
  449. //
  450. // SETPISP - Change the PISP for this page.
  451. //
  452. #define SETPISP(ppd, i, v) ((ppd)->psh.H_phpage[i] = (HPROPSHEETPAGE)(v))
  453. //
  454. // GETHPAGE - Obtain the external HPROPSHEETPAGE for this page.
  455. //
  456. #define GETHPAGE(ppd, i) ExternalizeHPROPSHEETPAGE(GETPISP(ppd, i))
  457. //
  458. // GETPPSP - Obtain the PPSP for this page. We get the PISP
  459. // and then retrieve the PROPSHEETHEADER part.
  460. //
  461. #define GETPPSP(ppd, i) (&GETPISP(ppd, i)->_psp)
  462. //
  463. // HASANSISHADOW
  464. //
  465. // Does this authoritative property sheet page have an ANSI shadow?
  466. //
  467. // If we are built ANSI, then the canonical PSP is equal to the
  468. // ANSI version, so there is no shadow. (It's already the real thing.)
  469. //
  470. #ifdef UNICODE
  471. #define HASANSISHADOW(pisp) ((pisp)->_cpfx.pispShadow)
  472. #else
  473. #define HASANSISHADOW(pisp) FALSE
  474. #endif
  475. //
  476. // HIDEWIZ97HEADER
  477. //
  478. // Nonzero if we are a WIZARD97 property sheet but we should
  479. // hide the header for this page.
  480. #define HIDEWIZ97HEADER(ppd, i) \
  481. (((ppd)->psh.dwFlags & PSH_WIZARD97) && \
  482. (GETPPSP(ppd, i)->dwFlags & PSP_HIDEHEADER))
  483. //
  484. // Stub macros so we don't have to put "#ifdef BIG_ENDIAN" everywhere.
  485. //
  486. #ifndef BIG_ENDIAN
  487. #define MwReadDWORD(lpByte) *(LPDWORD)(lpByte)
  488. #define MwWriteDWORD(lpByte, dwValue) *(LPDWORD)(lpByte) = dwValue
  489. #endif
  490. //
  491. // End of helper macros
  492. //
  493. //
  494. // Functions shared between prsht.c and prpage.c
  495. //
  496. PISP AllocPropertySheetPage(DWORD dwClientSize);
  497. HWND _CreatePage(LPPROPDATA ppd, PISP pisp, HWND hwndParent, LANGID langidMUI);
  498. HPROPSHEETPAGE WINAPI _CreatePropertySheetPage(LPCPROPSHEETPAGE psp, BOOL fNeedShadow, BOOL fWx86);
  499. #ifdef UNICODE
  500. HPROPSHEETPAGE WINAPI _Hijaak95Hack(LPPROPDATA ppd, HPROPSHEETPAGE hpage);
  501. #else
  502. #define _Hijaak95Hack(ppd, hpage) hpage
  503. #endif
  504. typedef LPTSTR (STDMETHODCALLTYPE *STRDUPPROC)(LPCTSTR ptsz);
  505. BOOL CopyPropertyPageStrings(LPPROPSHEETPAGE ppsp, STRDUPPROC pfnStrDup);
  506. void FreePropertyPageStrings(LPCPROPSHEETPAGE ppsp);
  507. BOOL ThunkPropSheetHeaderAtoW (LPCPROPSHEETHEADERA ppshA,
  508. LPPROPSHEETHEADERW ppsh);
  509. void FreePropSheetHeaderW(LPPROPSHEETHEADERW ppsh);
  510. STDAPI_(LPTSTR) StrDup_AtoW(LPCTSTR ptsz);
  511. typedef struct
  512. {
  513. POINT pt; // Dialog box dimensions (DLU)
  514. HICON hIcon; // Page icon
  515. PAGEFONTDATA pfd; // Font info
  516. #ifdef WINDOWS_ME
  517. BOOL bRTL; // If tab caption should be right to left reading
  518. #endif
  519. BOOL bMirrored; // if the page contains mirroring flags
  520. BOOL bDialogEx; // Is it a DIALOGEX?
  521. DWORD dwStyle; // Dialog style
  522. TCHAR szCaption[128 + 50]; // Caption as stored in template
  523. } PAGEINFOEX;
  524. //
  525. // These flags control which parts of the PAGEINFOEX get filled in.
  526. //
  527. #define GPI_PT 0x0000 // so cheap, we always fetch it
  528. #define GPI_ICON 0x0001
  529. #define GPI_FONT 0x0002 // PAGEFONTDATA
  530. #define GPI_BRTL 0x0000 // so cheap, we always fetch it
  531. #define GPI_BMIRROR 0x0000 // so cheap, we always fetch it
  532. #define GPI_DIALOGEX 0x0000 // so cheap, we always fetch it
  533. #define GPI_CAPTION 0x0004
  534. #define GPI_ALL 0x0007
  535. BOOL WINAPI GetPageInfoEx(LPPROPDATA ppd, PISP pisp, PAGEINFOEX *ppi, LANGID langidMUI, DWORD flags);
  536. // SHELLFONT means that you are a DIALOGEX and have the DS_SHELLFONT bits set
  537. // Although this is supported only on NT5, the flag is still meaningful on
  538. // Win9x to indicate an implicit PSH_USEPAGEFONT.
  539. #define IsPageInfoSHELLFONT(ppi) \
  540. ((ppi)->bDialogEx && DS_SHELLFONT == (DS_SHELLFONT & (ppi)->dwStyle))
  541. // Prsht_PrepareTemplate operating systems types
  542. // Used as array indices. Be careful !!
  543. typedef enum {
  544. PSPT_OS_WIN95_BIDI, // Win95 BiDi
  545. PSPT_OS_WIN98_BIDI, // Win98 BiDi (Or Higher)
  546. PSPT_OS_WINNT4_ENA, // WinNT4 BiDi Ena, No Winnt4 BiDi loc
  547. PSPT_OS_WINNT5, // WinNT5 (Or Higher)
  548. PSPT_OS_OTHER, // Anything else ....
  549. PSPT_OS_MAX
  550. } PSPT_OS;
  551. // Prsht_PrepareTemplate property sheet type
  552. // Used as array indices. Be careful !!
  553. typedef enum {
  554. PSPT_TYPE_MIRRORED, // Mirrored first page OR mirrored Process
  555. PSPT_TYPE_ENABLED, // First page Language is BiDi
  556. PSPT_TYPE_ENGLISH, // Anything else ....
  557. PSPT_TYPE_MAX
  558. } PSPT_TYPE;
  559. // Prsht_PrepareTemplate property sheet default behavior override
  560. // Used as array indices. Be careful !!
  561. typedef enum {
  562. PSPT_OVERRIDE_NOOVERRIDE,
  563. PSPT_OVERRIDE_USEPAGELANG, // Overridden by PSH_USEPAGELANG
  564. PSPT_OVERRIDE_MAX
  565. } PSPT_OVERRIDE;
  566. // Prsht_PrepareTemplate Preparation action
  567. typedef enum {
  568. PSPT_ACTION_NOACTION, // Don't touch whatever you've passed
  569. PSPT_ACTION_NOMIRRORING, // Turn off mirroring
  570. PSPT_ACTION_FLIP, // Turn off mirroring and flip
  571. PSPT_ACTION_LOADENGLISH, // load English template
  572. PSPT_ACTION_WIN9XCOMPAT // Tags the templae with DS_BIDI_RTL for Win9x compat
  573. } PSPT_ACTION;