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

624 lines
21 KiB

  1. //
  2. // Internal data structures for property sheet support.
  3. //
  4. //
  5. // Sigh. 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. //
  220. // CLASSICPREFIX
  221. //
  222. // This structure is allocated ahead of the PROPSHEETPAGE when we
  223. // create an HPROPSHEETPAGE. See the diagrams above. Sometimes
  224. // the HPROPSHEETPAGE points to this structure, sometimes it doesn't.
  225. // See the diagrams above.
  226. //
  227. // This structure can never change, due to backwards compatibility
  228. // constraints described above. (Okay, you can change it once you
  229. // decide to drop support for versions of NT less than 5, like that'll
  230. // ever happen.)
  231. //
  232. // pispMain
  233. //
  234. // Points to the main copy of the HPROPSHEETPAGE.
  235. //
  236. // pispShadow
  237. //
  238. // Points to that shadow copy of the HPROPSHEETPAGE, or NULL if
  239. // there is no shadow copy.
  240. typedef struct CLASSICPREFIX
  241. {
  242. union ISP *pispMain;
  243. union ISP *pispShadow;
  244. } CLASSICPREFIX, *PCLASSICPREFIX;
  245. //
  246. // PAGEPREFIX
  247. //
  248. // Stuff that we track which isn't part of the CLASSICPREFIX.
  249. //
  250. // hpage is the HPROPSHEETPAGE that we give out to applications.
  251. //
  252. typedef struct PAGEPREFIX
  253. {
  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. {
  290. struct
  291. {
  292. PAGEPREFIX pfx; // lives above the HPROPSHEETPAGE
  293. } above[1];
  294. struct
  295. {
  296. CLASSICPREFIX cpfx; // lives below the HPROPSHEETPAGE
  297. PROPSHEETPAGE psp; // lives below the HPROPSHEETPAGE
  298. } below;
  299. } ISP, *PISP;
  300. #define _pfx above[-1].pfx
  301. #define _psp below.psp
  302. #define _cpfx below.cpfx
  303. #define GETORIGINALSIZE(psp) (((psp)->_pfx.dwInternalFlags & PSPI_SIZEMASK) >> 16)
  304. #define SETORIGINALSIZE(psp, iSize) ((psp)->_pfx.dwInternalFlags |= (iSize << 16))
  305. #define PropSheetBase(pisp) ((LPBYTE)(pisp) - sizeof((PISP)pisp)->above)
  306. //
  307. // Converting an HPROPSHEETPAGE into a PSP means sniffing at the
  308. // _cpfx.dwFlags and seeing if it's an ANSI page or a UNICODE page.
  309. //
  310. __inline
  311. PISP
  312. InternalizeHPROPSHEETPAGE(HPROPSHEETPAGE hpage)
  313. {
  314. PISP pisp = (PISP)hpage;
  315. return pisp->_cpfx.pispMain;
  316. }
  317. #define ExternalizeHPROPSHEETPAGE(pisp) ((pisp)->_pfx.hpage)
  318. //
  319. // Used for GetPageInfo(), prpage.c
  320. //
  321. typedef struct {
  322. short PointSize;
  323. WCHAR szFace[LF_FACESIZE];
  324. BOOL bItalic;
  325. int iCharset;
  326. } PAGEFONTDATA, * PPAGEFONTDATA;
  327. //
  328. // PROPDATA
  329. //
  330. // The state of a property sheet.
  331. //
  332. typedef struct
  333. {
  334. HWND hDlg; // the dialog for this instance data
  335. PROPSHEETHEADER psh;
  336. HWND hwndCurPage; // current page hwnd
  337. HWND hwndTabs; // tab control window
  338. int nCurItem; // index of current item in tab control
  339. int idDefaultFallback; // the default id to set as DEFID if page doesn't have one
  340. int nReturn;
  341. UINT nRestart;
  342. int xSubDlg, ySubDlg; // dimensions of sub dialog
  343. int cxSubDlg, cySubDlg;
  344. BOOL fFlags;
  345. BOOL fFlipped; // Property sheet not mirrored but with flipped buttons
  346. // Wizard97 IE4 vs. IE5 discrepancy:
  347. //
  348. // Wizard 97 IE4 - "watermark" refers to the bitmap that is used to
  349. // paint the background of the dialog.
  350. // Wizard 97 IE5 - "watermark" refers to the bitmap that goes on
  351. // on the left-hand side of Welcome/Finish screens.
  352. //
  353. HBITMAP hbmWatermark;
  354. HBRUSH hbrWatermark;
  355. HPALETTE hplWatermark;
  356. int cyHeaderHeight;
  357. HFONT hFontBold;
  358. HBITMAP hbmHeader;
  359. HBRUSH hbrHeader;
  360. int ySubTitle; // The subtitle's starting Y position
  361. BOOL fAllowApply;
  362. // These fields are used by MLUI
  363. LANGID wFrameLang; // langid of propsheet frame
  364. int iFrameCharset; // charset of propsheet frame
  365. // These fields cache font metric information
  366. PAGEFONTDATA pfdCache; // Cached font descriptor
  367. SIZE sizCache; // Cached height and width go here
  368. SIZE sizMin; // Smallest we allow pages to get
  369. HPROPSHEETPAGE rghpage[MAXPROPPAGES];
  370. HANDLE hActCtxInit;
  371. } PROPDATA, *LPPROPDATA;
  372. // defines for fFlags
  373. #define PD_NOERASE 0x0001
  374. #define PD_CANCELTOCLOSE 0x0002
  375. #define PD_DESTROY 0x0004
  376. #define PD_WX86 0x0008
  377. #define PD_FREETITLE 0x0010
  378. #define PD_SHELLFONT 0x0020 // Is the frame using SHELLFONT?
  379. #define PD_NEEDSHADOW 0x0040
  380. //
  381. // Helper macros
  382. //
  383. // H_blah means "the field in the PROPSHEETHEADER named blah".
  384. // P_blah means "the field in the PROPSHEETPAGE named blah".
  385. //
  386. //
  387. #define H_hIcon DUMMYUNION_MEMBER(hIcon)
  388. #define H_pszIcon DUMMYUNION_MEMBER(pszIcon)
  389. #define H_nStartPage DUMMYUNION2_MEMBER(nStartPage)
  390. #define H_pStartPage DUMMYUNION2_MEMBER(pStartPage)
  391. #define H_phpage DUMMYUNION3_MEMBER(phpage)
  392. #define H_ppsp DUMMYUNION3_MEMBER(ppsp)
  393. #define H_hbmWatermark DUMMYUNION4_MEMBER(hbmWatermark)
  394. #define H_pszbmWatermark DUMMYUNION4_MEMBER(pszbmWatermark)
  395. #define H_hbmHeader DUMMYUNION5_MEMBER(hbmHeader)
  396. #define H_pszbmHeader DUMMYUNION5_MEMBER(pszbmHeader)
  397. #define P_pszTemplate DUMMYUNION_MEMBER(pszTemplate)
  398. #define P_pResource DUMMYUNION_MEMBER(pResource)
  399. #define P_hIcon DUMMYUNION2_MEMBER(hIcon)
  400. #define P_pszIcon DUMMYUNION2_MEMBER(pszIcon)
  401. //
  402. // HASCALLBACK - We should call the callback for this page.
  403. //
  404. #define HASCALLBACK(pisp) \
  405. (((pisp)->_psp.dwFlags & PSP_USECALLBACK) && \
  406. (pisp)->_psp.pfnCallback)
  407. //
  408. // HASREFPARENT - We should adjust the pcRefParent for this page.
  409. //
  410. #define HASREFPARENT(pisp) \
  411. (((pisp)->_psp.dwFlags & PSP_USEREFPARENT) && \
  412. (pisp)->_psp.pcRefParent)
  413. //
  414. // HASHEADERTITLE - We should display a header title for this page.
  415. //
  416. #define HASHEADERTITLE(pisp) \
  417. (((pisp)->_psp.dwFlags & PSP_USEHEADERTITLE) && \
  418. (pisp)->_psp.pszHeaderTitle)
  419. //
  420. // HASHEADERSUBTITLE - We should display a header subtitle for this page.
  421. //
  422. #define HASHEADERSUBTITLE(pisp) \
  423. (((pisp)->_psp.dwFlags & PSP_USEHEADERSUBTITLE) && \
  424. (pisp)->_psp.pszHeaderSubTitle)
  425. //
  426. // GETPISP - Obtain the PISP for this page. Once they have been
  427. // placed into the H_phpage, all the HPROPSHEETPAGEs are
  428. // already internalized, so we can just cast them over.
  429. //
  430. #define GETPISP(ppd, i) ((PISP)(ppd)->psh.H_phpage[i])
  431. //
  432. // SETPISP - Change the PISP for this page.
  433. //
  434. #define SETPISP(ppd, i, v) ((ppd)->psh.H_phpage[i] = (HPROPSHEETPAGE)(v))
  435. //
  436. // GETHPAGE - Obtain the external HPROPSHEETPAGE for this page.
  437. //
  438. #define GETHPAGE(ppd, i) ExternalizeHPROPSHEETPAGE(GETPISP(ppd, i))
  439. //
  440. // GETPPSP - Obtain the PPSP for this page. We get the PISP
  441. // and then retrieve the PROPSHEETHEADER part.
  442. //
  443. #define GETPPSP(ppd, i) (&GETPISP(ppd, i)->_psp)
  444. //
  445. // HASANSISHADOW
  446. //
  447. // Does this authoritative property sheet page have an ANSI shadow?
  448. //
  449. // If we are built ANSI, then the canonical PSP is equal to the
  450. // ANSI version, so there is no shadow. (It's already the real thing.)
  451. //
  452. #define HASANSISHADOW(pisp) ((pisp)->_cpfx.pispShadow)
  453. //
  454. // HIDEWIZ97HEADER
  455. //
  456. // Nonzero if we are a WIZARD97 property sheet but we should
  457. // hide the header for this page.
  458. #define HIDEWIZ97HEADER(ppd, i) \
  459. (((ppd)->psh.dwFlags & PSH_WIZARD97) && \
  460. (GETPPSP(ppd, i)->dwFlags & PSP_HIDEHEADER))
  461. //
  462. // Stub macros so we don't have to put "#ifdef BIG_ENDIAN" everywhere.
  463. //
  464. #ifndef BIG_ENDIAN
  465. #define MwReadDWORD(lpByte) *(LPDWORD)(lpByte)
  466. #define MwWriteDWORD(lpByte, dwValue) *(LPDWORD)(lpByte) = dwValue
  467. #endif
  468. //
  469. // End of helper macros
  470. //
  471. //
  472. // Functions shared between prsht.c and prpage.c
  473. //
  474. PISP AllocPropertySheetPage(DWORD dwClientSize);
  475. HWND _CreatePage(LPPROPDATA ppd, PISP pisp, HWND hwndParent, LANGID langidMUI);
  476. HPROPSHEETPAGE WINAPI _CreatePropertySheetPage(LPCPROPSHEETPAGE psp, BOOL fNeedShadow, BOOL fWx86);
  477. typedef LPTSTR (STDMETHODCALLTYPE *STRDUPPROC)(LPCTSTR ptsz);
  478. BOOL CopyPropertyPageStrings(LPPROPSHEETPAGE ppsp, STRDUPPROC pfnStrDup);
  479. void FreePropertyPageStrings(LPCPROPSHEETPAGE ppsp);
  480. BOOL ThunkPropSheetHeaderAtoW (LPCPROPSHEETHEADERA ppshA,
  481. LPPROPSHEETHEADERW ppsh);
  482. void FreePropSheetHeaderW(LPPROPSHEETHEADERW ppsh);
  483. STDAPI_(LPTSTR) StrDup_AtoW(LPCTSTR ptsz);
  484. typedef struct
  485. {
  486. POINT pt; // Dialog box dimensions (DLU)
  487. HICON hIcon; // Page icon
  488. PAGEFONTDATA pfd; // Font info
  489. BOOL bRTL; // If tab caption should be right to left reading
  490. BOOL bMirrored; // if the page contains mirroring flags
  491. BOOL bDialogEx; // Is it a DIALOGEX?
  492. DWORD dwStyle; // Dialog style
  493. TCHAR szCaption[128 + 50]; // Caption as stored in template
  494. } PAGEINFOEX;
  495. //
  496. // These flags control which parts of the PAGEINFOEX get filled in.
  497. //
  498. #define GPI_PT 0x0000 // so cheap, we always fetch it
  499. #define GPI_ICON 0x0001
  500. #define GPI_FONT 0x0002 // PAGEFONTDATA
  501. #define GPI_BRTL 0x0000 // so cheap, we always fetch it
  502. #define GPI_BMIRROR 0x0000 // so cheap, we always fetch it
  503. #define GPI_DIALOGEX 0x0000 // so cheap, we always fetch it
  504. #define GPI_CAPTION 0x0004
  505. #define GPI_ALL 0x0007
  506. BOOL WINAPI GetPageInfoEx(LPPROPDATA ppd, PISP pisp, PAGEINFOEX *ppi, LANGID langidMUI, DWORD flags);
  507. // SHELLFONT means that you are a DIALOGEX and have the DS_SHELLFONT bits set
  508. // Although this is supported only on NT5, the flag is still meaningful on
  509. // Win9x to indicate an implicit PSH_USEPAGEFONT.
  510. #define IsPageInfoSHELLFONT(ppi) \
  511. ((ppi)->bDialogEx && DS_SHELLFONT == (DS_SHELLFONT & (ppi)->dwStyle))
  512. // Prsht_PrepareTemplate operating systems types
  513. // Used as array indices. Be careful !!
  514. typedef enum {
  515. PSPT_OS_WIN95_BIDI, // Win95 BiDi
  516. PSPT_OS_WIN98_BIDI, // Win98 BiDi (Or Higher)
  517. PSPT_OS_WINNT4_ENA, // WinNT4 BiDi Ena, No Winnt4 BiDi loc
  518. PSPT_OS_WINNT5, // WinNT5 (Or Higher)
  519. PSPT_OS_OTHER, // Anything else ....
  520. PSPT_OS_MAX
  521. } PSPT_OS;
  522. // Prsht_PrepareTemplate property sheet type
  523. // Used as array indices. Be careful !!
  524. typedef enum {
  525. PSPT_TYPE_MIRRORED, // Mirrored first page OR mirrored Process
  526. PSPT_TYPE_ENABLED, // First page Language is BiDi
  527. PSPT_TYPE_ENGLISH, // Anything else ....
  528. PSPT_TYPE_MAX
  529. } PSPT_TYPE;
  530. // Prsht_PrepareTemplate property sheet default behavior override
  531. // Used as array indices. Be careful !!
  532. typedef enum {
  533. PSPT_OVERRIDE_NOOVERRIDE,
  534. PSPT_OVERRIDE_USEPAGELANG, // Overridden by PSH_USEPAGELANG
  535. PSPT_OVERRIDE_MAX
  536. } PSPT_OVERRIDE;
  537. // Prsht_PrepareTemplate Preparation action
  538. typedef enum {
  539. PSPT_ACTION_NOACTION, // Don't touch whatever you've passed
  540. PSPT_ACTION_NOMIRRORING, // Turn off mirroring
  541. PSPT_ACTION_FLIP, // Turn off mirroring and flip
  542. PSPT_ACTION_LOADENGLISH, // load English template
  543. PSPT_ACTION_WIN9XCOMPAT // Tags the templae with DS_BIDI_RTL for Win9x compat
  544. } PSPT_ACTION;
  545. ULONG_PTR PropPageActivateContext(LPPROPDATA ppd, PISP pisp);
  546. void PropPageDeactivateContext(ULONG_PTR i);