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