home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / commdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  12.9 KB  |  355 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *   commdlg.h -- This module defines the 32-Bit Common Dialog APIs      *
  4. *                                                                       *
  5. *   Copyright (c) 1992-1995, Microsoft Corp. All rights reserved.       *
  6. *                                                                       *
  7. ************************************************************************/
  8. #ifndef _INC_COMMDLG
  9. #define _INC_COMMDLG
  10.  
  11. #include <pshpack1.h>         /* Assume byte packing throughout */
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {            /* Assume C declarations for C++ */
  15. #endif  /* __cplusplus */
  16.  
  17. #if(WINVER >= 0x0400)
  18. #ifdef __cplusplus
  19.  
  20. #ifndef SNDMSG
  21. #ifndef UNDER_CE
  22. #define SNDMSG ::SendMessage
  23. #else  // UNDER_CE
  24. #define SNDMSG SendMessage
  25. #endif // !UNDER_CE
  26. #endif // !SNDMSG
  27.  
  28. #else   // __cplusplus
  29.  
  30. #ifndef SNDMSG
  31. #define SNDMSG SendMessage
  32. #endif
  33.  
  34. #endif // __cplusplus 
  35. #endif // WINVER >= 0x0400 
  36.  
  37. typedef UINT (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  38.  
  39. typedef struct tagOFNA {
  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.    WORD         nFileOffset;
  55.    WORD         nFileExtension;
  56.    LPCSTR       lpstrDefExt;
  57.    LPARAM       lCustData;
  58.    LPOFNHOOKPROC lpfnHook;
  59.    LPCSTR       lpTemplateName;
  60. } OPENFILENAMEA, *LPOPENFILENAMEA;
  61. typedef struct tagOFNW {
  62.    DWORD        lStructSize;
  63.    HWND         hwndOwner;
  64.    HINSTANCE    hInstance;
  65.    LPCWSTR      lpstrFilter;
  66.    LPWSTR       lpstrCustomFilter;
  67.    DWORD        nMaxCustFilter;
  68.    DWORD        nFilterIndex;
  69.    LPWSTR       lpstrFile;
  70.    DWORD        nMaxFile;
  71.    LPWSTR       lpstrFileTitle;
  72.    DWORD        nMaxFileTitle;
  73.    LPCWSTR      lpstrInitialDir;
  74.    LPCWSTR      lpstrTitle;
  75.    DWORD        Flags;
  76.    WORD         nFileOffset;
  77.    WORD         nFileExtension;
  78.    LPCWSTR      lpstrDefExt;
  79.    LPARAM       lCustData;
  80.    LPOFNHOOKPROC lpfnHook;
  81.    LPCWSTR      lpTemplateName;
  82. } OPENFILENAMEW, *LPOPENFILENAMEW;
  83. #ifdef UNICODE
  84. typedef OPENFILENAMEW OPENFILENAME;
  85. typedef LPOPENFILENAMEW LPOPENFILENAME;
  86. #else
  87. typedef OPENFILENAMEA OPENFILENAME;
  88. typedef LPOPENFILENAMEA LPOPENFILENAME;
  89. #endif // UNICODE
  90.  
  91. BOOL  APIENTRY     GetOpenFileNameA(LPOPENFILENAMEA);
  92. BOOL APIENTRY      GetOpenFileNameW ( LPOPENFILENAMEW );
  93. BOOL  APIENTRY     GetSaveFileNameW(LPOPENFILENAMEW);
  94. BOOL  APIENTRY     GetSaveFileNameA(LPOPENFILENAMEA);
  95. #ifdef UNICODE
  96. #define GetOpenFileName  GetOpenFileNameW
  97. #define GetSaveFileName  GetSaveFileNameW
  98. #else
  99. #define GetSaveFileName  GetSaveFileNameA
  100. #define GetOpenFileName  GetOpenFileNameA
  101. #endif // !UNICODE
  102.  
  103. #define OFN_OVERWRITEPROMPT          0x00000002
  104. #define OFN_HIDEREADONLY             0x00000004
  105. #define OFN_NOCHANGEDIR              0x00000008
  106. #define OFN_SHOWHELP                 0x00000010
  107. #define OFN_EXTENSIONDIFFERENT       0x00000400
  108. #define OFN_PATHMUSTEXIST            0x00000800
  109. #define OFN_FILEMUSTEXIST            0x00001000
  110. #define OFN_CREATEPROMPT             0x00002000
  111. #define OFN_NOTESTFILECREATE         0x00010000
  112. #define OFN_NONETWORKBUTTON          0x00020000
  113. #define OFN_NOLONGNAMES              0x00040000     // force no long names for 4.x modules
  114. #if(WINVER >= 0x0400)
  115. #define OFN_EXPLORER                 0x00080000     // new look commdlg
  116. #define OFN_NODEREFERENCELINKS       0x00100000
  117. #define OFN_LONGNAMES                0x00200000     // force long names for 3.x modules
  118. #endif /* WINVER >= 0x0400 */
  119. #define OFN_PROJECT                     0x00400000     // If this flag is set, the GetOpenFileName API will open the Project dialog for Gryphon
  120. #define OFN_PROPERTY                 0x00800000     // If this flag is set, the GetSaveFileName API will open the Propery dialog for Gryphon
  121. #define OFN_SHOW_ALL                 0x01000000     // If OFN_PROJECT is set,  show the <All Folders> item
  122.  
  123. // Return values for the registered message sent to the hook function
  124. // when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  125. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  126. // up no warning (returned when the app has already put up a warning
  127. // message), and OFN_SHAREWARN puts up the default warning message
  128. // for sharing violations.
  129. //
  130. // Note:  Undefined return values map to OFN_SHAREWARN, but are
  131. //        reserved for future use.
  132.  
  133. #define OFN_SHAREFALLTHROUGH     2
  134. #define OFN_SHARENOWARN          1
  135. #define OFN_SHAREWARN            0
  136.  
  137. typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  138.  
  139. #if(WINVER >= 0x0400)
  140. // Structure used for all OpenFileName notifications
  141. typedef struct _OFNOTIFYW
  142. {
  143.         NMHDR           hdr;
  144.         LPOPENFILENAMEW lpOFN;
  145.         LPWSTR          pszFile;        // May be NULL
  146. } OFNOTIFYW, FAR *LPOFNOTIFYW;
  147. typedef struct _OFNOTIFYA
  148. {
  149.         NMHDR           hdr;
  150.         LPOPENFILENAMEA lpOFN;
  151.         LPSTR           pszFile;        // May be NULL
  152. } OFNOTIFYA, FAR *LPOFNOTIFYA;
  153. #ifdef UNICODE
  154. typedef OFNOTIFYW OFNOTIFY;
  155. typedef LPOFNOTIFYW LPOFNOTIFY;
  156. #else
  157. typedef OFNOTIFYA OFNOTIFY;
  158. typedef LPOFNOTIFYA LPOFNOTIFY;
  159. #endif // UNICODE
  160.  
  161. #define CDN_FIRST   (0U-601U)
  162. #define CDN_LAST    (0U-699U)
  163.  
  164. // Notifications when Open or Save dialog status changes
  165. #define CDN_INITDONE            (CDN_FIRST - 0x0000)
  166. #define CDN_SELCHANGE           (CDN_FIRST - 0x0001)
  167. #define CDN_FOLDERCHANGE        (CDN_FIRST - 0x0002)
  168. #define CDN_SHAREVIOLATION      (CDN_FIRST - 0x0003)
  169. #define CDN_HELP                (CDN_FIRST - 0x0004)
  170. #define CDN_FILEOK              (CDN_FIRST - 0x0005)
  171. #define CDN_TYPECHANGE          (CDN_FIRST - 0x0006)
  172.  
  173. #define CDM_FIRST       (WM_USER + 100)
  174. #define CDM_LAST        (WM_USER + 200)
  175.  
  176. // Messages to query information from the Open or Save dialogs
  177.  
  178. // lParam = pointer to text buffer that gets filled in
  179. // wParam = max number of characters of the text buffer (including NULL)
  180. // return = < 0 if error; number of characters needed (including NULL)
  181. #define CDM_GETSPEC             (CDM_FIRST + 0x0000)
  182. #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
  183.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  184. #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
  185.         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  186. #ifdef UNICODE
  187. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecW
  188. #else
  189. #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecA
  190. #endif // !UNICODE
  191.  
  192. // lParam = pointer to text buffer that gets filled in
  193. // wParam = max number of characters of the text buffer (including NULL)
  194. // return = < 0 if error; number of characters needed (including NULL)
  195. #define CDM_GETFILEPATH         (CDM_FIRST + 0x0001)
  196. #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
  197.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  198. #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
  199.         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  200. #ifdef UNICODE
  201. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathW
  202. #else
  203. #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathA
  204. #endif // !UNICODE
  205.  
  206. // lParam = pointer to text buffer that gets filled in
  207. // wParam = max number of characters of the text buffer (including NULL)
  208. // return = < 0 if error; number of characters needed (including NULL)
  209. #define CDM_GETFOLDERPATH       (CDM_FIRST + 0x0002)
  210. #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
  211.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  212. #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
  213.         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  214. #ifdef UNICODE
  215. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathW
  216. #else
  217. #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathA
  218. #endif // !UNICODE
  219.  
  220. // lParam = pointer to ITEMIDLIST buffer that gets filled in
  221. // wParam = size of the ITEMIDLIST buffer
  222. // return = < 0 if error; length of buffer needed
  223. #define CDM_GETFOLDERIDLIST     (CDM_FIRST + 0x0003)
  224. #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
  225.         (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  226.  
  227. // lParam = pointer to a string
  228. // wParam = ID of control to change
  229. // return = not used
  230. #define CDM_SETCONTROLTEXT      (CDM_FIRST + 0x0004)
  231. #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
  232.         (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  233.  
  234. // lParam = not used
  235. // wParam = ID of control to change
  236. // return = not used
  237. #define CDM_HIDECONTROL         (CDM_FIRST + 0x0005)
  238. #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
  239.         (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  240.  
  241. // lParam = pointer to default extension (no dot)
  242. // wParam = not used
  243. // return = not used
  244. #define CDM_SETDEFEXT           (CDM_FIRST + 0x0006)
  245. #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
  246.         (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  247. #endif /* WINVER >= 0x0400 */
  248.  
  249. #ifdef WINCEOEM
  250. #ifdef WINCEMACRO
  251. #include <mcommdlg.h>
  252. #endif
  253. #endif
  254.  
  255. typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  256.  
  257. typedef struct tagCHOOSECOLOR  {
  258.    DWORD        lStructSize;
  259.    HWND         hwndOwner;
  260.    HINSTANCE    hInstance;
  261.    COLORREF     rgbResult;
  262.    COLORREF*    lpCustColors;
  263.    DWORD        Flags;
  264.    LPARAM       lCustData;
  265.    LPCCHOOKPROC lpfnHook;
  266.    LPCTSTR      lpTemplateName;
  267. } CHOOSECOLOR , *LPCHOOSECOLOR ;
  268.  
  269. BOOL  APIENTRY ChooseColor (LPCHOOSECOLOR );
  270.  
  271. #define CC_RGBINIT               0x00000001
  272. #define CC_FULLOPEN              0x00000002
  273. #define CC_PREVENTFULLOPEN       0x00000004
  274. #define CC_ENABLEHOOK            0x00000010
  275. #define CC_ENABLETEMPLATE        0x00000020
  276. #define CC_ENABLETEMPLATEHANDLE  0x00000040
  277. #if(WINVER >= 0x0400)
  278. #define CC_SOLIDCOLOR            0x00000080
  279. #define CC_ANYCOLOR              0x00000100
  280. #endif /* WINVER >= 0x0400 */
  281.  
  282. DWORD APIENTRY     CommDlgExtendedError(VOID);
  283.  
  284. typedef UINT (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  285.  
  286. typedef struct tagPD  {
  287.    DWORD            cbStruct;
  288.    HWND             hwndOwner;
  289.    HDC              hdc;
  290.    DWORD            dwFlags;
  291.    RECT             rcMinMargin;
  292.    RECT             rcMargin;
  293.    HINSTANCE        hinst;
  294.    LPARAM           lCustData;
  295.    LPPRINTHOOKPROC  pfnPrintHook;
  296.    LPCTSTR          pszPrintTemplateName;
  297.    HGLOBAL          hglbPrintTemplateResource;
  298. } PRINTDLG , *LPPRINTDLG ;
  299.  
  300. BOOL  APIENTRY     PrintDlg (LPPRINTDLG);
  301.  
  302. // Out only
  303. #define PD_SELECTALLPAGES                 0x00000001
  304. #define PD_SELECTSELECTION                0x00000002
  305. #define PD_SELECTDRAFTMODE                0x00000008
  306. #define PD_SELECTA4                       0x00000010
  307. #define PD_SELECTLETTER                   0x00000020
  308. #define PD_SELECTINFRARED                 0x00000040 
  309. #define PD_SELECTSERIAL                   0x00000080
  310.  
  311. // In only
  312. #define PD_DISABLEPAPERSIZE               0x00000100
  313. #define PD_DISABLEPRINTRANGE              0x00000200
  314. #define PD_DISABLEMARGINS                 0x00000400
  315. #define PD_DISABLEORIENTATION             0x00000800
  316. #define PD_RETURNDEFAULTDC                0x00002000
  317. #define PD_ENABLEPRINTHOOK                0x00004000
  318. #define PD_ENABLEPRINTTEMPLATE            0x00008000
  319. #define PD_ENABLEPRINTTEMPLATEHANDLE      0x00010000
  320. #define PD_TITLE                          0x00020000                          
  321.  
  322. // In-Out
  323. #define PD_SELECTPORTRAIT                 0x00040000
  324. #define PD_SELECTLANDSCAPE                0x00080000
  325. #define PD_MARGINS                        0x00100000
  326. #define PD_INTHOUSANDTHSOFINCHES          0x00200000
  327. #define PD_INHUNDREDTHSOFMILLIMETERS      0x00400000
  328. #define PD_MINMARGINS                     0x00800000
  329.  
  330. // Errors returned by CommDlgExtendedError()
  331. #define CDERR_DIALOGFAILURE    0xFFFF
  332. #define CDERR_STRUCTSIZE       0x0001
  333. #define CDERR_INITIALIZATION   0x0002
  334. #define CDERR_NOTEMPLATE       0x0003
  335. #define CDERR_FINDRESFAILURE   0x0004
  336. #define CDERR_LOADRESFAILURE   0x0005
  337. #define CDERR_LOCKRESFAILURE   0x0006
  338. #define CDERR_MEMALLOCFAILURE  0x0007
  339. #define CDERR_NOHOOK           0x0008
  340. #define CDERR_REGISTRYFAILURE  0x0009
  341. #define CDERR_NOHINSTANCE      0x000A
  342.  
  343. #define PDERR_NODEFAULTPRN     0x1000
  344. #define PDERR_PRINTERNOTFOUND  0x1001
  345. #define PDERR_NOPORTS          0x1002
  346. #define PDERR_NOPRINTERS       0x1003
  347. #define PDERR_CREATEDCFAILURE  0x1004
  348.  
  349. #ifdef __cplusplus
  350. }
  351. #endif  /* __cplusplus */
  352.  
  353. #include <poppack.h>
  354. #endif  /* !_INC_COMMDLG */
  355.