home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / commdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  27.5 KB  |  716 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *   commdlg.h -- This module defines the 32-Bit Common Dialog APIs      *
  4. *                                                                       *
  5. *   Copyright (c) 1992-1995, Microsoft Corp. All rights reserved.       *
  6. *                                                                       *
  7. ************************************************************************/
  8. #ifndef _INC_COMMDLG
  9. #define _INC_COMMDLG
  10.  
  11. #include <pshpack1.h>         /* Assume byte packing throughout */
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {            /* Assume C declarations for C++ */
  15. #endif  /* __cplusplus */
  16.  
  17. #if(WINVER >= 0x0400)
  18. #ifdef __cplusplus
  19. #define SNDMSG ::SendMessage
  20. #else   /* __cplusplus */
  21. #define SNDMSG SendMessage
  22. #endif  /* __cplusplus */
  23. #endif /* WINVER >= 0x0400 */
  24.  
  25. typedef UINT (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  26.  
  27. typedef struct tagOFNA {
  28.    DWORD        lStructSize;
  29.    HWND         hwndOwner;
  30.    HINSTANCE    hInstance;
  31.    LPCSTR       lpstrFilter;
  32.    LPSTR        lpstrCustomFilter;
  33.    DWORD        nMaxCustFilter;
  34.    DWORD        nFilterIndex;
  35.    LPSTR        lpstrFile;
  36.    DWORD        nMaxFile;
  37.    LPSTR        lpstrFileTitle;
  38.    DWORD        nMaxFileTitle;
  39.    LPCSTR       lpstrInitialDir;
  40.    LPCSTR       lpstrTitle;
  41.    DWORD        Flags;
  42.    WORD         nFileOffset;
  43.    WORD         nFileExtension;
  44.    LPCSTR       lpstrDefExt;
  45.    LPARAM       lCustData;
  46.    LPOFNHOOKPROC lpfnHook;
  47.    LPCSTR       lpTemplateName;
  48. } OPENFILENAMEA, *LPOPENFILENAMEA;
  49. typedef struct tagOFNW {
  50.    DWORD        lStructSize;
  51.    HWND         hwndOwner;
  52.    HINSTANCE    hInstance;
  53.    LPCWSTR      lpstrFilter;
  54.    LPWSTR       lpstrCustomFilter;
  55.    DWORD        nMaxCustFilter;
  56.    DWORD        nFilterIndex;
  57.    LPWSTR       lpstrFile;
  58.    DWORD        nMaxFile;
  59.    LPWSTR       lpstrFileTitle;
  60.    DWORD        nMaxFileTitle;
  61.    LPCWSTR      lpstrInitialDir;
  62.    LPCWSTR      lpstrTitle;
  63.    DWORD        Flags;
  64.    WORD         nFileOffset;
  65.    WORD         nFileExtension;
  66.    LPCWSTR      lpstrDefExt;
  67.    LPARAM       lCustData;
  68.    LPOFNHOOKPROC lpfnHook;
  69.    LPCWSTR      lpTemplateName;
  70. } OPENFILENAMEW, *LPOPENFILENAMEW;
  71. #ifdef UNICODE
  72. typedef OPENFILENAMEW OPENFILENAME;
  73. typedef LPOPENFILENAMEW LPOPENFILENAME;
  74. #else
  75. typedef OPENFILENAMEA OPENFILENAME;
  76. typedef LPOPENFILENAMEA LPOPENFILENAME;
  77. #endif // UNICODE
  78.  
  79. BOOL  APIENTRY     GetOpenFileNameA(LPOPENFILENAMEA);
  80. BOOL  APIENTRY     GetOpenFileNameW(LPOPENFILENAMEW);
  81. #ifdef UNICODE
  82. #define GetOpenFileName  GetOpenFileNameW
  83. #else
  84. #define GetOpenFileName  GetOpenFileNameA
  85. #endif // !UNICODE
  86. BOOL  APIENTRY     GetSaveFileNameA(LPOPENFILENAMEA);
  87. BOOL  APIENTRY     GetSaveFileNameW(LPOPENFILENAMEW);
  88. #ifdef UNICODE
  89. #define GetSaveFileName  GetSaveFileNameW
  90. #else
  91. #define GetSaveFileName  GetSaveFileNameA
  92. #endif // !UNICODE
  93. short APIENTRY     GetFileTitleA(LPCSTR, LPSTR, WORD);
  94. short APIENTRY     GetFileTitleW(LPCWSTR, LPWSTR, WORD);
  95. #ifdef UNICODE
  96. #define GetFileTitle  GetFileTitleW
  97. #else
  98. #define GetFileTitle  GetFileTitleA
  99. #endif // !UNICODE
  100.  
  101. #define OFN_READONLY                 0x00000001
  102. #define OFN_OVERWRITEPROMPT          0x00000002
  103. #define OFN_HIDEREADONLY             0x00000004
  104. #define OFN_NOCHANGEDIR              0x00000008
  105. #define OFN_SHOWHELP                 0x00000010
  106. #define OFN_ENABLEHOOK               0x00000020
  107. #define OFN_ENABLETEMPLATE           0x00000040
  108. #define OFN_ENABLETEMPLATEHANDLE     0x00000080
  109. #define OFN_NOVALIDATE               0x00000100
  110. #define OFN_ALLOWMULTISELECT         0x00000200
  111. #define OFN_EXTENSIONDIFFERENT       0x00000400
  112. #define OFN_PATHMUSTEXIST            0x00000800
  113. #define OFN_FILEMUSTEXIST            0x00001000
  114. #define OFN_CREATEPROMPT             0x00002000
  115. #define OFN_SHAREAWARE               0x00004000
  116. #define OFN_NOREADONLYRETURN         0x00008000
  117. #define OFN_NOTESTFILECREATE         0x00010000
  118. #define OFN_NONETWORKBUTTON          0x00020000
  119. #define OFN_NOLONGNAMES              0x00040000     // force no long names for 4.x modules
  120. #if(WINVER >= 0x0400)
  121. #define OFN_EXPLORER                 0x00080000     // new look commdlg
  122. #define OFN_NODEREFERENCELINKS       0x00100000
  123. #define OFN_LONGNAMES                0x00200000     // force long names for 3.x modules
  124. #endif /* WINVER >= 0x0400 */
  125.  
  126. // Return values for the registered message sent to the hook function
  127. // when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  128. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  129. // up no warning (returned when the app has already put up a warning
  130. // message), and OFN_SHAREWARN puts up the default warning message
  131. // for sharing violations.
  132. //
  133. // Note:  Undefined return values map to OFN_SHAREWARN, but are
  134. //        reserved for future use.
  135.  
  136. #define OFN_SHAREFALLTHROUGH     2
  137. #define OFN_SHARENOWARN          1
  138. #define OFN_SHAREWARN            0
  139.  
  140. typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  141.  
  142. #if(WINVER >= 0x0400)
  143. // Structure used for all OpenFileName notifications
  144. typedef struct _OFNOTIFYA
  145. {
  146.         NMHDR           hdr;
  147.         LPOPENFILENAMEA lpOFN;
  148.         LPSTR           pszFile;        // May be NULL
  149. } OFNOTIFYA, FAR *LPOFNOTIFYA;
  150. // Structure used for all OpenFileName notifications
  151. typedef struct _OFNOTIFYW
  152. {
  153.         NMHDR           hdr;
  154.         LPOPENFILENAMEW lpOFN;
  155.         LPWSTR          pszFile;        // May be NULL
  156. } OFNOTIFYW, FAR *LPOFNOTIFYW;
  157. #ifdef UNICODE
  158. typedef OFNOTIFYW OFNOTIFY;
  159. typedef LPOFNOTIFYW LPOFNOTIFY;
  160. #else
  161. typedef OFNOTIFYA OFNOTIFY;
  162. typedef LPOFNOTIFYA LPOFNOTIFY;
  163. #endif // UNICODE
  164.  
  165. #define CDN_FIRST   (0U-601U)
  166. #define CDN_LAST    (0U-699U)
  167.  
  168. // Notifications when Open or Save dialog status changes
  169. #define CDN_INITDONE            (CDN_FIRST - 0x0000)
  170. #define CDN_SELCHANGE           (CDN_FIRST - 0x0001)
  171. #define CDN_FOLDERCHANGE        (CDN_FIRST - 0x0002)
  172. #define CDN_SHAREVIOLATION      (CDN_FIRST - 0x0003)
  173. #define CDN_HELP                (CDN_FIRST - 0x0004)
  174. #define CDN_FILEOK              (CDN_FIRST - 0x0005)
  175. #define CDN_TYPECHANGE          (CDN_FIRST - 0x0006)
  176.  
  177. #define CDM_FIRST       (WM_USER + 100)
  178. #define CDM_LAST        (WM_USER + 200)
  179.  
  180. // Messages to query information from the Open or Save dialogs
  181.  
  182. // lParam = pointer to text buffer that gets filled in
  183. // wParam = max number of characters of the text buffer (including NULL)
  184. // return = < 0 if error; number of characters needed (including NULL)
  185. #define CDM_GETSPEC             (CDM_FIRST + 0x0000)
  186. #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
  187.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  188. #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
  189.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  190. #ifdef UNICODE
  191. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecW
  192. #else
  193. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecA
  194. #endif // !UNICODE
  195.  
  196. // lParam = pointer to text buffer that gets filled in
  197. // wParam = max number of characters of the text buffer (including NULL)
  198. // return = < 0 if error; number of characters needed (including NULL)
  199. #define CDM_GETFILEPATH         (CDM_FIRST + 0x0001)
  200. #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
  201.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  202. #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
  203.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  204. #ifdef UNICODE
  205. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathW
  206. #else
  207. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathA
  208. #endif // !UNICODE
  209.  
  210. // lParam = pointer to text buffer that gets filled in
  211. // wParam = max number of characters of the text buffer (including NULL)
  212. // return = < 0 if error; number of characters needed (including NULL)
  213. #define CDM_GETFOLDERPATH       (CDM_FIRST + 0x0002)
  214. #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
  215.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  216. #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
  217.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  218. #ifdef UNICODE
  219. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathW
  220. #else
  221. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathA
  222. #endif // !UNICODE
  223.  
  224. // lParam = pointer to ITEMIDLIST buffer that gets filled in
  225. // wParam = size of the ITEMIDLIST buffer
  226. // return = < 0 if error; length of buffer needed
  227. #define CDM_GETFOLDERIDLIST     (CDM_FIRST + 0x0003)
  228. #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
  229.         (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  230.  
  231. // lParam = pointer to a string
  232. // wParam = ID of control to change
  233. // return = not used
  234. #define CDM_SETCONTROLTEXT      (CDM_FIRST + 0x0004)
  235. #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
  236.         (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  237.  
  238. // lParam = not used
  239. // wParam = ID of control to change
  240. // return = not used
  241. #define CDM_HIDECONTROL         (CDM_FIRST + 0x0005)
  242. #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
  243.         (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  244.  
  245. // lParam = pointer to default extension (no dot)
  246. // wParam = not used
  247. // return = not used
  248. #define CDM_SETDEFEXT           (CDM_FIRST + 0x0006)
  249. #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
  250.         (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  251. #endif /* WINVER >= 0x0400 */
  252.  
  253. typedef struct tagCHOOSECOLORA {
  254.    DWORD        lStructSize;
  255.    HWND         hwndOwner;
  256.    HWND         hInstance;
  257.    COLORREF     rgbResult;
  258.    COLORREF*    lpCustColors;
  259.    DWORD        Flags;
  260.    LPARAM       lCustData;
  261.    LPCCHOOKPROC lpfnHook;
  262.    LPCSTR       lpTemplateName;
  263. } CHOOSECOLORA, *LPCHOOSECOLORA;
  264. typedef struct tagCHOOSECOLORW {
  265.    DWORD        lStructSize;
  266.    HWND         hwndOwner;
  267.    HWND         hInstance;
  268.    COLORREF     rgbResult;
  269.    COLORREF*    lpCustColors;
  270.    DWORD        Flags;
  271.    LPARAM       lCustData;
  272.    LPCCHOOKPROC lpfnHook;
  273.    LPCWSTR      lpTemplateName;
  274. } CHOOSECOLORW, *LPCHOOSECOLORW;
  275. #ifdef UNICODE
  276. typedef CHOOSECOLORW CHOOSECOLOR;
  277. typedef LPCHOOSECOLORW LPCHOOSECOLOR;
  278. #else
  279. typedef CHOOSECOLORA CHOOSECOLOR;
  280. typedef LPCHOOSECOLORA LPCHOOSECOLOR;
  281. #endif // UNICODE
  282.  
  283. BOOL  APIENTRY ChooseColorA(LPCHOOSECOLORA);
  284. BOOL  APIENTRY ChooseColorW(LPCHOOSECOLORW);
  285. #ifdef UNICODE
  286. #define ChooseColor  ChooseColorW
  287. #else
  288. #define ChooseColor  ChooseColorA
  289. #endif // !UNICODE
  290.  
  291. #define CC_RGBINIT               0x00000001
  292. #define CC_FULLOPEN              0x00000002
  293. #define CC_PREVENTFULLOPEN       0x00000004
  294. #define CC_SHOWHELP              0x00000008
  295. #define CC_ENABLEHOOK            0x00000010
  296. #define CC_ENABLETEMPLATE        0x00000020
  297. #define CC_ENABLETEMPLATEHANDLE  0x00000040
  298. #if(WINVER >= 0x0400)
  299. #define CC_SOLIDCOLOR            0x00000080
  300. #define CC_ANYCOLOR              0x00000100
  301. #endif /* WINVER >= 0x0400 */
  302.  
  303. typedef UINT (APIENTRY *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  304.  
  305. typedef struct tagFINDREPLACEA {
  306.    DWORD        lStructSize;        // size of this struct 0x20
  307.    HWND         hwndOwner;          // handle to owner's window
  308.    HINSTANCE    hInstance;          // instance handle of.EXE that
  309.                                     //   contains cust. dlg. template
  310.    DWORD        Flags;              // one or more of the FR_??
  311.    LPSTR        lpstrFindWhat;      // ptr. to search string
  312.    LPSTR        lpstrReplaceWith;   // ptr. to replace string
  313.    WORD         wFindWhatLen;       // size of find buffer
  314.    WORD         wReplaceWithLen;    // size of replace buffer
  315.    LPARAM       lCustData;          // data passed to hook fn.
  316.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  317.    LPCSTR       lpTemplateName;     // custom template name
  318. } FINDREPLACEA, *LPFINDREPLACEA;
  319. typedef struct tagFINDREPLACEW {
  320.    DWORD        lStructSize;        // size of this struct 0x20
  321.    HWND         hwndOwner;          // handle to owner's window
  322.    HINSTANCE    hInstance;          // instance handle of.EXE that
  323.                                     //   contains cust. dlg. template
  324.    DWORD        Flags;              // one or more of the FR_??
  325.    LPWSTR       lpstrFindWhat;      // ptr. to search string
  326.    LPWSTR       lpstrReplaceWith;   // ptr. to replace string
  327.    WORD         wFindWhatLen;       // size of find buffer
  328.    WORD         wReplaceWithLen;    // size of replace buffer
  329.    LPARAM       lCustData;          // data passed to hook fn.
  330.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  331.    LPCWSTR      lpTemplateName;     // custom template name
  332. } FINDREPLACEW, *LPFINDREPLACEW;
  333. #ifdef UNICODE
  334. typedef FINDREPLACEW FINDREPLACE;
  335. typedef LPFINDREPLACEW LPFINDREPLACE;
  336. #else
  337. typedef FINDREPLACEA FINDREPLACE;
  338. typedef LPFINDREPLACEA LPFINDREPLACE;
  339. #endif // UNICODE
  340.  
  341. #define FR_DOWN                         0x00000001
  342. #define FR_WHOLEWORD                    0x00000002
  343. #define FR_MATCHCASE                    0x00000004
  344. #define FR_FINDNEXT                     0x00000008
  345. #define FR_REPLACE                      0x00000010
  346. #define FR_REPLACEALL                   0x00000020
  347. #define FR_DIALOGTERM                   0x00000040
  348. #define FR_SHOWHELP                     0x00000080
  349. #define FR_ENABLEHOOK                   0x00000100
  350. #define FR_ENABLETEMPLATE               0x00000200
  351. #define FR_NOUPDOWN                     0x00000400
  352. #define FR_NOMATCHCASE                  0x00000800
  353. #define FR_NOWHOLEWORD                  0x00001000
  354. #define FR_ENABLETEMPLATEHANDLE         0x00002000
  355. #define FR_HIDEUPDOWN                   0x00004000
  356. #define FR_HIDEMATCHCASE                0x00008000
  357. #define FR_HIDEWHOLEWORD                0x00010000
  358.  
  359. HWND  APIENTRY    FindTextA(LPFINDREPLACEA);
  360. HWND  APIENTRY    FindTextW(LPFINDREPLACEW);
  361. #ifdef UNICODE
  362. #define FindText  FindTextW
  363. #else
  364. #define FindText  FindTextA
  365. #endif // !UNICODE
  366. HWND  APIENTRY    ReplaceTextA(LPFINDREPLACEA);
  367. HWND  APIENTRY    ReplaceTextW(LPFINDREPLACEW);
  368. #ifdef UNICODE
  369. #define ReplaceText  ReplaceTextW
  370. #else
  371. #define ReplaceText  ReplaceTextA
  372. #endif // !UNICODE
  373.  
  374. typedef UINT (APIENTRY *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  375.  
  376. typedef struct tagCHOOSEFONTA {
  377.    DWORD           lStructSize;
  378.    HWND            hwndOwner;          // caller's window handle
  379.    HDC             hDC;                // printer DC/IC or NULL
  380.    LPLOGFONTA      lpLogFont;          // ptr. to a LOGFONT struct
  381.    INT             iPointSize;         // 10 * size in points of selected font
  382.    DWORD           Flags;              // enum. type flags
  383.    COLORREF        rgbColors;          // returned text color
  384.    LPARAM          lCustData;          // data passed to hook fn.
  385.    LPCFHOOKPROC    lpfnHook;           // ptr. to hook function
  386.    LPCSTR          lpTemplateName;     // custom template name
  387.    HINSTANCE       hInstance;          // instance handle of.EXE that
  388.                                        //   contains cust. dlg. template
  389.    LPSTR           lpszStyle;          // return the style field here
  390.                                        // must be LF_FACESIZE or bigger
  391.    WORD            nFontType;          // same value reported to the EnumFonts
  392.                                        //   call back with the extra FONTTYPE_
  393.                                        //   bits added
  394.    WORD            ___MISSING_ALIGNMENT__;
  395.    INT             nSizeMin;           // minimum pt size allowed &
  396.    INT             nSizeMax;           // max pt size allowed if
  397.                                        //   CF_LIMITSIZE is used
  398. } CHOOSEFONTA, *LPCHOOSEFONTA;
  399. typedef struct tagCHOOSEFONTW {
  400.    DWORD           lStructSize;
  401.    HWND            hwndOwner;          // caller's window handle
  402.    HDC             hDC;                // printer DC/IC or NULL
  403.    LPLOGFONTW      lpLogFont;          // ptr. to a LOGFONT struct
  404.    INT             iPointSize;         // 10 * size in points of selected font
  405.    DWORD           Flags;              // enum. type flags
  406.    COLORREF        rgbColors;          // returned text color
  407.    LPARAM          lCustData;          // data passed to hook fn.
  408.    LPCFHOOKPROC    lpfnHook;           // ptr. to hook function
  409.    LPCWSTR         lpTemplateName;     // custom template name
  410.    HINSTANCE       hInstance;          // instance handle of.EXE that
  411.                                        //   contains cust. dlg. template
  412.    LPWSTR          lpszStyle;          // return the style field here
  413.                                        // must be LF_FACESIZE or bigger
  414.    WORD            nFontType;          // same value reported to the EnumFonts
  415.                                        //   call back with the extra FONTTYPE_
  416.                                        //   bits added
  417.    WORD            ___MISSING_ALIGNMENT__;
  418.    INT             nSizeMin;           // minimum pt size allowed &
  419.    INT             nSizeMax;           // max pt size allowed if
  420.                                        //   CF_LIMITSIZE is used
  421. } CHOOSEFONTW, *LPCHOOSEFONTW;
  422. #ifdef UNICODE
  423. typedef CHOOSEFONTW CHOOSEFONT;
  424. typedef LPCHOOSEFONTW LPCHOOSEFONT;
  425. #else
  426. typedef CHOOSEFONTA CHOOSEFONT;
  427. typedef LPCHOOSEFONTA LPCHOOSEFONT;
  428. #endif // UNICODE
  429.  
  430. BOOL APIENTRY ChooseFontA(LPCHOOSEFONTA);
  431. BOOL APIENTRY ChooseFontW(LPCHOOSEFONTW);
  432. #ifdef UNICODE
  433. #define ChooseFont  ChooseFontW
  434. #else
  435. #define ChooseFont  ChooseFontA
  436. #endif // !UNICODE
  437.  
  438. #define CF_SCREENFONTS             0x00000001
  439. #define CF_PRINTERFONTS            0x00000002
  440. #define CF_BOTH                    (CF_SCREENFONTS | CF_PRINTERFONTS)
  441. #define CF_SHOWHELP                0x00000004L
  442. #define CF_ENABLEHOOK              0x00000008L
  443. #define CF_ENABLETEMPLATE          0x00000010L
  444. #define CF_ENABLETEMPLATEHANDLE    0x00000020L
  445. #define CF_INITTOLOGFONTSTRUCT     0x00000040L
  446. #define CF_USESTYLE                0x00000080L
  447. #define CF_EFFECTS                 0x00000100L
  448. #define CF_APPLY                   0x00000200L
  449. #define CF_ANSIONLY                0x00000400L
  450. #if(WINVER >= 0x0400)
  451. #define CF_SCRIPTSONLY             CF_ANSIONLY
  452. #endif /* WINVER >= 0x0400 */
  453. #define CF_NOVECTORFONTS           0x00000800L
  454. #define CF_NOOEMFONTS              CF_NOVECTORFONTS
  455. #define CF_NOSIMULATIONS           0x00001000L
  456. #define CF_LIMITSIZE               0x00002000L
  457. #define CF_FIXEDPITCHONLY          0x00004000L
  458. #define CF_WYSIWYG                 0x00008000L // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  459. #define CF_FORCEFONTEXIST          0x00010000L
  460. #define CF_SCALABLEONLY            0x00020000L
  461. #define CF_TTONLY                  0x00040000L
  462. #define CF_NOFACESEL               0x00080000L
  463. #define CF_NOSTYLESEL              0x00100000L
  464. #define CF_NOSIZESEL               0x00200000L
  465. #if(WINVER >= 0x0400)
  466. #define CF_SELECTSCRIPT            0x00400000L
  467. #define CF_NOSCRIPTSEL             0x00800000L
  468. #define CF_NOVERTFONTS             0x01000000L
  469. #endif /* WINVER >= 0x0400 */
  470.  
  471. // these are extra nFontType bits that are added to what is returned to the
  472. // EnumFonts callback routine
  473.  
  474. #define SIMULATED_FONTTYPE    0x8000
  475. #define PRINTER_FONTTYPE      0x4000
  476. #define SCREEN_FONTTYPE       0x2000
  477. #define BOLD_FONTTYPE         0x0100
  478. #define ITALIC_FONTTYPE       0x0200
  479. #define REGULAR_FONTTYPE      0x0400
  480.  
  481. #define WM_CHOOSEFONT_GETLOGFONT      (WM_USER + 1)
  482. #define WM_CHOOSEFONT_SETLOGFONT      (WM_USER + 101)
  483. #define WM_CHOOSEFONT_SETFLAGS        (WM_USER + 102)
  484.  
  485. // strings used to obtain unique window message for communication
  486. // between dialog and caller
  487.  
  488. #define LBSELCHSTRINGA  "commdlg_LBSelChangedNotify"
  489. #define SHAREVISTRINGA  "commdlg_ShareViolation"
  490. #define FILEOKSTRINGA   "commdlg_FileNameOK"
  491. #define COLOROKSTRINGA  "commdlg_ColorOK"
  492. #define SETRGBSTRINGA   "commdlg_SetRGBColor"
  493. #define HELPMSGSTRINGA  "commdlg_help"
  494. #define FINDMSGSTRINGA  "commdlg_FindReplace"
  495.  
  496. #define LBSELCHSTRINGW  L"commdlg_LBSelChangedNotify"
  497. #define SHAREVISTRINGW  L"commdlg_ShareViolation"
  498. #define FILEOKSTRINGW   L"commdlg_FileNameOK"
  499. #define COLOROKSTRINGW  L"commdlg_ColorOK"
  500. #define SETRGBSTRINGW   L"commdlg_SetRGBColor"
  501. #define HELPMSGSTRINGW  L"commdlg_help"
  502. #define FINDMSGSTRINGW  L"commdlg_FindReplace"
  503.  
  504. #ifdef UNICODE
  505. #define LBSELCHSTRING  LBSELCHSTRINGW
  506. #define SHAREVISTRING  SHAREVISTRINGW
  507. #define FILEOKSTRING   FILEOKSTRINGW
  508. #define COLOROKSTRING  COLOROKSTRINGW
  509. #define SETRGBSTRING   SETRGBSTRINGW
  510. #define HELPMSGSTRING  HELPMSGSTRINGW
  511. #define FINDMSGSTRING  FINDMSGSTRINGW
  512. #else
  513. #define LBSELCHSTRING  LBSELCHSTRINGA
  514. #define SHAREVISTRING  SHAREVISTRINGA
  515. #define FILEOKSTRING   FILEOKSTRINGA
  516. #define COLOROKSTRING  COLOROKSTRINGA
  517. #define SETRGBSTRING   SETRGBSTRINGA
  518. #define HELPMSGSTRING  HELPMSGSTRINGA
  519. #define FINDMSGSTRING  FINDMSGSTRINGA
  520. #endif
  521.  
  522. // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  523. #define CD_LBSELNOITEMS -1
  524. #define CD_LBSELCHANGE   0
  525. #define CD_LBSELSUB      1
  526. #define CD_LBSELADD      2
  527.  
  528. typedef UINT (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  529. typedef UINT (APIENTRY *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  530.  
  531. typedef struct tagPDA {
  532.    DWORD            lStructSize;
  533.    HWND             hwndOwner;
  534.    HGLOBAL          hDevMode;
  535.    HGLOBAL          hDevNames;
  536.    HDC              hDC;
  537.    DWORD            Flags;
  538.    WORD             nFromPage;
  539.    WORD             nToPage;
  540.    WORD             nMinPage;
  541.    WORD             nMaxPage;
  542.    WORD             nCopies;
  543.    HINSTANCE        hInstance;
  544.    LPARAM           lCustData;
  545.    LPPRINTHOOKPROC  lpfnPrintHook;
  546.    LPSETUPHOOKPROC  lpfnSetupHook;
  547.    LPCSTR           lpPrintTemplateName;
  548.    LPCSTR           lpSetupTemplateName;
  549.    HGLOBAL          hPrintTemplate;
  550.    HGLOBAL          hSetupTemplate;
  551. } PRINTDLGA, *LPPRINTDLGA;
  552. typedef struct tagPDW {
  553.    DWORD            lStructSize;
  554.    HWND             hwndOwner;
  555.    HGLOBAL          hDevMode;
  556.    HGLOBAL          hDevNames;
  557.    HDC              hDC;
  558.    DWORD            Flags;
  559.    WORD             nFromPage;
  560.    WORD             nToPage;
  561.    WORD             nMinPage;
  562.    WORD             nMaxPage;
  563.    WORD             nCopies;
  564.    HINSTANCE        hInstance;
  565.    LPARAM           lCustData;
  566.    LPPRINTHOOKPROC  lpfnPrintHook;
  567.    LPSETUPHOOKPROC  lpfnSetupHook;
  568.    LPCWSTR          lpPrintTemplateName;
  569.    LPCWSTR          lpSetupTemplateName;
  570.    HGLOBAL          hPrintTemplate;
  571.    HGLOBAL          hSetupTemplate;
  572. } PRINTDLGW, *LPPRINTDLGW;
  573. #ifdef UNICODE
  574. typedef PRINTDLGW PRINTDLG;
  575. typedef LPPRINTDLGW LPPRINTDLG;
  576. #else
  577. typedef PRINTDLGA PRINTDLG;
  578. typedef LPPRINTDLGA LPPRINTDLG;
  579. #endif // UNICODE
  580.  
  581. BOOL  APIENTRY     PrintDlgA(LPPRINTDLGA);
  582. BOOL  APIENTRY     PrintDlgW(LPPRINTDLGW);
  583. #ifdef UNICODE
  584. #define PrintDlg  PrintDlgW
  585. #else
  586. #define PrintDlg  PrintDlgA
  587. #endif // !UNICODE
  588.  
  589. #define PD_ALLPAGES                  0x00000000
  590. #define PD_SELECTION                 0x00000001
  591. #define PD_PAGENUMS                  0x00000002
  592. #define PD_NOSELECTION               0x00000004
  593. #define PD_NOPAGENUMS                0x00000008
  594. #define PD_COLLATE                   0x00000010
  595. #define PD_PRINTTOFILE               0x00000020
  596. #define PD_PRINTSETUP                0x00000040
  597. #define PD_NOWARNING                 0x00000080
  598. #define PD_RETURNDC                  0x00000100
  599. #define PD_RETURNIC                  0x00000200
  600. #define PD_RETURNDEFAULT             0x00000400
  601. #define PD_SHOWHELP                  0x00000800
  602. #define PD_ENABLEPRINTHOOK           0x00001000
  603. #define PD_ENABLESETUPHOOK           0x00002000
  604. #define PD_ENABLEPRINTTEMPLATE       0x00004000
  605. #define PD_ENABLESETUPTEMPLATE       0x00008000
  606. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  607. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  608. #define PD_USEDEVMODECOPIES          0x00040000
  609. #define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
  610. #define PD_DISABLEPRINTTOFILE        0x00080000
  611. #define PD_HIDEPRINTTOFILE           0x00100000
  612. #define PD_NONETWORKBUTTON           0x00200000
  613.  
  614. typedef struct tagDEVNAMES {
  615.    WORD wDriverOffset;
  616.    WORD wDeviceOffset;
  617.    WORD wOutputOffset;
  618.    WORD wDefault;
  619. } DEVNAMES;
  620.  
  621. typedef DEVNAMES * LPDEVNAMES;
  622.  
  623. #define DN_DEFAULTPRN      0x0001
  624.  
  625. DWORD APIENTRY     CommDlgExtendedError(VOID);
  626.  
  627. #if(WINVER >= 0x0400)
  628. #define WM_PSD_PAGESETUPDLG     (WM_USER  )
  629. #define WM_PSD_FULLPAGERECT     (WM_USER+1)
  630. #define WM_PSD_MINMARGINRECT    (WM_USER+2)
  631. #define WM_PSD_MARGINRECT       (WM_USER+3)
  632. #define WM_PSD_GREEKTEXTRECT    (WM_USER+4)
  633. #define WM_PSD_ENVSTAMPRECT     (WM_USER+5)
  634. #define WM_PSD_YAFULLPAGERECT   (WM_USER+6)
  635.  
  636. typedef UINT (APIENTRY* LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
  637. typedef UINT (APIENTRY* LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
  638.  
  639. typedef struct tagPSDA
  640. {
  641.     DWORD           lStructSize;
  642.     HWND            hwndOwner;
  643.     HGLOBAL         hDevMode;
  644.     HGLOBAL         hDevNames;
  645.     DWORD           Flags;
  646.     POINT           ptPaperSize;
  647.     RECT            rtMinMargin;
  648.     RECT            rtMargin;
  649.     HINSTANCE       hInstance;
  650.     LPARAM          lCustData;
  651.     LPPAGESETUPHOOK lpfnPageSetupHook;
  652.     LPPAGEPAINTHOOK lpfnPagePaintHook;
  653.     LPCSTR          lpPageSetupTemplateName;
  654.     HGLOBAL         hPageSetupTemplate;
  655. } PAGESETUPDLGA, * LPPAGESETUPDLGA;
  656. typedef struct tagPSDW
  657. {
  658.     DWORD           lStructSize;
  659.     HWND            hwndOwner;
  660.     HGLOBAL         hDevMode;
  661.     HGLOBAL         hDevNames;
  662.     DWORD           Flags;
  663.     POINT           ptPaperSize;
  664.     RECT            rtMinMargin;
  665.     RECT            rtMargin;
  666.     HINSTANCE       hInstance;
  667.     LPARAM          lCustData;
  668.     LPPAGESETUPHOOK lpfnPageSetupHook;
  669.     LPPAGEPAINTHOOK lpfnPagePaintHook;
  670.     LPCWSTR         lpPageSetupTemplateName;
  671.     HGLOBAL         hPageSetupTemplate;
  672. } PAGESETUPDLGW, * LPPAGESETUPDLGW;
  673. #ifdef UNICODE
  674. typedef PAGESETUPDLGW PAGESETUPDLG;
  675. typedef LPPAGESETUPDLGW LPPAGESETUPDLG;
  676. #else
  677. typedef PAGESETUPDLGA PAGESETUPDLG;
  678. typedef LPPAGESETUPDLGA LPPAGESETUPDLG;
  679. #endif // UNICODE
  680.  
  681. BOOL APIENTRY PageSetupDlgA( LPPAGESETUPDLGA );
  682. BOOL APIENTRY PageSetupDlgW( LPPAGESETUPDLGW );
  683. #ifdef UNICODE
  684. #define PageSetupDlg  PageSetupDlgW
  685. #else
  686. #define PageSetupDlg  PageSetupDlgA
  687. #endif // !UNICODE
  688.  
  689. #define PSD_DEFAULTMINMARGINS             0x00000000 // default (printer's)
  690. #define PSD_INWININIINTLMEASURE           0x00000000 // 1st of 4 possible
  691.  
  692. #define PSD_MINMARGINS                    0x00000001 // use caller's
  693. #define PSD_MARGINS                       0x00000002 // use caller's
  694. #define PSD_INTHOUSANDTHSOFINCHES         0x00000004 // 2nd of 4 possible
  695. #define PSD_INHUNDREDTHSOFMILLIMETERS     0x00000008 // 3rd of 4 possible
  696. #define PSD_DISABLEMARGINS                0x00000010
  697. #define PSD_DISABLEPRINTER                0x00000020
  698. #define PSD_NOWARNING                     0x00000080 // must be same as PD_*
  699. #define PSD_DISABLEORIENTATION            0x00000100
  700. #define PSD_RETURNDEFAULT                 0x00000400 // must be same as PD_*
  701. #define PSD_DISABLEPAPER                  0x00000200
  702. #define PSD_SHOWHELP                      0x00000800 // must be same as PD_*
  703. #define PSD_ENABLEPAGESETUPHOOK           0x00002000 // must be same as PD_*
  704. #define PSD_ENABLEPAGESETUPTEMPLATE       0x00008000 // must be same as PD_*
  705. #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000 // must be same as PD_*
  706. #define PSD_ENABLEPAGEPAINTHOOK           0x00040000
  707. #define PSD_DISABLEPAGEPAINTING           0x00080000
  708. #endif /* WINVER >= 0x0400 */
  709.  
  710. #ifdef __cplusplus
  711. }
  712. #endif  /* __cplusplus */
  713.  
  714. #include <poppack.h>
  715. #endif  /* !_INC_COMMDLG */
  716.