home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / COMMDLG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  30.0 KB  |  840 lines

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