home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / win32 / Commdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-08  |  27.5 KB  |  718 lines

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