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