home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / COMMDLG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  30.4 KB  |  804 lines

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