home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / biology / gsrc208a.zip / COMMDLG.H < prev    next >
C/C++ Source or Header  |  1992-04-06  |  13KB  |  319 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * commdlg.h -   Common dialog functions, types, and definitions               *
  4. *                                                                             *
  5. *               Version 1.0                                                   *
  6. *                                                                             *
  7. *               NOTE: windows.h must be #included first                       *
  8. *                                                                             *
  9. *               Copyright (c) 1992, Microsoft Corp.  All rights reserved.     *
  10. *                                                                             *
  11. \*****************************************************************************/
  12.  
  13. #ifndef _INC_COMMDLG
  14. #define _INC_COMMDLG
  15.  
  16. #ifndef RC_INVOKED
  17. #pragma pack(1)         /* Assume byte packing throughout */
  18. #endif /* !RC_INVOKED */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {            /* Assume C declarations for C++ */
  22. #endif  /* __cplusplus */
  23.  
  24. #ifndef WINAPI          /* If not included with 3.1 headers... */
  25. #define WINAPI      FAR PASCAL
  26. #define CALLBACK    FAR PASCAL
  27. #define LPCSTR      LPSTR
  28. #define UINT        WORD
  29. #define LPARAM      LONG
  30. #define WPARAM      WORD
  31. #define LRESULT     LONG
  32. #define HMODULE     HANDLE
  33. #define HINSTANCE   HANDLE
  34. #define HLOCAL      HANDLE
  35. #define HGLOBAL     HANDLE
  36. #endif  /* _INC_WINDOWS */
  37.  
  38. typedef struct tagOFN
  39. {
  40.     DWORD   lStructSize;
  41.     HWND    hwndOwner;
  42.     HINSTANCE hInstance;
  43.     LPCSTR  lpstrFilter;
  44.     LPSTR   lpstrCustomFilter;
  45.     DWORD   nMaxCustFilter;
  46.     DWORD   nFilterIndex;
  47.     LPSTR   lpstrFile;
  48.     DWORD   nMaxFile;
  49.     LPSTR   lpstrFileTitle;
  50.     DWORD   nMaxFileTitle;
  51.     LPCSTR  lpstrInitialDir;
  52.     LPCSTR  lpstrTitle;
  53.     DWORD   Flags;
  54.     UINT    nFileOffset;
  55.     UINT    nFileExtension;
  56.     LPCSTR  lpstrDefExt;
  57.     LPARAM  lCustData;
  58.     UINT    (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  59.     LPCSTR  lpTemplateName;
  60. }   OPENFILENAME;
  61. typedef OPENFILENAME FAR* LPOPENFILENAME;
  62.  
  63. BOOL    WINAPI GetOpenFileName(OPENFILENAME FAR*);
  64. BOOL    WINAPI GetSaveFileName(OPENFILENAME FAR*);
  65. int     WINAPI GetFileTitle(LPCSTR, LPSTR, UINT);
  66.  
  67. #define OFN_READONLY                 0x00000001
  68. #define OFN_OVERWRITEPROMPT          0x00000002
  69. #define OFN_HIDEREADONLY             0x00000004
  70. #define OFN_NOCHANGEDIR              0x00000008
  71. #define OFN_SHOWHELP                 0x00000010
  72. #define OFN_ENABLEHOOK               0x00000020
  73. #define OFN_ENABLETEMPLATE           0x00000040
  74. #define OFN_ENABLETEMPLATEHANDLE     0x00000080
  75. #define OFN_NOVALIDATE               0x00000100
  76. #define OFN_ALLOWMULTISELECT         0x00000200
  77. #define OFN_EXTENSIONDIFFERENT       0x00000400
  78. #define OFN_PATHMUSTEXIST            0x00000800
  79. #define OFN_FILEMUSTEXIST            0x00001000
  80. #define OFN_CREATEPROMPT             0x00002000
  81. #define OFN_SHAREAWARE               0x00004000
  82. #define OFN_NOREADONLYRETURN         0x00008000
  83. #define OFN_NOTESTFILECREATE         0x00010000
  84.  
  85. /* Return values for the registered message sent to the hook function
  86.  * when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  87.  * filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  88.  * up no warning (returned when the app has already put up a warning
  89.  * message), and OFN_SHAREWARN puts up the default warning message
  90.  * for sharing violations.
  91.  *
  92.  * Note:  Undefined return values map to OFN_SHAREWARN, but are
  93.  *        reserved for future use.
  94.  */
  95.  
  96. #define OFN_SHAREFALLTHROUGH     2
  97. #define OFN_SHARENOWARN          1
  98. #define OFN_SHAREWARN            0
  99.  
  100. typedef struct tagCHOOSECOLOR
  101. {
  102.     DWORD   lStructSize;
  103.     HWND    hwndOwner;
  104.     HWND    hInstance;
  105.     COLORREF rgbResult;
  106.     COLORREF FAR* lpCustColors;
  107.     DWORD   Flags;
  108.     LPARAM  lCustData;
  109.     UINT    (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  110.     LPCSTR  lpTemplateName;
  111. } CHOOSECOLOR;
  112. typedef CHOOSECOLOR FAR *LPCHOOSECOLOR;
  113.  
  114. BOOL    WINAPI ChooseColor(CHOOSECOLOR FAR*);
  115.  
  116. #define CC_RGBINIT               0x00000001
  117. #define CC_FULLOPEN              0x00000002
  118. #define CC_PREVENTFULLOPEN       0x00000004
  119. #define CC_SHOWHELP              0x00000008
  120. #define CC_ENABLEHOOK            0x00000010
  121. #define CC_ENABLETEMPLATE        0x00000020
  122. #define CC_ENABLETEMPLATEHANDLE  0x00000040
  123.  
  124. typedef struct tagFINDREPLACE
  125. {
  126.     DWORD    lStructSize;            /* size of this struct 0x20 */
  127.     HWND     hwndOwner;              /* handle to owner's window */
  128.     HINSTANCE hInstance;             /* instance handle of.EXE that
  129.                                       * contains cust. dlg. template
  130.                                       */
  131.     DWORD    Flags;                  /* one or more of the FR_?? */
  132.     LPSTR    lpstrFindWhat;          /* ptr. to search string    */
  133.     LPSTR    lpstrReplaceWith;       /* ptr. to replace string   */
  134.     UINT     wFindWhatLen;           /* size of find buffer      */
  135.     UINT     wReplaceWithLen;        /* size of replace buffer   */
  136.     LPARAM   lCustData;              /* data passed to hook fn.  */
  137.     UINT    (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  138.                                      /* ptr. to hook fn. or NULL */
  139.     LPCSTR   lpTemplateName;         /* custom template name     */
  140. } FINDREPLACE;
  141. typedef FINDREPLACE FAR *LPFINDREPLACE;
  142.  
  143. #define FR_DOWN                         0x00000001
  144. #define FR_WHOLEWORD                    0x00000002
  145. #define FR_MATCHCASE                    0x00000004
  146. #define FR_FINDNEXT                     0x00000008
  147. #define FR_REPLACE                      0x00000010
  148. #define FR_REPLACEALL                   0x00000020
  149. #define FR_DIALOGTERM                   0x00000040
  150. #define FR_SHOWHELP                     0x00000080
  151. #define FR_ENABLEHOOK                   0x00000100
  152. #define FR_ENABLETEMPLATE               0x00000200
  153. #define FR_NOUPDOWN                     0x00000400
  154. #define FR_NOMATCHCASE                  0x00000800
  155. #define FR_NOWHOLEWORD                  0x00001000
  156. #define FR_ENABLETEMPLATEHANDLE         0x00002000
  157. #define FR_HIDEUPDOWN                   0x00004000
  158. #define FR_HIDEMATCHCASE                0x00008000
  159. #define FR_HIDEWHOLEWORD                0x00010000
  160.  
  161. HWND    WINAPI FindText(FINDREPLACE FAR*);
  162. HWND    WINAPI ReplaceText(FINDREPLACE FAR*);
  163.  
  164. typedef struct tagCHOOSEFONT
  165. {
  166.     DWORD           lStructSize;        /* */
  167.     HWND            hwndOwner;          /* caller's window handle   */
  168.     HDC             hDC;                /* printer DC/IC or NULL    */
  169.     LOGFONT FAR*    lpLogFont;          /* ptr. to a LOGFONT struct */
  170.     int             iPointSize;         /* 10 * size in points of selected font */
  171.     DWORD           Flags;              /* enum. type flags         */
  172.     COLORREF        rgbColors;          /* returned text color      */
  173.     LPARAM          lCustData;          /* data passed to hook fn.  */
  174.     UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  175.                                         /* ptr. to hook function    */
  176.     LPCSTR          lpTemplateName;     /* custom template name     */
  177.     HINSTANCE       hInstance;          /* instance handle of.EXE that
  178.                                          * contains cust. dlg. template
  179.                                          */
  180.     LPSTR           lpszStyle;          /* return the style field here 
  181.                                          * must be LF_FACESIZE or bigger */
  182.     UINT            nFontType;          /* same value reported to the EnumFonts
  183.                                          * call back with the extra FONTTYPE_ 
  184.                                          * bits added */
  185.     int             nSizeMin;           /* minimum pt size allowed & */
  186.     int             nSizeMax;           /* max pt size allowed if    */
  187.                                         /* CF_LIMITSIZE is used      */
  188. } CHOOSEFONT;
  189. typedef CHOOSEFONT FAR *LPCHOOSEFONT;
  190.  
  191. BOOL WINAPI ChooseFont(CHOOSEFONT FAR*);
  192.  
  193. #define CF_SCREENFONTS               0x00000001
  194. #define CF_PRINTERFONTS              0x00000002
  195. #define CF_BOTH                      (CF_SCREENFONTS | CF_PRINTERFONTS)
  196. #define CF_SHOWHELP                  0x00000004L
  197. #define CF_ENABLEHOOK                0x00000008L
  198. #define CF_ENABLETEMPLATE            0x00000010L
  199. #define CF_ENABLETEMPLATEHANDLE      0x00000020L
  200. #define CF_INITTOLOGFONTSTRUCT       0x00000040L
  201. #define CF_USESTYLE                  0x00000080L
  202. #define CF_EFFECTS                   0x00000100L
  203. #define CF_APPLY                     0x00000200L
  204. #define CF_ANSIONLY                  0x00000400L
  205. #define CF_NOVECTORFONTS             0x00000800L
  206. #define CF_NOOEMFONTS                CF_NOVECTORFONTS
  207. #define CF_NOSIMULATIONS             0x00001000L
  208. #define CF_LIMITSIZE                 0x00002000L
  209. #define CF_FIXEDPITCHONLY            0x00004000L
  210. #define CF_WYSIWYG                   0x00008000L /* must also have CF_SCREENFONTS & CF_PRINTERFONTS */
  211. #define CF_FORCEFONTEXIST            0x00010000L
  212. #define CF_SCALABLEONLY              0x00020000L
  213. #define CF_TTONLY                    0x00040000L
  214. #define CF_NOFACESEL                 0x00080000L
  215. #define CF_NOSTYLESEL                0x00100000L
  216. #define CF_NOSIZESEL                 0x00200000L
  217.  
  218. /* these are extra nFontType bits that are added to what is returned to the
  219.  * EnumFonts callback routine */
  220.  
  221. #define SIMULATED_FONTTYPE      0x8000
  222. #define PRINTER_FONTTYPE        0x4000
  223. #define SCREEN_FONTTYPE         0x2000
  224. #define BOLD_FONTTYPE           0x0100
  225. #define ITALIC_FONTTYPE         0x0200
  226. #define REGULAR_FONTTYPE        0x0400
  227.  
  228. #define WM_CHOOSEFONT_GETLOGFONT        (WM_USER + 1)
  229.  
  230.  
  231. /* strings used to obtain unique window message for communication
  232.  * between dialog and caller
  233.  */
  234. #define LBSELCHSTRING  "commdlg_LBSelChangedNotify"
  235. #define SHAREVISTRING  "commdlg_ShareViolation"
  236. #define FILEOKSTRING   "commdlg_FileNameOK"
  237. #define COLOROKSTRING  "commdlg_ColorOK"
  238. #define SETRGBSTRING   "commdlg_SetRGBColor"
  239. #define FINDMSGSTRING  "commdlg_FindReplace"
  240. #define HELPMSGSTRING  "commdlg_help"
  241.  
  242. /* HIWORD values for lParam of commdlg_LBSelChangeNotify message */
  243. #define CD_LBSELNOITEMS -1
  244. #define CD_LBSELCHANGE   0
  245. #define CD_LBSELSUB      1
  246. #define CD_LBSELADD      2
  247.  
  248. typedef struct tagPD
  249. {
  250.     DWORD   lStructSize;
  251.     HWND    hwndOwner;
  252.     HGLOBAL hDevMode;
  253.     HGLOBAL hDevNames;
  254.     HDC     hDC;
  255.     DWORD   Flags;
  256.     UINT    nFromPage;
  257.     UINT    nToPage;
  258.     UINT    nMinPage;
  259.     UINT    nMaxPage;
  260.     UINT    nCopies;
  261.     HINSTANCE hInstance;
  262.     LPARAM  lCustData;
  263.     UINT    (CALLBACK* lpfnPrintHook)(HWND, UINT, WPARAM, LPARAM);
  264.     UINT    (CALLBACK* lpfnSetupHook)(HWND, UINT, WPARAM, LPARAM);
  265.     LPCSTR  lpPrintTemplateName;
  266.     LPCSTR  lpSetupTemplateName;
  267.     HGLOBAL hPrintTemplate;
  268.     HGLOBAL hSetupTemplate;
  269. } PRINTDLG;
  270. typedef PRINTDLG  FAR* LPPRINTDLG;
  271.  
  272. BOOL    WINAPI PrintDlg(PRINTDLG FAR*);
  273.  
  274. #define PD_ALLPAGES                  0x00000000
  275. #define PD_SELECTION                 0x00000001
  276. #define PD_PAGENUMS                  0x00000002
  277. #define PD_NOSELECTION               0x00000004
  278. #define PD_NOPAGENUMS                0x00000008
  279. #define PD_COLLATE                   0x00000010
  280. #define PD_PRINTTOFILE               0x00000020
  281. #define PD_PRINTSETUP                0x00000040
  282. #define PD_NOWARNING                 0x00000080
  283. #define PD_RETURNDC                  0x00000100
  284. #define PD_RETURNIC                  0x00000200
  285. #define PD_RETURNDEFAULT             0x00000400
  286. #define PD_SHOWHELP                  0x00000800
  287. #define PD_ENABLEPRINTHOOK           0x00001000
  288. #define PD_ENABLESETUPHOOK           0x00002000
  289. #define PD_ENABLEPRINTTEMPLATE       0x00004000
  290. #define PD_ENABLESETUPTEMPLATE       0x00008000
  291. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  292. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  293. #define PD_USEDEVMODECOPIES          0x00040000
  294. #define PD_DISABLEPRINTTOFILE        0x00080000
  295. #define PD_HIDEPRINTTOFILE           0x00100000
  296.  
  297. typedef struct tagDEVNAMES
  298. {
  299.     UINT wDriverOffset;
  300.     UINT wDeviceOffset;
  301.     UINT wOutputOffset;
  302.     UINT wDefault;
  303. } DEVNAMES;
  304. typedef DEVNAMES FAR* LPDEVNAMES;
  305.  
  306. #define DN_DEFAULTPRN      0x0001
  307.  
  308. DWORD   WINAPI CommDlgExtendedError(void);
  309.  
  310. #ifdef __cplusplus
  311. }
  312. #endif  /* __cplusplus */
  313.  
  314. #ifndef RC_INVOKED
  315. #pragma pack()
  316. #endif  /* !RC_INVOKED */
  317.  
  318. #endif  /* !_INC_COMMDLG */
  319.