CommDlg.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:72k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /************************************************************************
  2. *                                                                       *
  3. *   commdlg.h -- This module defines the 32-Bit Common Dialog APIs      *
  4. *                                                                       *
  5. *   Copyright (c) Microsoft Corporation. All rights reserved.           *
  6. *                                                                       *
  7. ************************************************************************/
  8. #ifndef _INC_COMMDLG
  9. #define _INC_COMMDLG
  10. #if(WINVER >= 0x0500)
  11. #ifdef DEFINE_GUID
  12. //
  13. //  IPrintDialogCallback interface id used by PrintDlgEx.
  14. //
  15. //  {5852A2C3-6530-11D1-B6A3-0000F8757BF9}
  16. //
  17. DEFINE_GUID(IID_IPrintDialogCallback, 0x5852a2c3, 0x6530, 0x11d1, 0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9);
  18. //
  19. //  IPrintDialogServices interface id used by PrintDlgEx.
  20. //
  21. //  {509AAEDA-5639-11D1-B6A1-0000F8757BF9}
  22. //
  23. DEFINE_GUID(IID_IPrintDialogServices, 0x509aaeda, 0x5639, 0x11d1, 0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9);
  24. #endif
  25. #endif /* WINVER >= 0x0500 */
  26. #ifndef GUID_DEFS_ONLY
  27. #include <prsht.h>
  28. #if !defined(_WIN64)
  29. #include <pshpack1.h>         /* Assume byte packing throughout */
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {            /* Assume C declarations for C++ */
  33. #endif  /* __cplusplus */
  34. //
  35. // Define API decoration for direct importing of DLL references.
  36. //
  37. #ifndef WINCOMMDLGAPI
  38. #if !defined(_COMDLG32_)
  39. #define WINCOMMDLGAPI DECLSPEC_IMPORT
  40. #else
  41. #define WINCOMMDLGAPI
  42. #endif
  43. #endif // WINCOMMDLGAPI
  44. #if(WINVER >= 0x0400)
  45. #ifndef SNDMSG
  46. #ifdef __cplusplus
  47. #ifndef _MAC
  48. #define SNDMSG ::SendMessage
  49. #else
  50. #define SNDMSG ::AfxSendMessage
  51. #endif
  52. #else   /* __cplusplus */
  53. #ifndef _MAC
  54. #define SNDMSG SendMessage
  55. #else
  56. #define SNDMSG AfxSendMessage
  57. #endif
  58. #endif  /* __cplusplus */
  59. #endif  // ifndef SNDMSG
  60. #endif /* WINVER >= 0x0400 */
  61. #ifdef _MAC
  62. typedef struct tagEDITMENU
  63. {
  64.    HMENU   hmenu;
  65.    WORD    idEdit;
  66.    WORD    idCut;
  67.    WORD    idCopy;
  68.    WORD    idPaste;
  69.    WORD    idClear;
  70.    WORD    idUndo;
  71. } EDITMENU;
  72. typedef EDITMENU *LPEDITMENU;
  73. #endif
  74. typedef UINT_PTR (CALLBACK *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  75. #ifndef CDSIZEOF_STRUCT
  76. #define CDSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
  77. #endif
  78. //
  79. // For compilers that don't support nameless unions
  80. //
  81. #ifndef DUMMYUNIONNAME
  82. #ifdef NONAMELESSUNION
  83. #define DUMMYUNIONNAME   u
  84. #endif // NONAMELESSUNION
  85. #endif // DUMMYUNIONNAME
  86. typedef struct tagOFN_NT4A {
  87.    DWORD        lStructSize;
  88.    HWND         hwndOwner;
  89.    HINSTANCE    hInstance;
  90.    LPCSTR       lpstrFilter;
  91.    LPSTR        lpstrCustomFilter;
  92.    DWORD        nMaxCustFilter;
  93.    DWORD        nFilterIndex;
  94.    LPSTR        lpstrFile;
  95.    DWORD        nMaxFile;
  96.    LPSTR        lpstrFileTitle;
  97.    DWORD        nMaxFileTitle;
  98.    LPCSTR       lpstrInitialDir;
  99.    LPCSTR       lpstrTitle;
  100.    DWORD        Flags;
  101.    WORD         nFileOffset;
  102.    WORD         nFileExtension;
  103.    LPCSTR       lpstrDefExt;
  104.    LPARAM       lCustData;
  105.    LPOFNHOOKPROC lpfnHook;
  106.    LPCSTR       lpTemplateName;
  107. } OPENFILENAME_NT4A, *LPOPENFILENAME_NT4A;
  108. typedef struct tagOFN_NT4W {
  109.    DWORD        lStructSize;
  110.    HWND         hwndOwner;
  111.    HINSTANCE    hInstance;
  112.    LPCWSTR      lpstrFilter;
  113.    LPWSTR       lpstrCustomFilter;
  114.    DWORD        nMaxCustFilter;
  115.    DWORD        nFilterIndex;
  116.    LPWSTR       lpstrFile;
  117.    DWORD        nMaxFile;
  118.    LPWSTR       lpstrFileTitle;
  119.    DWORD        nMaxFileTitle;
  120.    LPCWSTR      lpstrInitialDir;
  121.    LPCWSTR      lpstrTitle;
  122.    DWORD        Flags;
  123.    WORD         nFileOffset;
  124.    WORD         nFileExtension;
  125.    LPCWSTR      lpstrDefExt;
  126.    LPARAM       lCustData;
  127.    LPOFNHOOKPROC lpfnHook;
  128.    LPCWSTR      lpTemplateName;
  129. } OPENFILENAME_NT4W, *LPOPENFILENAME_NT4W;
  130. #ifdef UNICODE
  131. typedef OPENFILENAME_NT4W OPENFILENAME_NT4;
  132. typedef LPOPENFILENAME_NT4W LPOPENFILENAME_NT4;
  133. #else
  134. typedef OPENFILENAME_NT4A OPENFILENAME_NT4;
  135. typedef LPOPENFILENAME_NT4A LPOPENFILENAME_NT4;
  136. #endif // UNICODE
  137. typedef struct tagOFNA {
  138.    DWORD        lStructSize;
  139.    HWND         hwndOwner;
  140.    HINSTANCE    hInstance;
  141.    LPCSTR       lpstrFilter;
  142.    LPSTR        lpstrCustomFilter;
  143.    DWORD        nMaxCustFilter;
  144.    DWORD        nFilterIndex;
  145.    LPSTR        lpstrFile;
  146.    DWORD        nMaxFile;
  147.    LPSTR        lpstrFileTitle;
  148.    DWORD        nMaxFileTitle;
  149.    LPCSTR       lpstrInitialDir;
  150.    LPCSTR       lpstrTitle;
  151.    DWORD        Flags;
  152.    WORD         nFileOffset;
  153.    WORD         nFileExtension;
  154.    LPCSTR       lpstrDefExt;
  155.    LPARAM       lCustData;
  156.    LPOFNHOOKPROC lpfnHook;
  157.    LPCSTR       lpTemplateName;
  158. #ifdef _MAC
  159.    LPEDITMENU   lpEditInfo;
  160.    LPCSTR       lpstrPrompt;
  161. #endif
  162. #if (_WIN32_WINNT >= 0x0500)
  163.    void * pvReserved;
  164.    DWORD        dwReserved;
  165.    DWORD        FlagsEx;
  166. #endif // (_WIN32_WINNT >= 0x0500)
  167. } OPENFILENAMEA, *LPOPENFILENAMEA;
  168. typedef struct tagOFNW {
  169.    DWORD        lStructSize;
  170.    HWND         hwndOwner;
  171.    HINSTANCE    hInstance;
  172.    LPCWSTR      lpstrFilter;
  173.    LPWSTR       lpstrCustomFilter;
  174.    DWORD        nMaxCustFilter;
  175.    DWORD        nFilterIndex;
  176.    LPWSTR       lpstrFile;
  177.    DWORD        nMaxFile;
  178.    LPWSTR       lpstrFileTitle;
  179.    DWORD        nMaxFileTitle;
  180.    LPCWSTR      lpstrInitialDir;
  181.    LPCWSTR      lpstrTitle;
  182.    DWORD        Flags;
  183.    WORD         nFileOffset;
  184.    WORD         nFileExtension;
  185.    LPCWSTR      lpstrDefExt;
  186.    LPARAM       lCustData;
  187.    LPOFNHOOKPROC lpfnHook;
  188.    LPCWSTR      lpTemplateName;
  189. #ifdef _MAC
  190.    LPEDITMENU   lpEditInfo;
  191.    LPCSTR       lpstrPrompt;
  192. #endif
  193. #if (_WIN32_WINNT >= 0x0500)
  194.    void * pvReserved;
  195.    DWORD        dwReserved;
  196.    DWORD        FlagsEx;
  197. #endif // (_WIN32_WINNT >= 0x0500)
  198. } OPENFILENAMEW, *LPOPENFILENAMEW;
  199. #ifdef UNICODE
  200. typedef OPENFILENAMEW OPENFILENAME;
  201. typedef LPOPENFILENAMEW LPOPENFILENAME;
  202. #else
  203. typedef OPENFILENAMEA OPENFILENAME;
  204. typedef LPOPENFILENAMEA LPOPENFILENAME;
  205. #endif // UNICODE
  206. #if (_WIN32_WINNT >= 0x0500)
  207. #define OPENFILENAME_SIZE_VERSION_400A  CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)
  208. #define OPENFILENAME_SIZE_VERSION_400W  CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
  209. #ifdef UNICODE
  210. #define OPENFILENAME_SIZE_VERSION_400  OPENFILENAME_SIZE_VERSION_400W
  211. #else
  212. #define OPENFILENAME_SIZE_VERSION_400  OPENFILENAME_SIZE_VERSION_400A
  213. #endif // !UNICODE
  214. #endif // (_WIN32_WINNT >= 0x0500)
  215. WINCOMMDLGAPI BOOL  APIENTRY GetOpenFileNameA(LPOPENFILENAMEA);
  216. WINCOMMDLGAPI BOOL  APIENTRY GetOpenFileNameW(LPOPENFILENAMEW);
  217. #ifdef UNICODE
  218. #define GetOpenFileName  GetOpenFileNameW
  219. #else
  220. #define GetOpenFileName  GetOpenFileNameA
  221. #endif // !UNICODE
  222. WINCOMMDLGAPI BOOL  APIENTRY GetSaveFileNameA(LPOPENFILENAMEA);
  223. WINCOMMDLGAPI BOOL  APIENTRY GetSaveFileNameW(LPOPENFILENAMEW);
  224. #ifdef UNICODE
  225. #define GetSaveFileName  GetSaveFileNameW
  226. #else
  227. #define GetSaveFileName  GetSaveFileNameA
  228. #endif // !UNICODE
  229. WINCOMMDLGAPI short APIENTRY GetFileTitleA(LPCSTR, LPSTR, WORD);
  230. WINCOMMDLGAPI short APIENTRY GetFileTitleW(LPCWSTR, LPWSTR, WORD);
  231. #ifdef UNICODE
  232. #define GetFileTitle  GetFileTitleW
  233. #else
  234. #define GetFileTitle  GetFileTitleA
  235. #endif // !UNICODE
  236. #define OFN_READONLY                 0x00000001
  237. #define OFN_OVERWRITEPROMPT          0x00000002
  238. #define OFN_HIDEREADONLY             0x00000004
  239. #define OFN_NOCHANGEDIR              0x00000008
  240. #define OFN_SHOWHELP                 0x00000010
  241. #define OFN_ENABLEHOOK               0x00000020
  242. #define OFN_ENABLETEMPLATE           0x00000040
  243. #define OFN_ENABLETEMPLATEHANDLE     0x00000080
  244. #define OFN_NOVALIDATE               0x00000100
  245. #define OFN_ALLOWMULTISELECT         0x00000200
  246. #define OFN_EXTENSIONDIFFERENT       0x00000400
  247. #define OFN_PATHMUSTEXIST            0x00000800
  248. #define OFN_FILEMUSTEXIST            0x00001000
  249. #define OFN_CREATEPROMPT             0x00002000
  250. #define OFN_SHAREAWARE               0x00004000
  251. #define OFN_NOREADONLYRETURN         0x00008000
  252. #define OFN_NOTESTFILECREATE         0x00010000
  253. #define OFN_NONETWORKBUTTON          0x00020000
  254. #define OFN_NOLONGNAMES              0x00040000     // force no long names for 4.x modules
  255. #if(WINVER >= 0x0400)
  256. #define OFN_EXPLORER                 0x00080000     // new look commdlg
  257. #define OFN_NODEREFERENCELINKS       0x00100000
  258. #define OFN_LONGNAMES                0x00200000     // force long names for 3.x modules
  259. #define OFN_ENABLEINCLUDENOTIFY      0x00400000     // send include message to callback
  260. #define OFN_ENABLESIZING             0x00800000
  261. #endif /* WINVER >= 0x0400 */
  262. #if (_WIN32_WINNT >= 0x0500)
  263. #define OFN_DONTADDTORECENT          0x02000000
  264. #define OFN_FORCESHOWHIDDEN          0x10000000    // Show All files including System and hidden files
  265. #endif // (_WIN32_WINNT >= 0x0500)
  266. //FlagsEx Values
  267. #if (_WIN32_WINNT >= 0x0500)
  268. #define  OFN_EX_NOPLACESBAR         0x00000001
  269. #endif // (_WIN32_WINNT >= 0x0500)
  270. // Return values for the registered message sent to the hook function
  271. // when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  272. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  273. // up no warning (returned when the app has already put up a warning
  274. // message), and OFN_SHAREWARN puts up the default warning message
  275. // for sharing violations.
  276. //
  277. // Note:  Undefined return values map to OFN_SHAREWARN, but are
  278. //        reserved for future use.
  279. #define OFN_SHAREFALLTHROUGH     2
  280. #define OFN_SHARENOWARN          1
  281. #define OFN_SHAREWARN            0
  282. typedef UINT_PTR (CALLBACK *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  283. #if(WINVER >= 0x0400)
  284. // Structure used for all file based OpenFileName notifications
  285. typedef struct _OFNOTIFYA
  286. {
  287.         NMHDR           hdr;
  288.         LPOPENFILENAMEA lpOFN;
  289.         LPSTR           pszFile;        // May be NULL
  290. } OFNOTIFYA, *LPOFNOTIFYA;
  291. // Structure used for all file based OpenFileName notifications
  292. typedef struct _OFNOTIFYW
  293. {
  294.         NMHDR           hdr;
  295.         LPOPENFILENAMEW lpOFN;
  296.         LPWSTR          pszFile;        // May be NULL
  297. } OFNOTIFYW, *LPOFNOTIFYW;
  298. #ifdef UNICODE
  299. typedef OFNOTIFYW OFNOTIFY;
  300. typedef LPOFNOTIFYW LPOFNOTIFY;
  301. #else
  302. typedef OFNOTIFYA OFNOTIFY;
  303. typedef LPOFNOTIFYA LPOFNOTIFY;
  304. #endif // UNICODE
  305. // Structure used for all object based OpenFileName notifications
  306. typedef struct _OFNOTIFYEXA
  307. {
  308.         NMHDR           hdr;
  309.         LPOPENFILENAMEA lpOFN;
  310.         LPVOID          psf;
  311.         LPVOID          pidl;          // May be NULL
  312. } OFNOTIFYEXA, *LPOFNOTIFYEXA;
  313. // Structure used for all object based OpenFileName notifications
  314. typedef struct _OFNOTIFYEXW
  315. {
  316.         NMHDR           hdr;
  317.         LPOPENFILENAMEW lpOFN;
  318.         LPVOID          psf;
  319.         LPVOID          pidl;          // May be NULL
  320. } OFNOTIFYEXW, *LPOFNOTIFYEXW;
  321. #ifdef UNICODE
  322. typedef OFNOTIFYEXW OFNOTIFYEX;
  323. typedef LPOFNOTIFYEXW LPOFNOTIFYEX;
  324. #else
  325. typedef OFNOTIFYEXA OFNOTIFYEX;
  326. typedef LPOFNOTIFYEXA LPOFNOTIFYEX;
  327. #endif // UNICODE
  328. #define CDN_FIRST   (0U-601U)
  329. #define CDN_LAST    (0U-699U)
  330. // Notifications from Open or Save dialog
  331. #define CDN_INITDONE            (CDN_FIRST - 0x0000)
  332. #define CDN_SELCHANGE           (CDN_FIRST - 0x0001)
  333. #define CDN_FOLDERCHANGE        (CDN_FIRST - 0x0002)
  334. #define CDN_SHAREVIOLATION      (CDN_FIRST - 0x0003)
  335. #define CDN_HELP                (CDN_FIRST - 0x0004)
  336. #define CDN_FILEOK              (CDN_FIRST - 0x0005)
  337. #define CDN_TYPECHANGE          (CDN_FIRST - 0x0006)
  338. #define CDN_INCLUDEITEM         (CDN_FIRST - 0x0007)
  339. #define CDM_FIRST       (WM_USER + 100)
  340. #define CDM_LAST        (WM_USER + 200)
  341. // Messages to query information from the Open or Save dialogs
  342. // lParam = pointer to text buffer that gets filled in
  343. // wParam = max number of characters of the text buffer (including NULL)
  344. // return = < 0 if error; number of characters needed (including NULL)
  345. #define CDM_GETSPEC             (CDM_FIRST + 0x0000)
  346. #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) 
  347.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  348. #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) 
  349.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  350. #ifdef UNICODE
  351. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecW
  352. #else
  353. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecA
  354. #endif // !UNICODE
  355. // lParam = pointer to text buffer that gets filled in
  356. // wParam = max number of characters of the text buffer (including NULL)
  357. // return = < 0 if error; number of characters needed (including NULL)
  358. #define CDM_GETFILEPATH         (CDM_FIRST + 0x0001)
  359. #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) 
  360.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  361. #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) 
  362.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  363. #ifdef UNICODE
  364. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathW
  365. #else
  366. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathA
  367. #endif // !UNICODE
  368. // lParam = pointer to text buffer that gets filled in
  369. // wParam = max number of characters of the text buffer (including NULL)
  370. // return = < 0 if error; number of characters needed (including NULL)
  371. #define CDM_GETFOLDERPATH       (CDM_FIRST + 0x0002)
  372. #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) 
  373.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  374. #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) 
  375.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  376. #ifdef UNICODE
  377. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathW
  378. #else
  379. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathA
  380. #endif // !UNICODE
  381. // lParam = pointer to ITEMIDLIST buffer that gets filled in
  382. // wParam = size of the ITEMIDLIST buffer
  383. // return = < 0 if error; length of buffer needed
  384. #define CDM_GETFOLDERIDLIST     (CDM_FIRST + 0x0003)
  385. #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) 
  386.         (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  387. // lParam = pointer to a string
  388. // wParam = ID of control to change
  389. // return = not used
  390. #define CDM_SETCONTROLTEXT      (CDM_FIRST + 0x0004)
  391. #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) 
  392.         (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  393. // lParam = not used
  394. // wParam = ID of control to change
  395. // return = not used
  396. #define CDM_HIDECONTROL         (CDM_FIRST + 0x0005)
  397. #define CommDlg_OpenSave_HideControl(_hdlg, _id) 
  398.         (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  399. // lParam = pointer to default extension (no dot)
  400. // wParam = not used
  401. // return = not used
  402. #define CDM_SETDEFEXT           (CDM_FIRST + 0x0006)
  403. #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) 
  404.         (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  405. #endif /* WINVER >= 0x0400 */
  406. #ifndef _MAC
  407. typedef struct tagCHOOSECOLORA {
  408.    DWORD        lStructSize;
  409.    HWND         hwndOwner;
  410.    HWND         hInstance;
  411.    COLORREF     rgbResult;
  412.    COLORREF*    lpCustColors;
  413.    DWORD        Flags;
  414.    LPARAM       lCustData;
  415.    LPCCHOOKPROC lpfnHook;
  416.    LPCSTR       lpTemplateName;
  417. } CHOOSECOLORA, *LPCHOOSECOLORA;
  418. typedef struct tagCHOOSECOLORW {
  419.    DWORD        lStructSize;
  420.    HWND         hwndOwner;
  421.    HWND         hInstance;
  422.    COLORREF     rgbResult;
  423.    COLORREF*    lpCustColors;
  424.    DWORD        Flags;
  425.    LPARAM       lCustData;
  426.    LPCCHOOKPROC lpfnHook;
  427.    LPCWSTR      lpTemplateName;
  428. } CHOOSECOLORW, *LPCHOOSECOLORW;
  429. #ifdef UNICODE
  430. typedef CHOOSECOLORW CHOOSECOLOR;
  431. typedef LPCHOOSECOLORW LPCHOOSECOLOR;
  432. #else
  433. typedef CHOOSECOLORA CHOOSECOLOR;
  434. typedef LPCHOOSECOLORA LPCHOOSECOLOR;
  435. #endif // UNICODE
  436. #else
  437. typedef struct tagCHOOSECOLORA {
  438.    DWORD        lStructSize;
  439.    HWND         hwndOwner;
  440.    HWND         hInstance;
  441.    COLORREF     rgbResult;
  442.    COLORREF*    lpCustColors;
  443.    DWORD        Flags;
  444.    LPARAM       lCustData;
  445.    LPCCHOOKPROC lpfnHook;
  446.    LPCSTR       lpTemplateName;
  447.    LPEDITMENU   lpEditInfo;
  448. } CHOOSECOLORA, *LPCHOOSECOLORA;
  449. typedef struct tagCHOOSECOLORW {
  450.    DWORD        lStructSize;
  451.    HWND         hwndOwner;
  452.    HWND         hInstance;
  453.    COLORREF     rgbResult;
  454.    COLORREF*    lpCustColors;
  455.    DWORD        Flags;
  456.    LPARAM       lCustData;
  457.    LPCCHOOKPROC lpfnHook;
  458.    LPCWSTR      lpTemplateName;
  459.    LPEDITMENU   lpEditInfo;
  460. } CHOOSECOLORW, *LPCHOOSECOLORW;
  461. #ifdef UNICODE
  462. typedef CHOOSECOLORW CHOOSECOLOR;
  463. typedef LPCHOOSECOLORW LPCHOOSECOLOR;
  464. #else
  465. typedef CHOOSECOLORA CHOOSECOLOR;
  466. typedef LPCHOOSECOLORA LPCHOOSECOLOR;
  467. #endif // UNICODE
  468. #endif //_MAC
  469. WINCOMMDLGAPI BOOL APIENTRY ChooseColorA(LPCHOOSECOLORA);
  470. WINCOMMDLGAPI BOOL APIENTRY ChooseColorW(LPCHOOSECOLORW);
  471. #ifdef UNICODE
  472. #define ChooseColor  ChooseColorW
  473. #else
  474. #define ChooseColor  ChooseColorA
  475. #endif // !UNICODE
  476. #define CC_RGBINIT               0x00000001
  477. #define CC_FULLOPEN              0x00000002
  478. #define CC_PREVENTFULLOPEN       0x00000004
  479. #define CC_SHOWHELP              0x00000008
  480. #define CC_ENABLEHOOK            0x00000010
  481. #define CC_ENABLETEMPLATE        0x00000020
  482. #define CC_ENABLETEMPLATEHANDLE  0x00000040
  483. #if(WINVER >= 0x0400)
  484. #define CC_SOLIDCOLOR            0x00000080
  485. #define CC_ANYCOLOR              0x00000100
  486. #endif /* WINVER >= 0x0400 */
  487. typedef UINT_PTR (CALLBACK *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  488. typedef struct tagFINDREPLACEA {
  489.    DWORD        lStructSize;        // size of this struct 0x20
  490.    HWND         hwndOwner;          // handle to owner's window
  491.    HINSTANCE    hInstance;          // instance handle of.EXE that
  492.                                     //   contains cust. dlg. template
  493.    DWORD        Flags;              // one or more of the FR_??
  494.    LPSTR        lpstrFindWhat;      // ptr. to search string
  495.    LPSTR        lpstrReplaceWith;   // ptr. to replace string
  496.    WORD         wFindWhatLen;       // size of find buffer
  497.    WORD         wReplaceWithLen;    // size of replace buffer
  498.    LPARAM       lCustData;          // data passed to hook fn.
  499.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  500.    LPCSTR       lpTemplateName;     // custom template name
  501. } FINDREPLACEA, *LPFINDREPLACEA;
  502. typedef struct tagFINDREPLACEW {
  503.    DWORD        lStructSize;        // size of this struct 0x20
  504.    HWND         hwndOwner;          // handle to owner's window
  505.    HINSTANCE    hInstance;          // instance handle of.EXE that
  506.                                     //   contains cust. dlg. template
  507.    DWORD        Flags;              // one or more of the FR_??
  508.    LPWSTR       lpstrFindWhat;      // ptr. to search string
  509.    LPWSTR       lpstrReplaceWith;   // ptr. to replace string
  510.    WORD         wFindWhatLen;       // size of find buffer
  511.    WORD         wReplaceWithLen;    // size of replace buffer
  512.    LPARAM       lCustData;          // data passed to hook fn.
  513.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  514.    LPCWSTR      lpTemplateName;     // custom template name
  515. } FINDREPLACEW, *LPFINDREPLACEW;
  516. #ifdef UNICODE
  517. typedef FINDREPLACEW FINDREPLACE;
  518. typedef LPFINDREPLACEW LPFINDREPLACE;
  519. #else
  520. typedef FINDREPLACEA FINDREPLACE;
  521. typedef LPFINDREPLACEA LPFINDREPLACE;
  522. #endif // UNICODE
  523. #define FR_DOWN                         0x00000001
  524. #define FR_WHOLEWORD                    0x00000002
  525. #define FR_MATCHCASE                    0x00000004
  526. #define FR_FINDNEXT                     0x00000008
  527. #define FR_REPLACE                      0x00000010
  528. #define FR_REPLACEALL                   0x00000020
  529. #define FR_DIALOGTERM                   0x00000040
  530. #define FR_SHOWHELP                     0x00000080
  531. #define FR_ENABLEHOOK                   0x00000100
  532. #define FR_ENABLETEMPLATE               0x00000200
  533. #define FR_NOUPDOWN                     0x00000400
  534. #define FR_NOMATCHCASE                  0x00000800
  535. #define FR_NOWHOLEWORD                  0x00001000
  536. #define FR_ENABLETEMPLATEHANDLE         0x00002000
  537. #define FR_HIDEUPDOWN                   0x00004000
  538. #define FR_HIDEMATCHCASE                0x00008000
  539. #define FR_HIDEWHOLEWORD                0x00010000
  540. #define FR_RAW                          0x00020000
  541. #define FR_MATCHDIAC                    0x20000000
  542. #define FR_MATCHKASHIDA                 0x40000000
  543. #define FR_MATCHALEFHAMZA               0x80000000
  544. WINCOMMDLGAPI HWND APIENTRY FindTextA(LPFINDREPLACEA);
  545. WINCOMMDLGAPI HWND APIENTRY FindTextW(LPFINDREPLACEW);
  546. #ifdef UNICODE
  547. #define FindText  FindTextW
  548. #else
  549. #define FindText  FindTextA
  550. #endif // !UNICODE
  551. #ifndef _MAC
  552. WINCOMMDLGAPI HWND APIENTRY ReplaceTextA(LPFINDREPLACEA);
  553. WINCOMMDLGAPI HWND APIENTRY ReplaceTextW(LPFINDREPLACEW);
  554. #ifdef UNICODE
  555. #define ReplaceText  ReplaceTextW
  556. #else
  557. #define ReplaceText  ReplaceTextA
  558. #endif // !UNICODE
  559. #else
  560. WINCOMMDLGAPI HWND APIENTRY AfxReplaceTextA(LPFINDREPLACEA);
  561. WINCOMMDLGAPI HWND APIENTRY AfxReplaceTextW(LPFINDREPLACEW);
  562. #ifdef UNICODE
  563. #define AfxReplaceText  AfxReplaceTextW
  564. #else
  565. #define AfxReplaceText  AfxReplaceTextA
  566. #endif // !UNICODE
  567. #endif
  568. typedef UINT_PTR (CALLBACK *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  569. typedef struct tagCHOOSEFONTA {
  570.    DWORD           lStructSize;
  571.    HWND            hwndOwner;          // caller's window handle
  572.    HDC             hDC;                // printer DC/IC or NULL
  573.    LPLOGFONTA      lpLogFont;          // ptr. to a LOGFONT struct
  574.    INT             iPointSize;         // 10 * size in points of selected font
  575.    DWORD           Flags;              // enum. type flags
  576.    COLORREF        rgbColors;          // returned text color
  577.    LPARAM          lCustData;          // data passed to hook fn.
  578.    LPCFHOOKPROC    lpfnHook;           // ptr. to hook function
  579.    LPCSTR          lpTemplateName;     // custom template name
  580.    HINSTANCE       hInstance;          // instance handle of.EXE that
  581.                                        //   contains cust. dlg. template
  582.    LPSTR           lpszStyle;          // return the style field here
  583.                                        // must be LF_FACESIZE or bigger
  584.    WORD            nFontType;          // same value reported to the EnumFonts
  585.                                        //   call back with the extra FONTTYPE_
  586.                                        //   bits added
  587.    WORD            ___MISSING_ALIGNMENT__;
  588.    INT             nSizeMin;           // minimum pt size allowed &
  589.    INT             nSizeMax;           // max pt size allowed if
  590.                                        //   CF_LIMITSIZE is used
  591. } CHOOSEFONTA, *LPCHOOSEFONTA;
  592. typedef struct tagCHOOSEFONTW {
  593.    DWORD           lStructSize;
  594.    HWND            hwndOwner;          // caller's window handle
  595.    HDC             hDC;                // printer DC/IC or NULL
  596.    LPLOGFONTW      lpLogFont;          // ptr. to a LOGFONT struct
  597.    INT             iPointSize;         // 10 * size in points of selected font
  598.    DWORD           Flags;              // enum. type flags
  599.    COLORREF        rgbColors;          // returned text color
  600.    LPARAM          lCustData;          // data passed to hook fn.
  601.    LPCFHOOKPROC    lpfnHook;           // ptr. to hook function
  602.    LPCWSTR         lpTemplateName;     // custom template name
  603.    HINSTANCE       hInstance;          // instance handle of.EXE that
  604.                                        //   contains cust. dlg. template
  605.    LPWSTR          lpszStyle;          // return the style field here
  606.                                        // must be LF_FACESIZE or bigger
  607.    WORD            nFontType;          // same value reported to the EnumFonts
  608.                                        //   call back with the extra FONTTYPE_
  609.                                        //   bits added
  610.    WORD            ___MISSING_ALIGNMENT__;
  611.    INT             nSizeMin;           // minimum pt size allowed &
  612.    INT             nSizeMax;           // max pt size allowed if
  613.                                        //   CF_LIMITSIZE is used
  614. } CHOOSEFONTW, *LPCHOOSEFONTW;
  615. #ifdef UNICODE
  616. typedef CHOOSEFONTW CHOOSEFONT;
  617. typedef LPCHOOSEFONTW LPCHOOSEFONT;
  618. #else
  619. typedef CHOOSEFONTA CHOOSEFONT;
  620. typedef LPCHOOSEFONTA LPCHOOSEFONT;
  621. #endif // UNICODE
  622. WINCOMMDLGAPI BOOL APIENTRY ChooseFontA(LPCHOOSEFONTA);
  623. WINCOMMDLGAPI BOOL APIENTRY ChooseFontW(LPCHOOSEFONTW);
  624. #ifdef UNICODE
  625. #define ChooseFont  ChooseFontW
  626. #else
  627. #define ChooseFont  ChooseFontA
  628. #endif // !UNICODE
  629. #define CF_SCREENFONTS             0x00000001
  630. #define CF_PRINTERFONTS            0x00000002
  631. #define CF_BOTH                    (CF_SCREENFONTS | CF_PRINTERFONTS)
  632. #define CF_SHOWHELP                0x00000004L
  633. #define CF_ENABLEHOOK              0x00000008L
  634. #define CF_ENABLETEMPLATE          0x00000010L
  635. #define CF_ENABLETEMPLATEHANDLE    0x00000020L
  636. #define CF_INITTOLOGFONTSTRUCT     0x00000040L
  637. #define CF_USESTYLE                0x00000080L
  638. #define CF_EFFECTS                 0x00000100L
  639. #define CF_APPLY                   0x00000200L
  640. #define CF_ANSIONLY                0x00000400L
  641. #if(WINVER >= 0x0400)
  642. #define CF_SCRIPTSONLY             CF_ANSIONLY
  643. #endif /* WINVER >= 0x0400 */
  644. #define CF_NOVECTORFONTS           0x00000800L
  645. #define CF_NOOEMFONTS              CF_NOVECTORFONTS
  646. #define CF_NOSIMULATIONS           0x00001000L
  647. #define CF_LIMITSIZE               0x00002000L
  648. #define CF_FIXEDPITCHONLY          0x00004000L
  649. #define CF_WYSIWYG                 0x00008000L // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  650. #define CF_FORCEFONTEXIST          0x00010000L
  651. #define CF_SCALABLEONLY            0x00020000L
  652. #define CF_TTONLY                  0x00040000L
  653. #define CF_NOFACESEL               0x00080000L
  654. #define CF_NOSTYLESEL              0x00100000L
  655. #define CF_NOSIZESEL               0x00200000L
  656. #if(WINVER >= 0x0400)
  657. #define CF_SELECTSCRIPT            0x00400000L
  658. #define CF_NOSCRIPTSEL             0x00800000L
  659. #define CF_NOVERTFONTS             0x01000000L
  660. #endif /* WINVER >= 0x0400 */
  661. // these are extra nFontType bits that are added to what is returned to the
  662. // EnumFonts callback routine
  663. #define SIMULATED_FONTTYPE    0x8000
  664. #define PRINTER_FONTTYPE      0x4000
  665. #define SCREEN_FONTTYPE       0x2000
  666. #define BOLD_FONTTYPE         0x0100
  667. #define ITALIC_FONTTYPE       0x0200
  668. #define REGULAR_FONTTYPE      0x0400
  669. // EnumFonts callback routine only uses these bits, so we can use the rest
  670. // #define RASTER_FONTTYPE     0x001
  671. // #define DEVICE_FONTTYPE     0x002
  672. // #define TRUETYPE_FONTTYPE   0x004
  673. #ifdef WINNT
  674. #define PS_OPENTYPE_FONTTYPE  0x10000
  675. #define TT_OPENTYPE_FONTTYPE  0x20000
  676. #define TYPE1_FONTTYPE        0x40000
  677. #endif
  678. #define WM_CHOOSEFONT_GETLOGFONT      (WM_USER + 1)
  679. #define WM_CHOOSEFONT_SETLOGFONT      (WM_USER + 101)
  680. #define WM_CHOOSEFONT_SETFLAGS        (WM_USER + 102)
  681. // strings used to obtain unique window message for communication
  682. // between dialog and caller
  683. #define LBSELCHSTRINGA  "commdlg_LBSelChangedNotify"
  684. #define SHAREVISTRINGA  "commdlg_ShareViolation"
  685. #define FILEOKSTRINGA   "commdlg_FileNameOK"
  686. #define COLOROKSTRINGA  "commdlg_ColorOK"
  687. #define SETRGBSTRINGA   "commdlg_SetRGBColor"
  688. #define HELPMSGSTRINGA  "commdlg_help"
  689. #define FINDMSGSTRINGA  "commdlg_FindReplace"
  690. #define LBSELCHSTRINGW  L"commdlg_LBSelChangedNotify"
  691. #define SHAREVISTRINGW  L"commdlg_ShareViolation"
  692. #define FILEOKSTRINGW   L"commdlg_FileNameOK"
  693. #define COLOROKSTRINGW  L"commdlg_ColorOK"
  694. #define SETRGBSTRINGW   L"commdlg_SetRGBColor"
  695. #define HELPMSGSTRINGW  L"commdlg_help"
  696. #define FINDMSGSTRINGW  L"commdlg_FindReplace"
  697. #ifdef UNICODE
  698. #define LBSELCHSTRING  LBSELCHSTRINGW
  699. #define SHAREVISTRING  SHAREVISTRINGW
  700. #define FILEOKSTRING   FILEOKSTRINGW
  701. #define COLOROKSTRING  COLOROKSTRINGW
  702. #define SETRGBSTRING   SETRGBSTRINGW
  703. #define HELPMSGSTRING  HELPMSGSTRINGW
  704. #define FINDMSGSTRING  FINDMSGSTRINGW
  705. #else
  706. #define LBSELCHSTRING  LBSELCHSTRINGA
  707. #define SHAREVISTRING  SHAREVISTRINGA
  708. #define FILEOKSTRING   FILEOKSTRINGA
  709. #define COLOROKSTRING  COLOROKSTRINGA
  710. #define SETRGBSTRING   SETRGBSTRINGA
  711. #define HELPMSGSTRING  HELPMSGSTRINGA
  712. #define FINDMSGSTRING  FINDMSGSTRINGA
  713. #endif
  714. // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  715. #define CD_LBSELNOITEMS -1
  716. #define CD_LBSELCHANGE   0
  717. #define CD_LBSELSUB      1
  718. #define CD_LBSELADD      2
  719. typedef UINT_PTR (CALLBACK *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  720. typedef UINT_PTR (CALLBACK *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  721. typedef struct tagPDA {
  722.    DWORD            lStructSize;
  723.    HWND             hwndOwner;
  724.    HGLOBAL          hDevMode;
  725.    HGLOBAL          hDevNames;
  726.    HDC              hDC;
  727.    DWORD            Flags;
  728.    WORD             nFromPage;
  729.    WORD             nToPage;
  730.    WORD             nMinPage;
  731.    WORD             nMaxPage;
  732.    WORD             nCopies;
  733.    HINSTANCE        hInstance;
  734.    LPARAM           lCustData;
  735.    LPPRINTHOOKPROC  lpfnPrintHook;
  736.    LPSETUPHOOKPROC  lpfnSetupHook;
  737.    LPCSTR           lpPrintTemplateName;
  738.    LPCSTR           lpSetupTemplateName;
  739.    HGLOBAL          hPrintTemplate;
  740.    HGLOBAL          hSetupTemplate;
  741. } PRINTDLGA, *LPPRINTDLGA;
  742. typedef struct tagPDW {
  743.    DWORD            lStructSize;
  744.    HWND             hwndOwner;
  745.    HGLOBAL          hDevMode;
  746.    HGLOBAL          hDevNames;
  747.    HDC              hDC;
  748.    DWORD            Flags;
  749.    WORD             nFromPage;
  750.    WORD             nToPage;
  751.    WORD             nMinPage;
  752.    WORD             nMaxPage;
  753.    WORD             nCopies;
  754.    HINSTANCE        hInstance;
  755.    LPARAM           lCustData;
  756.    LPPRINTHOOKPROC  lpfnPrintHook;
  757.    LPSETUPHOOKPROC  lpfnSetupHook;
  758.    LPCWSTR          lpPrintTemplateName;
  759.    LPCWSTR          lpSetupTemplateName;
  760.    HGLOBAL          hPrintTemplate;
  761.    HGLOBAL          hSetupTemplate;
  762. } PRINTDLGW, *LPPRINTDLGW;
  763. #ifdef UNICODE
  764. typedef PRINTDLGW PRINTDLG;
  765. typedef LPPRINTDLGW LPPRINTDLG;
  766. #else
  767. typedef PRINTDLGA PRINTDLG;
  768. typedef LPPRINTDLGA LPPRINTDLG;
  769. #endif // UNICODE
  770. WINCOMMDLGAPI BOOL APIENTRY PrintDlgA(LPPRINTDLGA);
  771. WINCOMMDLGAPI BOOL APIENTRY PrintDlgW(LPPRINTDLGW);
  772. #ifdef UNICODE
  773. #define PrintDlg  PrintDlgW
  774. #else
  775. #define PrintDlg  PrintDlgA
  776. #endif // !UNICODE
  777. #if(WINVER >= 0x0500)
  778. #ifdef STDMETHOD
  779. //-------------------------------------------------------------------------
  780. //
  781. //  IPrintDialogCallback Interface
  782. //
  783. //  IPrintDialogCallback::InitDone()
  784. //    This function is called by PrintDlgEx when the system has finished
  785. //    initializing the main page of the print dialog.  This function
  786. //    should return S_OK if it has processed the action or S_FALSE to let
  787. //    PrintDlgEx perform the default action.
  788. //
  789. //  IPrintDialogCallback::SelectionChange()
  790. //    This function is called by PrintDlgEx when a selection change occurs
  791. //    in the list view that displays the currently installed printers.
  792. //    This function should return S_OK if it has processed the action or
  793. //    S_FALSE to let PrintDlgEx perform the default action.
  794. //
  795. //  IPrintDialogCallback::HandleMessage(hDlg, uMsg, wParam, lParam, pResult)
  796. //    This function is called by PrintDlgEx when a message is sent to the
  797. //    child window of the main page of the print dialog.  This function
  798. //    should return S_OK if it has processed the action or S_FALSE to let
  799. //    PrintDlgEx perform the default action.
  800. //
  801. //  IObjectWithSite::SetSite(punkSite)
  802. //    IPrintDialogCallback usually paired with IObjectWithSite.
  803. //    Provides the IUnknown pointer of the site to QI for the
  804. //    IPrintDialogServices interface.
  805. //
  806. //-------------------------------------------------------------------------
  807. #undef  INTERFACE
  808. #define INTERFACE   IPrintDialogCallback
  809. DECLARE_INTERFACE_(IPrintDialogCallback, IUnknown)
  810. {
  811.     // *** IUnknown methods ***
  812.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  813.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  814.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  815.     // *** IPrintDialogCallback methods ***
  816.     STDMETHOD(InitDone) (THIS) PURE;
  817.     STDMETHOD(SelectionChange) (THIS) PURE;
  818.     STDMETHOD(HandleMessage) (THIS_ HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult) PURE;
  819. };
  820. //-------------------------------------------------------------------------
  821. //
  822. //  IPrintDialogServices Interface
  823. //
  824. //  IPrintDialogServices::GetCurrentDevMode(pDevMode, pcbSize)
  825. //    Returns the DEVMODE structure for the currently selected printer.
  826. //
  827. //  IPrintDialogServices::GetCurrentPrinterName(pPrinterName, pcchSize)
  828. //    Returns the printer name for the currently selected printer.
  829. //
  830. //  IPrintDialogServices::GetCurrentPortName(pPortName, pcchSize)
  831. //    Returns the port name for the currently selected printer.
  832. //
  833. //-------------------------------------------------------------------------
  834. #undef  INTERFACE
  835. #define INTERFACE   IPrintDialogServices
  836. DECLARE_INTERFACE_(IPrintDialogServices, IUnknown)
  837. {
  838.     // *** IUnknown methods ***
  839.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  840.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  841.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  842.     // *** IPrintDialogServices methods ***
  843.     STDMETHOD(GetCurrentDevMode) (THIS_ LPDEVMODE pDevMode, UINT *pcbSize) PURE;
  844.     STDMETHOD(GetCurrentPrinterName) (THIS_ LPTSTR pPrinterName, UINT *pcchSize) PURE;
  845.     STDMETHOD(GetCurrentPortName) (THIS_ LPTSTR pPortName, UINT *pcchSize) PURE;
  846. };
  847. //
  848. //  Page Range structure for PrintDlgEx.
  849. //
  850. typedef struct tagPRINTPAGERANGE {
  851.    DWORD  nFromPage;
  852.    DWORD  nToPage;
  853. } PRINTPAGERANGE, *LPPRINTPAGERANGE;
  854. //
  855. //  PrintDlgEx structure.
  856. //
  857. typedef struct tagPDEXA {
  858.    DWORD                 lStructSize;          // size of structure in bytes
  859.    HWND                  hwndOwner;            // caller's window handle
  860.    HGLOBAL               hDevMode;             // handle to DevMode
  861.    HGLOBAL               hDevNames;            // handle to DevNames
  862.    HDC                   hDC;                  // printer DC/IC or NULL
  863.    DWORD                 Flags;                // PD_ flags
  864.    DWORD                 Flags2;               // reserved
  865.    DWORD                 ExclusionFlags;       // items to exclude from driver pages
  866.    DWORD                 nPageRanges;          // number of page ranges
  867.    DWORD                 nMaxPageRanges;       // max number of page ranges
  868.    LPPRINTPAGERANGE      lpPageRanges;         // array of page ranges
  869.    DWORD                 nMinPage;             // min page number
  870.    DWORD                 nMaxPage;             // max page number
  871.    DWORD                 nCopies;              // number of copies
  872.    HINSTANCE             hInstance;            // instance handle
  873.    LPCSTR                lpPrintTemplateName;  // template name for app specific area
  874.    LPUNKNOWN             lpCallback;           // app callback interface
  875.    DWORD                 nPropertyPages;       // number of app property pages in lphPropertyPages
  876.    HPROPSHEETPAGE       *lphPropertyPages;     // array of app property page handles
  877.    DWORD                 nStartPage;           // start page id
  878.    DWORD                 dwResultAction;       // result action if S_OK is returned
  879. } PRINTDLGEXA, *LPPRINTDLGEXA;
  880. //
  881. //  PrintDlgEx structure.
  882. //
  883. typedef struct tagPDEXW {
  884.    DWORD                 lStructSize;          // size of structure in bytes
  885.    HWND                  hwndOwner;            // caller's window handle
  886.    HGLOBAL               hDevMode;             // handle to DevMode
  887.    HGLOBAL               hDevNames;            // handle to DevNames
  888.    HDC                   hDC;                  // printer DC/IC or NULL
  889.    DWORD                 Flags;                // PD_ flags
  890.    DWORD                 Flags2;               // reserved
  891.    DWORD                 ExclusionFlags;       // items to exclude from driver pages
  892.    DWORD                 nPageRanges;          // number of page ranges
  893.    DWORD                 nMaxPageRanges;       // max number of page ranges
  894.    LPPRINTPAGERANGE      lpPageRanges;         // array of page ranges
  895.    DWORD                 nMinPage;             // min page number
  896.    DWORD                 nMaxPage;             // max page number
  897.    DWORD                 nCopies;              // number of copies
  898.    HINSTANCE             hInstance;            // instance handle
  899.    LPCWSTR               lpPrintTemplateName;  // template name for app specific area
  900.    LPUNKNOWN             lpCallback;           // app callback interface
  901.    DWORD                 nPropertyPages;       // number of app property pages in lphPropertyPages
  902.    HPROPSHEETPAGE       *lphPropertyPages;     // array of app property page handles
  903.    DWORD                 nStartPage;           // start page id
  904.    DWORD                 dwResultAction;       // result action if S_OK is returned
  905. } PRINTDLGEXW, *LPPRINTDLGEXW;
  906. #ifdef UNICODE
  907. typedef PRINTDLGEXW PRINTDLGEX;
  908. typedef LPPRINTDLGEXW LPPRINTDLGEX;
  909. #else
  910. typedef PRINTDLGEXA PRINTDLGEX;
  911. typedef LPPRINTDLGEXA LPPRINTDLGEX;
  912. #endif // UNICODE
  913. WINCOMMDLGAPI HRESULT APIENTRY PrintDlgExA(LPPRINTDLGEXA);
  914. WINCOMMDLGAPI HRESULT APIENTRY PrintDlgExW(LPPRINTDLGEXW);
  915. #ifdef UNICODE
  916. #define PrintDlgEx  PrintDlgExW
  917. #else
  918. #define PrintDlgEx  PrintDlgExA
  919. #endif // !UNICODE
  920. #endif
  921. #endif /* WINVER >= 0x0500 */
  922. //
  923. //  Flags for PrintDlg and PrintDlgEx.
  924. //
  925. #define PD_ALLPAGES                    0x00000000
  926. #define PD_SELECTION                   0x00000001
  927. #define PD_PAGENUMS                    0x00000002
  928. #define PD_NOSELECTION                 0x00000004
  929. #define PD_NOPAGENUMS                  0x00000008
  930. #define PD_COLLATE                     0x00000010
  931. #define PD_PRINTTOFILE                 0x00000020
  932. #define PD_PRINTSETUP                  0x00000040
  933. #define PD_NOWARNING                   0x00000080
  934. #define PD_RETURNDC                    0x00000100
  935. #define PD_RETURNIC                    0x00000200
  936. #define PD_RETURNDEFAULT               0x00000400
  937. #define PD_SHOWHELP                    0x00000800
  938. #define PD_ENABLEPRINTHOOK             0x00001000
  939. #define PD_ENABLESETUPHOOK             0x00002000
  940. #define PD_ENABLEPRINTTEMPLATE         0x00004000
  941. #define PD_ENABLESETUPTEMPLATE         0x00008000
  942. #define PD_ENABLEPRINTTEMPLATEHANDLE   0x00010000
  943. #define PD_ENABLESETUPTEMPLATEHANDLE   0x00020000
  944. #define PD_USEDEVMODECOPIES            0x00040000
  945. #define PD_USEDEVMODECOPIESANDCOLLATE  0x00040000
  946. #define PD_DISABLEPRINTTOFILE          0x00080000
  947. #define PD_HIDEPRINTTOFILE             0x00100000
  948. #define PD_NONETWORKBUTTON             0x00200000
  949. #if(WINVER >= 0x0500)
  950. #define PD_CURRENTPAGE                 0x00400000
  951. #define PD_NOCURRENTPAGE               0x00800000
  952. #define PD_EXCLUSIONFLAGS              0x01000000
  953. #define PD_USELARGETEMPLATE            0x10000000
  954. #endif /* WINVER >= 0x0500 */
  955. #if(WINVER >= 0x0500)
  956. //
  957. //  Exclusion flags for PrintDlgEx.
  958. //
  959. #define PD_EXCL_COPIESANDCOLLATE       (DM_COPIES | DM_COLLATE)
  960. //
  961. //  Define the start page for the print dialog when using PrintDlgEx.
  962. //
  963. #define START_PAGE_GENERAL             0xffffffff
  964. //
  965. //  Result action ids for PrintDlgEx.
  966. //
  967. #define PD_RESULT_CANCEL               0
  968. #define PD_RESULT_PRINT                1
  969. #define PD_RESULT_APPLY                2
  970. #endif /* WINVER >= 0x0500 */
  971. //
  972. //  Device Names structure for PrintDlg and PrintDlgEx.
  973. //
  974. typedef struct tagDEVNAMES {
  975.    WORD wDriverOffset;
  976.    WORD wDeviceOffset;
  977.    WORD wOutputOffset;
  978.    WORD wDefault;
  979. } DEVNAMES, *LPDEVNAMES;
  980. #define DN_DEFAULTPRN      0x0001
  981. WINCOMMDLGAPI DWORD APIENTRY CommDlgExtendedError(VOID);
  982. #if(WINVER >= 0x0400)
  983. #define WM_PSD_PAGESETUPDLG     (WM_USER  )
  984. #define WM_PSD_FULLPAGERECT     (WM_USER+1)
  985. #define WM_PSD_MINMARGINRECT    (WM_USER+2)
  986. #define WM_PSD_MARGINRECT       (WM_USER+3)
  987. #define WM_PSD_GREEKTEXTRECT    (WM_USER+4)
  988. #define WM_PSD_ENVSTAMPRECT     (WM_USER+5)
  989. #define WM_PSD_YAFULLPAGERECT   (WM_USER+6)
  990. typedef UINT_PTR (CALLBACK* LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
  991. typedef UINT_PTR (CALLBACK* LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
  992. typedef struct tagPSDA
  993. {
  994.     DWORD           lStructSize;
  995.     HWND            hwndOwner;
  996.     HGLOBAL         hDevMode;
  997.     HGLOBAL         hDevNames;
  998.     DWORD           Flags;
  999.     POINT           ptPaperSize;
  1000.     RECT            rtMinMargin;
  1001.     RECT            rtMargin;
  1002.     HINSTANCE       hInstance;
  1003.     LPARAM          lCustData;
  1004.     LPPAGESETUPHOOK lpfnPageSetupHook;
  1005.     LPPAGEPAINTHOOK lpfnPagePaintHook;
  1006.     LPCSTR          lpPageSetupTemplateName;
  1007.     HGLOBAL         hPageSetupTemplate;
  1008. } PAGESETUPDLGA, * LPPAGESETUPDLGA;
  1009. typedef struct tagPSDW
  1010. {
  1011.     DWORD           lStructSize;
  1012.     HWND            hwndOwner;
  1013.     HGLOBAL         hDevMode;
  1014.     HGLOBAL         hDevNames;
  1015.     DWORD           Flags;
  1016.     POINT           ptPaperSize;
  1017.     RECT            rtMinMargin;
  1018.     RECT            rtMargin;
  1019.     HINSTANCE       hInstance;
  1020.     LPARAM          lCustData;
  1021.     LPPAGESETUPHOOK lpfnPageSetupHook;
  1022.     LPPAGEPAINTHOOK lpfnPagePaintHook;
  1023.     LPCWSTR         lpPageSetupTemplateName;
  1024.     HGLOBAL         hPageSetupTemplate;
  1025. } PAGESETUPDLGW, * LPPAGESETUPDLGW;
  1026. #ifdef UNICODE
  1027. typedef PAGESETUPDLGW PAGESETUPDLG;
  1028. typedef LPPAGESETUPDLGW LPPAGESETUPDLG;
  1029. #else
  1030. typedef PAGESETUPDLGA PAGESETUPDLG;
  1031. typedef LPPAGESETUPDLGA LPPAGESETUPDLG;
  1032. #endif // UNICODE
  1033. WINCOMMDLGAPI BOOL APIENTRY PageSetupDlgA( LPPAGESETUPDLGA );
  1034. WINCOMMDLGAPI BOOL APIENTRY PageSetupDlgW( LPPAGESETUPDLGW );
  1035. #ifdef UNICODE
  1036. #define PageSetupDlg  PageSetupDlgW
  1037. #else
  1038. #define PageSetupDlg  PageSetupDlgA
  1039. #endif // !UNICODE
  1040. #define PSD_DEFAULTMINMARGINS             0x00000000 // default (printer's)
  1041. #define PSD_INWININIINTLMEASURE           0x00000000 // 1st of 4 possible
  1042. #define PSD_MINMARGINS                    0x00000001 // use caller's
  1043. #define PSD_MARGINS                       0x00000002 // use caller's
  1044. #define PSD_INTHOUSANDTHSOFINCHES         0x00000004 // 2nd of 4 possible
  1045. #define PSD_INHUNDREDTHSOFMILLIMETERS     0x00000008 // 3rd of 4 possible
  1046. #define PSD_DISABLEMARGINS                0x00000010
  1047. #define PSD_DISABLEPRINTER                0x00000020
  1048. #define PSD_NOWARNING                     0x00000080 // must be same as PD_*
  1049. #define PSD_DISABLEORIENTATION            0x00000100
  1050. #define PSD_RETURNDEFAULT                 0x00000400 // must be same as PD_*
  1051. #define PSD_DISABLEPAPER                  0x00000200
  1052. #define PSD_SHOWHELP                      0x00000800 // must be same as PD_*
  1053. #define PSD_ENABLEPAGESETUPHOOK           0x00002000 // must be same as PD_*
  1054. #define PSD_ENABLEPAGESETUPTEMPLATE       0x00008000 // must be same as PD_*
  1055. #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000 // must be same as PD_*
  1056. #define PSD_ENABLEPAGEPAINTHOOK           0x00040000
  1057. #define PSD_DISABLEPAGEPAINTING           0x00080000
  1058. #define PSD_NONETWORKBUTTON               0x00200000 // must be same as PD_*
  1059. #endif /* WINVER >= 0x0400 */
  1060. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  1061. #if ISOLATION_AWARE_ENABLED
  1062. #if !defined(ISOLATION_AWARE_INLINE)
  1063. #if defined(__cplusplus)
  1064. #define ISOLATION_AWARE_INLINE inline
  1065. #else
  1066. #define ISOLATION_AWARE_INLINE __inline
  1067. #endif
  1068. #endif
  1069. FARPROC WINAPI CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL(LPCSTR pszProcName);
  1070. BOOL WINAPI IsolationAwareGetOpenFileNameA(LPOPENFILENAMEA unnamed1);
  1071. BOOL WINAPI IsolationAwareGetOpenFileNameW(LPOPENFILENAMEW unnamed1);
  1072. BOOL WINAPI IsolationAwareGetSaveFileNameA(LPOPENFILENAMEA unnamed1);
  1073. BOOL WINAPI IsolationAwareGetSaveFileNameW(LPOPENFILENAMEW unnamed1);
  1074. short WINAPI IsolationAwareGetFileTitleA(LPCSTR unnamed1,LPSTR unnamed2,WORD unnamed3);
  1075. short WINAPI IsolationAwareGetFileTitleW(LPCWSTR unnamed1,LPWSTR unnamed2,WORD unnamed3);
  1076. BOOL WINAPI IsolationAwareChooseColorA(LPCHOOSECOLORA unnamed1);
  1077. BOOL WINAPI IsolationAwareChooseColorW(LPCHOOSECOLORW unnamed1);
  1078. HWND WINAPI IsolationAwareFindTextA(LPFINDREPLACEA unnamed1);
  1079. HWND WINAPI IsolationAwareFindTextW(LPFINDREPLACEW unnamed1);
  1080. HWND WINAPI IsolationAwareReplaceTextA(LPFINDREPLACEA unnamed1);
  1081. HWND WINAPI IsolationAwareReplaceTextW(LPFINDREPLACEW unnamed1);
  1082. BOOL WINAPI IsolationAwareChooseFontA(LPCHOOSEFONTA unnamed1);
  1083. BOOL WINAPI IsolationAwareChooseFontW(LPCHOOSEFONTW unnamed1);
  1084. BOOL WINAPI IsolationAwarePrintDlgA(LPPRINTDLGA unnamed1);
  1085. BOOL WINAPI IsolationAwarePrintDlgW(LPPRINTDLGW unnamed1);
  1086. #if defined(STDMETHOD) && (WINVER >= 0x0500)
  1087. HRESULT WINAPI IsolationAwarePrintDlgExA(LPPRINTDLGEXA unnamed1);
  1088. HRESULT WINAPI IsolationAwarePrintDlgExW(LPPRINTDLGEXW unnamed1);
  1089. #endif /* defined(STDMETHOD) && (WINVER >= 0x0500) */
  1090. DWORD WINAPI IsolationAwareCommDlgExtendedError(void);
  1091. BOOL WINAPI IsolationAwarePageSetupDlgA(LPPAGESETUPDLGA unnamed1);
  1092. BOOL WINAPI IsolationAwarePageSetupDlgW(LPPAGESETUPDLGW unnamed1);
  1093. #if defined(UNICODE)
  1094. #define IsolationAwareChooseColor IsolationAwareChooseColorW
  1095. #define IsolationAwareChooseFont IsolationAwareChooseFontW
  1096. #define IsolationAwareFindText IsolationAwareFindTextW
  1097. #define IsolationAwareGetFileTitle IsolationAwareGetFileTitleW
  1098. #define IsolationAwareGetOpenFileName IsolationAwareGetOpenFileNameW
  1099. #define IsolationAwareGetSaveFileName IsolationAwareGetSaveFileNameW
  1100. #define IsolationAwarePageSetupDlg IsolationAwarePageSetupDlgW
  1101. #define IsolationAwarePrintDlg IsolationAwarePrintDlgW
  1102. #define IsolationAwarePrintDlgEx IsolationAwarePrintDlgExW
  1103. #define IsolationAwareReplaceText IsolationAwareReplaceTextW
  1104. #else /* UNICODE */
  1105. #define IsolationAwareChooseColor IsolationAwareChooseColorA
  1106. #define IsolationAwareChooseFont IsolationAwareChooseFontA
  1107. #define IsolationAwareFindText IsolationAwareFindTextA
  1108. #define IsolationAwareGetFileTitle IsolationAwareGetFileTitleA
  1109. #define IsolationAwareGetOpenFileName IsolationAwareGetOpenFileNameA
  1110. #define IsolationAwareGetSaveFileName IsolationAwareGetSaveFileNameA
  1111. #define IsolationAwarePageSetupDlg IsolationAwarePageSetupDlgA
  1112. #define IsolationAwarePrintDlg IsolationAwarePrintDlgA
  1113. #define IsolationAwarePrintDlgEx IsolationAwarePrintDlgExA
  1114. #define IsolationAwareReplaceText IsolationAwareReplaceTextA
  1115. #endif /* UNICODE */
  1116. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetOpenFileNameA(LPOPENFILENAMEA unnamed1)
  1117. {
  1118.     BOOL fResult = FALSE;
  1119.     typedef BOOL (WINAPI* PFN)(LPOPENFILENAMEA unnamed1);
  1120.     static PFN s_pfn;
  1121.     ULONG_PTR  ulpCookie = 0;
  1122.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1123.     if (!fActivateActCtxSuccess)
  1124.         return fResult;
  1125.     __try
  1126.     {
  1127.         if (s_pfn == NULL)
  1128.         {
  1129.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetOpenFileNameA");
  1130.             if (s_pfn == NULL)
  1131.                 __leave;
  1132.         }
  1133.         fResult = s_pfn(unnamed1);
  1134.     }
  1135.     __finally
  1136.     {
  1137.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1138.         {
  1139.             const BOOL fPreserveLastError = (fResult == FALSE);
  1140.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1141.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1142.             if (fPreserveLastError)
  1143.                 SetLastError(dwLastError);
  1144.         }
  1145.     }
  1146.     return fResult;
  1147. }
  1148. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetOpenFileNameW(LPOPENFILENAMEW unnamed1)
  1149. {
  1150.     BOOL fResult = FALSE;
  1151.     typedef BOOL (WINAPI* PFN)(LPOPENFILENAMEW unnamed1);
  1152.     static PFN s_pfn;
  1153.     ULONG_PTR  ulpCookie = 0;
  1154.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1155.     if (!fActivateActCtxSuccess)
  1156.         return fResult;
  1157.     __try
  1158.     {
  1159.         if (s_pfn == NULL)
  1160.         {
  1161.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetOpenFileNameW");
  1162.             if (s_pfn == NULL)
  1163.                 __leave;
  1164.         }
  1165.         fResult = s_pfn(unnamed1);
  1166.     }
  1167.     __finally
  1168.     {
  1169.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1170.         {
  1171.             const BOOL fPreserveLastError = (fResult == FALSE);
  1172.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1173.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1174.             if (fPreserveLastError)
  1175.                 SetLastError(dwLastError);
  1176.         }
  1177.     }
  1178.     return fResult;
  1179. }
  1180. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetSaveFileNameA(LPOPENFILENAMEA unnamed1)
  1181. {
  1182.     BOOL fResult = FALSE;
  1183.     typedef BOOL (WINAPI* PFN)(LPOPENFILENAMEA unnamed1);
  1184.     static PFN s_pfn;
  1185.     ULONG_PTR  ulpCookie = 0;
  1186.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1187.     if (!fActivateActCtxSuccess)
  1188.         return fResult;
  1189.     __try
  1190.     {
  1191.         if (s_pfn == NULL)
  1192.         {
  1193.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetSaveFileNameA");
  1194.             if (s_pfn == NULL)
  1195.                 __leave;
  1196.         }
  1197.         fResult = s_pfn(unnamed1);
  1198.     }
  1199.     __finally
  1200.     {
  1201.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1202.         {
  1203.             const BOOL fPreserveLastError = (fResult == FALSE);
  1204.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1205.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1206.             if (fPreserveLastError)
  1207.                 SetLastError(dwLastError);
  1208.         }
  1209.     }
  1210.     return fResult;
  1211. }
  1212. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetSaveFileNameW(LPOPENFILENAMEW unnamed1)
  1213. {
  1214.     BOOL fResult = FALSE;
  1215.     typedef BOOL (WINAPI* PFN)(LPOPENFILENAMEW unnamed1);
  1216.     static PFN s_pfn;
  1217.     ULONG_PTR  ulpCookie = 0;
  1218.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1219.     if (!fActivateActCtxSuccess)
  1220.         return fResult;
  1221.     __try
  1222.     {
  1223.         if (s_pfn == NULL)
  1224.         {
  1225.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetSaveFileNameW");
  1226.             if (s_pfn == NULL)
  1227.                 __leave;
  1228.         }
  1229.         fResult = s_pfn(unnamed1);
  1230.     }
  1231.     __finally
  1232.     {
  1233.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1234.         {
  1235.             const BOOL fPreserveLastError = (fResult == FALSE);
  1236.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1237.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1238.             if (fPreserveLastError)
  1239.                 SetLastError(dwLastError);
  1240.         }
  1241.     }
  1242.     return fResult;
  1243. }
  1244. ISOLATION_AWARE_INLINE short WINAPI IsolationAwareGetFileTitleA(LPCSTR unnamed1,LPSTR unnamed2,WORD unnamed3)
  1245. {
  1246.     short nResult = -1;
  1247.     typedef short (WINAPI* PFN)(LPCSTR unnamed1,LPSTR unnamed2,WORD unnamed3);
  1248.     static PFN s_pfn;
  1249.     ULONG_PTR  ulpCookie = 0;
  1250.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1251.     if (!fActivateActCtxSuccess)
  1252.         return nResult;
  1253.     __try
  1254.     {
  1255.         if (s_pfn == NULL)
  1256.         {
  1257.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetFileTitleA");
  1258.             if (s_pfn == NULL)
  1259.                 __leave;
  1260.         }
  1261.         nResult = s_pfn(unnamed1,unnamed2,unnamed3);
  1262.     }
  1263.     __finally
  1264.     {
  1265.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1266.         {
  1267.             const BOOL fPreserveLastError = (nResult == -1);
  1268.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1269.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1270.             if (fPreserveLastError)
  1271.                 SetLastError(dwLastError);
  1272.         }
  1273.     }
  1274.     return nResult;
  1275. }
  1276. ISOLATION_AWARE_INLINE short WINAPI IsolationAwareGetFileTitleW(LPCWSTR unnamed1,LPWSTR unnamed2,WORD unnamed3)
  1277. {
  1278.     short nResult = -1;
  1279.     typedef short (WINAPI* PFN)(LPCWSTR unnamed1,LPWSTR unnamed2,WORD unnamed3);
  1280.     static PFN s_pfn;
  1281.     ULONG_PTR  ulpCookie = 0;
  1282.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1283.     if (!fActivateActCtxSuccess)
  1284.         return nResult;
  1285.     __try
  1286.     {
  1287.         if (s_pfn == NULL)
  1288.         {
  1289.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("GetFileTitleW");
  1290.             if (s_pfn == NULL)
  1291.                 __leave;
  1292.         }
  1293.         nResult = s_pfn(unnamed1,unnamed2,unnamed3);
  1294.     }
  1295.     __finally
  1296.     {
  1297.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1298.         {
  1299.             const BOOL fPreserveLastError = (nResult == -1);
  1300.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1301.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1302.             if (fPreserveLastError)
  1303.                 SetLastError(dwLastError);
  1304.         }
  1305.     }
  1306.     return nResult;
  1307. }
  1308. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareChooseColorA(LPCHOOSECOLORA unnamed1)
  1309. {
  1310.     BOOL fResult = FALSE;
  1311.     typedef BOOL (WINAPI* PFN)(LPCHOOSECOLORA unnamed1);
  1312.     static PFN s_pfn;
  1313.     ULONG_PTR  ulpCookie = 0;
  1314.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1315.     if (!fActivateActCtxSuccess)
  1316.         return fResult;
  1317.     __try
  1318.     {
  1319.         if (s_pfn == NULL)
  1320.         {
  1321.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ChooseColorA");
  1322.             if (s_pfn == NULL)
  1323.                 __leave;
  1324.         }
  1325.         fResult = s_pfn(unnamed1);
  1326.     }
  1327.     __finally
  1328.     {
  1329.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1330.         {
  1331.             const BOOL fPreserveLastError = (fResult == FALSE);
  1332.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1333.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1334.             if (fPreserveLastError)
  1335.                 SetLastError(dwLastError);
  1336.         }
  1337.     }
  1338.     return fResult;
  1339. }
  1340. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareChooseColorW(LPCHOOSECOLORW unnamed1)
  1341. {
  1342.     BOOL fResult = FALSE;
  1343.     typedef BOOL (WINAPI* PFN)(LPCHOOSECOLORW unnamed1);
  1344.     static PFN s_pfn;
  1345.     ULONG_PTR  ulpCookie = 0;
  1346.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1347.     if (!fActivateActCtxSuccess)
  1348.         return fResult;
  1349.     __try
  1350.     {
  1351.         if (s_pfn == NULL)
  1352.         {
  1353.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ChooseColorW");
  1354.             if (s_pfn == NULL)
  1355.                 __leave;
  1356.         }
  1357.         fResult = s_pfn(unnamed1);
  1358.     }
  1359.     __finally
  1360.     {
  1361.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1362.         {
  1363.             const BOOL fPreserveLastError = (fResult == FALSE);
  1364.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1365.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1366.             if (fPreserveLastError)
  1367.                 SetLastError(dwLastError);
  1368.         }
  1369.     }
  1370.     return fResult;
  1371. }
  1372. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareFindTextA(LPFINDREPLACEA unnamed1)
  1373. {
  1374.     HWND windowResult = NULL;
  1375.     typedef HWND (WINAPI* PFN)(LPFINDREPLACEA unnamed1);
  1376.     static PFN s_pfn;
  1377.     ULONG_PTR  ulpCookie = 0;
  1378.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1379.     if (!fActivateActCtxSuccess)
  1380.         return windowResult;
  1381.     __try
  1382.     {
  1383.         if (s_pfn == NULL)
  1384.         {
  1385.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("FindTextA");
  1386.             if (s_pfn == NULL)
  1387.                 __leave;
  1388.         }
  1389.         windowResult = s_pfn(unnamed1);
  1390.     }
  1391.     __finally
  1392.     {
  1393.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1394.         {
  1395.             const BOOL fPreserveLastError = (windowResult == NULL);
  1396.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1397.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1398.             if (fPreserveLastError)
  1399.                 SetLastError(dwLastError);
  1400.         }
  1401.     }
  1402.     return windowResult;
  1403. }
  1404. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareFindTextW(LPFINDREPLACEW unnamed1)
  1405. {
  1406.     HWND windowResult = NULL;
  1407.     typedef HWND (WINAPI* PFN)(LPFINDREPLACEW unnamed1);
  1408.     static PFN s_pfn;
  1409.     ULONG_PTR  ulpCookie = 0;
  1410.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1411.     if (!fActivateActCtxSuccess)
  1412.         return windowResult;
  1413.     __try
  1414.     {
  1415.         if (s_pfn == NULL)
  1416.         {
  1417.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("FindTextW");
  1418.             if (s_pfn == NULL)
  1419.                 __leave;
  1420.         }
  1421.         windowResult = s_pfn(unnamed1);
  1422.     }
  1423.     __finally
  1424.     {
  1425.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1426.         {
  1427.             const BOOL fPreserveLastError = (windowResult == NULL);
  1428.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1429.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1430.             if (fPreserveLastError)
  1431.                 SetLastError(dwLastError);
  1432.         }
  1433.     }
  1434.     return windowResult;
  1435. }
  1436. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareReplaceTextA(LPFINDREPLACEA unnamed1)
  1437. {
  1438.     HWND windowResult = NULL;
  1439.     typedef HWND (WINAPI* PFN)(LPFINDREPLACEA unnamed1);
  1440.     static PFN s_pfn;
  1441.     ULONG_PTR  ulpCookie = 0;
  1442.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1443.     if (!fActivateActCtxSuccess)
  1444.         return windowResult;
  1445.     __try
  1446.     {
  1447.         if (s_pfn == NULL)
  1448.         {
  1449.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ReplaceTextA");
  1450.             if (s_pfn == NULL)
  1451.                 __leave;
  1452.         }
  1453.         windowResult = s_pfn(unnamed1);
  1454.     }
  1455.     __finally
  1456.     {
  1457.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1458.         {
  1459.             const BOOL fPreserveLastError = (windowResult == NULL);
  1460.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1461.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1462.             if (fPreserveLastError)
  1463.                 SetLastError(dwLastError);
  1464.         }
  1465.     }
  1466.     return windowResult;
  1467. }
  1468. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareReplaceTextW(LPFINDREPLACEW unnamed1)
  1469. {
  1470.     HWND windowResult = NULL;
  1471.     typedef HWND (WINAPI* PFN)(LPFINDREPLACEW unnamed1);
  1472.     static PFN s_pfn;
  1473.     ULONG_PTR  ulpCookie = 0;
  1474.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1475.     if (!fActivateActCtxSuccess)
  1476.         return windowResult;
  1477.     __try
  1478.     {
  1479.         if (s_pfn == NULL)
  1480.         {
  1481.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ReplaceTextW");
  1482.             if (s_pfn == NULL)
  1483.                 __leave;
  1484.         }
  1485.         windowResult = s_pfn(unnamed1);
  1486.     }
  1487.     __finally
  1488.     {
  1489.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1490.         {
  1491.             const BOOL fPreserveLastError = (windowResult == NULL);
  1492.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1493.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1494.             if (fPreserveLastError)
  1495.                 SetLastError(dwLastError);
  1496.         }
  1497.     }
  1498.     return windowResult;
  1499. }
  1500. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareChooseFontA(LPCHOOSEFONTA unnamed1)
  1501. {
  1502.     BOOL fResult = FALSE;
  1503.     typedef BOOL (WINAPI* PFN)(LPCHOOSEFONTA unnamed1);
  1504.     static PFN s_pfn;
  1505.     ULONG_PTR  ulpCookie = 0;
  1506.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1507.     if (!fActivateActCtxSuccess)
  1508.         return fResult;
  1509.     __try
  1510.     {
  1511.         if (s_pfn == NULL)
  1512.         {
  1513.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ChooseFontA");
  1514.             if (s_pfn == NULL)
  1515.                 __leave;
  1516.         }
  1517.         fResult = s_pfn(unnamed1);
  1518.     }
  1519.     __finally
  1520.     {
  1521.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1522.         {
  1523.             const BOOL fPreserveLastError = (fResult == FALSE);
  1524.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1525.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1526.             if (fPreserveLastError)
  1527.                 SetLastError(dwLastError);
  1528.         }
  1529.     }
  1530.     return fResult;
  1531. }
  1532. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareChooseFontW(LPCHOOSEFONTW unnamed1)
  1533. {
  1534.     BOOL fResult = FALSE;
  1535.     typedef BOOL (WINAPI* PFN)(LPCHOOSEFONTW unnamed1);
  1536.     static PFN s_pfn;
  1537.     ULONG_PTR  ulpCookie = 0;
  1538.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1539.     if (!fActivateActCtxSuccess)
  1540.         return fResult;
  1541.     __try
  1542.     {
  1543.         if (s_pfn == NULL)
  1544.         {
  1545.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("ChooseFontW");
  1546.             if (s_pfn == NULL)
  1547.                 __leave;
  1548.         }
  1549.         fResult = s_pfn(unnamed1);
  1550.     }
  1551.     __finally
  1552.     {
  1553.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1554.         {
  1555.             const BOOL fPreserveLastError = (fResult == FALSE);
  1556.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1557.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1558.             if (fPreserveLastError)
  1559.                 SetLastError(dwLastError);
  1560.         }
  1561.     }
  1562.     return fResult;
  1563. }
  1564. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwarePrintDlgA(LPPRINTDLGA unnamed1)
  1565. {
  1566.     BOOL fResult = FALSE;
  1567.     typedef BOOL (WINAPI* PFN)(LPPRINTDLGA unnamed1);
  1568.     static PFN s_pfn;
  1569.     ULONG_PTR  ulpCookie = 0;
  1570.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1571.     if (!fActivateActCtxSuccess)
  1572.         return fResult;
  1573.     __try
  1574.     {
  1575.         if (s_pfn == NULL)
  1576.         {
  1577.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PrintDlgA");
  1578.             if (s_pfn == NULL)
  1579.                 __leave;
  1580.         }
  1581.         fResult = s_pfn(unnamed1);
  1582.     }
  1583.     __finally
  1584.     {
  1585.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1586.         {
  1587.             const BOOL fPreserveLastError = (fResult == FALSE);
  1588.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1589.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1590.             if (fPreserveLastError)
  1591.                 SetLastError(dwLastError);
  1592.         }
  1593.     }
  1594.     return fResult;
  1595. }
  1596. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwarePrintDlgW(LPPRINTDLGW unnamed1)
  1597. {
  1598.     BOOL fResult = FALSE;
  1599.     typedef BOOL (WINAPI* PFN)(LPPRINTDLGW unnamed1);
  1600.     static PFN s_pfn;
  1601.     ULONG_PTR  ulpCookie = 0;
  1602.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1603.     if (!fActivateActCtxSuccess)
  1604.         return fResult;
  1605.     __try
  1606.     {
  1607.         if (s_pfn == NULL)
  1608.         {
  1609.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PrintDlgW");
  1610.             if (s_pfn == NULL)
  1611.                 __leave;
  1612.         }
  1613.         fResult = s_pfn(unnamed1);
  1614.     }
  1615.     __finally
  1616.     {
  1617.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1618.         {
  1619.             const BOOL fPreserveLastError = (fResult == FALSE);
  1620.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1621.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1622.             if (fPreserveLastError)
  1623.                 SetLastError(dwLastError);
  1624.         }
  1625.     }
  1626.     return fResult;
  1627. }
  1628. #if defined(STDMETHOD) && (WINVER >= 0x0500)
  1629. ISOLATION_AWARE_INLINE HRESULT WINAPI IsolationAwarePrintDlgExA(LPPRINTDLGEXA unnamed1)
  1630. {
  1631.     HRESULT result = S_OK;
  1632.     typedef HRESULT (WINAPI* PFN)(LPPRINTDLGEXA unnamed1);
  1633.     static PFN s_pfn;
  1634.     ULONG_PTR  ulpCookie = 0;
  1635.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1636.     if (!fActivateActCtxSuccess)
  1637.         goto ExitWin32ToHresult;
  1638.     __try
  1639.     {
  1640.         if (s_pfn == NULL)
  1641.         {
  1642.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PrintDlgExA");
  1643.             if (s_pfn == NULL)
  1644.                 goto ExitWin32ToHresult;
  1645.         }
  1646.         result = s_pfn(unnamed1);
  1647.     }
  1648.     __finally
  1649.     {
  1650.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1651.         {
  1652.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1653.         }
  1654.     }
  1655.     return result;
  1656. ExitWin32ToHresult:
  1657.     {
  1658.         DWORD dwLastError = GetLastError();
  1659.         if (dwLastError == NO_ERROR)
  1660.             dwLastError = ERROR_INTERNAL_ERROR;
  1661.         result = HRESULT_FROM_WIN32(dwLastError);
  1662.         return result;
  1663.     }
  1664. }
  1665. ISOLATION_AWARE_INLINE HRESULT WINAPI IsolationAwarePrintDlgExW(LPPRINTDLGEXW unnamed1)
  1666. {
  1667.     HRESULT result = S_OK;
  1668.     typedef HRESULT (WINAPI* PFN)(LPPRINTDLGEXW unnamed1);
  1669.     static PFN s_pfn;
  1670.     ULONG_PTR  ulpCookie = 0;
  1671.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1672.     if (!fActivateActCtxSuccess)
  1673.         goto ExitWin32ToHresult;
  1674.     __try
  1675.     {
  1676.         if (s_pfn == NULL)
  1677.         {
  1678.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PrintDlgExW");
  1679.             if (s_pfn == NULL)
  1680.                 goto ExitWin32ToHresult;
  1681.         }
  1682.         result = s_pfn(unnamed1);
  1683.     }
  1684.     __finally
  1685.     {
  1686.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1687.         {
  1688.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1689.         }
  1690.     }
  1691.     return result;
  1692. ExitWin32ToHresult:
  1693.     {
  1694.         DWORD dwLastError = GetLastError();
  1695.         if (dwLastError == NO_ERROR)
  1696.             dwLastError = ERROR_INTERNAL_ERROR;
  1697.         result = HRESULT_FROM_WIN32(dwLastError);
  1698.         return result;
  1699.     }
  1700. }
  1701. #endif /* defined(STDMETHOD) && (WINVER >= 0x0500) */
  1702. ISOLATION_AWARE_INLINE DWORD WINAPI IsolationAwareCommDlgExtendedError(void)
  1703. {
  1704.     DWORD nResult = 0 ;
  1705.     typedef DWORD (WINAPI* PFN)(void);
  1706.     static PFN s_pfn;
  1707.     ULONG_PTR  ulpCookie = 0;
  1708.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1709.     if (!fActivateActCtxSuccess)
  1710.         return nResult;
  1711.     __try
  1712.     {
  1713.         if (s_pfn == NULL)
  1714.         {
  1715.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("CommDlgExtendedError");
  1716.             if (s_pfn == NULL)
  1717.                 __leave;
  1718.         }
  1719.         nResult = s_pfn();
  1720.     }
  1721.     __finally
  1722.     {
  1723.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1724.         {
  1725.             const BOOL fPreserveLastError = (nResult == 0 );
  1726.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1727.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1728.             if (fPreserveLastError)
  1729.                 SetLastError(dwLastError);
  1730.         }
  1731.     }
  1732.     return nResult;
  1733. }
  1734. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwarePageSetupDlgA(LPPAGESETUPDLGA unnamed1)
  1735. {
  1736.     BOOL fResult = FALSE;
  1737.     typedef BOOL (WINAPI* PFN)(LPPAGESETUPDLGA unnamed1);
  1738.     static PFN s_pfn;
  1739.     ULONG_PTR  ulpCookie = 0;
  1740.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1741.     if (!fActivateActCtxSuccess)
  1742.         return fResult;
  1743.     __try
  1744.     {
  1745.         if (s_pfn == NULL)
  1746.         {
  1747.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PageSetupDlgA");
  1748.             if (s_pfn == NULL)
  1749.                 __leave;
  1750.         }
  1751.         fResult = s_pfn(unnamed1);
  1752.     }
  1753.     __finally
  1754.     {
  1755.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1756.         {
  1757.             const BOOL fPreserveLastError = (fResult == FALSE);
  1758.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1759.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1760.             if (fPreserveLastError)
  1761.                 SetLastError(dwLastError);
  1762.         }
  1763.     }
  1764.     return fResult;
  1765. }
  1766. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwarePageSetupDlgW(LPPAGESETUPDLGW unnamed1)
  1767. {
  1768.     BOOL fResult = FALSE;
  1769.     typedef BOOL (WINAPI* PFN)(LPPAGESETUPDLGW unnamed1);
  1770.     static PFN s_pfn;
  1771.     ULONG_PTR  ulpCookie = 0;
  1772.     const BOOL fActivateActCtxSuccess = IsolationAwarePrivateG_FqbjaLEiEL || IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1773.     if (!fActivateActCtxSuccess)
  1774.         return fResult;
  1775.     __try
  1776.     {
  1777.         if (s_pfn == NULL)
  1778.         {
  1779.             s_pfn = (PFN)CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL("PageSetupDlgW");
  1780.             if (s_pfn == NULL)
  1781.                 __leave;
  1782.         }
  1783.         fResult = s_pfn(unnamed1);
  1784.     }
  1785.     __finally
  1786.     {
  1787.         if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1788.         {
  1789.             const BOOL fPreserveLastError = (fResult == FALSE);
  1790.             const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  1791.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1792.             if (fPreserveLastError)
  1793.                 SetLastError(dwLastError);
  1794.         }
  1795.     }
  1796.     return fResult;
  1797. }
  1798. ISOLATION_AWARE_INLINE FARPROC WINAPI CommdlgIsolationAwarePrivatetEgCebCnDDeEff_pbMDLGDC_DLL(LPCSTR pszProcName)
  1799. /* This function is shared by the other stubs in this header. */
  1800. {
  1801.     FARPROC proc = NULL;
  1802.     static HMODULE s_module;
  1803.     BOOL fActivateActCtxSuccess = FALSE;
  1804.     ULONG_PTR ulpCookie = 0;
  1805.     __try
  1806.     {
  1807.         if (s_module == NULL)
  1808.         {
  1809.             if (!IsolationAwarePrivateG_FqbjaLEiEL)
  1810.             {
  1811.                 fActivateActCtxSuccess = IsolationAwarePrivatenCgIiAgEzlnCgpgk(&ulpCookie);
  1812.                 if (!fActivateActCtxSuccess)
  1813.                     __leave;
  1814.             }
  1815.             s_module = LoadLibraryW(L"Comdlg32.dll");
  1816.             if (s_module == NULL)
  1817.             {
  1818.                 if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
  1819.                     __leave;
  1820.                 s_module = LoadLibraryA("Comdlg32.dll");
  1821.                 if (s_module == NULL)
  1822.                     __leave;
  1823.             }
  1824.         }
  1825.         proc = GetProcAddress(s_module, pszProcName);
  1826.     }
  1827.     __finally
  1828.     {
  1829.         if (!IsolationAwarePrivateG_FqbjaLEiEL && fActivateActCtxSuccess)
  1830.         {
  1831.             const DWORD dwLastError = (proc == NULL) ? GetLastError() : NO_ERROR;
  1832.             (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  1833.             if (proc == NULL)
  1834.                 SetLastError(dwLastError);
  1835.         }
  1836.     }
  1837.     return proc;
  1838. }
  1839. #define ChooseColorA IsolationAwareChooseColorA
  1840. #define ChooseColorW IsolationAwareChooseColorW
  1841. #define ChooseFontA IsolationAwareChooseFontA
  1842. #define ChooseFontW IsolationAwareChooseFontW
  1843. #define CommDlgExtendedError IsolationAwareCommDlgExtendedError
  1844. #define FindTextA IsolationAwareFindTextA
  1845. #define FindTextW IsolationAwareFindTextW
  1846. #define GetFileTitleA IsolationAwareGetFileTitleA
  1847. #define GetFileTitleW IsolationAwareGetFileTitleW
  1848. #define GetOpenFileNameA IsolationAwareGetOpenFileNameA
  1849. #define GetOpenFileNameW IsolationAwareGetOpenFileNameW
  1850. #define GetSaveFileNameA IsolationAwareGetSaveFileNameA
  1851. #define GetSaveFileNameW IsolationAwareGetSaveFileNameW
  1852. #define PageSetupDlgA IsolationAwarePageSetupDlgA
  1853. #define PageSetupDlgW IsolationAwarePageSetupDlgW
  1854. #define PrintDlgA IsolationAwarePrintDlgA
  1855. #define PrintDlgExA IsolationAwarePrintDlgExA
  1856. #define PrintDlgExW IsolationAwarePrintDlgExW
  1857. #define PrintDlgW IsolationAwarePrintDlgW
  1858. #define ReplaceTextA IsolationAwareReplaceTextA
  1859. #define ReplaceTextW IsolationAwareReplaceTextW
  1860. #endif /* ISOLATION_AWARE_ENABLED */
  1861. #endif /* RC */
  1862. #ifdef __cplusplus
  1863. }
  1864. #endif  /* __cplusplus */
  1865. #if !defined(_WIN64)
  1866. #include <poppack.h>
  1867. #endif
  1868. #endif  /* GUID_DEFS_ONLY */
  1869. #endif  /* !_INC_COMMDLG */