home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / commdlg.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  32KB  |  857 lines

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