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

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * windows.h -   Windows functions, types, and definitions                     *
  4. *                                                                             *
  5. *               Version 3.10                                                  *
  6. *                                                                             *
  7. *******************************************************************************
  8. *
  9. * The following symbols control inclusion of various parts of this file:
  10. *
  11. * WINVER            Windows version number (0x030a).  To exclude
  12. *                   definitions introduced in version 3.1 (or above)
  13. *                   #define WINVER 0x0300 before #including <windows.h>
  14. *
  15. * #define:          To prevent inclusion of:
  16. *
  17. * NOKERNEL          KERNEL APIs and definitions
  18. * NOGDI             GDI APIs and definitions
  19. * NOUSER            USER APIs and definitions
  20. * NOSOUND           Sound APIs and definitions
  21. * NOCOMM            Comm driver APIs and definitions
  22. * NODRIVERS         Installable driver APIs and definitions
  23. *
  24. * OEMRESOURCE       OEM Resource values
  25. * NONLS             All NLS defines and routines
  26. * NOSERVICE         All Service Controller routines, SERVICE_ equates, etc.
  27. * NOKANJI           Kanji support stuff.
  28. * NOMINMAX          min() and max() macros
  29. * NOLOGERROR        LogError() and related definitions
  30. * NOPROFILER        Profiler APIs
  31. * NOMEMMGR          Local and global memory management
  32. * NOLFILEIO         _l* file I/O routines
  33. * NOOPENFILE        OpenFile and related definitions
  34. * NORESOURCE        Resource management
  35. * NOATOM            Atom management
  36. * NOLANGUAGE        Character test routines
  37. * NOLSTRING         lstr* string management routines
  38. * NODBCS            Double-byte character set routines
  39. * NOKEYBOARDINFO    Keyboard driver routines
  40. * NOGDICAPMASKS     GDI device capability constants
  41. * NOCOLOR           COLOR_* color values
  42. * NOGDIOBJ          GDI pens, brushes, fonts
  43. * NODRAWTEXT        DrawText() and related definitions
  44. * NOTEXTMETRIC      TEXTMETRIC and related APIs
  45. * NOSCALABLEFONT    Truetype scalable font support
  46. * NOBITMAP          Bitmap support
  47. * NORASTEROPS       GDI Raster operation definitions
  48. * NOMETAFILE        Metafile support
  49. * NOSYSMETRICS      GetSystemMetrics() and related SM_* definitions
  50. * NOSYSTEMPARAMSINFO SystemParametersInfo() and SPI_* definitions
  51. * NOMSG             APIs and definitions that use MSG structure
  52. * NOWINSTYLES       Window style definitions
  53. * NOWINOFFSETS      Get/SetWindowWord/Long offset definitions
  54. * NOSHOWWINDOW      ShowWindow and related definitions
  55. * NODEFERWINDOWPOS  DeferWindowPos and related definitions
  56. * NOVIRTUALKEYCODES VK_* virtual key codes
  57. * NOKEYSTATES       MK_* message key state flags
  58. * NOWH              SetWindowsHook and related WH_* definitions
  59. * NOMENUS           Menu APIs
  60. * NOSCROLL          Scrolling APIs and scroll bar control
  61. * NOCLIPBOARD       Clipboard APIs and definitions
  62. * NOICONS           IDI_* icon IDs
  63. * NOMB              MessageBox and related definitions
  64. * NOSYSCOMMANDS     WM_SYSCOMMAND SC_* definitions
  65. * NOMDI             MDI support
  66. * NOCTLMGR          Control management and controls
  67. * NOWINMESSAGES     WM_* window messages
  68. * NOHELP            Help support
  69. *
  70. \****************************************************************************/
  71.  
  72. /*
  73.  *      C/C++ Run Time Library - Version 6.0
  74.  *
  75.  *      Copyright (c) 1987, 1993 by Borland International
  76.  *      All Rights Reserved.
  77.  *
  78.  */
  79.  
  80. #ifndef __WINDOWS_H     /* prevent multiple includes */
  81. #define __WINDOWS_H
  82.  
  83. #ifndef RC_INVOKED
  84. #pragma option -a-      /* Assume byte packing throughout */
  85. #endif  /* RC_INVOKED */
  86.  
  87. #ifdef __cplusplus
  88. extern "C" {            /* Assume C declarations for C++ */
  89. #endif  /* __cplusplus */
  90.  
  91. #if !defined(__FLAT__)
  92.  
  93. /* If WINVER is not defined, assume version 3.1 */
  94. #ifndef WINVER
  95. #define WINVER  0x030a
  96. #endif
  97.  
  98. #ifdef RC_INVOKED
  99. /* Don't include definitions that RC.EXE can't parse */
  100. #define NOATOM
  101. #define NOGDI
  102. #define NOGDICAPMASKS
  103. #define NOMETAFILE
  104. #define NOMINMAX
  105. #define NOMSG
  106. #define NOOPENFILE
  107. #define NORASTEROPS
  108. #define NOSCROLL
  109. #define NOSOUND
  110. #define NOSYSMETRICS
  111. #define NOTEXTMETRIC
  112. #define NOWH
  113. #define NODBCS
  114. #define NOSYSTEMPARAMSINFO
  115. #define NOCOMM
  116. #define NOOEMRESOURCE
  117. #endif  /* RC_INVOKED */
  118.  
  119. /* Handle OEMRESOURCE for 3.0 compatibility */
  120. #if (WINVER < 0x030a)
  121. #define NOOEMRESOURCE
  122. #ifdef OEMRESOURCE
  123. #undef NOOEMRESOURCE
  124. #endif
  125. #endif
  126.  
  127. /******* Common definitions and typedefs ***********************************/
  128.  
  129. #define VOID                void
  130.  
  131. #define FAR                 _far
  132. #define NEAR                _near
  133. #define PASCAL              _pascal
  134. #define CDECL               _cdecl
  135.  
  136. #define WINAPI              _far _pascal
  137. #define CALLBACK            _far _pascal
  138.  
  139. /****** Simple types & common helper macros *********************************/
  140.  
  141. typedef int                 BOOL;
  142. #define FALSE               0
  143. #define TRUE                1
  144.  
  145. typedef unsigned char       BYTE;
  146. typedef unsigned short      WORD;
  147. typedef unsigned long       DWORD;
  148.  
  149. typedef unsigned int        UINT;
  150.  
  151. #ifdef STRICT
  152. typedef signed long         LONG;
  153. #else
  154. #define LONG long
  155. #endif
  156.  
  157. #define LOBYTE(w)           ((BYTE)(w))
  158. #define HIBYTE(w)           ((BYTE)((UINT)(w) >> 8))
  159.  
  160. #define LOWORD(l)           ((WORD)(l))
  161. #define HIWORD(l)           ((WORD)((DWORD)(l) >> 16))
  162.  
  163. #define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
  164.  
  165. #if defined(__MSC) || !defined(NOMINMAX) && !defined(__cplusplus)
  166. #ifndef max
  167. #define max(a,b)            (((a) > (b)) ? (a) : (b))
  168. #endif
  169. #ifndef min
  170. #define min(a,b)            (((a) < (b)) ? (a) : (b))
  171. #endif
  172. #endif  /* NOMINMAX */
  173.  
  174. /* Types used for passing & returning polymorphic values */
  175. typedef UINT WPARAM;
  176. typedef LONG LPARAM;
  177. typedef LONG LRESULT;
  178.  
  179. #define MAKELPARAM(low, high)   ((LPARAM)MAKELONG(low, high))
  180. #define MAKELRESULT(low, high)  ((LRESULT)MAKELONG(low, high))
  181.  
  182. /****** Common pointer types ************************************************/
  183.  
  184. #ifndef NULL
  185. #define NULL                0
  186. #endif
  187.  
  188. typedef char NEAR*          PSTR;
  189. typedef char NEAR*          NPSTR;
  190.  
  191.  
  192. typedef char FAR*           LPSTR;
  193. typedef const char FAR*     LPCSTR;
  194.  
  195. typedef BYTE NEAR*          PBYTE;
  196. typedef BYTE FAR*           LPBYTE;
  197.  
  198. typedef int NEAR*           PINT;
  199. typedef int FAR*            LPINT;
  200.  
  201. typedef WORD NEAR*          PWORD;
  202. typedef WORD FAR*           LPWORD;
  203.  
  204. typedef long NEAR*          PLONG;
  205. typedef long FAR*           LPLONG;
  206.  
  207. typedef DWORD NEAR*         PDWORD;
  208. typedef DWORD FAR*          LPDWORD;
  209.  
  210. typedef void FAR*           LPVOID;
  211.  
  212. #define MAKELP(sel, off)    ((void FAR*)MAKELONG((off), (sel)))
  213. #define SELECTOROF(lp)      HIWORD(lp)
  214. #define OFFSETOF(lp)        LOWORD(lp)
  215.  
  216. #define FIELDOFFSET(type, field)    ((int)(&((type NEAR*)1)->field)-1)
  217.  
  218. /****** Common handle types *************************************************/
  219.  
  220. #ifdef STRICT
  221. typedef const void NEAR*        HANDLE;
  222. #define DECLARE_HANDLE(name)    struct name##__ { int unused; }; \
  223.                                 typedef const struct name##__ NEAR* name
  224. #define DECLARE_HANDLE32(name)  struct name##__ { int unused; }; \
  225.                                 typedef const struct name##__ FAR* name
  226. #else   /* STRICT */
  227. typedef UINT                    HANDLE;
  228. #define DECLARE_HANDLE(name)    typedef UINT name
  229. #define DECLARE_HANDLE32(name)  typedef DWORD name
  230. #endif  /* !STRICT */
  231.  
  232. typedef HANDLE*             PHANDLE;
  233. typedef HANDLE NEAR*        SPHANDLE;
  234. typedef HANDLE FAR*         LPHANDLE;
  235.  
  236. typedef HANDLE              HGLOBAL;
  237. typedef HANDLE              HLOCAL;
  238.  
  239. typedef HANDLE              GLOBALHANDLE;
  240. typedef HANDLE              LOCALHANDLE;
  241.  
  242. typedef UINT                ATOM;
  243.  
  244. #ifdef STRICT
  245. typedef void (CALLBACK*     FARPROC)(void);
  246. typedef void (NEAR PASCAL*  NEARPROC)(void);
  247. #else
  248. typedef int (CALLBACK*      FARPROC)();
  249. typedef int (NEAR PASCAL*   NEARPROC)();
  250. #endif
  251.  
  252. DECLARE_HANDLE(HSTR);
  253.  
  254. /****** KERNEL typedefs, structures, and functions **************************/
  255.  
  256. DECLARE_HANDLE(HINSTANCE);
  257. typedef HINSTANCE HMODULE;  /* HMODULEs can be used in place of HINSTANCEs */
  258.  
  259. #ifndef NOKERNEL
  260.  
  261. /****** Application entry point function ************************************/
  262.  
  263. #if defined(STRICT)
  264. int     PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
  265. int FAR PASCAL LibMain(HINSTANCE, WORD, WORD, LPSTR);
  266. #else
  267. int     PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
  268. int FAR PASCAL LibMain(HANDLE, WORD, WORD, LPSTR);
  269. #endif
  270. int CALLBACK   WEP(int);
  271.  
  272. /****** System Information **************************************************/
  273.  
  274. DWORD   WINAPI GetVersion(void);
  275.  
  276. DWORD   WINAPI GetFreeSpace(UINT);
  277. UINT    WINAPI GetCurrentPDB(void);
  278.  
  279. UINT    WINAPI GetWindowsDirectory(LPSTR, UINT);
  280. UINT    WINAPI GetSystemDirectory(LPSTR, UINT);
  281.  
  282. #if (WINVER >= 0x030a)
  283. UINT    WINAPI GetFreeSystemResources(UINT);
  284. #define GFSR_SYSTEMRESOURCES   0x0000
  285. #define GFSR_GDIRESOURCES      0x0001
  286. #define GFSR_USERRESOURCES     0x0002
  287. #endif  /* WINVER >= 0x030a */
  288.  
  289. DWORD   WINAPI GetWinFlags(void);
  290.  
  291. #define WF_PMODE        0x0001
  292. #define WF_CPU286       0x0002
  293. #define WF_CPU386       0x0004
  294. #define WF_CPU486       0x0008
  295. #define WF_STANDARD     0x0010
  296. #define WF_WIN286       0x0010
  297. #define WF_ENHANCED     0x0020
  298. #define WF_WIN386       0x0020
  299. #define WF_CPU086       0x0040
  300. #define WF_CPU186       0x0080
  301. #define WF_LARGEFRAME   0x0100
  302. #define WF_SMALLFRAME   0x0200
  303. #define WF_80x87        0x0400
  304. #define WF_PAGING       0x0800
  305. #define WF_WLO          0x8000
  306.  
  307. LPSTR   WINAPI GetDOSEnvironment(void);
  308.  
  309. DWORD   WINAPI GetCurrentTime(void);
  310. DWORD   WINAPI GetTickCount(void);
  311. DWORD   WINAPI GetTimerResolution(void);
  312.  
  313. /****** Error handling ******************************************************/
  314.  
  315. #if (WINVER >= 0x030a)
  316. #ifndef NOLOGERROR
  317.  
  318. void    WINAPI LogError(UINT err, void FAR* lpInfo);
  319. void    WINAPI LogParamError(UINT err, FARPROC lpfn, void FAR* param);
  320.  
  321. /****** LogParamError/LogError values */
  322.  
  323. /* Error modifier bits */
  324.  
  325. #define ERR_WARNING             0x8000
  326. #define ERR_PARAM               0x4000
  327.  
  328. #define ERR_SIZE_MASK           0x3000
  329. #define ERR_BYTE                0x1000
  330. #define ERR_WORD                0x2000
  331. #define ERR_DWORD               0x3000
  332.  
  333. /****** LogParamError() values */
  334.  
  335. /* Generic parameter values */
  336. #define ERR_BAD_VALUE           0x6001
  337. #define ERR_BAD_FLAGS           0x6002
  338. #define ERR_BAD_INDEX           0x6003
  339. #define ERR_BAD_DVALUE          0x7004
  340. #define ERR_BAD_DFLAGS          0x7005
  341. #define ERR_BAD_DINDEX          0x7006
  342. #define ERR_BAD_PTR             0x7007
  343. #define ERR_BAD_FUNC_PTR        0x7008
  344. #define ERR_BAD_SELECTOR        0x6009
  345. #define ERR_BAD_STRING_PTR      0x700a
  346. #define ERR_BAD_HANDLE          0x600b
  347.  
  348. /* KERNEL parameter errors */
  349. #define ERR_BAD_HINSTANCE       0x6020
  350. #define ERR_BAD_HMODULE         0x6021
  351. #define ERR_BAD_GLOBAL_HANDLE   0x6022
  352. #define ERR_BAD_LOCAL_HANDLE    0x6023
  353. #define ERR_BAD_ATOM            0x6024
  354. #define ERR_BAD_HFILE           0x6025
  355.  
  356. /* USER parameter errors */
  357. #define ERR_BAD_HWND            0x6040
  358. #define ERR_BAD_HMENU           0x6041
  359. #define ERR_BAD_HCURSOR         0x6042
  360. #define ERR_BAD_HICON           0x6043
  361. #define ERR_BAD_HDWP            0x6044
  362. #define ERR_BAD_CID             0x6045
  363. #define ERR_BAD_HDRVR           0x6046
  364.  
  365. /* GDI parameter errors */
  366. #define ERR_BAD_COORDS          0x7060
  367. #define ERR_BAD_GDI_OBJECT      0x6061
  368. #define ERR_BAD_HDC             0x6062
  369. #define ERR_BAD_HPEN            0x6063
  370. #define ERR_BAD_HFONT           0x6064
  371. #define ERR_BAD_HBRUSH          0x6065
  372. #define ERR_BAD_HBITMAP         0x6066
  373. #define ERR_BAD_HRGN            0x6067
  374. #define ERR_BAD_HPALETTE        0x6068
  375. #define ERR_BAD_HMETAFILE       0x6069
  376.  
  377.  
  378. /**** LogError() values */
  379.  
  380. /* KERNEL errors */
  381. #define ERR_GALLOC              0x0001
  382. #define ERR_GREALLOC            0x0002
  383. #define ERR_GLOCK               0x0003
  384. #define ERR_LALLOC              0x0004
  385. #define ERR_LREALLOC            0x0005
  386. #define ERR_LLOCK               0x0006
  387. #define ERR_ALLOCRES            0x0007
  388. #define ERR_LOCKRES             0x0008
  389. #define ERR_LOADMODULE          0x0009
  390.  
  391. /* USER errors */
  392. #define ERR_CREATEDLG           0x0040
  393. #define ERR_CREATEDLG2          0x0041
  394. #define ERR_REGISTERCLASS       0x0042
  395. #define ERR_DCBUSY              0x0043
  396. #define ERR_CREATEWND           0x0044
  397. #define ERR_STRUCEXTRA          0x0045
  398. #define ERR_LOADSTR             0x0046
  399. #define ERR_LOADMENU            0x0047
  400. #define ERR_NESTEDBEGINPAINT    0x0048
  401. #define ERR_BADINDEX            0x0049
  402. #define ERR_CREATEMENU          0x004a
  403.  
  404. /* GDI errors */
  405. #define ERR_CREATEDC            0x0080
  406. #define ERR_CREATEMETA          0x0081
  407. #define ERR_DELOBJSELECTED      0x0082
  408. #define ERR_SELBITMAP           0x0083
  409.  
  410. /* Debugging support (DEBUG SYSTEM ONLY) */
  411. typedef struct tagWINDEBUGINFO
  412. {
  413.     UINT    flags;
  414.     DWORD   dwOptions;
  415.     DWORD   dwFilter;
  416.     char    achAllocModule[8];
  417.     DWORD   dwAllocBreak;
  418.     DWORD   dwAllocCount;
  419. } WINDEBUGINFO;
  420.  
  421. BOOL    WINAPI GetWinDebugInfo(WINDEBUGINFO FAR* lpwdi, UINT flags);
  422. BOOL    WINAPI SetWinDebugInfo(const WINDEBUGINFO FAR* lpwdi);
  423.  
  424. void    FAR _cdecl DebugOutput(UINT flags, LPCSTR lpsz, ...);
  425.  
  426. /* WINDEBUGINFO flags values */
  427. #define WDI_OPTIONS         0x0001
  428. #define WDI_FILTER          0x0002
  429. #define WDI_ALLOCBREAK      0x0004
  430.  
  431. /* dwOptions values */
  432. #define DBO_CHECKHEAP       0x0001
  433. #define DBO_BUFFERFILL      0x0004
  434. #define DBO_DISABLEGPTRAPPING 0x0010
  435. #define DBO_CHECKFREE       0x0020
  436.  
  437. #define DBO_SILENT          0x8000
  438.  
  439. #define DBO_TRACEBREAK      0x2000
  440. #define DBO_WARNINGBREAK    0x1000
  441. #define DBO_NOERRORBREAK    0x0800
  442. #define DBO_NOFATALBREAK    0x0400
  443. #define DBO_INT3BREAK       0x0100
  444.  
  445. /* DebugOutput flags values */
  446. #define DBF_TRACE           0x0000
  447. #define DBF_WARNING         0x4000
  448. #define DBF_ERROR           0x8000
  449. #define DBF_FATAL           0xc000
  450.  
  451. /* dwFilter values */
  452. #define DBF_KERNEL          0x1000
  453. #define DBF_KRN_MEMMAN      0x0001
  454. #define DBF_KRN_LOADMODULE  0x0002
  455. #define DBF_KRN_SEGMENTLOAD 0x0004
  456. #define DBF_USER            0x0800
  457. #define DBF_GDI             0x0400
  458. #define DBF_MMSYSTEM        0x0040
  459. #define DBF_PENWIN          0x0020
  460. #define DBF_APPLICATION     0x0008
  461. #define DBF_DRIVER          0x0010
  462.  
  463. #endif  /* NOLOGERROR */
  464. #endif  /* WINVER >= 0x030a */
  465.  
  466. void    WINAPI FatalExit(int);
  467. void    WINAPI FatalAppExit(UINT, LPCSTR);
  468.  
  469. BOOL    WINAPI ExitWindows(DWORD dwReturnCode, UINT wReserved);
  470.  
  471. #define EW_RESTARTWINDOWS 0x42
  472. #if (WINVER >= 0x030a)
  473. #define EW_REBOOTSYSTEM   0x43
  474.  
  475. BOOL    WINAPI ExitWindowsExec(LPCSTR, LPCSTR);
  476. #endif  /* WINVER >= 0x030a */
  477.  
  478. void    WINAPI DebugBreak(void);
  479. void    WINAPI OutputDebugString(LPCSTR);
  480.  
  481. /* SetErrorMode() constants */
  482. #define SEM_FAILCRITICALERRORS  0x0001
  483. #define SEM_NOGPFAULTERRORBOX   0x0002
  484. #define SEM_NOOPENFILEERRORBOX  0x8000
  485.  
  486. UINT    WINAPI SetErrorMode(UINT);
  487.  
  488. /****** Pointer validation **************************************************/
  489.  
  490. #if (WINVER >= 0x030a)
  491.  
  492. BOOL    WINAPI IsBadReadPtr(const void FAR* lp, UINT cb);
  493. BOOL    WINAPI IsBadWritePtr(void FAR* lp, UINT cb);
  494. BOOL    WINAPI IsBadHugeReadPtr(const void _huge* lp, DWORD cb);
  495. BOOL    WINAPI IsBadHugeWritePtr(void _huge* lp, DWORD cb);
  496. BOOL    WINAPI IsBadCodePtr(FARPROC lpfn);
  497. BOOL    WINAPI IsBadStringPtr(const void FAR* lpsz, UINT cchMax);
  498. #endif  /* WINVER >= 0x030a */
  499.  
  500. /****** Profiling support ***************************************************/
  501.  
  502. #ifndef NOPROFILER
  503.  
  504. int     WINAPI ProfInsChk(void);
  505. void    WINAPI ProfSetup(int,int);
  506. void    WINAPI ProfSampRate(int,int);
  507. void    WINAPI ProfStart(void);
  508. void    WINAPI ProfStop(void);
  509. void    WINAPI ProfClear(void);
  510. void    WINAPI ProfFlush(void);
  511. void    WINAPI ProfFinish(void);
  512. #endif  /* NOPROFILER */
  513.  
  514. /****** Catch/Throw and stack management ************************************/
  515.  
  516. typedef int CATCHBUF[9];
  517. typedef int FAR* LPCATCHBUF;
  518.  
  519. int     WINAPI Catch(int FAR*);
  520. void    WINAPI Throw(const int FAR*, int);
  521.  
  522. void    WINAPI SwitchStackBack(void);
  523. void    WINAPI SwitchStackTo(UINT, UINT, UINT);
  524.  
  525. /****** Module Management ***************************************************/
  526.  
  527. #define HINSTANCE_ERROR ((HINSTANCE)32)
  528.  
  529.  
  530. HINSTANCE   WINAPI LoadModule(LPCSTR, LPVOID);
  531. BOOL        WINAPI FreeModule(HINSTANCE);
  532.  
  533. HINSTANCE   WINAPI LoadLibrary(LPCSTR);
  534. void        WINAPI FreeLibrary(HINSTANCE);
  535.  
  536. UINT    WINAPI WinExec(LPCSTR, UINT);
  537.  
  538. HMODULE WINAPI GetModuleHandle(LPCSTR);
  539.  
  540. int     WINAPI GetModuleUsage(HINSTANCE);
  541. int     WINAPI GetModuleFileName(HINSTANCE, LPSTR, int);
  542.  
  543. FARPROC WINAPI GetProcAddress(HINSTANCE, LPCSTR);
  544.  
  545. int     WINAPI GetInstanceData(HINSTANCE, BYTE*, int);
  546.  
  547. HGLOBAL WINAPI GetCodeHandle(FARPROC);
  548.  
  549. typedef struct tagSEGINFO
  550. {
  551.     UINT offSegment;
  552.     UINT cbSegment;
  553.     UINT flags;
  554.     UINT cbAlloc;
  555.     HGLOBAL h;
  556.     UINT alignShift;
  557.     UINT reserved[2];
  558. } SEGINFO;
  559. typedef SEGINFO FAR* LPSEGINFO;
  560.  
  561. void    WINAPI GetCodeInfo(FARPROC lpProc, SEGINFO FAR* lpSegInfo);
  562.  
  563. FARPROC WINAPI MakeProcInstance(FARPROC, HINSTANCE);
  564. void    WINAPI FreeProcInstance(FARPROC);
  565.  
  566. #ifdef _LAX
  567. #define MakeProcInstance(__F, __H) MakeProcInstance((FARPROC)__F, __H)
  568. #define FreeProcInstance(__F)      FreeProcInstance((FARPROC)__F)
  569. #endif /* _LAX */
  570.  
  571. LONG    WINAPI SetSwapAreaSize(UINT);
  572. void    WINAPI SwapRecording(UINT);
  573. void    WINAPI ValidateCodeSegments(void);
  574.  
  575. /* Windows Exit Procedure flag values */
  576. #define WEP_SYSTEM_EXIT 1
  577. #define WEP_FREE_DLL    0
  578.  
  579. /****** Task Management *****************************************************/
  580.  
  581. #endif  /* NOKERNEL */
  582.  
  583. DECLARE_HANDLE(HTASK);
  584.  
  585. #ifndef NOKERNEL
  586.  
  587. UINT    WINAPI GetNumTasks(void);
  588.  
  589. #if (WINVER >= 0x030a)
  590. BOOL    WINAPI IsTask(HTASK);
  591. #endif  /* WINVER >= 0x030a */
  592.  
  593. HTASK   WINAPI GetCurrentTask(void);
  594.  
  595. void    WINAPI Yield(void);
  596. void    WINAPI DirectedYield(HTASK);
  597.  
  598.  
  599. /****** Global memory management ********************************************/
  600.  
  601. #ifndef NOMEMMGR
  602.  
  603. /* Global Memory Flags */
  604.  
  605. #define GMEM_FIXED          0x0000
  606. #define GMEM_MOVEABLE       0x0002
  607. #define GMEM_NOCOMPACT      0x0010
  608. #define GMEM_NODISCARD      0x0020
  609. #define GMEM_ZEROINIT       0x0040
  610. #define GMEM_MODIFY         0x0080
  611. #define GMEM_DISCARDABLE    0x0100
  612. #define GMEM_NOT_BANKED     0x1000
  613. #define GMEM_SHARE          0x2000
  614. #define GMEM_DDESHARE       0x2000
  615. #define GMEM_NOTIFY         0x4000
  616. #define GMEM_LOWER          GMEM_NOT_BANKED
  617.  
  618. #define GHND                (GMEM_MOVEABLE | GMEM_ZEROINIT)
  619. #define GPTR                (GMEM_FIXED | GMEM_ZEROINIT)
  620.  
  621. #define GlobalDiscard(h)    GlobalReAlloc(h, 0L, GMEM_MOVEABLE)
  622.  
  623. HGLOBAL WINAPI GlobalAlloc(UINT, DWORD);
  624. HGLOBAL WINAPI GlobalReAlloc(HGLOBAL, DWORD, UINT);
  625. HGLOBAL WINAPI GlobalFree(HGLOBAL);
  626.  
  627. DWORD   WINAPI GlobalDosAlloc(DWORD);
  628. UINT    WINAPI GlobalDosFree(UINT);
  629.  
  630. #ifdef STRICT
  631. void FAR* WINAPI GlobalLock(HGLOBAL);
  632. #else
  633. char FAR* WINAPI GlobalLock(HGLOBAL);
  634. #endif
  635.  
  636. BOOL    WINAPI GlobalUnlock(HGLOBAL);
  637.  
  638. DWORD   WINAPI GlobalSize(HGLOBAL);
  639. DWORD   WINAPI GlobalHandle(UINT);
  640.  
  641. /* GlobalFlags return flags (in addition to GMEM_DISCARDABLE) */
  642. #define GMEM_DISCARDED      0x4000
  643. #define GMEM_LOCKCOUNT      0x00FF
  644. UINT    WINAPI GlobalFlags(HGLOBAL);
  645.  
  646. #ifdef STRICT
  647. void FAR* WINAPI GlobalWire(HGLOBAL);
  648. #else
  649. char FAR* WINAPI GlobalWire(HGLOBAL);
  650. #endif
  651.  
  652. BOOL    WINAPI GlobalUnWire(HGLOBAL);
  653.  
  654. UINT    WINAPI GlobalPageLock(HGLOBAL);
  655. UINT    WINAPI GlobalPageUnlock(HGLOBAL);
  656.  
  657. void    WINAPI GlobalFix(HGLOBAL);
  658. void    WINAPI GlobalUnfix(HGLOBAL);
  659.  
  660. HGLOBAL WINAPI GlobalLRUNewest(HGLOBAL);
  661. HGLOBAL WINAPI GlobalLRUOldest(HGLOBAL);
  662.  
  663. DWORD   WINAPI GlobalCompact(DWORD);
  664.  
  665. #ifdef STRICT
  666. typedef BOOL (CALLBACK* GNOTIFYPROC)(HGLOBAL);
  667. #else
  668. typedef FARPROC GNOTIFYPROC;
  669. #endif
  670.  
  671. void    WINAPI GlobalNotify(GNOTIFYPROC);
  672.  
  673. HGLOBAL WINAPI LockSegment(UINT);
  674. void    WINAPI UnlockSegment(UINT);
  675.  
  676. #define LockData(dummy)     LockSegment((UINT)-1)
  677. #define UnlockData(dummy)   UnlockSegment((UINT)-1)
  678.  
  679. UINT    WINAPI AllocSelector(UINT);
  680. UINT    WINAPI FreeSelector(UINT);
  681. UINT    WINAPI AllocDStoCSAlias(UINT);
  682. UINT    WINAPI PrestoChangoSelector(UINT sourceSel, UINT destSel);
  683. DWORD   WINAPI GetSelectorBase(UINT);
  684. UINT    WINAPI SetSelectorBase(UINT, DWORD);
  685. DWORD   WINAPI GetSelectorLimit(UINT);
  686. UINT    WINAPI SetSelectorLimit(UINT, DWORD);
  687.  
  688. void    WINAPI LimitEmsPages(DWORD);
  689.  
  690. void    WINAPI ValidateFreeSpaces(void);
  691.  
  692. /* Low system memory notification message */
  693. #define WM_COMPACTING       0x0041
  694.  
  695. /***** Local Memory Management */
  696.  
  697. /* Local Memory Flags */
  698. #define LMEM_FIXED          0x0000
  699. #define LMEM_MOVEABLE       0x0002
  700. #define LMEM_NOCOMPACT      0x0010
  701. #define LMEM_NODISCARD      0x0020
  702. #define LMEM_ZEROINIT       0x0040
  703. #define LMEM_MODIFY         0x0080
  704. #define LMEM_DISCARDABLE    0x0F00
  705.  
  706. #define LHND                (LMEM_MOVEABLE | LMEM_ZEROINIT)
  707. #define LPTR                (LMEM_FIXED | LMEM_ZEROINIT)
  708.  
  709. #define NONZEROLHND         (LMEM_MOVEABLE)
  710. #define NONZEROLPTR         (LMEM_FIXED)
  711.  
  712.  
  713. #define LocalDiscard(h)     LocalReAlloc(h, 0, LMEM_MOVEABLE)
  714.  
  715.  
  716. HLOCAL  WINAPI LocalAlloc(UINT, UINT);
  717. HLOCAL  WINAPI LocalReAlloc(HLOCAL, UINT, UINT);
  718. HLOCAL  WINAPI LocalFree(HLOCAL);
  719.  
  720. #ifdef STRICT
  721. void NEAR* WINAPI LocalLock(HLOCAL);
  722. #else
  723. char NEAR* WINAPI LocalLock(HLOCAL);
  724. #endif
  725.  
  726. BOOL    WINAPI LocalUnlock(HLOCAL);
  727.  
  728. UINT    WINAPI LocalSize(HLOCAL);
  729. #ifdef STRICT
  730. HLOCAL  WINAPI LocalHandle(void NEAR*);
  731. #else
  732. HLOCAL  WINAPI LocalHandle(UINT);
  733. #endif
  734.  
  735. /* LocalFlags return flags (in addition to LMEM_DISCARDABLE) */
  736. #define LMEM_DISCARDED      0x4000
  737. #define LMEM_LOCKCOUNT      0x00FF
  738.  
  739. UINT    WINAPI LocalFlags(HLOCAL);
  740.  
  741. BOOL    WINAPI LocalInit(UINT, UINT, UINT);
  742. UINT    WINAPI LocalCompact(UINT);
  743. UINT    WINAPI LocalShrink(HLOCAL, UINT);
  744.  
  745. #endif  /* NOMEMMGR */
  746.  
  747. /****** File I/O ************************************************************/
  748.  
  749. #ifndef NOLFILEIO
  750.  
  751. typedef int HFILE;      /* Polymorphic with C runtime file handle type */
  752.  
  753. #define HFILE_ERROR ((HFILE)-1)
  754.  
  755. #ifndef NOOPENFILE
  756.  
  757. /* OpenFile() Structure */
  758. typedef struct tagOFSTRUCT
  759. {
  760.     BYTE cBytes;
  761.     BYTE fFixedDisk;
  762.     UINT nErrCode;
  763.     BYTE reserved[4];
  764.     char szPathName[128];
  765. } OFSTRUCT;
  766. typedef OFSTRUCT*       POFSTRUCT;
  767. typedef OFSTRUCT NEAR* NPOFSTRUCT;
  768. typedef OFSTRUCT FAR*  LPOFSTRUCT;
  769.  
  770. /* OpenFile() Flags */
  771. #define OF_READ             0x0000
  772. #define OF_WRITE            0x0001
  773. #define OF_READWRITE        0x0002
  774. #define OF_SHARE_COMPAT     0x0000
  775. #define OF_SHARE_EXCLUSIVE  0x0010
  776. #define OF_SHARE_DENY_WRITE 0x0020
  777. #define OF_SHARE_DENY_READ  0x0030
  778. #define OF_SHARE_DENY_NONE  0x0040
  779. #define OF_PARSE            0x0100
  780. #define OF_DELETE           0x0200
  781. #define OF_VERIFY           0x0400      /* Used with OF_REOPEN */
  782. #define OF_SEARCH           0x0400      /* Used without OF_REOPEN */
  783. #define OF_CANCEL           0x0800
  784. #define OF_CREATE           0x1000
  785. #define OF_PROMPT           0x2000
  786. #define OF_EXIST            0x4000
  787. #define OF_REOPEN           0x8000
  788.  
  789. HFILE   WINAPI OpenFile(LPCSTR, OFSTRUCT FAR*, UINT);
  790.  
  791. #endif  /* NOOPENFILE */
  792.  
  793. /* _lopen() flags */
  794. #define READ        0
  795. #define WRITE       1
  796. #define READ_WRITE  2
  797.  
  798. HFILE   WINAPI _lopen(LPCSTR, int);
  799. HFILE   WINAPI _lcreat(LPCSTR, int);
  800.  
  801. HFILE   WINAPI _lclose(HFILE);
  802.  
  803. LONG    WINAPI _llseek(HFILE, LONG, int);
  804.  
  805. /* _llseek origin values */
  806. #define SEEK_SET 0
  807. #define SEEK_CUR 1
  808. #define SEEK_END 2
  809.  
  810. UINT    WINAPI _lread(HFILE, void _huge*, UINT);
  811. UINT    WINAPI _lwrite(HFILE, const void _huge*, UINT);
  812.  
  813. #if (WINVER >= 0x030a)
  814. long    WINAPI _hread(HFILE, void _huge*, long);
  815. long    WINAPI _hwrite(HFILE, const void _huge*, long);
  816. #endif  /* WINVER >= 0x030a */
  817.  
  818.  
  819. #endif  /* NOLFILEIO */
  820.  
  821. /* GetTempFileName() Flags */
  822. #define TF_FORCEDRIVE       (BYTE)0x80
  823.  
  824. int     WINAPI GetTempFileName(BYTE, LPCSTR, UINT, LPSTR);
  825. BYTE    WINAPI GetTempDrive(char);
  826.  
  827. /* GetDriveType return values */
  828. #define DRIVE_REMOVABLE 2
  829. #define DRIVE_FIXED     3
  830. #define DRIVE_REMOTE    4
  831. UINT    WINAPI GetDriveType(int);
  832.  
  833. UINT    WINAPI SetHandleCount(UINT);
  834.  
  835. /****** Network support *****************************************************/
  836. UINT WINAPI WNetAddConnection(LPSTR, LPSTR, LPSTR);
  837. UINT WINAPI WNetGetConnection(LPSTR, LPSTR, UINT FAR*);
  838. UINT WINAPI WNetCancelConnection(LPSTR, BOOL);
  839. /* Errors */
  840. #define WN_SUCCESS                      0x0000
  841. #define WN_NOT_SUPPORTED                0x0001
  842. #define WN_NET_ERROR                    0x0002
  843. #define WN_MORE_DATA                    0x0003
  844. #define WN_BAD_POINTER                  0x0004
  845. #define WN_BAD_VALUE                    0x0005
  846. #define WN_BAD_PASSWORD                 0x0006
  847. #define WN_ACCESS_DENIED                0x0007
  848. #define WN_FUNCTION_BUSY                0x0008
  849. #define WN_WINDOWS_ERROR                0x0009
  850. #define WN_BAD_USER                     0x000A
  851. #define WN_OUT_OF_MEMORY                0x000B
  852. #define WN_CANCEL                       0x000C
  853. #define WN_CONTINUE                     0x000D
  854.  
  855. /* Connection errors */
  856. #define WN_NOT_CONNECTED                0x0030
  857. #define WN_OPEN_FILES                   0x0031
  858. #define WN_BAD_NETNAME                  0x0032
  859. #define WN_BAD_LOCALNAME                0x0033
  860. #define WN_ALREADY_CONNECTED            0x0034
  861. #define WN_DEVICE_ERROR                 0x0035
  862. #define WN_CONNECTION_CLOSED            0x0036
  863.  
  864. /****** Resource Management *************************************************/
  865.  
  866. DECLARE_HANDLE(HRSRC);
  867.  
  868. HRSRC   WINAPI FindResource(HINSTANCE, LPCSTR, LPCSTR);
  869. HGLOBAL WINAPI LoadResource(HINSTANCE, HRSRC);
  870. BOOL    WINAPI FreeResource(HGLOBAL);
  871.  
  872. #ifdef STRICT
  873. void FAR* WINAPI LockResource(HGLOBAL);
  874. #else
  875. char FAR* WINAPI LockResource(HGLOBAL);
  876. #endif
  877.  
  878. #define     UnlockResource(h)       GlobalUnlock(h)
  879.  
  880. DWORD   WINAPI SizeofResource(HINSTANCE, HRSRC);
  881.  
  882. int     WINAPI AccessResource(HINSTANCE, HRSRC);
  883.  
  884. HGLOBAL WINAPI AllocResource(HINSTANCE, HRSRC, DWORD);
  885.  
  886. #ifdef STRICT
  887. typedef HGLOBAL (CALLBACK* RSRCHDLRPROC)(HGLOBAL, HINSTANCE, HRSRC);
  888. #else
  889. typedef FARPROC RSRCHDLRPROC;
  890. #endif
  891.  
  892. RSRCHDLRPROC WINAPI SetResourceHandler(HINSTANCE, LPCSTR, RSRCHDLRPROC);
  893.  
  894. #if defined(_WIN30_API)
  895. #define MAKEINTRESOURCE(i)  ((LPSTR)MAKELP(0, (i)))
  896. #else
  897. #define MAKEINTRESOURCE(i)  ((LPCSTR)MAKELP(0, (i)))
  898. #endif
  899.  
  900. #ifndef NORESOURCE
  901.  
  902. /* Predefined Resource Types */
  903. #define RT_CURSOR           MAKEINTRESOURCE(1)
  904. #define RT_BITMAP           MAKEINTRESOURCE(2)
  905. #define RT_ICON             MAKEINTRESOURCE(3)
  906. #define RT_MENU             MAKEINTRESOURCE(4)
  907. #define RT_DIALOG           MAKEINTRESOURCE(5)
  908. #define RT_STRING           MAKEINTRESOURCE(6)
  909. #define RT_FONTDIR          MAKEINTRESOURCE(7)
  910. #define RT_FONT             MAKEINTRESOURCE(8)
  911. #define RT_ACCELERATOR      MAKEINTRESOURCE(9)
  912. #define RT_RCDATA           MAKEINTRESOURCE(10)
  913.  
  914. #define RT_GROUP_CURSOR     MAKEINTRESOURCE(12)
  915. #define RT_GROUP_ICON       MAKEINTRESOURCE(14)
  916.  
  917. #endif  /* NORESOURCE */
  918.  
  919. #ifdef OEMRESOURCE
  920.  
  921. /* OEM Resource Ordinal Numbers */
  922. #define OBM_CLOSE           32754
  923. #define OBM_UPARROW         32753
  924. #define OBM_DNARROW         32752
  925. #define OBM_RGARROW         32751
  926. #define OBM_LFARROW         32750
  927. #define OBM_REDUCE          32749
  928. #define OBM_ZOOM            32748
  929. #define OBM_RESTORE         32747
  930. #define OBM_REDUCED         32746
  931. #define OBM_ZOOMD           32745
  932. #define OBM_RESTORED        32744
  933. #define OBM_UPARROWD        32743
  934. #define OBM_DNARROWD        32742
  935. #define OBM_RGARROWD        32741
  936. #define OBM_LFARROWD        32740
  937. #define OBM_MNARROW         32739
  938. #define OBM_COMBO           32738
  939. #if (WINVER >= 0x030a)
  940. #define OBM_UPARROWI        32737
  941. #define OBM_DNARROWI        32736
  942. #define OBM_RGARROWI        32735
  943. #define OBM_LFARROWI        32734
  944. #endif  /* WINVER >= 0x030a */
  945.  
  946. #define OBM_OLD_CLOSE       32767
  947. #define OBM_SIZE            32766
  948. #define OBM_OLD_UPARROW     32765
  949. #define OBM_OLD_DNARROW     32764
  950. #define OBM_OLD_RGARROW     32763
  951. #define OBM_OLD_LFARROW     32762
  952. #define OBM_BTSIZE          32761
  953. #define OBM_CHECK           32760
  954. #define OBM_CHECKBOXES      32759
  955. #define OBM_BTNCORNERS      32758
  956. #define OBM_OLD_REDUCE      32757
  957. #define OBM_OLD_ZOOM        32756
  958. #define OBM_OLD_RESTORE     32755
  959.  
  960. #define OCR_NORMAL          32512
  961. #define OCR_IBEAM           32513
  962. #define OCR_WAIT            32514
  963. #define OCR_CROSS           32515
  964. #define OCR_UP              32516
  965. #define OCR_SIZE            32640
  966. #define OCR_ICON            32641
  967. #define OCR_SIZENWSE        32642
  968. #define OCR_SIZENESW        32643
  969. #define OCR_SIZEWE          32644
  970. #define OCR_SIZENS          32645
  971. #define OCR_SIZEALL         32646
  972. #define OCR_ICOCUR          32647
  973.  
  974. #define OIC_SAMPLE          32512
  975. #define OIC_HAND            32513
  976. #define OIC_QUES            32514
  977. #define OIC_BANG            32515
  978. #define OIC_NOTE            32516
  979.  
  980. #endif  /* OEMRESOURCE */
  981.  
  982. /****** Atom Management *****************************************************/
  983.  
  984. #if defined(_WIN30_API)
  985. #define MAKEINTATOM(i)      ((LPSTR)MAKELP(0, (i)))
  986. #else
  987. #define MAKEINTATOM(i)      ((LPCSTR)MAKELP(0, (i)))
  988. #endif
  989.  
  990. #ifndef NOATOM
  991.  
  992. BOOL    WINAPI InitAtomTable(int);
  993. ATOM    WINAPI AddAtom(LPCSTR);
  994. ATOM    WINAPI DeleteAtom(ATOM);
  995. ATOM    WINAPI FindAtom(LPCSTR);
  996. UINT    WINAPI GetAtomName(ATOM, LPSTR, int);
  997. ATOM    WINAPI GlobalAddAtom(LPCSTR);
  998. ATOM    WINAPI GlobalDeleteAtom(ATOM);
  999. ATOM    WINAPI GlobalFindAtom(LPCSTR);
  1000. UINT    WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
  1001. HLOCAL  WINAPI GetAtomHandle(ATOM);
  1002.  
  1003. #endif  /* NOATOM */
  1004.  
  1005. /****** WIN.INI Support *****************************************************/
  1006.  
  1007. /* User Profile Routines */
  1008. UINT    WINAPI GetProfileInt(LPCSTR, LPCSTR, int);
  1009. int     WINAPI GetProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int);
  1010. BOOL    WINAPI WriteProfileString(LPCSTR, LPCSTR, LPCSTR);
  1011.  
  1012. UINT    WINAPI GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
  1013. int     WINAPI GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
  1014. BOOL    WINAPI WritePrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPCSTR);
  1015.  
  1016. #define WM_WININICHANGE     0x001A
  1017.  
  1018. /****** International & Char Translation Support ****************************/
  1019.  
  1020. void    WINAPI AnsiToOem(const char _huge*, char _huge*);
  1021. void    WINAPI OemToAnsi(const char _huge*, char _huge*);
  1022.  
  1023. void    WINAPI AnsiToOemBuff(LPCSTR, LPSTR, UINT);
  1024. void    WINAPI OemToAnsiBuff(LPCSTR, LPSTR, UINT);
  1025.  
  1026. LPSTR   WINAPI AnsiNext(LPCSTR);
  1027. LPSTR   WINAPI AnsiPrev(LPCSTR, LPCSTR);
  1028.  
  1029. LPSTR   WINAPI AnsiUpper(LPSTR);
  1030. LPSTR   WINAPI AnsiLower(LPSTR);
  1031.  
  1032. UINT    WINAPI AnsiUpperBuff(LPSTR, UINT);
  1033. UINT    WINAPI AnsiLowerBuff(LPSTR, UINT);
  1034.  
  1035.  
  1036. #ifndef  NOLANGUAGE
  1037. BOOL    WINAPI IsCharAlpha(char);
  1038. BOOL    WINAPI IsCharAlphaNumeric(char);
  1039. BOOL    WINAPI IsCharUpper(char);
  1040. BOOL    WINAPI IsCharLower(char);
  1041. #endif
  1042.  
  1043. #ifndef NOLSTRING
  1044. int     WINAPI lstrcmp(LPCSTR, LPCSTR);
  1045. int     WINAPI lstrcmpi(LPCSTR, LPCSTR);
  1046. LPSTR   WINAPI lstrcpy(LPSTR, LPCSTR);
  1047. LPSTR   WINAPI lstrcat(LPSTR, LPCSTR);
  1048. int     WINAPI lstrlen(LPCSTR);
  1049. #if (WINVER >= 0x030a)
  1050. LPSTR   WINAPI lstrcpyn(LPSTR, LPCSTR, int);
  1051. void    WINAPI hmemcpy(void _huge*, const void _huge*, long);
  1052. #endif  /* WINVER >= 0x030a */
  1053. #endif  /* NOLSTRING */
  1054.  
  1055. #if (WINVER >= 0x030a)
  1056. #ifndef NODBCS
  1057. BOOL    WINAPI IsDBCSLeadByte(BYTE);
  1058. #endif  /* NODBCS */
  1059. #endif  /* WINVER >= 0x030a */
  1060.  
  1061. int     WINAPI LoadString(HINSTANCE, UINT, LPSTR, int);
  1062.  
  1063. /****** Keyboard Driver Functions *******************************************/
  1064.  
  1065. #ifndef NOKEYBOARDINFO
  1066.  
  1067. DWORD   WINAPI OemKeyScan(UINT);
  1068. UINT    WINAPI VkKeyScan(UINT);
  1069. int     WINAPI GetKeyboardType(int);
  1070. UINT    WINAPI MapVirtualKey(UINT, UINT);
  1071. int     WINAPI GetKBCodePage(void);
  1072. int     WINAPI GetKeyNameText(LONG, LPSTR, int);
  1073. int     WINAPI ToAscii(UINT wVirtKey, UINT wScanCode, BYTE FAR* lpKeyState, DWORD FAR* lpChar, UINT wFlags);
  1074.  
  1075. #endif
  1076.  
  1077. #endif  /* NOKERNEL */
  1078.  
  1079. /****** GDI typedefs, structures, and functions *****************************/
  1080.  
  1081. DECLARE_HANDLE(HDC);
  1082.  
  1083. #ifndef NOGDI
  1084.  
  1085. #ifdef STRICT
  1086. typedef const void NEAR* HGDIOBJ;
  1087. #else
  1088. DECLARE_HANDLE(HGDIOBJ);
  1089. #endif
  1090.  
  1091. #endif  /* NOGDI */
  1092.  
  1093. DECLARE_HANDLE(HBITMAP);
  1094. DECLARE_HANDLE(HPEN);
  1095. DECLARE_HANDLE(HBRUSH);
  1096. DECLARE_HANDLE(HRGN);
  1097. DECLARE_HANDLE(HPALETTE);
  1098. DECLARE_HANDLE(HFONT);
  1099.  
  1100. typedef struct tagRECT
  1101. {
  1102.     int left;
  1103.     int top;
  1104.     int right;
  1105.     int bottom;
  1106. } RECT;
  1107. typedef RECT*      PRECT;
  1108. typedef RECT NEAR* NPRECT;
  1109. typedef RECT FAR*  LPRECT;
  1110.  
  1111. typedef struct tagPOINT
  1112. {
  1113.     int x;
  1114.     int y;
  1115. } POINT;
  1116. typedef POINT*       PPOINT;
  1117. typedef POINT NEAR* NPPOINT;
  1118. typedef POINT FAR*  LPPOINT;
  1119.  
  1120. #if (WINVER >= 0x030a)
  1121. typedef struct tagSIZE
  1122. {
  1123.     int cx;
  1124.     int cy;
  1125. } SIZE;
  1126. typedef SIZE*       PSIZE;
  1127. typedef SIZE NEAR* NPSIZE;
  1128. typedef SIZE FAR*  LPSIZE;
  1129. #endif  /* WINVER >= 0x030a */
  1130.  
  1131. #define MAKEPOINT(l)        (*((POINT FAR*)&(l)))
  1132.  
  1133. #ifndef NOGDI
  1134.  
  1135. /****** DC Management *******************************************************/
  1136.  
  1137. HDC     WINAPI CreateDC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1138. HDC     WINAPI CreateIC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1139. HDC     WINAPI CreateCompatibleDC(HDC);
  1140.  
  1141. BOOL    WINAPI DeleteDC(HDC);
  1142.  
  1143. DWORD   WINAPI GetDCOrg(HDC);
  1144.  
  1145. int     WINAPI SaveDC(HDC);
  1146. BOOL    WINAPI RestoreDC(HDC, int);
  1147.  
  1148. int     WINAPI SetEnvironment(LPCSTR, const void FAR*, UINT);
  1149. int     WINAPI GetEnvironment(LPCSTR, void FAR*, UINT);
  1150.  
  1151. int     WINAPI MulDiv(int, int, int);
  1152.  
  1153. #if (WINVER >= 0x030a)
  1154. /* Drawing bounds accumulation APIs */
  1155. UINT    WINAPI SetBoundsRect(HDC hDC, const RECT FAR* lprcBounds, UINT flags);
  1156. UINT    WINAPI GetBoundsRect(HDC hDC, RECT FAR* lprcBounds, UINT flags);
  1157.  
  1158. #define DCB_RESET       0x0001
  1159. #define DCB_ACCUMULATE  0x0002
  1160. #define DCB_DIRTY       DCB_ACCUMULATE
  1161. #define DCB_SET         (DCB_RESET | DCB_ACCUMULATE)
  1162. #define DCB_ENABLE      0x0004
  1163. #define DCB_DISABLE     0x0008
  1164. #endif  /* WINVER >= 0x030a */
  1165.  
  1166. /****** Device Capabilities *************************************************/
  1167.  
  1168. int WINAPI GetDeviceCaps(HDC, int);
  1169.  
  1170. /* Device Parameters for GetDeviceCaps() */
  1171. #define DRIVERVERSION 0
  1172. #define TECHNOLOGY    2
  1173. #define HORZSIZE      4
  1174. #define VERTSIZE      6
  1175. #define HORZRES       8
  1176. #define VERTRES       10
  1177. #define BITSPIXEL     12
  1178. #define PLANES        14
  1179. #define NUMBRUSHES    16
  1180. #define NUMPENS       18
  1181. #define NUMMARKERS    20
  1182. #define NUMFONTS      22
  1183. #define NUMCOLORS     24
  1184. #define PDEVICESIZE   26
  1185. #define CURVECAPS     28
  1186. #define LINECAPS      30
  1187. #define POLYGONALCAPS 32
  1188. #define TEXTCAPS      34
  1189. #define CLIPCAPS      36
  1190. #define RASTERCAPS    38
  1191. #define ASPECTX       40
  1192. #define ASPECTY       42
  1193. #define ASPECTXY      44
  1194.  
  1195. #define LOGPIXELSX    88
  1196. #define LOGPIXELSY    90
  1197.  
  1198. #define SIZEPALETTE  104
  1199. #define NUMRESERVED  106
  1200. #define COLORRES     108
  1201.  
  1202. #ifndef NOGDICAPMASKS
  1203.  
  1204. /* GetDeviceCaps() return value masks */
  1205.  
  1206. /* TECHNOLOGY */
  1207. #define DT_PLOTTER          0
  1208. #define DT_RASDISPLAY       1
  1209. #define DT_RASPRINTER       2
  1210. #define DT_RASCAMERA        3
  1211. #define DT_CHARSTREAM       4
  1212. #define DT_METAFILE         5
  1213. #define DT_DISPFILE         6
  1214.  
  1215. /* CURVECAPS */
  1216. #define CC_NONE             0x0000
  1217. #define CC_CIRCLES          0x0001
  1218. #define CC_PIE              0x0002
  1219. #define CC_CHORD            0x0004
  1220. #define CC_ELLIPSES         0x0008
  1221. #define CC_WIDE             0x0010
  1222. #define CC_STYLED           0x0020
  1223. #define CC_WIDESTYLED       0x0040
  1224. #define CC_INTERIORS        0x0080
  1225. #define CC_ROUNDRECT        0x0100
  1226.  
  1227. /* LINECAPS */
  1228. #define LC_NONE             0x0000
  1229. #define LC_POLYLINE         0x0002
  1230. #define LC_MARKER           0x0004
  1231. #define LC_POLYMARKER       0x0008
  1232. #define LC_WIDE             0x0010
  1233. #define LC_STYLED           0x0020
  1234. #define LC_WIDESTYLED       0x0040
  1235. #define LC_INTERIORS        0x0080
  1236.  
  1237. /* POLYGONALCAPS */
  1238. #define PC_NONE             0x0000
  1239. #define PC_POLYGON          0x0001
  1240. #define PC_RECTANGLE        0x0002
  1241. #define PC_WINDPOLYGON      0x0004
  1242. #define PC_SCANLINE         0x0008
  1243. #define PC_WIDE             0x0010
  1244. #define PC_STYLED           0x0020
  1245. #define PC_WIDESTYLED       0x0040
  1246. #define PC_INTERIORS        0x0080
  1247.  
  1248. /* TEXTCAPS */
  1249. #define TC_OP_CHARACTER     0x0001
  1250. #define TC_OP_STROKE        0x0002
  1251. #define TC_CP_STROKE        0x0004
  1252. #define TC_CR_90            0x0008
  1253. #define TC_CR_ANY           0x0010
  1254. #define TC_SF_X_YINDEP      0x0020
  1255. #define TC_SA_DOUBLE        0x0040
  1256. #define TC_SA_INTEGER       0x0080
  1257. #define TC_SA_CONTIN        0x0100
  1258. #define TC_EA_DOUBLE        0x0200
  1259. #define TC_IA_ABLE          0x0400
  1260. #define TC_UA_ABLE          0x0800
  1261. #define TC_SO_ABLE          0x1000
  1262. #define TC_RA_ABLE          0x2000
  1263. #define TC_VA_ABLE          0x4000
  1264. #define TC_RESERVED         0x8000
  1265.  
  1266. /* CLIPCAPS */
  1267. #define CP_NONE             0x0000
  1268. #define CP_RECTANGLE        0x0001
  1269. #define CP_REGION           0x0002
  1270.  
  1271. /* RASTERCAPS */
  1272. #define RC_NONE
  1273. #define RC_BITBLT           0x0001
  1274. #define RC_BANDING          0x0002
  1275. #define RC_SCALING          0x0004
  1276. #define RC_BITMAP64         0x0008
  1277. #define RC_GDI20_OUTPUT     0x0010
  1278. #define RC_GDI20_STATE      0x0020
  1279. #define RC_SAVEBITMAP       0x0040
  1280. #define RC_DI_BITMAP        0x0080
  1281. #define RC_PALETTE          0x0100
  1282. #define RC_DIBTODEV         0x0200
  1283. #define RC_BIGFONT          0x0400
  1284. #define RC_STRETCHBLT       0x0800
  1285. #define RC_FLOODFILL        0x1000
  1286. #define RC_STRETCHDIB       0x2000
  1287. #define RC_OP_DX_OUTPUT     0x4000
  1288. #define RC_DEVBITS          0x8000
  1289.  
  1290. #endif  /* NOGDICAPMASKS */
  1291.  
  1292. /****** Coordinate transformation support ***********************************/
  1293.  
  1294. int     WINAPI SetMapMode(HDC, int);
  1295. int     WINAPI GetMapMode(HDC);
  1296.  
  1297. /* Map modes */
  1298. #define MM_TEXT             1
  1299. #define MM_LOMETRIC         2
  1300. #define MM_HIMETRIC         3
  1301. #define MM_LOENGLISH        4
  1302. #define MM_HIENGLISH        5
  1303. #define MM_TWIPS            6
  1304. #define MM_ISOTROPIC        7
  1305. #define MM_ANISOTROPIC      8
  1306.  
  1307. DWORD   WINAPI SetWindowOrg(HDC, int, int);
  1308. DWORD   WINAPI GetWindowOrg(HDC);
  1309.  
  1310. DWORD   WINAPI SetWindowExt(HDC, int, int);
  1311. DWORD   WINAPI GetWindowExt(HDC);
  1312.  
  1313. DWORD   WINAPI OffsetWindowOrg(HDC, int, int);
  1314. DWORD   WINAPI ScaleWindowExt(HDC, int, int, int, int);
  1315.  
  1316. DWORD   WINAPI SetViewportOrg(HDC, int, int);
  1317. DWORD   WINAPI GetViewportOrg(HDC);
  1318.  
  1319. DWORD   WINAPI SetViewportExt(HDC, int, int);
  1320. DWORD   WINAPI GetViewportExt(HDC);
  1321.  
  1322. DWORD   WINAPI OffsetViewportOrg(HDC, int, int);
  1323. DWORD   WINAPI ScaleViewportExt(HDC, int, int, int, int);
  1324.  
  1325. #if (WINVER >= 0x030a)
  1326. BOOL    WINAPI SetWindowOrgEx(HDC, int, int, POINT FAR*);
  1327. BOOL    WINAPI GetWindowOrgEx(HDC, POINT FAR*);
  1328.  
  1329. BOOL    WINAPI SetWindowExtEx(HDC, int, int, SIZE FAR*);
  1330. BOOL    WINAPI GetWindowExtEx(HDC, SIZE FAR*);
  1331.  
  1332. BOOL    WINAPI OffsetWindowOrgEx(HDC, int, int, POINT FAR*);
  1333. BOOL    WINAPI ScaleWindowExtEx(HDC, int, int, int, int, SIZE FAR*);
  1334.  
  1335. BOOL    WINAPI SetViewportExtEx(HDC, int, int, SIZE FAR*);
  1336. BOOL    WINAPI GetViewportExtEx(HDC, SIZE FAR*);
  1337.  
  1338. BOOL    WINAPI SetViewportOrgEx(HDC, int, int, POINT FAR*);
  1339. BOOL    WINAPI GetViewportOrgEx(HDC, POINT FAR*);
  1340.  
  1341. BOOL    WINAPI OffsetViewportOrgEx(HDC, int, int, POINT FAR*);
  1342. BOOL    WINAPI ScaleViewportExtEx(HDC, int, int, int, int, SIZE FAR*);
  1343. #endif  /* WINVER >= 0x030a */
  1344.  
  1345. BOOL    WINAPI DPtoLP(HDC, POINT FAR*, int);
  1346. BOOL    WINAPI LPtoDP(HDC, POINT FAR*, int);
  1347.  
  1348.  
  1349. /* Coordinate Modes */
  1350. #define ABSOLUTE    1
  1351. #define RELATIVE    2
  1352.  
  1353. /****** Color support *******************************************************/
  1354.  
  1355. typedef DWORD COLORREF;
  1356.  
  1357. #define RGB(r,g,b)          ((COLORREF)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
  1358.  
  1359. #define GetRValue(rgb)      ((BYTE)(rgb))
  1360. #define GetGValue(rgb)      ((BYTE)(((WORD)(rgb)) >> 8))
  1361. #define GetBValue(rgb)      ((BYTE)((rgb)>>16))
  1362.  
  1363. COLORREF WINAPI GetNearestColor(HDC, COLORREF);
  1364.  
  1365. #ifndef NOCOLOR
  1366.  
  1367. COLORREF WINAPI GetSysColor(int);
  1368. void    WINAPI SetSysColors(int, const int FAR*, const COLORREF FAR*);
  1369.  
  1370. #define COLOR_SCROLLBAR            0
  1371. #define COLOR_BACKGROUND           1
  1372. #define COLOR_ACTIVECAPTION        2
  1373. #define COLOR_INACTIVECAPTION      3
  1374. #define COLOR_MENU                 4
  1375. #define COLOR_WINDOW               5
  1376. #define COLOR_WINDOWFRAME          6
  1377. #define COLOR_MENUTEXT             7
  1378. #define COLOR_WINDOWTEXT           8
  1379. #define COLOR_CAPTIONTEXT          9
  1380. #define COLOR_ACTIVEBORDER        10
  1381. #define COLOR_INACTIVEBORDER      11
  1382. #define COLOR_APPWORKSPACE        12
  1383. #define COLOR_HIGHLIGHT           13
  1384. #define COLOR_HIGHLIGHTTEXT       14
  1385. #define COLOR_BTNFACE             15
  1386. #define COLOR_BTNSHADOW           16
  1387. #define COLOR_GRAYTEXT            17
  1388. #define COLOR_BTNTEXT             18
  1389. #if (WINVER >= 0x030a)
  1390. #define COLOR_INACTIVECAPTIONTEXT 19
  1391. #define COLOR_BTNHIGHLIGHT        20
  1392. #endif  /* WINVER >= 0x030a */
  1393.  
  1394. #endif  /* NOCOLOR */
  1395.  
  1396. #define WM_SYSCOLORCHANGE   0x0015
  1397.  
  1398. /****** GDI Object Support **************************************************/
  1399.  
  1400. #ifndef NOGDIOBJ
  1401.  
  1402. HGDIOBJ WINAPI GetStockObject(int);
  1403.  
  1404. BOOL    WINAPI IsGDIObject(HGDIOBJ);
  1405.  
  1406. BOOL    WINAPI DeleteObject(HGDIOBJ);
  1407. HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
  1408. int     WINAPI GetObject(HGDIOBJ, int, void FAR*);
  1409. BOOL    WINAPI UnrealizeObject(HGDIOBJ);
  1410.  
  1411. #ifdef STRICT
  1412. typedef (CALLBACK* GOBJENUMPROC)(void FAR*, LPARAM);
  1413. #else
  1414. typedef FARPROC GOBJENUMPROC;
  1415. #endif
  1416.  
  1417. #ifdef STRICT
  1418. int     WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPARAM);
  1419. #else
  1420. int     WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPSTR);
  1421. #endif
  1422.  
  1423. /* Object types for EnumObjects() */
  1424. #define OBJ_PEN             1
  1425. #define OBJ_BRUSH           2
  1426.  
  1427. /****** Pen support *********************************************************/
  1428.  
  1429. /* Logical Pen */
  1430. typedef struct tagLOGPEN
  1431. {
  1432.     UINT    lopnStyle;
  1433.     POINT   lopnWidth;
  1434.     COLORREF lopnColor;
  1435. } LOGPEN;
  1436. typedef LOGPEN*       PLOGPEN;
  1437. typedef LOGPEN NEAR* NPLOGPEN;
  1438. typedef LOGPEN FAR*  LPLOGPEN;
  1439.  
  1440. /* Pen Styles */
  1441. #define PS_SOLID            0
  1442. #define PS_DASH             1
  1443. #define PS_DOT              2
  1444. #define PS_DASHDOT          3
  1445. #define PS_DASHDOTDOT       4
  1446. #define PS_NULL             5
  1447. #define PS_INSIDEFRAME      6
  1448.  
  1449. HPEN    WINAPI CreatePen(int, int, COLORREF);
  1450. HPEN    WINAPI CreatePenIndirect(LOGPEN FAR*);
  1451.  
  1452. /* Stock pens for use with GetStockObject(); */
  1453. #define WHITE_PEN           6
  1454. #define BLACK_PEN           7
  1455. #define NULL_PEN            8
  1456.  
  1457. /****** Brush support *******************************************************/
  1458.  
  1459. /* Brush Styles */
  1460. #define BS_SOLID            0
  1461. #define BS_NULL             1
  1462. #define BS_HOLLOW           BS_NULL
  1463. #define BS_HATCHED          2
  1464. #define BS_PATTERN          3
  1465. #define BS_INDEXED          4
  1466. #define BS_DIBPATTERN       5
  1467.  
  1468. /* Hatch Styles */
  1469. #define HS_HORIZONTAL       0
  1470. #define HS_VERTICAL         1
  1471. #define HS_FDIAGONAL        2
  1472. #define HS_BDIAGONAL        3
  1473. #define HS_CROSS            4
  1474. #define HS_DIAGCROSS        5
  1475.  
  1476. /* Logical Brush (or Pattern) */
  1477. typedef struct tagLOGBRUSH
  1478. {
  1479.     UINT     lbStyle;
  1480.     COLORREF lbColor;
  1481.     int      lbHatch;
  1482. } LOGBRUSH;
  1483. typedef LOGBRUSH*       PLOGBRUSH;
  1484. typedef LOGBRUSH NEAR* NPLOGBRUSH;
  1485. typedef LOGBRUSH FAR*  LPLOGBRUSH;
  1486.  
  1487. typedef LOGBRUSH            PATTERN;
  1488. typedef PATTERN*       PPATTERN;
  1489. typedef PATTERN NEAR* NPPATTERN;
  1490. typedef PATTERN FAR*  LPPATTERN;
  1491.  
  1492. HBRUSH  WINAPI CreateSolidBrush(COLORREF);
  1493. HBRUSH  WINAPI CreateHatchBrush(int, COLORREF);
  1494. HBRUSH  WINAPI CreatePatternBrush(HBITMAP);
  1495. HBRUSH  WINAPI CreateDIBPatternBrush(HGLOBAL, UINT);
  1496. HBRUSH  WINAPI CreateBrushIndirect(LOGBRUSH FAR*);
  1497.  
  1498. /* Stock brushes for use with GetStockObject() */
  1499. #define WHITE_BRUSH         0
  1500. #define LTGRAY_BRUSH        1
  1501. #define GRAY_BRUSH          2
  1502. #define DKGRAY_BRUSH        3
  1503. #define BLACK_BRUSH         4
  1504. #define NULL_BRUSH          5
  1505. #define HOLLOW_BRUSH        NULL_BRUSH
  1506.  
  1507. DWORD   WINAPI SetBrushOrg(HDC, int, int);
  1508. DWORD   WINAPI GetBrushOrg(HDC);
  1509.  
  1510. #if (WINVER >= 0x030a)
  1511. BOOL    WINAPI GetBrushOrgEx(HDC, POINT FAR*);
  1512. #endif  /* WINVER >= 0x030a */
  1513. #endif  /* NOGDIOBJ */
  1514.  
  1515. /****** Region support ******************************************************/
  1516.  
  1517. HRGN    WINAPI CreateRectRgn(int, int, int, int);
  1518. HRGN    WINAPI CreateRectRgnIndirect(const RECT FAR*);
  1519. HRGN    WINAPI CreateEllipticRgnIndirect(const RECT FAR*);
  1520. HRGN    WINAPI CreateEllipticRgn(int, int, int, int);
  1521. HRGN    WINAPI CreatePolygonRgn(const POINT FAR*, int, int);
  1522. HRGN    WINAPI CreatePolyPolygonRgn(const POINT FAR*, const int FAR*, int, int);
  1523. HRGN    WINAPI CreateRoundRectRgn(int, int, int, int, int, int);
  1524.  
  1525. /* Region type flags */
  1526. #define ERROR               0
  1527. #define NULLREGION          1
  1528. #define SIMPLEREGION        2
  1529. #define COMPLEXREGION       3
  1530.  
  1531. void    WINAPI SetRectRgn(HRGN, int, int, int, int);
  1532.  
  1533. int     WINAPI CombineRgn(HRGN, HRGN, HRGN, int);
  1534.  
  1535. /* CombineRgn() command values */
  1536. #define RGN_AND             1
  1537. #define RGN_OR              2
  1538. #define RGN_XOR             3
  1539. #define RGN_DIFF            4
  1540. #define RGN_COPY            5
  1541.  
  1542. BOOL    WINAPI EqualRgn(HRGN, HRGN);
  1543. int     WINAPI OffsetRgn(HRGN, int, int);
  1544.  
  1545. int     WINAPI GetRgnBox(HRGN, RECT FAR*);
  1546.  
  1547. BOOL    WINAPI RectInRegion(HRGN, const RECT FAR*);
  1548. BOOL    WINAPI PtInRegion(HRGN, int, int);
  1549.  
  1550. /****** Color palette Support ************************************************/
  1551.  
  1552. #define PALETTERGB(r,g,b)   (0x02000000L | RGB(r,g,b))
  1553. #define PALETTEINDEX(i)     ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))
  1554.  
  1555. typedef struct tagPALETTEENTRY
  1556. {
  1557.     BYTE    peRed;
  1558.     BYTE    peGreen;
  1559.     BYTE    peBlue;
  1560.     BYTE    peFlags;
  1561. } PALETTEENTRY;
  1562. typedef PALETTEENTRY FAR* LPPALETTEENTRY;
  1563.  
  1564. /* Palette entry flags */
  1565. #define PC_RESERVED     0x01    /* palette index used for animation */
  1566. #define PC_EXPLICIT     0x02    /* palette index is explicit to device */
  1567. #define PC_NOCOLLAPSE   0x04    /* do not match color to system palette */
  1568.  
  1569. /* Logical Palette */
  1570. typedef struct tagLOGPALETTE
  1571. {
  1572.     WORD    palVersion;
  1573.     WORD    palNumEntries;
  1574.     PALETTEENTRY palPalEntry[1];
  1575. } LOGPALETTE;
  1576. typedef LOGPALETTE*       PLOGPALETTE;
  1577. typedef LOGPALETTE NEAR* NPLOGPALETTE;
  1578. typedef LOGPALETTE FAR*  LPLOGPALETTE;
  1579.  
  1580. HPALETTE WINAPI CreatePalette(const LOGPALETTE FAR*);
  1581.  
  1582. HPALETTE WINAPI SelectPalette(HDC, HPALETTE, BOOL);
  1583.  
  1584. UINT    WINAPI RealizePalette(HDC);
  1585.  
  1586. int     WINAPI UpdateColors(HDC);
  1587. void    WINAPI AnimatePalette(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1588.  
  1589. UINT    WINAPI SetPaletteEntries(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1590. UINT    WINAPI GetPaletteEntries(HPALETTE, UINT, UINT, PALETTEENTRY FAR*);
  1591.  
  1592. UINT    WINAPI GetNearestPaletteIndex(HPALETTE, COLORREF);
  1593.  
  1594. BOOL    WINAPI ResizePalette(HPALETTE, UINT);
  1595.  
  1596. UINT    WINAPI GetSystemPaletteEntries(HDC, UINT, UINT, PALETTEENTRY FAR*);
  1597.  
  1598. UINT    WINAPI GetSystemPaletteUse(HDC);
  1599. UINT    WINAPI SetSystemPaletteUse(HDC, UINT);
  1600.  
  1601. /* Get/SetSystemPaletteUse() values */
  1602. #define SYSPAL_STATIC   1
  1603. #define SYSPAL_NOSTATIC 2
  1604.  
  1605. /* Palette window messages */
  1606. #define WM_QUERYNEWPALETTE  0x030F
  1607. #define WM_PALETTEISCHANGING 0x0310
  1608. #define WM_PALETTECHANGED   0x0311
  1609.  
  1610. /****** Clipping support *****************************************************/
  1611.  
  1612. int     WINAPI SelectClipRgn(HDC, HRGN);
  1613. int     WINAPI GetClipBox(HDC, RECT FAR*);
  1614.  
  1615. int     WINAPI IntersectClipRect(HDC, int, int, int, int);
  1616. int     WINAPI OffsetClipRgn(HDC, int, int);
  1617. int     WINAPI ExcludeClipRect(HDC, int, int, int, int);
  1618.  
  1619. BOOL    WINAPI PtVisible(HDC, int, int);
  1620. BOOL    WINAPI RectVisible(HDC, const RECT FAR*);
  1621.  
  1622.  
  1623. /****** General drawing support ********************************************/
  1624.  
  1625. DWORD   WINAPI MoveTo(HDC, int, int);
  1626. DWORD   WINAPI GetCurrentPosition(HDC);
  1627.  
  1628. #if (WINVER >= 0x030a)
  1629. BOOL    WINAPI MoveToEx(HDC, int, int, POINT FAR*);
  1630. BOOL    WINAPI GetCurrentPositionEx(HDC, POINT FAR*);
  1631. #endif  /* WINVER >= 0x030a */
  1632.  
  1633. BOOL    WINAPI LineTo(HDC, int, int);
  1634. BOOL    WINAPI Polyline(HDC, const POINT FAR*, int);
  1635.  
  1636. #ifdef STRICT
  1637. typedef void (CALLBACK* LINEDDAPROC)(int, int, LPARAM);
  1638. #else
  1639. typedef FARPROC LINEDDAPROC;
  1640. #endif
  1641.  
  1642. void    WINAPI LineDDA(int, int, int, int, LINEDDAPROC, LPARAM);
  1643.  
  1644. BOOL    WINAPI Rectangle(HDC, int, int, int, int);
  1645. BOOL    WINAPI RoundRect(HDC, int, int, int, int, int, int);
  1646.  
  1647. BOOL    WINAPI Ellipse(HDC, int, int, int, int);
  1648. BOOL    WINAPI Arc(HDC, int, int, int, int, int, int, int, int);
  1649. BOOL    WINAPI Chord(HDC, int, int, int, int, int, int, int, int);
  1650. BOOL    WINAPI Pie(HDC, int, int, int, int, int, int, int, int);
  1651.  
  1652. BOOL    WINAPI Polygon(HDC, const POINT FAR*, int);
  1653. BOOL    WINAPI PolyPolygon(HDC, const POINT FAR*, int FAR*, int);
  1654.  
  1655. /* PolyFill Modes */
  1656. #define ALTERNATE   1
  1657. #define WINDING     2
  1658.  
  1659. int     WINAPI SetPolyFillMode(HDC, int);
  1660. int     WINAPI GetPolyFillMode(HDC);
  1661.  
  1662. BOOL    WINAPI FloodFill(HDC, int, int, COLORREF);
  1663. BOOL    WINAPI ExtFloodFill(HDC, int, int, COLORREF, UINT);
  1664.  
  1665. /* ExtFloodFill style flags */
  1666. #define  FLOODFILLBORDER   0
  1667. #define  FLOODFILLSURFACE  1
  1668.  
  1669. BOOL    WINAPI FillRgn(HDC, HRGN, HBRUSH);
  1670. BOOL    WINAPI FrameRgn(HDC, HRGN, HBRUSH, int, int);
  1671. BOOL    WINAPI InvertRgn(HDC, HRGN);
  1672. BOOL    WINAPI PaintRgn(HDC, HRGN);
  1673.  
  1674. /* Rectangle output routines */
  1675. int     WINAPI FillRect(HDC, const RECT FAR*, HBRUSH);
  1676. int     WINAPI FrameRect(HDC, const RECT FAR*, HBRUSH);
  1677. void    WINAPI InvertRect(HDC, const RECT FAR*);
  1678.  
  1679. void    WINAPI DrawFocusRect(HDC, const RECT FAR*);
  1680.  
  1681.  
  1682. /****** Text support ********************************************************/
  1683.  
  1684. BOOL    WINAPI TextOut(HDC, int, int, LPCSTR, int);
  1685. LONG    WINAPI TabbedTextOut(HDC, int, int, LPCSTR, int, int, int FAR*, int);
  1686. BOOL    WINAPI ExtTextOut(HDC, int, int, UINT, const RECT FAR*, LPCSTR, UINT, int FAR*);
  1687.  
  1688. #define ETO_GRAYED      0x0001
  1689. #define ETO_OPAQUE      0x0002
  1690. #define ETO_CLIPPED     0x0004
  1691.  
  1692. DWORD   WINAPI GetTextExtent(HDC, LPCSTR, int);
  1693. DWORD   WINAPI GetTabbedTextExtent(HDC, LPCSTR, int, int, int FAR*);
  1694.  
  1695. #if (WINVER >= 0x030a)
  1696. BOOL    WINAPI GetTextExtentPoint(HDC, LPCSTR, int, SIZE FAR*);
  1697. #endif  /* WINVER >= 0x030a */
  1698.  
  1699. /* DrawText() Format Flags */
  1700. #ifndef NODRAWTEXT
  1701. #define DT_TOP              0x0000
  1702. #define DT_LEFT             0x0000
  1703. #define DT_CENTER           0x0001
  1704. #define DT_RIGHT            0x0002
  1705. #define DT_VCENTER          0x0004
  1706. #define DT_BOTTOM           0x0008
  1707. #define DT_WORDBREAK        0x0010
  1708. #define DT_SINGLELINE       0x0020
  1709. #define DT_EXPANDTABS       0x0040
  1710. #define DT_TABSTOP          0x0080
  1711. #define DT_NOCLIP           0x0100
  1712. #define DT_EXTERNALLEADING  0x0200
  1713. #define DT_CALCRECT         0x0400
  1714. #define DT_NOPREFIX         0x0800
  1715. #define DT_INTERNAL         0x1000
  1716.  
  1717. int     WINAPI DrawText(HDC, LPCSTR, int, RECT FAR*, UINT);
  1718. #endif  /* NODRAWTEXT */
  1719.  
  1720. #ifdef STRICT
  1721. typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
  1722. #else
  1723. typedef FARPROC GRAYSTRINGPROC;
  1724. #endif
  1725.  
  1726. BOOL    WINAPI GrayString(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
  1727.  
  1728. BOOL    WINAPI GetCharWidth(HDC, UINT, UINT, int FAR*);
  1729.  
  1730. COLORREF WINAPI SetTextColor(HDC, COLORREF);
  1731. COLORREF WINAPI GetTextColor(HDC);
  1732.  
  1733. COLORREF WINAPI SetBkColor(HDC, COLORREF);
  1734. COLORREF WINAPI GetBkColor(HDC);
  1735.  
  1736. int     WINAPI SetBkMode(HDC, int);
  1737. int     WINAPI GetBkMode(HDC);
  1738.  
  1739. /* Background Modes */
  1740. #define TRANSPARENT     1
  1741. #define OPAQUE          2
  1742.  
  1743. UINT    WINAPI SetTextAlign(HDC, UINT);
  1744. UINT    WINAPI GetTextAlign(HDC);
  1745.  
  1746. /* Text Alignment Options */
  1747. #define TA_NOUPDATECP                0x0000
  1748. #define TA_UPDATECP                  0x0001
  1749. #define TA_LEFT                      0x0000
  1750. #define TA_RIGHT                     0x0002
  1751. #define TA_CENTER                    0x0006
  1752. #define TA_TOP                       0x0000
  1753. #define TA_BOTTOM                    0x0008
  1754. #define TA_BASELINE                  0x0018
  1755.  
  1756. int     WINAPI SetTextCharacterExtra(HDC, int);
  1757. int     WINAPI GetTextCharacterExtra(HDC);
  1758.  
  1759. int     WINAPI SetTextJustification(HDC, int, int);
  1760.  
  1761. /****** Font support ********************************************************/
  1762.  
  1763. #ifndef NOGDIOBJ
  1764. /* Logical Font */
  1765. #define LF_FACESIZE         32
  1766. typedef struct tagLOGFONT
  1767. {
  1768.     int     lfHeight;
  1769.     int     lfWidth;
  1770.     int     lfEscapement;
  1771.     int     lfOrientation;
  1772.     int     lfWeight;
  1773.     BYTE    lfItalic;
  1774.     BYTE    lfUnderline;
  1775.     BYTE    lfStrikeOut;
  1776.     BYTE    lfCharSet;
  1777.     BYTE    lfOutPrecision;
  1778.     BYTE    lfClipPrecision;
  1779.     BYTE    lfQuality;
  1780.     BYTE    lfPitchAndFamily;
  1781.     char    lfFaceName[LF_FACESIZE];
  1782. } LOGFONT;
  1783. typedef LOGFONT*       PLOGFONT;
  1784. typedef LOGFONT NEAR* NPLOGFONT;
  1785. typedef LOGFONT FAR*  LPLOGFONT;
  1786.  
  1787. /* weight values */
  1788. #define FW_DONTCARE         0
  1789. #define FW_THIN             100
  1790. #define FW_EXTRALIGHT       200
  1791. #define FW_LIGHT            300
  1792. #define FW_NORMAL           400
  1793. #define FW_MEDIUM           500
  1794. #define FW_SEMIBOLD         600
  1795. #define FW_BOLD             700
  1796. #define FW_EXTRABOLD        800
  1797. #define FW_HEAVY            900
  1798.  
  1799. #define FW_ULTRALIGHT       FW_EXTRALIGHT
  1800. #define FW_REGULAR          FW_NORMAL
  1801. #define FW_DEMIBOLD         FW_SEMIBOLD
  1802. #define FW_ULTRABOLD        FW_EXTRABOLD
  1803. #define FW_BLACK            FW_HEAVY
  1804.  
  1805. /* CharSet values */
  1806. #define ANSI_CHARSET        0
  1807. #define DEFAULT_CHARSET     1
  1808. #define SYMBOL_CHARSET      2
  1809. #define SHIFTJIS_CHARSET    128
  1810. #define HANGEUL_CHARSET     129
  1811. #define CHINESEBIG5_CHARSET 136
  1812. #define OEM_CHARSET         255
  1813.  
  1814. /* OutPrecision values */
  1815. #define OUT_DEFAULT_PRECIS      0
  1816. #define OUT_STRING_PRECIS       1
  1817. #define OUT_CHARACTER_PRECIS    2
  1818. #define OUT_STROKE_PRECIS       3
  1819. #if (WINVER >= 0x030a)
  1820. #define OUT_TT_PRECIS           4
  1821. #define OUT_DEVICE_PRECIS       5
  1822. #define OUT_RASTER_PRECIS       6
  1823. #define OUT_TT_ONLY_PRECIS      7
  1824. #endif  /* WINVER >= 0x030a */
  1825.  
  1826. /* ClipPrecision values */
  1827. #define CLIP_DEFAULT_PRECIS     0x00
  1828. #define CLIP_CHARACTER_PRECIS   0x01
  1829. #define CLIP_STROKE_PRECIS      0x02
  1830. #define CLIP_MASK               0x0F
  1831. #if (WINVER >= 0x030a)
  1832. #define CLIP_LH_ANGLES          0x10
  1833. #define CLIP_TT_ALWAYS          0x20
  1834. #define CLIP_EMBEDDED           0x80
  1835. #endif  /* WINVER >= 0x030a */
  1836.  
  1837. /* Quality values */
  1838. #define DEFAULT_QUALITY     0
  1839. #define DRAFT_QUALITY       1
  1840. #define PROOF_QUALITY       2
  1841.  
  1842. /* PitchAndFamily pitch values (low 4 bits) */
  1843. #define DEFAULT_PITCH       0x00
  1844. #define FIXED_PITCH         0x01
  1845. #define VARIABLE_PITCH      0x02
  1846.  
  1847. /* PitchAndFamily family values (high 4 bits) */
  1848. #define FF_DONTCARE         0x00
  1849. #define FF_ROMAN            0x10
  1850. #define FF_SWISS            0x20
  1851. #define FF_MODERN           0x30
  1852. #define FF_SCRIPT           0x40
  1853. #define FF_DECORATIVE       0x50
  1854.  
  1855. HFONT   WINAPI CreateFont(int, int, int, int, int, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, LPCSTR);
  1856. HFONT   WINAPI CreateFontIndirect(const LOGFONT FAR*);
  1857.  
  1858. /* Stock fonts for use with GetStockObject() */
  1859. #define OEM_FIXED_FONT      10
  1860. #define ANSI_FIXED_FONT     11
  1861. #define ANSI_VAR_FONT       12
  1862. #define SYSTEM_FONT         13
  1863. #define DEVICE_DEFAULT_FONT 14
  1864. #define DEFAULT_PALETTE     15
  1865. #define SYSTEM_FIXED_FONT   16
  1866.  
  1867.  
  1868. DWORD   WINAPI SetMapperFlags(HDC, DWORD);
  1869. #define ASPECT_FILTERING             0x00000001L
  1870.  
  1871. int     WINAPI AddFontResource(LPCSTR);
  1872. BOOL    WINAPI RemoveFontResource(LPCSTR);
  1873.  
  1874. #define WM_FONTCHANGE       0x001D
  1875.  
  1876. int     WINAPI GetTextFace(HDC, int, LPSTR);
  1877.  
  1878. DWORD   WINAPI GetAspectRatioFilter(HDC);
  1879. #if (WINVER >= 0x030a)
  1880. BOOL    WINAPI GetAspectRatioFilterEx(HDC, SIZE FAR*);
  1881. #endif  /* WINVER >= 0x030a */
  1882.  
  1883. #endif  /* NOGDIOBJ */
  1884.  
  1885. #ifndef NOTEXTMETRIC
  1886.  
  1887. typedef struct tagTEXTMETRIC
  1888. {
  1889.     int     tmHeight;
  1890.     int     tmAscent;
  1891.     int     tmDescent;
  1892.     int     tmInternalLeading;
  1893.     int     tmExternalLeading;
  1894.     int     tmAveCharWidth;
  1895.     int     tmMaxCharWidth;
  1896.     int     tmWeight;
  1897.     BYTE    tmItalic;
  1898.     BYTE    tmUnderlined;
  1899.     BYTE    tmStruckOut;
  1900.     BYTE    tmFirstChar;
  1901.     BYTE    tmLastChar;
  1902.     BYTE    tmDefaultChar;
  1903.     BYTE    tmBreakChar;
  1904.     BYTE    tmPitchAndFamily;
  1905.     BYTE    tmCharSet;
  1906.     int     tmOverhang;
  1907.     int     tmDigitizedAspectX;
  1908.     int     tmDigitizedAspectY;
  1909. } TEXTMETRIC;
  1910. typedef TEXTMETRIC*       PTEXTMETRIC;
  1911. typedef TEXTMETRIC NEAR* NPTEXTMETRIC;
  1912. typedef TEXTMETRIC FAR*  LPTEXTMETRIC;
  1913.  
  1914. /* tmPitchAndFamily values */
  1915. #define TMPF_FIXED_PITCH    0x01
  1916. #define TMPF_VECTOR         0x02
  1917. #define TMPF_DEVICE         0x08
  1918. #if (WINVER >= 0x030a)
  1919. #define TMPF_TRUETYPE       0x04
  1920. #endif  /* WINVER >= 0x030a */
  1921.  
  1922. BOOL    WINAPI GetTextMetrics(HDC, TEXTMETRIC FAR*);
  1923.  
  1924. #if (WINVER >= 0x030a)
  1925. #ifndef NOSCALABLEFONT
  1926.  
  1927. typedef struct tagPANOSE
  1928. {
  1929.     BYTE    bFamilyType;
  1930.     BYTE    bSerifStyle;
  1931.     BYTE    bWeight;
  1932.     BYTE    bProportion;
  1933.     BYTE    bContrast;
  1934.     BYTE    bStrokeVariation;
  1935.     BYTE    bArmStyle;
  1936.     BYTE    bLetterform;
  1937.     BYTE    bMidline;
  1938.     BYTE    bXHeight;
  1939. } PANOSE, FAR* LPPANOSE;
  1940.  
  1941. typedef struct tagOUTLINETEXTMETRIC
  1942. {
  1943.     UINT    otmSize;
  1944.     TEXTMETRIC otmTextMetrics;
  1945.     BYTE    otmFiller;
  1946.     PANOSE  otmPanoseNumber;
  1947.     UINT    otmfsSelection;
  1948.     UINT    otmfsType;
  1949.     int     otmsCharSlopeRise;
  1950.     int     otmsCharSlopeRun;
  1951.     int     otmItalicAngle;
  1952.     UINT    otmEMSquare;
  1953.     int     otmAscent;
  1954.     int     otmDescent;
  1955.     UINT    otmLineGap;
  1956.     UINT    otmsCapEmHeight;
  1957.     UINT    otmsXHeight;
  1958.     RECT    otmrcFontBox;
  1959.     int     otmMacAscent;
  1960.     int     otmMacDescent;
  1961.     UINT    otmMacLineGap;
  1962.     UINT    otmusMinimumPPEM;
  1963.     POINT   otmptSubscriptSize;
  1964.     POINT   otmptSubscriptOffset;
  1965.     POINT   otmptSuperscriptSize;
  1966.     POINT   otmptSuperscriptOffset;
  1967.     UINT    otmsStrikeoutSize;
  1968.     int     otmsStrikeoutPosition;
  1969.     int     otmsUnderscorePosition;
  1970.     int     otmsUnderscoreSize;
  1971.     PSTR    otmpFamilyName;
  1972.     PSTR    otmpFaceName;
  1973.     PSTR    otmpStyleName;
  1974.     PSTR    otmpFullName;
  1975. } OUTLINETEXTMETRIC, FAR* LPOUTLINETEXTMETRIC;
  1976.  
  1977. WORD    WINAPI GetOutlineTextMetrics(HDC, UINT, OUTLINETEXTMETRIC FAR*);
  1978.  
  1979. #endif  /* WINVER >= 0x030a */
  1980. #endif  /* NOSCALABLEFONT */
  1981.  
  1982. #ifndef NOGDIOBJ
  1983. #if (WINVER >= 0x030a)
  1984.  
  1985. /* Structure passed to FONTENUMPROC */
  1986. /* NOTE: NEWTEXTMETRIC is the same as TEXTMETRIC plus 4 new fields */
  1987. typedef struct tagNEWTEXTMETRIC
  1988. {
  1989.     int     tmHeight;
  1990.     int     tmAscent;
  1991.     int     tmDescent;
  1992.     int     tmInternalLeading;
  1993.     int     tmExternalLeading;
  1994.     int     tmAveCharWidth;
  1995.     int     tmMaxCharWidth;
  1996.     int     tmWeight;
  1997.     BYTE    tmItalic;
  1998.     BYTE    tmUnderlined;
  1999.     BYTE    tmStruckOut;
  2000.     BYTE    tmFirstChar;
  2001.     BYTE    tmLastChar;
  2002.     BYTE    tmDefaultChar;
  2003.     BYTE    tmBreakChar;
  2004.     BYTE    tmPitchAndFamily;
  2005.     BYTE    tmCharSet;
  2006.     int     tmOverhang;
  2007.     int     tmDigitizedAspectX;
  2008.     int     tmDigitizedAspectY;
  2009.     DWORD   ntmFlags;
  2010.     UINT    ntmSizeEM;
  2011.     UINT    ntmCellHeight;
  2012.     UINT    ntmAvgWidth;
  2013. } NEWTEXTMETRIC;
  2014. typedef NEWTEXTMETRIC*       PNEWTEXTMETRIC;
  2015. typedef NEWTEXTMETRIC NEAR* NPNEWTEXTMETRIC;
  2016. typedef NEWTEXTMETRIC FAR*  LPNEWTEXTMETRIC;
  2017.  
  2018. /* ntmFlags field flags */
  2019. #define NTM_REGULAR     0x00000040L
  2020. #define NTM_BOLD        0x00000020L
  2021. #define NTM_ITALIC      0x00000001L
  2022.  
  2023. #define LF_FULLFACESIZE     64
  2024.  
  2025. /* Structure passed to FONTENUMPROC */
  2026. typedef struct tagENUMLOGFONT
  2027. {
  2028.     LOGFONT elfLogFont;
  2029.     char    elfFullName[LF_FULLFACESIZE];
  2030.     char    elfStyle[LF_FACESIZE];
  2031. } ENUMLOGFONT, FAR* LPENUMLOGFONT;
  2032.  
  2033. #endif  /* WINVER >= 0x030a */
  2034. #endif  /* NOGDIOBJ */
  2035.  
  2036. #ifdef STRICT
  2037. #ifndef NOGDIOBJ
  2038.  
  2039. typedef int (CALLBACK* OLDFONTENUMPROC)(const LOGFONT FAR*, const TEXTMETRIC FAR*, int, LPARAM);
  2040.  
  2041. #if (WINVER >= 0x030a)
  2042. typedef int (CALLBACK* FONTENUMPROC)(const ENUMLOGFONT FAR*, const NEWTEXTMETRIC FAR*, int, LPARAM);
  2043.  
  2044. int     WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPARAM);
  2045.  
  2046. #else   /* WINVER >= 0x030a */
  2047. typedef OLDFONTENUMPROC FONTENUMPROC;
  2048. #endif  /* WINVER >= 0x030a */
  2049.  
  2050. int     WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPARAM);
  2051. #endif  /* NOGDIOBJ */
  2052.  
  2053. #else   /* STRICT */
  2054.  
  2055. typedef FARPROC OLDFONTENUMPROC;
  2056. typedef FARPROC FONTENUMPROC;
  2057.  
  2058. int     WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPSTR);
  2059.  
  2060. #if (WINVER >= 0x030a)
  2061. int     WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPSTR);
  2062. #endif  /* WINVER >= 0x030a */
  2063.  
  2064. #endif  /* !STRICT */
  2065.  
  2066. /* EnumFonts font type values */
  2067. #define RASTER_FONTTYPE     0x0001
  2068. #define DEVICE_FONTTYPE     0X0002
  2069. #if (WINVER >= 0x030a)
  2070. #define TRUETYPE_FONTTYPE   0x0004
  2071. #endif  /* WINVER >= 0x030a */
  2072.  
  2073. #endif  /* NOTEXTMETRIC */
  2074.  
  2075. #ifndef NOSCALABLEFONT
  2076. #if (WINVER >= 0x030a)
  2077.  
  2078. DWORD   WINAPI GetFontData(HDC, DWORD, DWORD, void FAR*, DWORD);
  2079. BOOL    WINAPI CreateScalableFontResource(UINT, LPCSTR, LPCSTR, LPCSTR);
  2080.  
  2081. typedef struct tagGLYPHMETRICS
  2082. {
  2083.     UINT    gmBlackBoxX;
  2084.     UINT    gmBlackBoxY;
  2085.     POINT   gmptGlyphOrigin;
  2086.     int     gmCellIncX;
  2087.     int     gmCellIncY;
  2088. } GLYPHMETRICS, FAR* LPGLYPHMETRICS;
  2089.  
  2090. typedef struct tagFIXED
  2091. {
  2092.     UINT    fract;
  2093.     int     value;
  2094. } FIXED, FAR* LPFIXED;
  2095.  
  2096. typedef struct tagMAT2
  2097. {
  2098.     FIXED  eM11;
  2099.     FIXED  eM12;
  2100.     FIXED  eM21;
  2101.     FIXED  eM22;
  2102. } MAT2, FAR* LPMAT2;
  2103.  
  2104. DWORD   WINAPI GetGlyphOutline(HDC, UINT, UINT, GLYPHMETRICS FAR*, DWORD, void FAR*, const MAT2 FAR*);
  2105.  
  2106. /* GetGlyphOutline constants */
  2107. #define GGO_METRICS        0
  2108. #define GGO_BITMAP         1
  2109. #define GGO_NATIVE         2
  2110.  
  2111. #define TT_POLYGON_TYPE   24
  2112.  
  2113. #define TT_PRIM_LINE       1
  2114. #define TT_PRIM_QSPLINE    2
  2115.  
  2116. typedef struct tagPOINTFX
  2117. {
  2118.     FIXED x;
  2119.     FIXED y;
  2120. } POINTFX, FAR* LPPOINTFX;
  2121.  
  2122. typedef struct tagTTPOLYCURVE
  2123. {
  2124.     UINT    wType;
  2125.     UINT    cpfx;
  2126.     POINTFX apfx[1];
  2127. } TTPOLYCURVE, FAR* LPTTPOLYCURVE;
  2128.  
  2129. typedef struct tagTTPOLYGONHEADER
  2130. {
  2131.     DWORD   cb;
  2132.     DWORD   dwType;
  2133.     POINTFX pfxStart;
  2134. } TTPOLYGONHEADER, FAR* LPTTPOLYGONHEADER;
  2135.  
  2136. typedef struct tagABC
  2137. {
  2138.     int   abcA;
  2139.     UINT  abcB;
  2140.     int   abcC;
  2141. } ABC;
  2142. typedef ABC FAR* LPABC;
  2143.  
  2144. BOOL    WINAPI GetCharABCWidths(HDC, UINT, UINT, ABC FAR*);
  2145.  
  2146. typedef struct tagKERNINGPAIR
  2147. {
  2148.     WORD wFirst;
  2149.     WORD wSecond;
  2150.     int  iKernAmount;
  2151. } KERNINGPAIR, FAR* LPKERNINGPAIR;
  2152.  
  2153. int     WINAPI GetKerningPairs(HDC, int, KERNINGPAIR FAR*);
  2154.  
  2155. typedef struct tagRASTERIZER_STATUS
  2156. {
  2157.     int   nSize;
  2158.     int   wFlags;
  2159.     int   nLanguageID;
  2160. } RASTERIZER_STATUS;
  2161. typedef RASTERIZER_STATUS FAR* LPRASTERIZER_STATUS;
  2162.  
  2163. /* bits defined in wFlags of RASTERIZER_STATUS */
  2164. #define TT_AVAILABLE    0x0001
  2165. #define TT_ENABLED      0x0002
  2166.  
  2167. BOOL    WINAPI GetRasterizerCaps(RASTERIZER_STATUS FAR*, int);
  2168.  
  2169. #endif  /* WINVER >= 0x030a */
  2170. #endif  /* NOSCALABLEFONT */
  2171.  
  2172. /****** Bitmap support ******************************************************/
  2173.  
  2174. #ifndef NOBITMAP
  2175. typedef struct tagBITMAP
  2176. {
  2177.     int     bmType;
  2178.     int     bmWidth;
  2179.     int     bmHeight;
  2180.     int     bmWidthBytes;
  2181.     BYTE    bmPlanes;
  2182.     BYTE    bmBitsPixel;
  2183.     void FAR* bmBits;
  2184. } BITMAP;
  2185. typedef BITMAP*       PBITMAP;
  2186. typedef BITMAP NEAR* NPBITMAP;
  2187. typedef BITMAP FAR*  LPBITMAP;
  2188.  
  2189. /* Bitmap Header structures */
  2190. typedef struct tagRGBTRIPLE
  2191. {
  2192.     BYTE    rgbtBlue;
  2193.     BYTE    rgbtGreen;
  2194.     BYTE    rgbtRed;
  2195. } RGBTRIPLE;
  2196. typedef RGBTRIPLE FAR* LPRGBTRIPLE;
  2197.  
  2198. typedef struct tagRGBQUAD
  2199. {
  2200.     BYTE    rgbBlue;
  2201.     BYTE    rgbGreen;
  2202.     BYTE    rgbRed;
  2203.     BYTE    rgbReserved;
  2204. } RGBQUAD;
  2205. typedef RGBQUAD FAR* LPRGBQUAD;
  2206.  
  2207. /* structures for defining DIBs */
  2208. typedef struct tagBITMAPCOREHEADER
  2209. {
  2210.     DWORD   bcSize;
  2211.     short   bcWidth;
  2212.     short   bcHeight;
  2213.     WORD    bcPlanes;
  2214.     WORD    bcBitCount;
  2215. } BITMAPCOREHEADER;
  2216. typedef BITMAPCOREHEADER*      PBITMAPCOREHEADER;
  2217. typedef BITMAPCOREHEADER FAR* LPBITMAPCOREHEADER;
  2218.  
  2219. typedef struct tagBITMAPINFOHEADER
  2220. {
  2221.     DWORD   biSize;
  2222.     LONG    biWidth;
  2223.     LONG    biHeight;
  2224.     WORD    biPlanes;
  2225.     WORD    biBitCount;
  2226.     DWORD   biCompression;
  2227.     DWORD   biSizeImage;
  2228.     LONG    biXPelsPerMeter;
  2229.     LONG    biYPelsPerMeter;
  2230.     DWORD   biClrUsed;
  2231.     DWORD   biClrImportant;
  2232. } BITMAPINFOHEADER;
  2233. typedef BITMAPINFOHEADER*      PBITMAPINFOHEADER;
  2234. typedef BITMAPINFOHEADER FAR* LPBITMAPINFOHEADER;
  2235.  
  2236. /* constants for the biCompression field */
  2237. #define BI_RGB      0L
  2238. #define BI_RLE8     1L
  2239. #define BI_RLE4     2L
  2240.  
  2241. typedef struct tagBITMAPINFO
  2242. {
  2243.     BITMAPINFOHEADER bmiHeader;
  2244.     RGBQUAD          bmiColors[1];
  2245. } BITMAPINFO;
  2246. typedef BITMAPINFO*     PBITMAPINFO;
  2247. typedef BITMAPINFO FAR* LPBITMAPINFO;
  2248.  
  2249. typedef struct tagBITMAPCOREINFO
  2250. {
  2251.     BITMAPCOREHEADER bmciHeader;
  2252.     RGBTRIPLE        bmciColors[1];
  2253. } BITMAPCOREINFO;
  2254. typedef BITMAPCOREINFO*      PBITMAPCOREINFO;
  2255. typedef BITMAPCOREINFO FAR* LPBITMAPCOREINFO;
  2256.  
  2257. typedef struct tagBITMAPFILEHEADER
  2258. {
  2259.     UINT    bfType;
  2260.     DWORD   bfSize;
  2261.     UINT    bfReserved1;
  2262.     UINT    bfReserved2;
  2263.     DWORD   bfOffBits;
  2264. } BITMAPFILEHEADER;
  2265. typedef BITMAPFILEHEADER*      PBITMAPFILEHEADER;
  2266. typedef BITMAPFILEHEADER FAR* LPBITMAPFILEHEADER;
  2267.  
  2268.  
  2269. HBITMAP WINAPI CreateBitmap(int, int, UINT, UINT, const void FAR*);
  2270. HBITMAP WINAPI CreateBitmapIndirect(BITMAP FAR* );
  2271. HBITMAP WINAPI CreateCompatibleBitmap(HDC, int, int);
  2272. HBITMAP WINAPI CreateDiscardableBitmap(HDC, int, int);
  2273. HBITMAP WINAPI CreateDIBitmap(HDC, BITMAPINFOHEADER FAR*, DWORD, const void FAR*, BITMAPINFO FAR*, UINT);
  2274.  
  2275. HBITMAP WINAPI LoadBitmap(HINSTANCE, LPCSTR);
  2276.  
  2277. /* DIB color table identifiers */
  2278. #define DIB_RGB_COLORS  0
  2279. #define DIB_PAL_COLORS  1
  2280.  
  2281. /* constants for CreateDIBitmap */
  2282. #define CBM_INIT        0x00000004L
  2283. #endif  /* NOBITMAP */
  2284.  
  2285. #ifndef NORASTEROPS
  2286.  
  2287. /* Binary raster ops */
  2288. #define R2_BLACK            1
  2289. #define R2_NOTMERGEPEN      2
  2290. #define R2_MASKNOTPEN       3
  2291. #define R2_NOTCOPYPEN       4
  2292. #define R2_MASKPENNOT       5
  2293. #define R2_NOT              6
  2294. #define R2_XORPEN           7
  2295. #define R2_NOTMASKPEN       8
  2296. #define R2_MASKPEN          9
  2297. #define R2_NOTXORPEN        10
  2298. #define R2_NOP              11
  2299. #define R2_MERGENOTPEN      12
  2300. #define R2_COPYPEN          13
  2301. #define R2_MERGEPENNOT      14
  2302. #define R2_MERGEPEN         15
  2303. #define R2_WHITE            16
  2304.  
  2305. /* Ternary raster operations */
  2306. #define SRCCOPY             0x00CC0020L
  2307. #define SRCPAINT            0x00EE0086L
  2308. #define SRCAND              0x008800C6L
  2309. #define SRCINVERT           0x00660046L
  2310. #define SRCERASE            0x00440328L
  2311. #define NOTSRCCOPY          0x00330008L
  2312. #define NOTSRCERASE         0x001100A6L
  2313. #define MERGECOPY           0x00C000CAL
  2314. #define MERGEPAINT          0x00BB0226L
  2315. #define PATCOPY             0x00F00021L
  2316. #define PATPAINT            0x00FB0A09L
  2317. #define PATINVERT           0x005A0049L
  2318. #define DSTINVERT           0x00550009L
  2319. #define BLACKNESS           0x00000042L
  2320. #define WHITENESS           0x00FF0062L
  2321.  
  2322. #endif  /* NORASTEROPS */
  2323.  
  2324. #ifndef NOBITMAP
  2325. BOOL    WINAPI BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
  2326.  
  2327. BOOL    WINAPI PatBlt(HDC, int, int, int, int, DWORD);
  2328.  
  2329. BOOL    WINAPI StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
  2330. int     WINAPI StretchDIBits(HDC, int, int, int, int, int,
  2331.                         int, int, int, const void FAR*, LPBITMAPINFO, UINT, DWORD);
  2332.  
  2333. COLORREF WINAPI SetPixel(HDC, int, int, COLORREF);
  2334. COLORREF WINAPI GetPixel(HDC, int, int);
  2335.  
  2336. /* StretchBlt() Modes */
  2337. #define BLACKONWHITE    1
  2338. #define WHITEONBLACK    2
  2339. #define COLORONCOLOR    3
  2340.  
  2341. /* new StretchBlt() Modes (simpler names) */
  2342. #define STRETCH_ANDSCANS        1
  2343. #define STRETCH_ORSCANS         2
  2344. #define STRETCH_DELETESCANS     3
  2345.  
  2346. int     WINAPI SetStretchBltMode(HDC, int);
  2347. int     WINAPI GetStretchBltMode(HDC);
  2348.  
  2349. DWORD   WINAPI SetBitmapDimension(HBITMAP, int, int);
  2350. DWORD   WINAPI GetBitmapDimension(HBITMAP);
  2351. #if (WINVER >= 0x030a)
  2352. BOOL    WINAPI SetBitmapDimensionEx(HBITMAP, int, int, SIZE FAR*);
  2353. BOOL    WINAPI GetBitmapDimensionEx(HBITMAP, SIZE FAR*);
  2354. #endif  /* WINVER >= 0x030a */
  2355. int     WINAPI SetROP2(HDC, int);
  2356. int     WINAPI GetROP2(HDC);
  2357.  
  2358. LONG    WINAPI SetBitmapBits(HBITMAP, DWORD, const void FAR*);
  2359. LONG    WINAPI GetBitmapBits(HBITMAP, LONG, void FAR*);
  2360.  
  2361. int     WINAPI SetDIBits(HDC, HBITMAP, UINT, UINT, const void FAR*, BITMAPINFO FAR*, UINT);
  2362. int     WINAPI GetDIBits(HDC, HBITMAP, UINT, UINT, void FAR*, BITMAPINFO FAR*, UINT);
  2363.  
  2364. int     WINAPI SetDIBitsToDevice(HDC, int, int, int, int, int, int, UINT, UINT,
  2365.                     void FAR*, BITMAPINFO FAR*, UINT);
  2366. #endif  /* NOBITMAP */
  2367.  
  2368. /****** Metafile support ****************************************************/
  2369.  
  2370. #ifndef NOMETAFILE
  2371.  
  2372. DECLARE_HANDLE(HMETAFILE);
  2373.  
  2374. HDC     WINAPI CreateMetaFile(LPCSTR);
  2375. HMETAFILE WINAPI CloseMetaFile(HDC);
  2376.  
  2377. HMETAFILE WINAPI GetMetaFile(LPCSTR);
  2378. BOOL      WINAPI DeleteMetaFile(HMETAFILE);
  2379. HMETAFILE WINAPI CopyMetaFile(HMETAFILE, LPCSTR);
  2380.  
  2381. BOOL    WINAPI PlayMetaFile(HDC, HMETAFILE);
  2382.  
  2383. HGLOBAL WINAPI GetMetaFileBits(HMETAFILE);
  2384. HMETAFILE WINAPI SetMetaFileBits(HGLOBAL);
  2385. #if (WINVER >= 0x030a)
  2386. HMETAFILE WINAPI SetMetaFileBitsBetter(HGLOBAL);
  2387. #endif  /* WINVER >= 0x030a */
  2388.  
  2389. /* Clipboard Metafile Picture Structure */
  2390. typedef struct tagMETAFILEPICT
  2391. {
  2392.     int     mm;
  2393.     int     xExt;
  2394.     int     yExt;
  2395.     HMETAFILE hMF;
  2396. } METAFILEPICT;
  2397. typedef METAFILEPICT FAR* LPMETAFILEPICT;
  2398.  
  2399. typedef struct tagMETAHEADER
  2400. {
  2401.     UINT    mtType;
  2402.     UINT    mtHeaderSize;
  2403.     UINT    mtVersion;
  2404.     DWORD   mtSize;
  2405.     UINT    mtNoObjects;
  2406.     DWORD   mtMaxRecord;
  2407.     UINT    mtNoParameters;
  2408. } METAHEADER;
  2409.  
  2410. typedef struct tagHANDLETABLE
  2411. {
  2412.     HGDIOBJ objectHandle[1];
  2413. } HANDLETABLE;
  2414. typedef HANDLETABLE*      PHANDLETABLE;
  2415. typedef HANDLETABLE FAR* LPHANDLETABLE;
  2416.  
  2417. typedef struct tagMETARECORD
  2418. {
  2419.     DWORD   rdSize;
  2420.     UINT    rdFunction;
  2421.     UINT    rdParm[1];
  2422. } METARECORD;
  2423. typedef METARECORD*      PMETARECORD;
  2424. typedef METARECORD FAR* LPMETARECORD;
  2425.  
  2426. /* Metafile Functions */
  2427. #define META_SETBKCOLOR              0x0201
  2428. #define META_SETBKMODE               0x0102
  2429. #define META_SETMAPMODE              0x0103
  2430. #define META_SETROP2                 0x0104
  2431. #define META_SETRELABS               0x0105
  2432. #define META_SETPOLYFILLMODE         0x0106
  2433. #define META_SETSTRETCHBLTMODE       0x0107
  2434. #define META_SETTEXTCHAREXTRA        0x0108
  2435. #define META_SETTEXTCOLOR            0x0209
  2436. #define META_SETTEXTJUSTIFICATION    0x020A
  2437. #define META_SETWINDOWORG            0x020B
  2438. #define META_SETWINDOWEXT            0x020C
  2439. #define META_SETVIEWPORTORG          0x020D
  2440. #define META_SETVIEWPORTEXT          0x020E
  2441. #define META_OFFSETWINDOWORG         0x020F
  2442. #define META_SCALEWINDOWEXT          0x0410
  2443. #define META_OFFSETVIEWPORTORG       0x0211
  2444. #define META_SCALEVIEWPORTEXT        0x0412
  2445. #define META_LINETO                  0x0213
  2446. #define META_MOVETO                  0x0214
  2447. #define META_EXCLUDECLIPRECT         0x0415
  2448. #define META_INTERSECTCLIPRECT       0x0416
  2449. #define META_ARC                     0x0817
  2450. #define META_ELLIPSE                 0x0418
  2451. #define META_FLOODFILL               0x0419
  2452. #define META_PIE                     0x081A
  2453. #define META_RECTANGLE               0x041B
  2454. #define META_ROUNDRECT               0x061C
  2455. #define META_PATBLT                  0x061D
  2456. #define META_SAVEDC                  0x001E
  2457. #define META_SETPIXEL                0x041F
  2458. #define META_OFFSETCLIPRGN           0x0220
  2459. #define META_TEXTOUT                 0x0521
  2460. #define META_BITBLT                  0x0922
  2461. #define META_STRETCHBLT              0x0B23
  2462. #define META_POLYGON                 0x0324
  2463. #define META_POLYLINE                0x0325
  2464. #define META_ESCAPE                  0x0626
  2465. #define META_RESTOREDC               0x0127
  2466. #define META_FILLREGION              0x0228
  2467. #define META_FRAMEREGION             0x0429
  2468. #define META_INVERTREGION            0x012A
  2469. #define META_PAINTREGION             0x012B
  2470. #define META_SELECTCLIPREGION        0x012C
  2471. #define META_SELECTOBJECT            0x012D
  2472. #define META_SETTEXTALIGN            0x012E
  2473. #define META_DRAWTEXT                0x062F
  2474.  
  2475. #define META_CHORD                   0x0830
  2476. #define META_SETMAPPERFLAGS          0x0231
  2477. #define META_EXTTEXTOUT              0x0a32
  2478. #define META_SETDIBTODEV             0x0d33
  2479. #define META_SELECTPALETTE           0x0234
  2480. #define META_REALIZEPALETTE          0x0035
  2481. #define META_ANIMATEPALETTE          0x0436
  2482. #define META_SETPALENTRIES           0x0037
  2483. #define META_POLYPOLYGON             0x0538
  2484. #define META_RESIZEPALETTE           0x0139
  2485.  
  2486. #define META_DIBBITBLT               0x0940
  2487. #define META_DIBSTRETCHBLT           0x0b41
  2488. #define META_DIBCREATEPATTERNBRUSH   0x0142
  2489. #define META_STRETCHDIB              0x0f43
  2490.  
  2491. #define META_EXTFLOODFILL            0x0548
  2492.  
  2493. #define META_RESETDC                 0x014C
  2494. #define META_STARTDOC                0x014D
  2495. #define META_STARTPAGE               0x004F
  2496. #define META_ENDPAGE                 0x0050
  2497. #define META_ABORTDOC                0x0052
  2498. #define META_ENDDOC                  0x005E
  2499.  
  2500. #define META_DELETEOBJECT            0x01f0
  2501.  
  2502. #define META_CREATEPALETTE           0x00f7
  2503. #define META_CREATEBRUSH             0x00F8
  2504. #define META_CREATEPATTERNBRUSH      0x01F9
  2505. #define META_CREATEPENINDIRECT       0x02FA
  2506. #define META_CREATEFONTINDIRECT      0x02FB
  2507. #define META_CREATEBRUSHINDIRECT     0x02FC
  2508. #define META_CREATEBITMAPINDIRECT    0x02FD
  2509. #define META_CREATEBITMAP            0x06FE
  2510. #define META_CREATEREGION            0x06FF
  2511.  
  2512. void    WINAPI PlayMetaFileRecord(HDC, HANDLETABLE FAR*, METARECORD FAR*, UINT);
  2513.  
  2514. #ifdef STRICT
  2515. typedef int (CALLBACK* MFENUMPROC)(HDC, HANDLETABLE FAR*, METARECORD FAR*, int, LPARAM);
  2516. #else
  2517. typedef FARPROC MFENUMPROC;
  2518. #endif
  2519.  
  2520. BOOL    WINAPI EnumMetaFile(HDC, HMETAFILE, MFENUMPROC, LPARAM);
  2521.  
  2522. #endif  /* NOMETAFILE */
  2523.  
  2524. /****** Printing support ****************************************************/
  2525.  
  2526. #ifdef STRICT
  2527. typedef BOOL (CALLBACK* ABORTPROC)(HDC, int);
  2528. #else
  2529. typedef FARPROC ABORTPROC;
  2530. #endif
  2531.  
  2532. #if (WINVER >= 0x030a)
  2533.  
  2534. typedef struct
  2535. {
  2536.     int     cbSize;
  2537.     LPCSTR  lpszDocName;
  2538.     LPCSTR  lpszOutput;
  2539. }   DOCINFO;
  2540. typedef DOCINFO FAR* LPDOCINFO;
  2541.  
  2542. int     WINAPI StartDoc(HDC, DOCINFO FAR*);
  2543. int     WINAPI StartPage(HDC);
  2544. int     WINAPI EndPage(HDC);
  2545. int     WINAPI EndDoc(HDC);
  2546. int     WINAPI AbortDoc(HDC);
  2547.  
  2548. int     WINAPI SetAbortProc(HDC, ABORTPROC);
  2549. HANDLE  WINAPI SpoolFile(LPSTR, LPSTR, LPSTR, LPSTR);
  2550. #endif  /* WINVER >= 0x030a */
  2551.  
  2552. BOOL    WINAPI QueryAbort(HDC, int);
  2553.  
  2554. /* Spooler Error Codes */
  2555. #define SP_NOTREPORTED               0x4000
  2556. #define SP_ERROR                     (-1)
  2557. #define SP_APPABORT                  (-2)
  2558. #define SP_USERABORT                 (-3)
  2559. #define SP_OUTOFDISK                 (-4)
  2560. #define SP_OUTOFMEMORY               (-5)
  2561.  
  2562. #define PR_JOBSTATUS                 0x0000
  2563.  
  2564. #endif  /* NOGDI  */
  2565.  
  2566. /* Spooler status notification message */
  2567. #define WM_SPOOLERSTATUS            0x002A
  2568.  
  2569. #ifndef NOGDI
  2570.  
  2571. /******* GDI Escape support *************************************************/
  2572.  
  2573. int     WINAPI Escape(HDC, int, int, LPCSTR, void FAR*);
  2574.  
  2575. /* GDI Escapes */
  2576. #define NEWFRAME                     1
  2577. #define ABORTDOC                     2
  2578. #define NEXTBAND                     3
  2579. #define SETCOLORTABLE                4
  2580. #define GETCOLORTABLE                5
  2581. #define FLUSHOUTPUT                  6
  2582. #define DRAFTMODE                    7
  2583. #define QUERYESCSUPPORT              8
  2584. #define SETABORTPROC                 9
  2585. #define STARTDOC                     10
  2586. #define ENDDOC                       11
  2587. #define GETPHYSPAGESIZE              12
  2588. #define GETPRINTINGOFFSET            13
  2589. #define GETSCALINGFACTOR             14
  2590. #define MFCOMMENT                    15
  2591. #define GETPENWIDTH                  16
  2592. #define SETCOPYCOUNT                 17
  2593. #define SELECTPAPERSOURCE            18
  2594. #define DEVICEDATA                   19
  2595. #define PASSTHROUGH                  19
  2596. #define GETTECHNOLGY                 20
  2597. #define GETTECHNOLOGY                20
  2598. #define SETLINECAP                   21
  2599. #define SETLINEJOIN                  22
  2600. #define SETMITERLIMIT                23
  2601. #define BANDINFO                     24
  2602. #define DRAWPATTERNRECT              25
  2603. #define GETVECTORPENSIZE             26
  2604. #define GETVECTORBRUSHSIZE           27
  2605. #define ENABLEDUPLEX                 28
  2606. #define GETSETPAPERBINS              29
  2607. #define GETSETPRINTORIENT            30
  2608. #define ENUMPAPERBINS                31
  2609. #define SETDIBSCALING                32
  2610. #define EPSPRINTING                  33
  2611. #define ENUMPAPERMETRICS             34
  2612. #define GETSETPAPERMETRICS           35
  2613. #define POSTSCRIPT_DATA              37
  2614. #define POSTSCRIPT_IGNORE            38
  2615. #define MOUSETRAILS                  39
  2616.  
  2617. #define GETEXTENDEDTEXTMETRICS       256
  2618. #define GETEXTENTTABLE               257
  2619. #define GETPAIRKERNTABLE             258
  2620. #define GETTRACKKERNTABLE            259
  2621. #define EXTTEXTOUT                   512
  2622. #define GETFACENAME                  513
  2623. #define ENABLERELATIVEWIDTHS         768
  2624. #define ENABLEPAIRKERNING            769
  2625. #define SETKERNTRACK                 770
  2626. #define SETALLJUSTVALUES             771
  2627. #define SETCHARSET                   772
  2628.  
  2629. #define STRETCHBLT                   2048
  2630.  
  2631. #define GETSETSCREENPARAMS           3072
  2632.  
  2633. #define BEGIN_PATH                   4096
  2634. #define CLIP_TO_PATH                 4097
  2635. #define END_PATH                     4098
  2636. #define EXT_DEVICE_CAPS              4099
  2637. #define RESTORE_CTM                  4100
  2638. #define SAVE_CTM                     4101
  2639. #define SET_ARC_DIRECTION            4102
  2640. #define SET_BACKGROUND_COLOR         4103
  2641. #define SET_POLY_MODE                4104
  2642. #define SET_SCREEN_ANGLE             4105
  2643. #define SET_SPREAD                   4106
  2644. #define TRANSFORM_CTM                4107
  2645. #define SET_CLIP_BOX                 4108
  2646. #define SET_BOUNDS                   4109
  2647.  
  2648. #endif  /* NOGDI */
  2649.  
  2650. /****** USER typedefs, structures, and functions *****************************/
  2651.  
  2652. DECLARE_HANDLE(HWND);
  2653.  
  2654. #ifndef NOUSER
  2655.  
  2656. DECLARE_HANDLE(HMENU);
  2657.  
  2658. DECLARE_HANDLE(HICON);
  2659. typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
  2660.  
  2661. /****** System Metrics *******************************************************/
  2662.  
  2663. #ifndef NOSYSMETRICS
  2664.  
  2665. int WINAPI GetSystemMetrics(int);
  2666.  
  2667. /* GetSystemMetrics() codes */
  2668. #define SM_CXSCREEN          0
  2669. #define SM_CYSCREEN          1
  2670. #define SM_CXVSCROLL         2
  2671. #define SM_CYHSCROLL         3
  2672. #define SM_CYCAPTION         4
  2673. #define SM_CXBORDER          5
  2674. #define SM_CYBORDER          6
  2675. #define SM_CXDLGFRAME        7
  2676. #define SM_CYDLGFRAME        8
  2677. #define SM_CYVTHUMB          9
  2678. #define SM_CXHTHUMB          10
  2679. #define SM_CXICON            11
  2680. #define SM_CYICON            12
  2681. #define SM_CXCURSOR          13
  2682. #define SM_CYCURSOR          14
  2683. #define SM_CYMENU            15
  2684. #define SM_CXFULLSCREEN      16
  2685. #define SM_CYFULLSCREEN      17
  2686. #define SM_CYKANJIWINDOW     18
  2687. #define SM_MOUSEPRESENT      19
  2688. #define SM_CYVSCROLL         20
  2689. #define SM_CXHSCROLL         21
  2690. #define SM_DEBUG             22
  2691. #define SM_SWAPBUTTON        23
  2692. #define SM_RESERVED1         24
  2693. #define SM_RESERVED2         25
  2694. #define SM_RESERVED3         26
  2695. #define SM_RESERVED4         27
  2696. #define SM_CXMIN             28
  2697. #define SM_CYMIN             29
  2698. #define SM_CXSIZE            30
  2699. #define SM_CYSIZE            31
  2700. #define SM_CXFRAME           32
  2701. #define SM_CYFRAME           33
  2702. #define SM_CXMINTRACK        34
  2703. #define SM_CYMINTRACK        35
  2704.  
  2705. #if (WINVER >= 0x030a)
  2706. #define SM_CXDOUBLECLK       36
  2707. #define SM_CYDOUBLECLK       37
  2708. #define SM_CXICONSPACING     38
  2709. #define SM_CYICONSPACING     39
  2710. #define SM_MENUDROPALIGNMENT 40
  2711. #define SM_PENWINDOWS        41
  2712. #define SM_DBCSENABLED       42
  2713. #endif  /* WINVER >= 0x030a */
  2714.  
  2715. #define SM_CMETRICS          43
  2716.  
  2717. #endif  /* NOSYSMETRICS */
  2718.  
  2719. UINT    WINAPI GetDoubleClickTime(void);
  2720. void    WINAPI SetDoubleClickTime(UINT);
  2721.  
  2722. #define WM_DEVMODECHANGE    0x001B
  2723. #define WM_TIMECHANGE       0x001E
  2724.  
  2725. /****** System Parameters support ********************************************/
  2726.  
  2727. #if (WINVER >= 0x030a)
  2728. #ifndef NOSYSTEMPARAMSINFO
  2729.  
  2730. BOOL    WINAPI SystemParametersInfo(UINT, UINT, VOID FAR*, UINT);
  2731.  
  2732. #define SPI_GETBEEP                 1
  2733. #define SPI_SETBEEP                 2
  2734. #define SPI_GETMOUSE                3
  2735. #define SPI_SETMOUSE                4
  2736. #define SPI_GETBORDER               5
  2737. #define SPI_SETBORDER               6
  2738. #define SPI_GETKEYBOARDSPEED        10
  2739. #define SPI_SETKEYBOARDSPEED        11
  2740. #define SPI_LANGDRIVER              12
  2741. #define SPI_ICONHORIZONTALSPACING   13
  2742. #define SPI_GETSCREENSAVETIMEOUT    14
  2743. #define SPI_SETSCREENSAVETIMEOUT    15
  2744. #define SPI_GETSCREENSAVEACTIVE     16
  2745. #define SPI_SETSCREENSAVEACTIVE     17
  2746. #define SPI_GETGRIDGRANULARITY      18
  2747. #define SPI_SETGRIDGRANULARITY      19
  2748. #define SPI_SETDESKWALLPAPER        20
  2749. #define SPI_SETDESKPATTERN          21
  2750. #define SPI_GETKEYBOARDDELAY        22
  2751. #define SPI_SETKEYBOARDDELAY        23
  2752. #define SPI_ICONVERTICALSPACING     24
  2753. #define SPI_GETICONTITLEWRAP        25
  2754. #define SPI_SETICONTITLEWRAP        26
  2755. #define SPI_GETMENUDROPALIGNMENT    27
  2756. #define SPI_SETMENUDROPALIGNMENT    28
  2757. #define SPI_SETDOUBLECLKWIDTH       29
  2758. #define SPI_SETDOUBLECLKHEIGHT      30
  2759. #define SPI_GETICONTITLELOGFONT     31
  2760. #define SPI_SETDOUBLECLICKTIME      32
  2761. #define SPI_SETMOUSEBUTTONSWAP      33
  2762. #define SPI_SETICONTITLELOGFONT     34
  2763. #define SPI_GETFASTTASKSWITCH       35
  2764. #define SPI_SETFASTTASKSWITCH       36
  2765.  
  2766. /* SystemParametersInfo flags */
  2767. #define SPIF_UPDATEINIFILE          0x0001
  2768. #define SPIF_SENDWININICHANGE       0x0002
  2769.  
  2770. #endif  /* NOSYSTEMPARAMSINFO  */
  2771. #endif  /* WINVER >= 0x030a */
  2772.  
  2773. /****** Rectangle support ****************************************************/
  2774.  
  2775. void    WINAPI SetRect(RECT FAR*, int, int, int, int);
  2776. void    WINAPI SetRectEmpty(RECT FAR*);
  2777.  
  2778. void    WINAPI CopyRect(RECT FAR*, const RECT FAR*);
  2779.  
  2780. BOOL    WINAPI IsRectEmpty(const RECT FAR*);
  2781.  
  2782. BOOL    WINAPI EqualRect(const RECT FAR*, const RECT FAR*);
  2783.  
  2784. BOOL    WINAPI IntersectRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2785. BOOL    WINAPI UnionRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2786. BOOL    WINAPI SubtractRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2787.  
  2788. void    WINAPI OffsetRect(RECT FAR*, int, int);
  2789. void    WINAPI InflateRect(RECT FAR*, int, int);
  2790.  
  2791. BOOL    WINAPI PtInRect(const RECT FAR*, POINT);
  2792.  
  2793. /****** Window message support ***********************************************/
  2794.  
  2795. UINT WINAPI RegisterWindowMessage(LPCSTR);
  2796.  
  2797. #define WM_NULL             0x0000
  2798.  
  2799. /* NOTE: All messages below 0x0400 are RESERVED by Windows */
  2800. #define WM_USER             0x0400
  2801.  
  2802. #ifndef NOMSG
  2803.  
  2804. /* Queued message structure */
  2805. typedef struct tagMSG
  2806. {
  2807.     HWND        hwnd;
  2808.     UINT        message;
  2809.     WPARAM      wParam;
  2810.     LPARAM      lParam;
  2811.     DWORD       time;
  2812.     POINT       pt;
  2813. } MSG;
  2814. typedef MSG* PMSG;
  2815. typedef MSG NEAR* NPMSG;
  2816. typedef MSG FAR* LPMSG;
  2817.  
  2818. BOOL    WINAPI GetMessage(MSG FAR*, HWND, UINT, UINT);
  2819. BOOL    WINAPI PeekMessage(MSG FAR*, HWND, UINT, UINT, UINT);
  2820.  
  2821. /* PeekMessage() options */
  2822. #define PM_NOREMOVE     0x0000
  2823. #define PM_REMOVE       0x0001
  2824. #define PM_NOYIELD      0x0002
  2825.  
  2826. void    WINAPI WaitMessage(void);
  2827.  
  2828. DWORD   WINAPI GetMessagePos(void);
  2829. LONG    WINAPI GetMessageTime(void);
  2830. #if (WINVER >= 0x030a)
  2831. LPARAM  WINAPI GetMessageExtraInfo(void);
  2832. #endif  /* WINVER >= 0x030a */
  2833.  
  2834. BOOL    WINAPI TranslateMessage(const MSG FAR*);
  2835. LONG    WINAPI DispatchMessage(const MSG FAR*);
  2836.  
  2837. BOOL    WINAPI SetMessageQueue(int);
  2838.  
  2839. BOOL    WINAPI GetInputState(void);
  2840.  
  2841. #if (WINVER >= 0x030a)
  2842. DWORD   WINAPI GetQueueStatus(UINT flags);
  2843.  
  2844. /* GetQueueStatus flags */
  2845. #define QS_KEY          0x0001
  2846. #define QS_MOUSEMOVE    0x0002
  2847. #define QS_MOUSEBUTTON  0x0004
  2848. #define QS_MOUSE        (QS_MOUSEMOVE | QS_MOUSEBUTTON)
  2849. #define QS_POSTMESSAGE  0x0008
  2850. #define QS_TIMER        0x0010
  2851. #define QS_PAINT        0x0020
  2852. #define QS_SENDMESSAGE  0x0040
  2853.  
  2854. #define QS_ALLINPUT     0x007f
  2855. #endif  /* WINVER >= 0x030a */
  2856.  
  2857. #endif  /* NOMSG */
  2858.  
  2859. BOOL    WINAPI PostMessage(HWND, UINT, WPARAM, LPARAM);
  2860. LRESULT WINAPI SendMessage(HWND, UINT, WPARAM, LPARAM);
  2861.  
  2862. #ifndef NOMSG
  2863.  
  2864. BOOL    WINAPI PostAppMessage(HTASK, UINT, WPARAM, LPARAM);
  2865.  
  2866. void    WINAPI ReplyMessage(LRESULT);
  2867. BOOL    WINAPI InSendMessage(void);
  2868.  
  2869. /* Special HWND value for use with PostMessage() and SendMessage() */
  2870. #define HWND_BROADCAST  ((HWND)0xffff)
  2871.  
  2872. BOOL WINAPI CallMsgFilter(MSG FAR*, int);
  2873.  
  2874. #define WH_GETMESSAGE       3
  2875.  
  2876. #define WH_CALLWNDPROC      4
  2877.  
  2878. #define WH_MSGFILTER        (-1)
  2879. #define WH_SYSMSGFILTER     6
  2880.  
  2881. /* CallMsgFilter() and WH_SYS/MSGFILTER context codes */
  2882. #define MSGF_DIALOGBOX           0
  2883. #define MSGF_MENU                2
  2884. #define MSGF_MOVE                3
  2885. #define MSGF_SIZE                4
  2886. #define MSGF_SCROLLBAR           5
  2887. #define MSGF_NEXTWINDOW          6
  2888. #define MSGF_MAINLOOP            8
  2889. #define MSGF_USER                4096
  2890. #endif  /* NOMSG */
  2891.  
  2892. /* Standard window messages */
  2893. /* PenWindows specific messages */
  2894. #define WM_PENWINFIRST      0x0380
  2895. #define WM_PENWINLAST       0x038F
  2896.  
  2897. /* Coalescing messages */
  2898. #define WM_COALESCE_FIRST   0x0390
  2899. #define WM_COALESCE_LAST    0x039F
  2900.  
  2901.  
  2902. #if (WINVER >= 0x030a)
  2903. /****** Power management ****************************************************/
  2904. #define WM_POWER            0x0048
  2905.  
  2906. /* wParam for WM_POWER window message and DRV_POWER driver notification */
  2907. #define PWR_OK              1
  2908. #define PWR_FAIL            (-1)
  2909. #define PWR_SUSPENDREQUEST  1
  2910. #define PWR_SUSPENDRESUME   2
  2911. #define PWR_CRITICALRESUME  3
  2912. #endif  /* WINVER >= 0x030a */
  2913.  
  2914. /****** Application termination *********************************************/
  2915.  
  2916. #define WM_QUERYENDSESSION  0x0011
  2917. #define WM_ENDSESSION       0x0016
  2918.  
  2919. #define WM_QUIT             0x0012
  2920.  
  2921. void    WINAPI PostQuitMessage(int);
  2922.  
  2923. #define WM_SYSTEMERROR      0x0017
  2924.  
  2925. /****** Window class management *********************************************/
  2926.  
  2927. typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
  2928.  
  2929. typedef struct tagWNDCLASS
  2930. {
  2931.     UINT        style;
  2932.     WNDPROC     lpfnWndProc;
  2933.     int         cbClsExtra;
  2934.     int         cbWndExtra;
  2935.     HINSTANCE   hInstance;
  2936.     HICON       hIcon;
  2937.     HCURSOR     hCursor;
  2938.     HBRUSH      hbrBackground;
  2939.     LPCSTR      lpszMenuName;
  2940.     LPCSTR      lpszClassName;
  2941. } WNDCLASS;
  2942. typedef WNDCLASS* PWNDCLASS;
  2943. typedef WNDCLASS NEAR* NPWNDCLASS;
  2944. typedef WNDCLASS FAR* LPWNDCLASS;
  2945.  
  2946. ATOM    WINAPI RegisterClass(const WNDCLASS FAR*);
  2947. BOOL    WINAPI UnregisterClass(LPCSTR, HINSTANCE);
  2948.  
  2949. BOOL    WINAPI GetClassInfo(HINSTANCE, LPCSTR, WNDCLASS FAR*);
  2950. int     WINAPI GetClassName(HWND, LPSTR, int);
  2951.  
  2952. #ifndef NOWINSTYLES
  2953.  
  2954. /* Class styles */
  2955. #define CS_VREDRAW          0x0001
  2956. #define CS_HREDRAW          0x0002
  2957.  
  2958. #define CS_OWNDC            0x0020
  2959. #define CS_CLASSDC          0x0040
  2960. #define CS_PARENTDC         0x0080
  2961.  
  2962. #define CS_SAVEBITS         0x0800
  2963.  
  2964. #define CS_DBLCLKS          0x0008
  2965.  
  2966. #define CS_BYTEALIGNCLIENT  0x1000
  2967. #define CS_BYTEALIGNWINDOW  0x2000
  2968.  
  2969. #define CS_NOCLOSE          0x0200
  2970.  
  2971. #define CS_KEYCVTWINDOW     0x0004
  2972. #define CS_NOKEYCVT         0x0100
  2973.  
  2974. #define CS_GLOBALCLASS      0x4000
  2975. #endif  /* NOWINSTYLES */
  2976.  
  2977. #ifndef NOWINOFFSETS
  2978.  
  2979. WORD    WINAPI GetClassWord(HWND, int);
  2980. WORD    WINAPI SetClassWord(HWND, int, WORD);
  2981. LONG    WINAPI GetClassLong(HWND, int);
  2982. LONG    WINAPI SetClassLong(HWND, int, LONG);
  2983.  
  2984. /* Class field offsets for GetClassLong() and GetClassWord() */
  2985. #define GCL_MENUNAME        (-8)
  2986. #define GCW_HBRBACKGROUND   (-10)
  2987. #define GCW_HCURSOR         (-12)
  2988. #define GCW_HICON           (-14)
  2989. #define GCW_HMODULE         (-16)
  2990. #define GCW_CBWNDEXTRA      (-18)
  2991. #define GCW_CBCLSEXTRA      (-20)
  2992. #define GCL_WNDPROC         (-24)
  2993. #define GCW_STYLE           (-26)
  2994.  
  2995. #if (WINVER >= 0x030a)
  2996. #define GCW_ATOM            (-32)
  2997. #endif  /* WINVER >= 0x030a */
  2998.  
  2999. #endif  /* NOWINOFFSETS */
  3000.  
  3001. /****** Window creation/destroy *********************************************/
  3002.  
  3003. /* Window Styles */
  3004. #ifndef NOWINSTYLES
  3005.  
  3006. /* Basic window types */
  3007. #define WS_OVERLAPPED       0x00000000L
  3008. #define WS_POPUP            0x80000000L
  3009. #define WS_CHILD            0x40000000L
  3010.  
  3011. /* Clipping styles */
  3012. #define WS_CLIPSIBLINGS     0x04000000L
  3013. #define WS_CLIPCHILDREN     0x02000000L
  3014.  
  3015. /* Generic window states */
  3016. #define WS_VISIBLE          0x10000000L
  3017. #define WS_DISABLED         0x08000000L
  3018.  
  3019. /* Main window states */
  3020. #define WS_MINIMIZE         0x20000000L
  3021. #define WS_MAXIMIZE         0x01000000L
  3022.  
  3023. /* Main window styles */
  3024. #define WS_CAPTION          0x00C00000L     /* WS_BORDER | WS_DLGFRAME  */
  3025. #define WS_BORDER           0x00800000L
  3026. #define WS_DLGFRAME         0x00400000L
  3027. #define WS_VSCROLL          0x00200000L
  3028. #define WS_HSCROLL          0x00100000L
  3029. #define WS_SYSMENU          0x00080000L
  3030. #define WS_THICKFRAME       0x00040000L
  3031. #define WS_MINIMIZEBOX      0x00020000L
  3032. #define WS_MAXIMIZEBOX      0x00010000L
  3033.  
  3034. /* Control window styles */
  3035. #define WS_GROUP            0x00020000L
  3036. #define WS_TABSTOP          0x00010000L
  3037.  
  3038. /* Common Window Styles */
  3039. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  3040. #define WS_POPUPWINDOW      (WS_POPUP | WS_BORDER | WS_SYSMENU)
  3041. #define WS_CHILDWINDOW      (WS_CHILD)
  3042.  
  3043. /* Extended Window Styles */
  3044. #define WS_EX_DLGMODALFRAME  0x00000001L
  3045. #define WS_EX_NOPARENTNOTIFY 0x00000004L
  3046.  
  3047. #if (WINVER >= 0x030a)
  3048. #define WS_EX_TOPMOST        0x00000008L
  3049. #define WS_EX_ACCEPTFILES    0x00000010L
  3050. #define WS_EX_TRANSPARENT    0x00000020L
  3051. #endif  /* WINVER >= 0x030a */
  3052.  
  3053. /* Obsolete style names */
  3054. #define WS_TILED            WS_OVERLAPPED
  3055. #define WS_ICONIC           WS_MINIMIZE
  3056. #define WS_SIZEBOX          WS_THICKFRAME
  3057. #define WS_TILEDWINDOW      WS_OVERLAPPEDWINDOW
  3058.  
  3059.  
  3060. #endif  /* NOWINSTYLES */
  3061.  
  3062. /* Special value for CreateWindow, et al. */
  3063. #define HWND_DESKTOP        ((HWND)0)
  3064.  
  3065. BOOL    WINAPI IsWindow(HWND);
  3066.  
  3067. HWND    WINAPI CreateWindowEx(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  3068. HWND    WINAPI CreateWindow(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  3069.  
  3070. #define WM_CREATE           0x0001
  3071. #define WM_NCCREATE         0x0081
  3072.  
  3073. /* WM_CREATE/WM_NCCREATE lParam struct */
  3074. typedef struct tagCREATESTRUCT
  3075. {
  3076.     void FAR* lpCreateParams;
  3077.     HINSTANCE hInstance;
  3078.     HMENU     hMenu;
  3079.     HWND      hwndParent;
  3080.     int       cy;
  3081.     int       cx;
  3082.     int       y;
  3083.     int       x;
  3084.     LONG      style;
  3085.     LPCSTR    lpszName;
  3086.     LPCSTR    lpszClass;
  3087.     DWORD     dwExStyle;
  3088. } CREATESTRUCT;
  3089. typedef CREATESTRUCT FAR* LPCREATESTRUCT;
  3090.  
  3091. BOOL    WINAPI DestroyWindow(HWND);
  3092.  
  3093. #define WM_DESTROY          0x0002
  3094. #define WM_NCDESTROY        0x0082
  3095.  
  3096. /* Basic window attributes */
  3097.  
  3098. HTASK   WINAPI GetWindowTask(HWND);
  3099.  
  3100. BOOL    WINAPI IsChild(HWND, HWND);
  3101.  
  3102. HWND    WINAPI GetParent(HWND);
  3103. HWND    WINAPI SetParent(HWND, HWND);
  3104.  
  3105. BOOL    WINAPI IsWindowVisible(HWND);
  3106.  
  3107. BOOL    WINAPI ShowWindow(HWND, int);
  3108.  
  3109.  
  3110. #ifndef NOSHOWWINDOW
  3111.  
  3112. #define SW_HIDE             0
  3113. #define SW_SHOWNORMAL       1
  3114. #define SW_NORMAL           1
  3115. #define SW_SHOWMINIMIZED    2
  3116. #define SW_SHOWMAXIMIZED    3
  3117. #define SW_MAXIMIZE         3
  3118. #define SW_SHOWNOACTIVATE   4
  3119. #define SW_SHOW             5
  3120. #define SW_MINIMIZE         6
  3121. #define SW_SHOWMINNOACTIVE  7
  3122. #define SW_SHOWNA           8
  3123. #define SW_RESTORE          9
  3124.  
  3125. /* Obsolete ShowWindow() command names */
  3126. #define HIDE_WINDOW         0
  3127. #define SHOW_OPENWINDOW     1
  3128. #define SHOW_ICONWINDOW     2
  3129. #define SHOW_FULLSCREEN     3
  3130. #define SHOW_OPENNOACTIVATE 4
  3131.  
  3132. #define WM_SHOWWINDOW       0x0018
  3133.  
  3134. /* WM_SHOWWINDOW wParam codes */
  3135. #define SW_PARENTCLOSING    1
  3136. #define SW_OTHERMAXIMIZED   2
  3137. #define SW_PARENTOPENING    3
  3138. #define SW_OTHERRESTORED    4
  3139.  
  3140. /* Obsolete constant names */
  3141. #define SW_OTHERZOOM        SW_OTHERMAXIMIZED
  3142. #define SW_OTHERUNZOOM      SW_OTHERRESTORED
  3143. #endif  /* NOSHOWWINDOW */
  3144.  
  3145. #define WM_SETREDRAW        0x000B
  3146.  
  3147. /* Enabled state */
  3148. BOOL    WINAPI EnableWindow(HWND,BOOL);
  3149. BOOL    WINAPI IsWindowEnabled(HWND);
  3150.  
  3151. #define WM_ENABLE           0x000A
  3152.  
  3153. /* Window text */
  3154. void    WINAPI SetWindowText(HWND, LPCSTR);
  3155. int     WINAPI GetWindowText(HWND, LPSTR, int);
  3156. int     WINAPI GetWindowTextLength(HWND);
  3157.  
  3158. #define WM_SETTEXT          0x000C
  3159. #define WM_GETTEXT          0x000D
  3160. #define WM_GETTEXTLENGTH    0x000E
  3161.  
  3162. /* Window words */
  3163. WORD    WINAPI GetWindowWord(HWND, int);
  3164. WORD    WINAPI SetWindowWord(HWND, int, WORD);
  3165. LONG    WINAPI GetWindowLong(HWND, int);
  3166. LONG    WINAPI SetWindowLong(HWND, int, LONG);
  3167.  
  3168. /* Window field offsets for GetWindowLong() and GetWindowWord() */
  3169. #ifndef NOWINOFFSETS
  3170. #define GWL_WNDPROC         (-4)
  3171. #define GWW_HINSTANCE       (-6)
  3172. #define GWW_HWNDPARENT      (-8)
  3173. #define GWW_ID              (-12)
  3174. #define GWL_STYLE           (-16)
  3175. #define GWL_EXSTYLE         (-20)
  3176. #endif  /* NOWINOFFSETS */
  3177.  
  3178. /****** Window size, position, Z-order, and visibility **********************/
  3179.  
  3180. #define CW_USEDEFAULT       ((int)0x8000)
  3181.  
  3182. void    WINAPI GetClientRect(HWND, RECT FAR*);
  3183. void    WINAPI GetWindowRect(HWND, RECT FAR*);
  3184.  
  3185.  
  3186. #if (WINVER >= 0x030a)
  3187. typedef struct tagWINDOWPLACEMENT
  3188. {
  3189.     UINT  length;
  3190.     UINT  flags;
  3191.     UINT  showCmd;
  3192.     POINT ptMinPosition;
  3193.     POINT ptMaxPosition;
  3194.     RECT  rcNormalPosition;
  3195. } WINDOWPLACEMENT;
  3196. typedef WINDOWPLACEMENT     *PWINDOWPLACEMENT;
  3197. typedef WINDOWPLACEMENT FAR* LPWINDOWPLACEMENT;
  3198.  
  3199. #define WPF_SETMINPOSITION      0x0001
  3200. #define WPF_RESTORETOMAXIMIZED  0x0002
  3201.  
  3202. BOOL    WINAPI GetWindowPlacement(HWND, WINDOWPLACEMENT FAR*);
  3203. BOOL    WINAPI SetWindowPlacement(HWND, const WINDOWPLACEMENT FAR*);
  3204. #endif  /* WINVER >= 0x030a */
  3205.  
  3206. BOOL    WINAPI SetWindowPos(HWND, HWND, int, int, int, int, UINT);
  3207.  
  3208. /* SetWindowPos() and WINDOWPOS flags */
  3209. #define SWP_NOSIZE          0x0001
  3210. #define SWP_NOMOVE          0x0002
  3211. #define SWP_NOZORDER        0x0004
  3212. #define SWP_NOREDRAW        0x0008
  3213. #define SWP_NOACTIVATE      0x0010
  3214. #define SWP_FRAMECHANGED    0x0020  /* The frame changed: send WM_NCCALCSIZE */
  3215. #define SWP_SHOWWINDOW      0x0040
  3216. #define SWP_HIDEWINDOW      0x0080
  3217. #define SWP_NOCOPYBITS      0x0100
  3218. #define SWP_NOOWNERZORDER   0x0200  /* Don't do owner Z ordering */
  3219.  
  3220. #define SWP_DRAWFRAME       SWP_FRAMECHANGED
  3221. #define SWP_NOREPOSITION    SWP_NOOWNERZORDER
  3222.  
  3223. #define SWP_NOSENDCHANGING  0x0400
  3224. #define SWP_DEFERERASE      0x2000
  3225.  
  3226. /* SetWindowPos() hwndInsertAfter field values */
  3227. #define HWND_TOP            ((HWND)0)
  3228. #define HWND_BOTTOM         ((HWND)1)
  3229. #define HWND_TOPMOST        ((HWND)-1)
  3230. #define HWND_NOTOPMOST      ((HWND)-2)
  3231.  
  3232. #ifndef NODEFERWINDOWPOS
  3233.  
  3234. DECLARE_HANDLE(HDWP);
  3235.  
  3236. HDWP    WINAPI BeginDeferWindowPos(int);
  3237. HDWP    WINAPI DeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT);
  3238. BOOL    WINAPI EndDeferWindowPos(HDWP);
  3239.  
  3240. #endif  /* NODEFERWINDOWPOS */
  3241.  
  3242. BOOL    WINAPI MoveWindow(HWND, int, int, int, int, BOOL);
  3243. BOOL    WINAPI BringWindowToTop(HWND);
  3244.  
  3245. #if (WINVER >= 0x030a)
  3246.  
  3247. #define WM_WINDOWPOSCHANGING 0x0046
  3248. #define WM_WINDOWPOSCHANGED 0x0047
  3249.  
  3250. /* WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam */
  3251. typedef struct tagWINDOWPOS
  3252. {
  3253.     HWND    hwnd;
  3254.     HWND    hwndInsertAfter;
  3255.     int     x;
  3256.     int     y;
  3257.     int     cx;
  3258.     int     cy;
  3259.     UINT    flags;
  3260. } WINDOWPOS;
  3261. typedef WINDOWPOS FAR* LPWINDOWPOS;
  3262. #endif  /* WINVER >= 0x030a */
  3263.  
  3264. #define WM_MOVE             0x0003
  3265. #define WM_SIZE             0x0005
  3266.  
  3267. /* WM_SIZE message wParam values */
  3268. #define SIZE_RESTORED       0
  3269. #define SIZE_MINIMIZED      1
  3270. #define SIZE_MAXIMIZED      2
  3271. #define SIZE_MAXSHOW        3
  3272. #define SIZE_MAXHIDE        4
  3273.  
  3274. /* Obsolete constant names */
  3275. #define SIZENORMAL          SIZE_RESTORED
  3276. #define SIZEICONIC          SIZE_MINIMIZED
  3277. #define SIZEFULLSCREEN      SIZE_MAXIMIZED
  3278. #define SIZEZOOMSHOW        SIZE_MAXSHOW
  3279. #define SIZEZOOMHIDE        SIZE_MAXHIDE
  3280.  
  3281. /****** Window proc implementation & subclassing support *********************/
  3282.  
  3283. LRESULT WINAPI DefWindowProc(HWND, UINT, WPARAM, LPARAM);
  3284.  
  3285. #ifdef STRICT
  3286. LRESULT WINAPI CallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM);
  3287. #else
  3288. LRESULT WINAPI CallWindowProc(FARPROC, HWND, UINT, WPARAM, LPARAM);
  3289. #endif
  3290.  
  3291. /****** Main window support **************************************************/
  3292.  
  3293. void    WINAPI AdjustWindowRect(RECT FAR*, DWORD, BOOL);
  3294. void    WINAPI AdjustWindowRectEx(RECT FAR*, DWORD, BOOL, DWORD);
  3295.  
  3296. #define WM_QUERYOPEN        0x0013
  3297. #define WM_CLOSE            0x0010
  3298.  
  3299. /* Struct pointed to by WM_GETMINMAXINFO lParam */
  3300. typedef struct tagMINMAXINFO
  3301. {
  3302.     POINT ptReserved;
  3303.     POINT ptMaxSize;
  3304.     POINT ptMaxPosition;
  3305.     POINT ptMinTrackSize;
  3306.     POINT ptMaxTrackSize;
  3307. } MINMAXINFO;
  3308. #define WM_GETMINMAXINFO    0x0024
  3309.  
  3310.  
  3311. BOOL    WINAPI FlashWindow(HWND, BOOL);
  3312.  
  3313. void    WINAPI ShowOwnedPopups(HWND, BOOL);
  3314.  
  3315. /* Obsolete functions */
  3316. BOOL    WINAPI OpenIcon(HWND);
  3317. void    WINAPI CloseWindow(HWND);
  3318. BOOL    WINAPI AnyPopup(void);
  3319. BOOL    WINAPI IsIconic(HWND);
  3320. BOOL    WINAPI IsZoomed(HWND);
  3321.  
  3322. /****** Window coordinate mapping and hit-testing ***************************/
  3323.  
  3324. void    WINAPI ClientToScreen(HWND, POINT FAR*);
  3325. void    WINAPI ScreenToClient(HWND, POINT FAR*);
  3326.  
  3327. #if (WINVER >= 0x030a)
  3328. void    WINAPI MapWindowPoints(HWND hwndFrom, HWND hwndTo, POINT FAR* lppt, UINT cpt);
  3329. #endif  /* WINVER >= 0x030a */
  3330.  
  3331. HWND    WINAPI WindowFromPoint(POINT);
  3332. HWND    WINAPI ChildWindowFromPoint(HWND, POINT);
  3333.  
  3334. /****** Window query and enumeration ****************************************/
  3335.  
  3336. HWND    WINAPI GetDesktopWindow(void);
  3337.  
  3338. HWND    WINAPI FindWindow(LPCSTR, LPCSTR);
  3339.  
  3340. #ifdef STRICT
  3341. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
  3342. #else
  3343. typedef FARPROC WNDENUMPROC;
  3344. #endif
  3345.  
  3346. BOOL    WINAPI EnumWindows(WNDENUMPROC, LPARAM);
  3347. BOOL    WINAPI EnumChildWindows(HWND, WNDENUMPROC, LPARAM);
  3348. BOOL    WINAPI EnumTaskWindows(HTASK, WNDENUMPROC, LPARAM);
  3349.  
  3350. HWND    WINAPI GetTopWindow(HWND);
  3351.  
  3352. HWND    WINAPI GetWindow(HWND, UINT);
  3353. HWND    WINAPI GetNextWindow(HWND, UINT);
  3354.  
  3355. /* GetWindow() constants */
  3356. #define GW_HWNDFIRST    0
  3357. #define GW_HWNDLAST     1
  3358. #define GW_HWNDNEXT     2
  3359. #define GW_HWNDPREV     3
  3360. #define GW_OWNER        4
  3361. #define GW_CHILD        5
  3362.  
  3363.  
  3364. /****** Window property support *********************************************/
  3365.  
  3366. BOOL    WINAPI SetProp(HWND, LPCSTR, HANDLE);
  3367. HANDLE  WINAPI GetProp(HWND, LPCSTR);
  3368. HANDLE  WINAPI RemoveProp(HWND, LPCSTR);
  3369.  
  3370. #ifdef STRICT
  3371. typedef BOOL (CALLBACK* PROPENUMPROC)(HWND, LPCSTR, HANDLE);
  3372. #else
  3373. typedef FARPROC PROPENUMPROC;
  3374. #endif
  3375.  
  3376. int     WINAPI EnumProps(HWND, PROPENUMPROC);
  3377.  
  3378. /****** Window drawing support **********************************************/
  3379.  
  3380. HDC     WINAPI GetDC(HWND);
  3381. int     WINAPI ReleaseDC(HWND, HDC);
  3382.  
  3383. HDC     WINAPI GetWindowDC(HWND);
  3384.  
  3385. #if (WINVER >= 0x030a)
  3386. HDC     WINAPI GetDCEx(register HWND hwnd, HRGN hrgnClip, DWORD flags);
  3387.  
  3388. #define DCX_WINDOW          0x00000001L
  3389. #define DCX_CACHE           0x00000002L
  3390. #define DCX_CLIPCHILDREN    0x00000008L
  3391. #define DCX_CLIPSIBLINGS    0x00000010L
  3392. #define DCX_PARENTCLIP      0x00000020L
  3393.  
  3394. #define DCX_EXCLUDERGN      0x00000040L
  3395. #define DCX_INTERSECTRGN    0x00000080L
  3396.  
  3397.  
  3398. #define DCX_LOCKWINDOWUPDATE 0x00000400L
  3399.  
  3400.  
  3401. #define DCX_USESTYLE        0x00010000L
  3402.  
  3403. #endif  /* WINVER >= 0x030a */
  3404.  
  3405. /****** Window repainting ***************************************************/
  3406.  
  3407. #define WM_PAINT            0x000F
  3408. #define WM_ERASEBKGND       0x0014
  3409. #define WM_ICONERASEBKGND   0x0027
  3410.  
  3411. /* BeginPaint() return structure */
  3412. typedef struct tagPAINTSTRUCT
  3413. {
  3414.     HDC         hdc;
  3415.     BOOL        fErase;
  3416.     RECT        rcPaint;
  3417.     BOOL        fRestore;
  3418.     BOOL        fIncUpdate;
  3419.     BYTE        rgbReserved[16];
  3420. } PAINTSTRUCT;
  3421. typedef PAINTSTRUCT* PPAINTSTRUCT;
  3422. typedef PAINTSTRUCT NEAR* NPPAINTSTRUCT;
  3423. typedef PAINTSTRUCT FAR* LPPAINTSTRUCT;
  3424.  
  3425. HDC     WINAPI BeginPaint(HWND, PAINTSTRUCT FAR*);
  3426. void    WINAPI EndPaint(HWND, const PAINTSTRUCT FAR*);
  3427.  
  3428. void    WINAPI UpdateWindow(HWND);
  3429.  
  3430. int     WINAPI ExcludeUpdateRgn(HDC, HWND);
  3431.  
  3432. #if (WINVER >= 0x030a)
  3433. BOOL    WINAPI LockWindowUpdate(HWND hwndLock);
  3434. #endif  /* WINVER >= 0x030a */
  3435.  
  3436. BOOL    WINAPI GetUpdateRect(HWND, RECT FAR*, BOOL);
  3437. int     WINAPI GetUpdateRgn(HWND, HRGN, BOOL);
  3438.  
  3439. void    WINAPI InvalidateRect(HWND, const RECT FAR*, BOOL);
  3440. void    WINAPI ValidateRect(HWND, const RECT FAR*);
  3441.  
  3442. void    WINAPI InvalidateRgn(HWND, HRGN, BOOL);
  3443. void    WINAPI ValidateRgn(HWND, HRGN);
  3444.  
  3445. #if (WINVER >= 0x030a)
  3446. BOOL    WINAPI RedrawWindow(HWND hwnd, const RECT FAR* lprcUpdate, HRGN hrgnUpdate, UINT flags);
  3447.  
  3448. #define RDW_INVALIDATE          0x0001
  3449. #define RDW_INTERNALPAINT       0x0002
  3450. #define RDW_ERASE               0x0004
  3451.  
  3452. #define RDW_VALIDATE            0x0008
  3453. #define RDW_NOINTERNALPAINT     0x0010
  3454. #define RDW_NOERASE             0x0020
  3455.  
  3456. #define RDW_NOCHILDREN          0x0040
  3457. #define RDW_ALLCHILDREN         0x0080
  3458.  
  3459. #define RDW_UPDATENOW           0x0100
  3460. #define RDW_ERASENOW            0x0200
  3461.  
  3462. #define RDW_FRAME               0x0400
  3463. #define RDW_NOFRAME             0x0800
  3464.  
  3465. #endif  /* WINVER >= 0x030a */
  3466.  
  3467. /****** Window scrolling ****************************************************/
  3468.  
  3469. void    WINAPI ScrollWindow(HWND, int, int, const RECT FAR*, const RECT FAR*);
  3470. BOOL    WINAPI ScrollDC(HDC, int, int, const RECT FAR*, const RECT FAR*, HRGN, RECT FAR*);
  3471.  
  3472. #if (WINVER >= 0x030a)
  3473.  
  3474. int     WINAPI ScrollWindowEx(HWND hwnd, int dx, int dy,
  3475.                 const RECT FAR* prcScroll, const RECT FAR* prcClip,
  3476.                 HRGN hrgnUpdate, RECT FAR* prcUpdate, UINT flags);
  3477.  
  3478. #define SW_SCROLLCHILDREN   0x0001
  3479. #define SW_INVALIDATE       0x0002
  3480. #define SW_ERASE            0x0004
  3481.  
  3482.  
  3483. #endif  /* WINVER >= 0x030a */
  3484.  
  3485. /****** Non-client window area management ************************************/
  3486.  
  3487. #define WM_NCPAINT          0x0085
  3488.  
  3489. #define WM_NCCALCSIZE       0x0083
  3490.  
  3491. #if (WINVER >= 0x030a)
  3492. /* WM_NCCALCSIZE return flags */
  3493. #define WVR_ALIGNTOP        0x0010
  3494. #define WVR_ALIGNLEFT       0x0020
  3495. #define WVR_ALIGNBOTTOM     0x0040
  3496. #define WVR_ALIGNRIGHT      0x0080
  3497. #define WVR_HREDRAW         0x0100
  3498. #define WVR_VREDRAW         0x0200
  3499. #define WVR_REDRAW          (WVR_HREDRAW | WVR_VREDRAW)
  3500. #define WVR_VALIDRECTS      0x0400
  3501.  
  3502.  
  3503. /* WM_NCCALCSIZE parameter structure */
  3504. typedef struct tagNCCALCSIZE_PARAMS
  3505. {
  3506.     RECT           rgrc[3];
  3507.     WINDOWPOS FAR* lppos;
  3508. } NCCALCSIZE_PARAMS;
  3509. #else   /* WINVER >= 0x030a */
  3510. typedef struct tagNCCALCSIZE_PARAMS
  3511. {
  3512.     RECT    rgrc[2];
  3513. } NCCALCSIZE_PARAMS;
  3514. #endif  /* WINVER >= 0x030a */
  3515. typedef NCCALCSIZE_PARAMS FAR* LPNCCALCSIZE_PARAMS;
  3516.  
  3517. #define WM_NCHITTEST        0x0084
  3518.  
  3519. /* WM_NCHITTEST return codes */
  3520. #define HTERROR             (-2)
  3521. #define HTTRANSPARENT       (-1)
  3522. #define HTNOWHERE           0
  3523. #define HTCLIENT            1
  3524. #define HTCAPTION           2
  3525. #define HTSYSMENU           3
  3526. #define HTSIZE              4
  3527. #define HTMENU              5
  3528. #define HTHSCROLL           6
  3529. #define HTVSCROLL           7
  3530. #define HTMINBUTTON         8
  3531. #define HTMAXBUTTON         9
  3532. #define HTLEFT              10
  3533. #define HTRIGHT             11
  3534. #define HTTOP               12
  3535. #define HTTOPLEFT           13
  3536. #define HTTOPRIGHT          14
  3537. #define HTBOTTOM            15
  3538. #define HTBOTTOMLEFT        16
  3539. #define HTBOTTOMRIGHT       17
  3540. #define HTBORDER            18
  3541. #define HTGROWBOX           HTSIZE
  3542. #define HTREDUCE            HTMINBUTTON
  3543. #define HTZOOM              HTMAXBUTTON
  3544.  
  3545. /****** Drag-and-drop support ***********************************************/
  3546.  
  3547. #define WM_QUERYDRAGICON    0x0037
  3548. #define WM_DROPFILES        0x0233
  3549.  
  3550. /****** Window activation ***************************************************/
  3551.  
  3552. HWND    WINAPI SetActiveWindow(HWND);
  3553. HWND    WINAPI GetActiveWindow(void);
  3554.  
  3555. HWND    WINAPI GetLastActivePopup(HWND);
  3556.  
  3557. /* WM_ACTIVATE state values */
  3558. #define WA_INACTIVE         0
  3559. #define WA_ACTIVE           1
  3560. #define WA_CLICKACTIVE      2
  3561.  
  3562. #define WM_ACTIVATE         0x0006
  3563. #define WM_ACTIVATEAPP      0x001C
  3564. #define WM_NCACTIVATE       0x0086
  3565.  
  3566. /****** Keyboard input support **********************************************/
  3567.  
  3568. HWND    WINAPI SetFocus(HWND);
  3569. HWND    WINAPI GetFocus(void);
  3570.  
  3571. int     WINAPI GetKeyState(int);
  3572. int     WINAPI GetAsyncKeyState(int);
  3573.  
  3574. void    WINAPI GetKeyboardState(BYTE FAR* );
  3575. void    WINAPI SetKeyboardState(BYTE FAR* );
  3576.  
  3577. #define WM_SETFOCUS         0x0007
  3578. #define WM_KILLFOCUS        0x0008
  3579.  
  3580. #define WM_KEYDOWN          0x0100
  3581. #define WM_KEYUP            0x0101
  3582.  
  3583. #define WM_CHAR             0x0102
  3584. #define WM_DEADCHAR         0x0103
  3585.  
  3586. #define WM_SYSKEYDOWN       0x0104
  3587. #define WM_SYSKEYUP         0x0105
  3588.  
  3589. #define WM_SYSCHAR          0x0106
  3590. #define WM_SYSDEADCHAR      0x0107
  3591.  
  3592.  
  3593. /* Keyboard message range */
  3594. #define WM_KEYFIRST         0x0100
  3595. #define WM_KEYLAST          0x0108
  3596.  
  3597. /* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
  3598. #define KF_EXTENDED         0x0100
  3599. #define KF_DLGMODE          0x0800
  3600. #define KF_MENUMODE         0x1000
  3601. #define KF_ALTDOWN          0x2000
  3602. #define KF_REPEAT           0x4000
  3603. #define KF_UP               0x8000
  3604.  
  3605. /* Virtual key codes */
  3606. #ifndef NOVIRTUALKEYCODES
  3607. #define VK_LBUTTON          0x01
  3608. #define VK_RBUTTON          0x02
  3609. #define VK_CANCEL           0x03
  3610. #define VK_MBUTTON          0x04
  3611. #define VK_BACK             0x08
  3612. #define VK_TAB              0x09
  3613. #define VK_CLEAR            0x0C
  3614. #define VK_RETURN           0x0D
  3615. #define VK_SHIFT            0x10
  3616. #define VK_CONTROL          0x11
  3617. #define VK_MENU             0x12
  3618. #define VK_PAUSE            0x13
  3619. #define VK_CAPITAL          0x14
  3620. #define VK_ESCAPE           0x1B
  3621. #define VK_SPACE            0x20
  3622. #define VK_PRIOR            0x21
  3623. #define VK_NEXT             0x22
  3624. #define VK_END              0x23
  3625. #define VK_HOME             0x24
  3626. #define VK_LEFT             0x25
  3627. #define VK_UP               0x26
  3628. #define VK_RIGHT            0x27
  3629. #define VK_DOWN             0x28
  3630. #define VK_SELECT           0x29
  3631. #define VK_PRINT            0x2A
  3632. #define VK_EXECUTE          0x2B
  3633. #define VK_SNAPSHOT         0x2C
  3634. #define VK_INSERT           0x2D
  3635. #define VK_DELETE           0x2E
  3636. #define VK_HELP             0x2F
  3637. #define VK_NUMPAD0          0x60
  3638. #define VK_NUMPAD1          0x61
  3639. #define VK_NUMPAD2          0x62
  3640. #define VK_NUMPAD3          0x63
  3641. #define VK_NUMPAD4          0x64
  3642. #define VK_NUMPAD5          0x65
  3643. #define VK_NUMPAD6          0x66
  3644. #define VK_NUMPAD7          0x67
  3645. #define VK_NUMPAD8          0x68
  3646. #define VK_NUMPAD9          0x69
  3647. #define VK_MULTIPLY         0x6A
  3648. #define VK_ADD              0x6B
  3649. #define VK_SEPARATOR        0x6C
  3650. #define VK_SUBTRACT         0x6D
  3651. #define VK_DECIMAL          0x6E
  3652. #define VK_DIVIDE           0x6F
  3653. #define VK_F1               0x70
  3654. #define VK_F2               0x71
  3655. #define VK_F3               0x72
  3656. #define VK_F4               0x73
  3657. #define VK_F5               0x74
  3658. #define VK_F6               0x75
  3659. #define VK_F7               0x76
  3660. #define VK_F8               0x77
  3661. #define VK_F9               0x78
  3662. #define VK_F10              0x79
  3663. #define VK_F11              0x7A
  3664. #define VK_F12              0x7B
  3665. #define VK_F13              0x7C
  3666. #define VK_F14              0x7D
  3667. #define VK_F15              0x7E
  3668. #define VK_F16              0x7F
  3669. #define VK_F17              0x80
  3670. #define VK_F18              0x81
  3671. #define VK_F19              0x82
  3672. #define VK_F20              0x83
  3673. #define VK_F21              0x84
  3674. #define VK_F22              0x85
  3675. #define VK_F23              0x86
  3676. #define VK_F24              0x87
  3677. #define VK_NUMLOCK          0x90
  3678. #define VK_SCROLL           0x91
  3679.  
  3680. /* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
  3681. /* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' */
  3682.  
  3683. #endif  /* NOVIRTUALKEYCODES */
  3684.  
  3685.  
  3686. /* SetWindowsHook() keyboard hook */
  3687. #define WH_KEYBOARD         2
  3688.  
  3689. /****** Mouse input support *************************************************/
  3690.  
  3691. HWND    WINAPI SetCapture(HWND);
  3692. void    WINAPI ReleaseCapture(void);
  3693. HWND    WINAPI GetCapture(void);
  3694.  
  3695. BOOL    WINAPI SwapMouseButton(BOOL);
  3696.  
  3697. /* Mouse input messages */
  3698. #define WM_MOUSEMOVE        0x0200
  3699. #define WM_LBUTTONDOWN      0x0201
  3700. #define WM_LBUTTONUP        0x0202
  3701. #define WM_LBUTTONDBLCLK    0x0203
  3702. #define WM_RBUTTONDOWN      0x0204
  3703. #define WM_RBUTTONUP        0x0205
  3704. #define WM_RBUTTONDBLCLK    0x0206
  3705. #define WM_MBUTTONDOWN      0x0207
  3706. #define WM_MBUTTONUP        0x0208
  3707. #define WM_MBUTTONDBLCLK    0x0209
  3708.  
  3709. /* Mouse input message range */
  3710. #define WM_MOUSEFIRST       0x0200
  3711. #define WM_MOUSELAST        0x0209
  3712.  
  3713. /* Mouse message wParam key states */
  3714. #ifndef NOKEYSTATES
  3715. #define MK_LBUTTON          0x0001
  3716. #define MK_RBUTTON          0x0002
  3717. #define MK_SHIFT            0x0004
  3718. #define MK_CONTROL          0x0008
  3719. #define MK_MBUTTON          0x0010
  3720. #endif  /* NOKEYSTATES */
  3721.  
  3722. /* Non-client mouse messages */
  3723. #define WM_NCMOUSEMOVE      0x00A0
  3724. #define WM_NCLBUTTONDOWN    0x00A1
  3725. #define WM_NCLBUTTONUP      0x00A2
  3726. #define WM_NCLBUTTONDBLCLK  0x00A3
  3727. #define WM_NCRBUTTONDOWN    0x00A4
  3728. #define WM_NCRBUTTONUP      0x00A5
  3729. #define WM_NCRBUTTONDBLCLK  0x00A6
  3730. #define WM_NCMBUTTONDOWN    0x00A7
  3731. #define WM_NCMBUTTONUP      0x00A8
  3732. #define WM_NCMBUTTONDBLCLK  0x00A9
  3733.  
  3734. /* Mouse click activation support */
  3735. #define WM_MOUSEACTIVATE    0x0021
  3736.  
  3737. /* WM_MOUSEACTIVATE return codes */
  3738. #define MA_ACTIVATE         1
  3739. #define MA_ACTIVATEANDEAT   2
  3740. #define MA_NOACTIVATE       3
  3741. #if (WINVER >= 0x030a)
  3742. #define MA_NOACTIVATEANDEAT 4
  3743. #endif  /* WINVER >= 0x030a */
  3744.  
  3745. /* SetWindowsHook() mouse hook */
  3746. #ifndef NOWH
  3747. #define WH_MOUSE            7
  3748.  
  3749. typedef struct tagMOUSEHOOKSTRUCT
  3750. {
  3751.     POINT   pt;
  3752.     HWND    hwnd;
  3753.     UINT    wHitTestCode;
  3754.     DWORD   dwExtraInfo;
  3755. } MOUSEHOOKSTRUCT;
  3756. typedef MOUSEHOOKSTRUCT  FAR* LPMOUSEHOOKSTRUCT;
  3757. #endif  /* NOWH */
  3758.  
  3759. /****** Mode control ********************************************************/
  3760.  
  3761. #define WM_CANCELMODE       0x001F
  3762.  
  3763. /****** System modal window support *****************************************/
  3764.  
  3765. HWND    WINAPI GetSysModalWindow(void);
  3766. HWND    WINAPI SetSysModalWindow(HWND);
  3767.  
  3768. /****** Timer support *******************************************************/
  3769.  
  3770. #ifdef STRICT
  3771. typedef void (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD);
  3772. #else
  3773. typedef FARPROC TIMERPROC;
  3774. #endif
  3775.  
  3776. UINT    WINAPI SetTimer(HWND, UINT, UINT, TIMERPROC);
  3777.  
  3778. BOOL    WINAPI KillTimer(HWND, UINT);
  3779.  
  3780. #define WM_TIMER            0x0113
  3781.  
  3782. /****** Accelerator support *************************************************/
  3783.  
  3784. DECLARE_HANDLE(HACCEL);
  3785.  
  3786. HACCEL  WINAPI LoadAccelerators(HINSTANCE, LPCSTR);
  3787.  
  3788. #ifndef NOMSG
  3789. int     WINAPI TranslateAccelerator(HWND, HACCEL, MSG FAR*);
  3790. #endif
  3791.  
  3792. /****** Menu support ********************************************************/
  3793.  
  3794. #ifndef NOMENUS
  3795.  
  3796. /* Menu template header */
  3797. typedef struct
  3798. {
  3799.     UINT    versionNumber;
  3800.     UINT    offset;
  3801. } MENUITEMTEMPLATEHEADER;
  3802.  
  3803. /* Menu template item struct */
  3804. typedef struct
  3805. {
  3806.     UINT    mtOption;
  3807.     UINT    mtID;
  3808.     char    mtString[1];
  3809. } MENUITEMTEMPLATE;
  3810.  
  3811. #if (WINVER >= 0x030a)
  3812. BOOL    WINAPI IsMenu(HMENU);
  3813. #endif  /* WINVER >= 0x030a */
  3814.  
  3815. HMENU   WINAPI CreateMenu(void);
  3816. HMENU   WINAPI CreatePopupMenu(void);
  3817. HMENU   WINAPI LoadMenu(HINSTANCE, LPCSTR);
  3818. HMENU   WINAPI LoadMenuIndirect(const void FAR*);
  3819.  
  3820. BOOL    WINAPI DestroyMenu(HMENU);
  3821.  
  3822. HMENU   WINAPI GetMenu(HWND);
  3823. BOOL    WINAPI SetMenu(HWND, HMENU);
  3824.  
  3825. HMENU   WINAPI GetSystemMenu(HWND, BOOL);
  3826.  
  3827. void    WINAPI DrawMenuBar(HWND);
  3828.  
  3829. BOOL    WINAPI HiliteMenuItem(HWND, HMENU, UINT, UINT);
  3830.  
  3831. BOOL    WINAPI InsertMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  3832. BOOL    WINAPI AppendMenu(HMENU, UINT, UINT, LPCSTR);
  3833. BOOL    WINAPI ModifyMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  3834. BOOL    WINAPI RemoveMenu(HMENU, UINT, UINT);
  3835. BOOL    WINAPI DeleteMenu(HMENU, UINT, UINT);
  3836.  
  3837. BOOL    WINAPI ChangeMenu(HMENU, UINT, LPCSTR, UINT, UINT);
  3838.  
  3839. #define MF_INSERT           0x0000
  3840. #define MF_CHANGE           0x0080
  3841. #define MF_APPEND           0x0100
  3842. #define MF_DELETE           0x0200
  3843. #define MF_REMOVE           0x1000
  3844.  
  3845. /* Menu flags for Add/Check/EnableMenuItem() */
  3846. #define MF_BYCOMMAND        0x0000
  3847. #define MF_BYPOSITION       0x0400
  3848.  
  3849. #define MF_SEPARATOR        0x0800
  3850.  
  3851. #define MF_ENABLED          0x0000
  3852. #define MF_GRAYED           0x0001
  3853. #define MF_DISABLED         0x0002
  3854.  
  3855. #define MF_UNCHECKED        0x0000
  3856. #define MF_CHECKED          0x0008
  3857. #define MF_USECHECKBITMAPS  0x0200
  3858.  
  3859. #define MF_STRING           0x0000
  3860. #define MF_BITMAP           0x0004
  3861. #define MF_OWNERDRAW        0x0100
  3862.  
  3863. #define MF_POPUP            0x0010
  3864. #define MF_MENUBARBREAK     0x0020
  3865. #define MF_MENUBREAK        0x0040
  3866.  
  3867. #define MF_UNHILITE         0x0000
  3868. #define MF_HILITE           0x0080
  3869.  
  3870. #define MF_SYSMENU          0x2000
  3871. #define MF_HELP             0x4000
  3872. #define MF_MOUSESELECT      0x8000
  3873.  
  3874.  
  3875. #define MF_END              0x0080  /* Only valid in menu resource templates */
  3876.  
  3877. BOOL    WINAPI EnableMenuItem(HMENU, UINT, UINT);
  3878. BOOL    WINAPI CheckMenuItem(HMENU, UINT, UINT);
  3879.  
  3880. HMENU   WINAPI GetSubMenu(HMENU, int);
  3881.  
  3882. int     WINAPI GetMenuItemCount(HMENU);
  3883. UINT    WINAPI GetMenuItemID(HMENU, int);
  3884.  
  3885. int     WINAPI GetMenuString(HMENU, UINT, LPSTR, int, UINT);
  3886. UINT    WINAPI GetMenuState(HMENU, UINT, UINT);
  3887.  
  3888. BOOL    WINAPI SetMenuItemBitmaps(HMENU, UINT, UINT, HBITMAP, HBITMAP);
  3889. DWORD   WINAPI GetMenuCheckMarkDimensions(void);
  3890.  
  3891. BOOL    WINAPI TrackPopupMenu(HMENU, UINT, int, int, int, HWND, const RECT FAR*);
  3892.  
  3893. /* Flags for TrackPopupMenu */
  3894. #define TPM_LEFTBUTTON  0x0000
  3895. #if (WINVER >= 0x030a)
  3896. #define TPM_RIGHTBUTTON 0x0002
  3897. #define TPM_LEFTALIGN   0x0000
  3898. #define TPM_CENTERALIGN 0x0004
  3899. #define TPM_RIGHTALIGN  0x0008
  3900. #endif  /* WINVER >= 0x030a */
  3901.  
  3902. #endif  /* NOMENUS */
  3903.  
  3904. /* Menu messages */
  3905. #define WM_INITMENU         0x0116
  3906. #define WM_INITMENUPOPUP    0x0117
  3907.  
  3908. #ifndef NOMENUS
  3909.  
  3910. #define WM_MENUSELECT       0x011F
  3911. #define WM_MENUCHAR         0x0120
  3912.  
  3913. #endif  /* NOMENUS */
  3914.  
  3915. /* Menu and control command messages */
  3916. #define WM_COMMAND          0x0111
  3917.  
  3918. /****** Scroll bar support **************************************************/
  3919.  
  3920. #ifndef NOSCROLL
  3921.  
  3922. #define WM_HSCROLL          0x0114
  3923. #define WM_VSCROLL          0x0115
  3924.  
  3925. /* WM_H/VSCROLL commands */
  3926. #define SB_LINEUP           0
  3927. #define SB_LINELEFT         0
  3928. #define SB_LINEDOWN         1
  3929. #define SB_LINERIGHT        1
  3930. #define SB_PAGEUP           2
  3931. #define SB_PAGELEFT         2
  3932. #define SB_PAGEDOWN         3
  3933. #define SB_PAGERIGHT        3
  3934. #define SB_THUMBPOSITION    4
  3935. #define SB_THUMBTRACK       5
  3936. #define SB_TOP              6
  3937. #define SB_LEFT             6
  3938. #define SB_BOTTOM           7
  3939. #define SB_RIGHT            7
  3940. #define SB_ENDSCROLL        8
  3941.  
  3942. /* Scroll bar selection constants */
  3943. #define SB_HORZ             0
  3944. #define SB_VERT             1
  3945. #define SB_CTL              2
  3946. #define SB_BOTH             3
  3947.  
  3948. int     WINAPI SetScrollPos(HWND, int, int, BOOL);
  3949. int     WINAPI GetScrollPos(HWND, int);
  3950. void    WINAPI SetScrollRange(HWND, int, int, int, BOOL);
  3951. void    WINAPI GetScrollRange(HWND, int, int FAR*, int FAR*);
  3952. void    WINAPI ShowScrollBar(HWND, int, BOOL);
  3953. BOOL    WINAPI EnableScrollBar(HWND, int, UINT);
  3954.  
  3955. /* EnableScrollBar() flags */
  3956. #define ESB_ENABLE_BOTH     0x0000
  3957. #define ESB_DISABLE_BOTH    0x0003
  3958.  
  3959. #define ESB_DISABLE_LEFT    0x0001
  3960. #define ESB_DISABLE_RIGHT   0x0002
  3961.  
  3962. #define ESB_DISABLE_UP      0x0001
  3963. #define ESB_DISABLE_DOWN    0x0002
  3964.  
  3965. #define ESB_DISABLE_LTUP    ESB_DISABLE_LEFT
  3966. #define ESB_DISABLE_RTDN    ESB_DISABLE_RIGHT
  3967.  
  3968. #endif  /* NOSCROLL */
  3969.  
  3970. /******* Clipboard manager **************************************************/
  3971.  
  3972. #ifndef NOCLIPBOARD
  3973.  
  3974. /* Predefined Clipboard Formats */
  3975. #define CF_TEXT              1
  3976. #define CF_BITMAP            2
  3977. #define CF_METAFILEPICT      3
  3978. #define CF_SYLK              4
  3979. #define CF_DIF               5
  3980. #define CF_TIFF              6
  3981. #define CF_OEMTEXT           7
  3982. #define CF_DIB               8
  3983. #define CF_PALETTE           9
  3984. #define CF_PENDATA          10
  3985. #define CF_RIFF             11
  3986. #define CF_WAVE             12
  3987.  
  3988. #define CF_OWNERDISPLAY     0x0080
  3989. #define CF_DSPTEXT          0x0081
  3990. #define CF_DSPBITMAP        0x0082
  3991. #define CF_DSPMETAFILEPICT  0x0083
  3992.  
  3993. /* "Private" formats don't get GlobalFree()'d */
  3994. #define CF_PRIVATEFIRST     0x0200
  3995. #define CF_PRIVATELAST      0x02FF
  3996.  
  3997. /* "GDIOBJ" formats do get DeleteObject()'d */
  3998. #define CF_GDIOBJFIRST      0x0300
  3999. #define CF_GDIOBJLAST       0x03FF
  4000.  
  4001. /* Clipboard Manager Functions */
  4002. BOOL    WINAPI OpenClipboard(HWND);
  4003. BOOL    WINAPI CloseClipboard(void);
  4004. BOOL    WINAPI EmptyClipboard(void);
  4005.  
  4006. #if (WINVER >= 0x030a)
  4007. HWND    WINAPI GetOpenClipboardWindow(void);
  4008. #endif  /* WINVER >= 0x030a */
  4009.  
  4010. HWND    WINAPI GetClipboardOwner(void);
  4011.  
  4012. HWND    WINAPI SetClipboardViewer(HWND);
  4013. HWND    WINAPI GetClipboardViewer(void);
  4014.  
  4015. HANDLE  WINAPI SetClipboardData(UINT, HANDLE);
  4016. HANDLE  WINAPI GetClipboardData(UINT);
  4017.  
  4018. BOOL    WINAPI IsClipboardFormatAvailable(UINT);
  4019. int     WINAPI GetPriorityClipboardFormat(UINT FAR*, int);
  4020.  
  4021. UINT    WINAPI RegisterClipboardFormat(LPCSTR);
  4022. int     WINAPI CountClipboardFormats(void);
  4023. UINT    WINAPI EnumClipboardFormats(UINT);
  4024. int     WINAPI GetClipboardFormatName(UINT, LPSTR, int);
  4025.  
  4026. BOOL    WINAPI ChangeClipboardChain(HWND, HWND);
  4027.  
  4028. /* Clipboard command messages */
  4029. #define WM_CUT              0x0300
  4030. #define WM_COPY             0x0301
  4031. #define WM_PASTE            0x0302
  4032. #define WM_CLEAR            0x0303
  4033. #define WM_UNDO             0x0304
  4034.  
  4035. /* Clipboard owner messages */
  4036. #define WM_RENDERFORMAT     0x0305
  4037. #define WM_RENDERALLFORMATS 0x0306
  4038. #define WM_DESTROYCLIPBOARD 0x0307
  4039.  
  4040. /* Clipboard viewer messages */
  4041. #define WM_DRAWCLIPBOARD    0x0308
  4042. #define WM_PAINTCLIPBOARD   0x0309
  4043. #define WM_SIZECLIPBOARD    0x030B
  4044. #define WM_VSCROLLCLIPBOARD 0x030A
  4045. #define WM_HSCROLLCLIPBOARD 0x030E
  4046. #define WM_ASKCBFORMATNAME  0x030C
  4047. #define WM_CHANGECBCHAIN    0x030D
  4048.  
  4049. #endif  /* NOCLIPBOARD */
  4050.  
  4051. /****** Mouse cursor support *************************************************/
  4052.  
  4053. HCURSOR WINAPI LoadCursor(HINSTANCE, LPCSTR);
  4054. HCURSOR WINAPI CreateCursor(HINSTANCE, int, int, int, int, const void FAR*, const void FAR*);
  4055. BOOL    WINAPI DestroyCursor(HCURSOR);
  4056.  
  4057. #if (WINVER >= 0x030a)
  4058. HCURSOR WINAPI CopyCursor(HINSTANCE, HCURSOR);
  4059. #endif  /* WINVER >= 0x030a */
  4060.  
  4061. int     WINAPI ShowCursor(BOOL);
  4062.  
  4063. void    WINAPI SetCursorPos(int, int);
  4064. void    WINAPI GetCursorPos(POINT FAR*);
  4065.  
  4066. HCURSOR WINAPI SetCursor(HCURSOR);
  4067.  
  4068. #if (WINVER >= 0x030a)
  4069. HCURSOR WINAPI GetCursor(void);
  4070. #endif  /* WINVER >= 0x030a */
  4071.  
  4072. void    WINAPI ClipCursor(const RECT FAR*);
  4073. #if (WINVER >= 0x030a)
  4074. void    WINAPI GetClipCursor(RECT FAR*);
  4075. #endif  /* WINVER >= 0x030a */
  4076.  
  4077. /* Standard cursor resource IDs */
  4078. #define IDC_ARROW           MAKEINTRESOURCE(32512)
  4079. #define IDC_IBEAM           MAKEINTRESOURCE(32513)
  4080. #define IDC_WAIT            MAKEINTRESOURCE(32514)
  4081. #define IDC_CROSS           MAKEINTRESOURCE(32515)
  4082. #define IDC_UPARROW         MAKEINTRESOURCE(32516)
  4083. #define IDC_SIZE            MAKEINTRESOURCE(32640)
  4084. #define IDC_ICON            MAKEINTRESOURCE(32641)
  4085. #define IDC_SIZENWSE        MAKEINTRESOURCE(32642)
  4086. #define IDC_SIZENESW        MAKEINTRESOURCE(32643)
  4087. #define IDC_SIZEWE          MAKEINTRESOURCE(32644)
  4088. #define IDC_SIZENS          MAKEINTRESOURCE(32645)
  4089.  
  4090. #define WM_SETCURSOR        0x0020
  4091.  
  4092. /****** Icon support *********************************************************/
  4093.  
  4094. HICON   WINAPI LoadIcon(HINSTANCE, LPCSTR);
  4095. HICON   WINAPI CreateIcon(HINSTANCE, int, int, BYTE, BYTE, const void FAR*, const void FAR*);
  4096. BOOL    WINAPI DestroyIcon(HICON);
  4097.  
  4098. #if (WINVER >= 0x030a)
  4099. HICON   WINAPI CopyIcon(HINSTANCE, HICON);
  4100. #endif  /* WINVER >= 0x030a */
  4101.  
  4102. BOOL    WINAPI DrawIcon(HDC, int, int, HICON);
  4103.  
  4104. #ifndef NOICONS
  4105.  
  4106. /* Standard icon resource IDs */
  4107. #define IDI_APPLICATION     MAKEINTRESOURCE(32512)
  4108. #define IDI_HAND            MAKEINTRESOURCE(32513)
  4109. #define IDI_QUESTION        MAKEINTRESOURCE(32514)
  4110. #define IDI_EXCLAMATION     MAKEINTRESOURCE(32515)
  4111. #define IDI_ASTERISK        MAKEINTRESOURCE(32516)
  4112.  
  4113. #endif  /* NOICONS */
  4114.  
  4115. /****** Message Box support *************************************************/
  4116.  
  4117. #ifndef NOMB
  4118.  
  4119. int     WINAPI MessageBox(HWND, LPCSTR, LPCSTR, UINT);
  4120. void    WINAPI MessageBeep(UINT);
  4121.  
  4122. #define MB_OK               0x0000
  4123. #define MB_OKCANCEL         0x0001
  4124. #define MB_ABORTRETRYIGNORE 0x0002
  4125. #define MB_YESNOCANCEL      0x0003
  4126. #define MB_YESNO            0x0004
  4127. #define MB_RETRYCANCEL      0x0005
  4128. #define MB_TYPEMASK         0x000F
  4129.  
  4130. #define MB_ICONHAND         0x0010
  4131. #define MB_ICONQUESTION     0x0020
  4132. #define MB_ICONEXCLAMATION  0x0030
  4133. #define MB_ICONASTERISK     0x0040
  4134. #define MB_ICONMASK         0x00F0
  4135.  
  4136. #define MB_ICONINFORMATION  MB_ICONASTERISK
  4137. #define MB_ICONSTOP         MB_ICONHAND
  4138.  
  4139. #define MB_DEFBUTTON1       0x0000
  4140. #define MB_DEFBUTTON2       0x0100
  4141. #define MB_DEFBUTTON3       0x0200
  4142. #define MB_DEFMASK          0x0F00
  4143.  
  4144. #define MB_APPLMODAL        0x0000
  4145. #define MB_SYSTEMMODAL      0x1000
  4146. #define MB_TASKMODAL        0x2000
  4147.  
  4148. #define MB_NOFOCUS          0x8000
  4149.  
  4150.  
  4151.  
  4152. #endif  /* NOMB */
  4153.  
  4154. /****** Caret support ********************************************************/
  4155.  
  4156. void    WINAPI CreateCaret(HWND, HBITMAP, int, int);
  4157. void    WINAPI DestroyCaret(void);
  4158.  
  4159. void    WINAPI SetCaretPos(int, int);
  4160. void    WINAPI GetCaretPos(POINT FAR*);
  4161.  
  4162. void    WINAPI HideCaret(HWND);
  4163. void    WINAPI ShowCaret(HWND);
  4164.  
  4165. UINT    WINAPI GetCaretBlinkTime(void);
  4166. void    WINAPI SetCaretBlinkTime(UINT);
  4167.  
  4168. /****** WM_SYSCOMMAND support ***********************************************/
  4169.  
  4170. #define WM_SYSCOMMAND   0x0112
  4171.  
  4172. #ifndef NOSYSCOMMANDS
  4173.  
  4174. /* System Menu Command Values */
  4175. #define SC_SIZE         0xF000
  4176. #define SC_MOVE         0xF010
  4177. #define SC_MINIMIZE     0xF020
  4178. #define SC_MAXIMIZE     0xF030
  4179. #define SC_NEXTWINDOW   0xF040
  4180. #define SC_PREVWINDOW   0xF050
  4181. #define SC_CLOSE        0xF060
  4182. #define SC_VSCROLL      0xF070
  4183. #define SC_HSCROLL      0xF080
  4184. #define SC_MOUSEMENU    0xF090
  4185. #define SC_KEYMENU      0xF100
  4186. #define SC_ARRANGE      0xF110
  4187. #define SC_RESTORE      0xF120
  4188. #define SC_TASKLIST     0xF130
  4189. #define SC_SCREENSAVE   0xF140
  4190. #define SC_HOTKEY       0xF150
  4191.  
  4192. /* Obsolete names */
  4193. #define SC_ICON         SC_MINIMIZE
  4194. #define SC_ZOOM         SC_MAXIMIZE
  4195.  
  4196.  
  4197. #endif  /* NOSYSCOMMANDS */
  4198.  
  4199. /****** MDI Support *********************************************************/
  4200.  
  4201. #ifndef NOMDI
  4202.  
  4203. /* CreateWindow lpParams structure for creating MDI client */
  4204. typedef struct tagCLIENTCREATESTRUCT
  4205. {
  4206.     HMENU  hWindowMenu;
  4207.     UINT   idFirstChild;
  4208. } CLIENTCREATESTRUCT;
  4209. typedef CLIENTCREATESTRUCT FAR* LPCLIENTCREATESTRUCT;
  4210.  
  4211. /* MDI client style bits */
  4212. #if (WINVER >= 0x030a)
  4213. #define MDIS_ALLCHILDSTYLES 0x0001
  4214. #endif  /* WINVER >= 0x030a */
  4215.  
  4216. /* MDI messages */
  4217. #define WM_MDICREATE        0x0220
  4218. #define WM_MDIDESTROY       0x0221
  4219. #define WM_MDIACTIVATE      0x0222
  4220. #define WM_MDIRESTORE       0x0223
  4221. #define WM_MDINEXT          0x0224
  4222. #define WM_MDIMAXIMIZE      0x0225
  4223. #define WM_MDITILE          0x0226
  4224. #define WM_MDICASCADE       0x0227
  4225. #define WM_MDIICONARRANGE   0x0228
  4226. #define WM_MDIGETACTIVE     0x0229
  4227. #define WM_MDISETMENU       0x0230
  4228.  
  4229. /* WM_MDICREATE message structure */
  4230. typedef struct tagMDICREATESTRUCT
  4231. {
  4232.     LPCSTR  szClass;
  4233.     LPCSTR  szTitle;
  4234.     HINSTANCE hOwner;
  4235.     int     x;
  4236.     int     y;
  4237.     int     cx;
  4238.     int     cy;
  4239.     DWORD   style;
  4240.     LPARAM  lParam;
  4241. } MDICREATESTRUCT;
  4242. typedef MDICREATESTRUCT FAR*  LPMDICREATESTRUCT;
  4243.  
  4244. #if (WINVER >= 0x030a)
  4245. /* wParam values for WM_MDITILE and WM_MDICASCADE messages. */
  4246. #define MDITILE_VERTICAL        0x0000
  4247. #define MDITILE_HORIZONTAL      0x0001
  4248. #define MDITILE_SKIPDISABLED    0x0002
  4249. #endif  /* WINVER >= 0x030a */
  4250.  
  4251. #define WM_CHILDACTIVATE    0x0022
  4252.  
  4253. LRESULT WINAPI DefFrameProc(HWND, HWND, UINT, WPARAM, LPARAM);
  4254. LRESULT WINAPI DefMDIChildProc(HWND, UINT, WPARAM, LPARAM);
  4255.  
  4256. #ifndef NOMSG
  4257. BOOL    WINAPI TranslateMDISysAccel(HWND, MSG FAR*);
  4258. #endif
  4259.  
  4260. UINT    WINAPI ArrangeIconicWindows(HWND);
  4261.  
  4262. #endif  /* NOMDI */
  4263.  
  4264. /****** Dialog and Control Management ***************************************/
  4265.  
  4266. #ifndef NOCTLMGR
  4267.  
  4268. /* Dialog window class */
  4269. #define WC_DIALOG       (MAKEINTATOM(0x8002))
  4270.  
  4271. /* cbWndExtra bytes needed by dialog manager for dialog classes */
  4272. #define DLGWINDOWEXTRA  30
  4273.  
  4274. /* Dialog styles */
  4275. #define DS_ABSALIGN         0x01L
  4276. #define DS_SYSMODAL         0x02L
  4277. #define DS_LOCALEDIT        0x20L
  4278. #define DS_SETFONT          0x40L
  4279. #define DS_MODALFRAME       0x80L
  4280. #define DS_NOIDLEMSG        0x100L
  4281.  
  4282. /* Dialog messages */
  4283. #define DM_GETDEFID         (WM_USER+0)
  4284. #define DM_SETDEFID         (WM_USER+1)
  4285.  
  4286. /* Returned in HIWORD() of DM_GETDEFID result if msg is supported */
  4287. #define DC_HASDEFID         0x534B
  4288.  
  4289. #endif  /* NOCTLMGR */
  4290.  
  4291. /* Dialog notification messages */
  4292. #define WM_INITDIALOG       0x0110
  4293. #define WM_NEXTDLGCTL       0x0028
  4294.  
  4295. #define WM_PARENTNOTIFY     0x0210
  4296.  
  4297. #define WM_ENTERIDLE        0x0121
  4298.  
  4299.  
  4300. #ifndef NOCTLMGR
  4301.  
  4302. #ifdef STRICT
  4303. typedef BOOL (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
  4304. #else
  4305. typedef FARPROC DLGPROC;
  4306. #endif
  4307.  
  4308. /* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
  4309. #define DWL_MSGRESULT   0
  4310. #define DWL_DLGPROC     4
  4311. #define DWL_USER        8
  4312.  
  4313. #ifndef NOMSG
  4314. BOOL    WINAPI IsDialogMessage(HWND, MSG FAR*);
  4315. #endif
  4316.  
  4317. LRESULT WINAPI DefDlgProc(HWND, UINT, WPARAM, LPARAM);
  4318.  
  4319. HWND    WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC);
  4320. HWND    WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC);
  4321. HWND    WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  4322. HWND    WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM);
  4323.  
  4324. int     WINAPI DialogBox(HINSTANCE, LPCSTR, HWND, DLGPROC);
  4325. int     WINAPI DialogBoxIndirect(HINSTANCE, HGLOBAL, HWND, DLGPROC);
  4326. int     WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  4327. int     WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM);
  4328.  
  4329. void    WINAPI EndDialog(HWND, int);
  4330.  
  4331. int     WINAPI GetDlgCtrlID(HWND);
  4332. HWND    WINAPI GetDlgItem(HWND, int);
  4333. LRESULT WINAPI SendDlgItemMessage(HWND, int, UINT, WPARAM, LPARAM);
  4334.  
  4335. void    WINAPI SetDlgItemInt(HWND, int, UINT, BOOL);
  4336. UINT    WINAPI GetDlgItemInt(HWND, int, BOOL FAR* , BOOL);
  4337.  
  4338. void    WINAPI SetDlgItemText(HWND, int, LPCSTR);
  4339. int     WINAPI GetDlgItemText(HWND, int, LPSTR, int);
  4340.  
  4341. void    WINAPI CheckDlgButton(HWND, int, UINT);
  4342. void    WINAPI CheckRadioButton(HWND, int, int, int);
  4343. UINT    WINAPI IsDlgButtonChecked(HWND, int);
  4344.  
  4345. HWND    WINAPI GetNextDlgGroupItem(HWND, HWND, BOOL);
  4346. HWND    WINAPI GetNextDlgTabItem(HWND, HWND, BOOL);
  4347.  
  4348. void    WINAPI MapDialogRect(HWND, RECT FAR*);
  4349. DWORD   WINAPI GetDialogBaseUnits(void);
  4350.  
  4351. #define WM_GETDLGCODE       0x0087
  4352.  
  4353. /* dialog codes */
  4354. #define DLGC_WANTARROWS     0x0001
  4355. #define DLGC_WANTTAB        0x0002
  4356. #define DLGC_WANTALLKEYS    0x0004
  4357. #define DLGC_WANTMESSAGE    0x0004
  4358. #define DLGC_HASSETSEL      0x0008
  4359. #define DLGC_DEFPUSHBUTTON  0x0010
  4360. #define DLGC_UNDEFPUSHBUTTON 0x0020
  4361. #define DLGC_RADIOBUTTON    0x0040
  4362. #define DLGC_WANTCHARS      0x0080
  4363. #define DLGC_STATIC         0x0100
  4364. #define DLGC_BUTTON         0x2000
  4365.  
  4366. #define WM_CTLCOLOR         0x0019
  4367.  
  4368. /* WM_CTLCOLOR control IDs */
  4369. #define CTLCOLOR_MSGBOX     0
  4370. #define CTLCOLOR_EDIT       1
  4371. #define CTLCOLOR_LISTBOX    2
  4372. #define CTLCOLOR_BTN        3
  4373. #define CTLCOLOR_DLG        4
  4374. #define CTLCOLOR_SCROLLBAR  5
  4375. #define CTLCOLOR_STATIC     6
  4376.  
  4377. #define WM_SETFONT          0x0030
  4378. #define WM_GETFONT          0x0031
  4379.  
  4380. #endif  /* NOCTLMGR */
  4381.  
  4382. /* Standard dialog button IDs */
  4383. #define IDOK                1
  4384. #define IDCANCEL            2
  4385. #define IDABORT             3
  4386. #define IDRETRY             4
  4387. #define IDIGNORE            5
  4388. #define IDYES               6
  4389. #define IDNO                7
  4390.  
  4391. /****** Owner draw control support ******************************************/
  4392.  
  4393. /* Owner draw control types */
  4394. #define ODT_MENU        1
  4395. #define ODT_LISTBOX     2
  4396. #define ODT_COMBOBOX    3
  4397. #define ODT_BUTTON      4
  4398.  
  4399. /* Owner draw actions */
  4400. #define ODA_DRAWENTIRE  0x0001
  4401. #define ODA_SELECT      0x0002
  4402. #define ODA_FOCUS       0x0004
  4403.  
  4404. /* Owner draw state */
  4405. #define ODS_SELECTED    0x0001
  4406. #define ODS_GRAYED      0x0002
  4407. #define ODS_DISABLED    0x0004
  4408. #define ODS_CHECKED     0x0008
  4409. #define ODS_FOCUS       0x0010
  4410.  
  4411. #define WM_DRAWITEM         0x002B
  4412.  
  4413. typedef struct tagDRAWITEMSTRUCT
  4414. {
  4415.     UINT        CtlType;
  4416.     UINT        CtlID;
  4417.     UINT        itemID;
  4418.     UINT        itemAction;
  4419.     UINT        itemState;
  4420.     HWND        hwndItem;
  4421.     HDC         hDC;
  4422.     RECT        rcItem;
  4423.     DWORD       itemData;
  4424. } DRAWITEMSTRUCT;
  4425. typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
  4426. typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
  4427.  
  4428. #define WM_MEASUREITEM      0x002C
  4429.  
  4430. typedef struct tagMEASUREITEMSTRUCT
  4431. {
  4432.     UINT        CtlType;
  4433.     UINT        CtlID;
  4434.     UINT        itemID;
  4435.     UINT        itemWidth;
  4436.     UINT        itemHeight;
  4437.     DWORD       itemData;
  4438. } MEASUREITEMSTRUCT;
  4439. typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
  4440. typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
  4441.  
  4442. #define WM_DELETEITEM       0x002D
  4443.  
  4444. typedef struct tagDELETEITEMSTRUCT
  4445. {
  4446.     UINT       CtlType;
  4447.     UINT       CtlID;
  4448.     UINT       itemID;
  4449.     HWND       hwndItem;
  4450.     DWORD      itemData;
  4451. } DELETEITEMSTRUCT;
  4452. typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
  4453. typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
  4454.  
  4455. #define WM_COMPAREITEM      0x0039
  4456.  
  4457. typedef struct tagCOMPAREITEMSTRUCT
  4458. {
  4459.     UINT        CtlType;
  4460.     UINT        CtlID;
  4461.     HWND        hwndItem;
  4462.     UINT        itemID1;
  4463.     DWORD       itemData1;
  4464.     UINT        itemID2;
  4465.     DWORD       itemData2;
  4466. } COMPAREITEMSTRUCT;
  4467. typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
  4468. typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
  4469.  
  4470. /****** Static control ******************************************************/
  4471.  
  4472. #ifndef NOCTLMGR
  4473.  
  4474. /* Static Control Styles */
  4475. #define SS_LEFT             0x00000000L
  4476. #define SS_CENTER           0x00000001L
  4477. #define SS_RIGHT            0x00000002L
  4478. #define SS_ICON             0x00000003L
  4479. #define SS_BLACKRECT        0x00000004L
  4480. #define SS_GRAYRECT         0x00000005L
  4481. #define SS_WHITERECT        0x00000006L
  4482. #define SS_BLACKFRAME       0x00000007L
  4483. #define SS_GRAYFRAME        0x00000008L
  4484. #define SS_WHITEFRAME       0x00000009L
  4485. #define SS_SIMPLE           0x0000000BL
  4486. #define SS_LEFTNOWORDWRAP   0x0000000CL
  4487. #define SS_NOPREFIX         0x00000080L
  4488.  
  4489. #if (WINVER >= 0x030a)
  4490. #ifndef NOWINMESSAGES
  4491. /* Static Control Mesages */
  4492. #define STM_SETICON         (WM_USER+0)
  4493. #define STM_GETICON         (WM_USER+1)
  4494. #endif  /* NOWINMESSAGES */
  4495. #endif  /* WINVER >= 0x030a */
  4496.  
  4497. #endif  /* NOCTLMGR */
  4498.  
  4499. /****** Button control *****************************************************/
  4500.  
  4501. #ifndef NOCTLMGR
  4502.  
  4503. /* Button Control Styles */
  4504. #define BS_PUSHBUTTON       0x00000000L
  4505. #define BS_DEFPUSHBUTTON    0x00000001L
  4506. #define BS_CHECKBOX         0x00000002L
  4507. #define BS_AUTOCHECKBOX     0x00000003L
  4508. #define BS_RADIOBUTTON      0x00000004L
  4509. #define BS_3STATE           0x00000005L
  4510. #define BS_AUTO3STATE       0x00000006L
  4511. #define BS_GROUPBOX         0x00000007L
  4512. #define BS_USERBUTTON       0x00000008L
  4513. #define BS_AUTORADIOBUTTON  0x00000009L
  4514. #define BS_OWNERDRAW        0x0000000BL
  4515. #define BS_LEFTTEXT         0x00000020L
  4516.  
  4517. /* Button Control Messages  */
  4518. #define BM_GETCHECK         (WM_USER+0)
  4519. #define BM_SETCHECK         (WM_USER+1)
  4520. #define BM_GETSTATE         (WM_USER+2)
  4521. #define BM_SETSTATE         (WM_USER+3)
  4522. #define BM_SETSTYLE         (WM_USER+4)
  4523.  
  4524. /* User Button Notification Codes */
  4525. #define BN_CLICKED          0
  4526. #define BN_PAINT            1
  4527. #define BN_HILITE           2
  4528. #define BN_UNHILITE         3
  4529. #define BN_DISABLE          4
  4530. #define BN_DOUBLECLICKED    5
  4531.  
  4532. #endif  /* NOCTLMGR */
  4533.  
  4534. /****** Edit control *******************************************************/
  4535.  
  4536. #ifndef NOCTLMGR
  4537.  
  4538. /* Edit control styles */
  4539. #ifndef NOWINSTYLES
  4540. #define ES_LEFT             0x00000000L
  4541. #define ES_CENTER           0x00000001L
  4542. #define ES_RIGHT            0x00000002L
  4543. #define ES_MULTILINE        0x00000004L
  4544. #define ES_UPPERCASE        0x00000008L
  4545. #define ES_LOWERCASE        0x00000010L
  4546. #define ES_PASSWORD         0x00000020L
  4547. #define ES_AUTOVSCROLL      0x00000040L
  4548. #define ES_AUTOHSCROLL      0x00000080L
  4549. #define ES_NOHIDESEL        0x00000100L
  4550. #define ES_OEMCONVERT       0x00000400L
  4551. #if (WINVER >= 0x030a)
  4552. #define ES_READONLY         0x00000800L
  4553. #define ES_WANTRETURN       0x00001000L
  4554. #endif  /* WINVER >= 0x030a */
  4555. #endif  /* NOWINSTYLES */
  4556.  
  4557. /* Edit control messages */
  4558. #ifndef NOWINMESSAGES
  4559. #define EM_GETSEL               (WM_USER+0)
  4560. #define EM_SETSEL               (WM_USER+1)
  4561. #define EM_GETRECT              (WM_USER+2)
  4562. #define EM_SETRECT              (WM_USER+3)
  4563. #define EM_SETRECTNP            (WM_USER+4)
  4564. #define EM_LINESCROLL           (WM_USER+6)
  4565. #define EM_GETMODIFY            (WM_USER+8)
  4566. #define EM_SETMODIFY            (WM_USER+9)
  4567. #define EM_GETLINECOUNT         (WM_USER+10)
  4568. #define EM_LINEINDEX            (WM_USER+11)
  4569. #define EM_SETHANDLE            (WM_USER+12)
  4570. #define EM_GETHANDLE            (WM_USER+13)
  4571. #define EM_LINELENGTH           (WM_USER+17)
  4572. #define EM_REPLACESEL           (WM_USER+18)
  4573. #define EM_SETFONT              (WM_USER+19)    /* NOT IMPLEMENTED: use WM_SETFONT */
  4574. #define EM_GETLINE              (WM_USER+20)
  4575. #define EM_LIMITTEXT            (WM_USER+21)
  4576. #define EM_CANUNDO              (WM_USER+22)
  4577. #define EM_UNDO                 (WM_USER+23)
  4578. #define EM_FMTLINES             (WM_USER+24)
  4579. #define EM_LINEFROMCHAR         (WM_USER+25)
  4580. #define EM_SETWORDBREAK         (WM_USER+26)    /* NOT IMPLEMENTED: use EM_SETWORDBREAK */
  4581. #define EM_SETTABSTOPS          (WM_USER+27)
  4582. #define EM_SETPASSWORDCHAR      (WM_USER+28)
  4583. #define EM_EMPTYUNDOBUFFER      (WM_USER+29)
  4584. #if (WINVER >= 0x030a)
  4585. #define EM_GETFIRSTVISIBLELINE  (WM_USER+30)
  4586. #define EM_SETREADONLY          (WM_USER+31)
  4587. #define EM_SETWORDBREAKPROC     (WM_USER+32)
  4588. #define EM_GETWORDBREAKPROC     (WM_USER+33)
  4589. #define EM_GETPASSWORDCHAR      (WM_USER+34)
  4590. #endif  /* WINVER >= 0x030a */
  4591. #endif  /* NOWINMESSAGES */
  4592.  
  4593. #if (WINVER >= 0x030a)
  4594. typedef int   (CALLBACK* EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch, int code);
  4595.  
  4596. /* EDITWORDBREAKPROC code values */
  4597. #define WB_LEFT            0
  4598. #define WB_RIGHT           1
  4599. #define WB_ISDELIMITER     2
  4600. #endif  /* WINVER >= 0x030a */
  4601.  
  4602. /* Edit control notification codes */
  4603. #define EN_SETFOCUS         0x0100
  4604. #define EN_KILLFOCUS        0x0200
  4605. #define EN_CHANGE           0x0300
  4606. #define EN_UPDATE           0x0400
  4607. #define EN_ERRSPACE         0x0500
  4608. #define EN_MAXTEXT          0x0501
  4609. #define EN_HSCROLL          0x0601
  4610. #define EN_VSCROLL          0x0602
  4611.  
  4612. #endif  /* NOCTLMGR */
  4613.  
  4614. /****** Scroll bar control *************************************************/
  4615. /* Also see scrolling support */
  4616.  
  4617. #ifndef NOCTLMGR
  4618.  
  4619. #ifndef NOWINSTYLES
  4620.  
  4621. /* Scroll bar styles */
  4622. #define SBS_HORZ                    0x0000L
  4623. #define SBS_VERT                    0x0001L
  4624. #define SBS_TOPALIGN                0x0002L
  4625. #define SBS_LEFTALIGN               0x0002L
  4626. #define SBS_BOTTOMALIGN             0x0004L
  4627. #define SBS_RIGHTALIGN              0x0004L
  4628. #define SBS_SIZEBOXTOPLEFTALIGN     0x0002L
  4629. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  4630. #define SBS_SIZEBOX                 0x0008L
  4631.  
  4632. #endif  /* NOWINSTYLES */
  4633.  
  4634. #endif  /* NOCTLMGR */
  4635.  
  4636. /****** Listbox control ****************************************************/
  4637.  
  4638. #ifndef NOCTLMGR
  4639.  
  4640. /* Listbox styles */
  4641. #ifndef NOWINSTYLES
  4642. #define LBS_NOTIFY            0x0001L
  4643. #define LBS_SORT              0x0002L
  4644. #define LBS_NOREDRAW          0x0004L
  4645. #define LBS_MULTIPLESEL       0x0008L
  4646. #define LBS_OWNERDRAWFIXED    0x0010L
  4647. #define LBS_OWNERDRAWVARIABLE 0x0020L
  4648. #define LBS_HASSTRINGS        0x0040L
  4649. #define LBS_USETABSTOPS       0x0080L
  4650. #define LBS_NOINTEGRALHEIGHT  0x0100L
  4651. #define LBS_MULTICOLUMN       0x0200L
  4652. #define LBS_WANTKEYBOARDINPUT 0x0400L
  4653. #define LBS_EXTENDEDSEL       0x0800L
  4654. #if (WINVER >= 0x030a)
  4655. #define LBS_DISABLENOSCROLL   0x1000L
  4656. #endif  /* WINVER >= 0x030a */
  4657. #define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  4658. #endif  /* NOWINSTYLES */
  4659.  
  4660. /* Listbox messages */
  4661. #ifndef NOWINMESSAGES
  4662. #define LB_ADDSTRING           (WM_USER+1)
  4663. #define LB_INSERTSTRING        (WM_USER+2)
  4664. #define LB_DELETESTRING        (WM_USER+3)
  4665. #define LB_RESETCONTENT        (WM_USER+5)
  4666. #define LB_SETSEL              (WM_USER+6)
  4667. #define LB_SETCURSEL           (WM_USER+7)
  4668. #define LB_GETSEL              (WM_USER+8)
  4669. #define LB_GETCURSEL           (WM_USER+9)
  4670. #define LB_GETTEXT             (WM_USER+10)
  4671. #define LB_GETTEXTLEN          (WM_USER+11)
  4672. #define LB_GETCOUNT            (WM_USER+12)
  4673. #define LB_SELECTSTRING        (WM_USER+13)
  4674. #define LB_DIR                 (WM_USER+14)
  4675. #define LB_GETTOPINDEX         (WM_USER+15)
  4676. #define LB_FINDSTRING          (WM_USER+16)
  4677. #define LB_GETSELCOUNT         (WM_USER+17)
  4678. #define LB_GETSELITEMS         (WM_USER+18)
  4679. #define LB_SETTABSTOPS         (WM_USER+19)
  4680. #define LB_GETHORIZONTALEXTENT (WM_USER+20)
  4681. #define LB_SETHORIZONTALEXTENT (WM_USER+21)
  4682. #define LB_SETCOLUMNWIDTH      (WM_USER+22)
  4683. #define LB_SETTOPINDEX         (WM_USER+24)
  4684. #define LB_GETITEMRECT         (WM_USER+25)
  4685. #define LB_GETITEMDATA         (WM_USER+26)
  4686. #define LB_SETITEMDATA         (WM_USER+27)
  4687. #define LB_SELITEMRANGE        (WM_USER+28)
  4688. #define LB_SETCARETINDEX       (WM_USER+31)
  4689. #define LB_GETCARETINDEX       (WM_USER+32)
  4690.  
  4691. #if (WINVER >= 0x030a)
  4692. #define LB_SETITEMHEIGHT       (WM_USER+33)
  4693. #define LB_GETITEMHEIGHT       (WM_USER+34)
  4694. #define LB_FINDSTRINGEXACT     (WM_USER+35)
  4695. #endif  /* WINVER >= 0x030a */
  4696.  
  4697. #endif  /* NOWINMESSAGES */
  4698.  
  4699. /* Listbox notification codes */
  4700. #define LBN_ERRSPACE        (-2)
  4701. #define LBN_SELCHANGE       1
  4702. #define LBN_DBLCLK          2
  4703. #define LBN_SELCANCEL       3
  4704. #define LBN_SETFOCUS        4
  4705. #define LBN_KILLFOCUS       5
  4706.  
  4707. /* Listbox notification messages */
  4708. #define WM_VKEYTOITEM       0x002E
  4709. #define WM_CHARTOITEM       0x002F
  4710.  
  4711. /* Listbox message return values */
  4712. #define LB_OKAY             0
  4713. #define LB_ERR              (-1)
  4714. #define LB_ERRSPACE         (-2)
  4715.  
  4716. #define LB_CTLCODE          0L
  4717.  
  4718. /****** Dialog directory support ********************************************/
  4719.  
  4720. int     WINAPI DlgDirList(HWND, LPSTR, int, int, UINT);
  4721. BOOL    WINAPI DlgDirSelect(HWND, LPSTR, int);
  4722.  
  4723. int     WINAPI DlgDirListComboBox(HWND, LPSTR, int, int, UINT);
  4724. BOOL    WINAPI DlgDirSelectComboBox(HWND, LPSTR, int);
  4725.  
  4726. #if (WINVER >= 0x030a)
  4727. BOOL    WINAPI DlgDirSelectEx(HWND, LPSTR, int, int);
  4728. BOOL    WINAPI DlgDirSelectComboBoxEx(HWND, LPSTR, int, int);
  4729. #endif  /* WINVER >= 0x030a */
  4730.  
  4731.  
  4732. /* DlgDirList, DlgDirListComboBox flags values */
  4733. #define DDL_READWRITE       0x0000
  4734. #define DDL_READONLY        0x0001
  4735. #define DDL_HIDDEN          0x0002
  4736. #define DDL_SYSTEM          0x0004
  4737. #define DDL_DIRECTORY       0x0010
  4738. #define DDL_ARCHIVE         0x0020
  4739.  
  4740. #define DDL_POSTMSGS        0x2000
  4741. #define DDL_DRIVES          0x4000
  4742. #define DDL_EXCLUSIVE       0x8000
  4743.  
  4744. #endif  /* NOCTLMGR */
  4745.  
  4746. /****** Combo box control **************************************************/
  4747.  
  4748. #ifndef NOCTLMGR
  4749.  
  4750. /* Combo box styles */
  4751. #ifndef NOWINSTYLES
  4752. #define CBS_SIMPLE            0x0001L
  4753. #define CBS_DROPDOWN          0x0002L
  4754. #define CBS_DROPDOWNLIST      0x0003L
  4755. #define CBS_OWNERDRAWFIXED    0x0010L
  4756. #define CBS_OWNERDRAWVARIABLE 0x0020L
  4757. #define CBS_AUTOHSCROLL       0x0040L
  4758. #define CBS_OEMCONVERT        0x0080L
  4759. #define CBS_SORT              0x0100L
  4760. #define CBS_HASSTRINGS        0x0200L
  4761. #define CBS_NOINTEGRALHEIGHT  0x0400L
  4762. #if (WINVER >= 0x030a)
  4763. #define CBS_DISABLENOSCROLL   0x0800L
  4764. #endif  /* WINVER >= 0x030a */
  4765. #endif  /* NOWINSTYLES */
  4766.  
  4767. /* Combo box messages */
  4768. #ifndef NOWINMESSAGES
  4769. #define CB_GETEDITSEL            (WM_USER+0)
  4770. #define CB_LIMITTEXT             (WM_USER+1)
  4771. #define CB_SETEDITSEL            (WM_USER+2)
  4772. #define CB_ADDSTRING             (WM_USER+3)
  4773. #define CB_DELETESTRING          (WM_USER+4)
  4774. #define CB_DIR                   (WM_USER+5)
  4775. #define CB_GETCOUNT              (WM_USER+6)
  4776. #define CB_GETCURSEL             (WM_USER+7)
  4777. #define CB_GETLBTEXT             (WM_USER+8)
  4778. #define CB_GETLBTEXTLEN          (WM_USER+9)
  4779. #define CB_INSERTSTRING          (WM_USER+10)
  4780. #define CB_RESETCONTENT          (WM_USER+11)
  4781. #define CB_FINDSTRING            (WM_USER+12)
  4782. #define CB_SELECTSTRING          (WM_USER+13)
  4783. #define CB_SETCURSEL             (WM_USER+14)
  4784. #define CB_SHOWDROPDOWN          (WM_USER+15)
  4785. #define CB_GETITEMDATA           (WM_USER+16)
  4786. #define CB_SETITEMDATA           (WM_USER+17)
  4787. #if (WINVER >= 0x030a)
  4788. #define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
  4789. #define CB_SETITEMHEIGHT         (WM_USER+19)
  4790. #define CB_GETITEMHEIGHT         (WM_USER+20)
  4791. #define CB_SETEXTENDEDUI         (WM_USER+21)
  4792. #define CB_GETEXTENDEDUI         (WM_USER+22)
  4793. #define CB_GETDROPPEDSTATE       (WM_USER+23)
  4794. #define CB_FINDSTRINGEXACT       (WM_USER+24)
  4795. #endif  /* WINVER >= 0x030a */
  4796.  
  4797. #endif  /* NOWINMESSAGES */
  4798.  
  4799. /* Combo box notification codes */
  4800. #define CBN_ERRSPACE        (-1)
  4801. #define CBN_SELCHANGE       1
  4802. #define CBN_DBLCLK          2
  4803. #define CBN_SETFOCUS        3
  4804. #define CBN_KILLFOCUS       4
  4805. #define CBN_EDITCHANGE      5
  4806. #define CBN_EDITUPDATE      6
  4807. #define CBN_DROPDOWN        7
  4808. #if (WINVER >= 0x030a)
  4809. #define CBN_CLOSEUP         8
  4810. #define CBN_SELENDOK        9
  4811. #define CBN_SELENDCANCEL    10
  4812. #endif  /* WINVER >= 0x030a */
  4813.  
  4814. /* Combo box message return values */
  4815. #define CB_OKAY             0
  4816. #define CB_ERR              (-1)
  4817. #define CB_ERRSPACE         (-2)
  4818.  
  4819. #endif  /* NOCTLMGR */
  4820.  
  4821. /******* Windows hook support **********************************************/
  4822.  
  4823. #ifndef NOWH
  4824.  
  4825. DECLARE_HANDLE32(HHOOK);
  4826.  
  4827. #ifdef STRICT
  4828. typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
  4829. #else
  4830. typedef FARPROC HOOKPROC;
  4831. #endif
  4832.  
  4833. #ifdef STRICT
  4834. HHOOK   WINAPI SetWindowsHook(int, HOOKPROC);
  4835. LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HHOOK FAR*);
  4836. #else
  4837. HOOKPROC WINAPI SetWindowsHook(int, HOOKPROC);
  4838. LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HOOKPROC FAR*);
  4839. #endif
  4840. BOOL    WINAPI UnhookWindowsHook(int, HOOKPROC);
  4841.  
  4842. #if (WINVER >= 0x030a)
  4843.  
  4844. HHOOK   WINAPI SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hInstance, HTASK hTask);
  4845. BOOL    WINAPI UnhookWindowsHookEx(HHOOK hHook);
  4846. LRESULT WINAPI CallNextHookEx(HHOOK hHook, int code, WPARAM wParam, LPARAM lParam);
  4847.  
  4848. #endif  /* WINVER >= 0x030a */
  4849.  
  4850.  
  4851. /* Standard hook code */
  4852. #define HC_ACTION           0
  4853.  
  4854. /* Obsolete hook codes (NO LONGER SUPPORTED) */
  4855. #define HC_GETLPLPFN        (-3)
  4856. #define HC_LPLPFNNEXT       (-2)
  4857. #define HC_LPFNNEXT         (-1)
  4858.  
  4859. #endif  /* NOWH */
  4860.  
  4861. /****** Computer-based-training (CBT) support *******************************/
  4862.  
  4863. #define WM_QUEUESYNC        0x0023
  4864.  
  4865. #ifndef NOWH
  4866.  
  4867. /* SetWindowsHook() code */
  4868. #define WH_CBT              5
  4869.  
  4870. #define HCBT_MOVESIZE       0
  4871. #define HCBT_MINMAX         1
  4872. #define HCBT_QS             2
  4873. #define HCBT_CREATEWND      3
  4874. #define HCBT_DESTROYWND     4
  4875. #define HCBT_ACTIVATE       5
  4876. #define HCBT_CLICKSKIPPED   6
  4877. #define HCBT_KEYSKIPPED     7
  4878. #define HCBT_SYSCOMMAND     8
  4879. #define HCBT_SETFOCUS       9
  4880.  
  4881. #if (WINVER >= 0x030a)
  4882. /* HCBT_CREATEWND parameters pointed to by lParam */
  4883. typedef struct tagCBT_CREATEWND
  4884. {
  4885.     CREATESTRUCT FAR* lpcs;
  4886.     HWND    hwndInsertAfter;
  4887. } CBT_CREATEWND;
  4888. typedef CBT_CREATEWND FAR* LPCBT_CREATEWND;
  4889.  
  4890. /* HCBT_ACTIVATE structure pointed to by lParam */
  4891. typedef struct tagCBTACTIVATESTRUCT
  4892. {
  4893.     BOOL    fMouse;
  4894.     HWND    hWndActive;
  4895. } CBTACTIVATESTRUCT;
  4896.  
  4897. #endif  /* WINVER >= 0x030a */
  4898. #endif  /* NOWH */
  4899.  
  4900. /****** Hardware hook support ***********************************************/
  4901.  
  4902. #ifndef NOWH
  4903. #if (WINVER >= 0x030a)
  4904. #define WH_HARDWARE         8
  4905.  
  4906. typedef struct tagHARDWAREHOOKSTRUCT
  4907. {
  4908.     HWND    hWnd;
  4909.     UINT    wMessage;
  4910.     WPARAM  wParam;
  4911.     LPARAM  lParam;
  4912. } HARDWAREHOOKSTRUCT;
  4913. #endif  /* WINVER >= 0x030a */
  4914. #endif  /* NOWH */
  4915.  
  4916. /****** Shell support *******************************************************/
  4917.  
  4918. #ifndef NOWH
  4919. #if (WINVER >= 0x030a)
  4920. /* SetWindowsHook() Shell hook code */
  4921. #define WH_SHELL           10
  4922.  
  4923. #define HSHELL_WINDOWCREATED       1
  4924. #define HSHELL_WINDOWDESTROYED     2
  4925. #define HSHELL_ACTIVATESHELLWINDOW 3
  4926.  
  4927. #endif  /* WINVER >= 0x030a */
  4928. #endif  /* NOWH */
  4929.  
  4930. /****** Journalling support *************************************************/
  4931.  
  4932. #ifndef NOWH
  4933. #define WH_JOURNALRECORD    0
  4934. #define WH_JOURNALPLAYBACK  1
  4935.  
  4936. /* Journalling hook codes */
  4937. #define HC_GETNEXT          1
  4938. #define HC_SKIP             2
  4939. #define HC_NOREMOVE         3
  4940. #define HC_NOREM            HC_NOREMOVE
  4941. #define HC_SYSMODALON       4
  4942. #define HC_SYSMODALOFF      5
  4943.  
  4944. /* Journalling message structure */
  4945. typedef struct tagEVENTMSG
  4946. {
  4947.     UINT    message;
  4948.     UINT    paramL;
  4949.     UINT    paramH;
  4950.     DWORD   time;
  4951. } EVENTMSG;
  4952. typedef EVENTMSG *PEVENTMSG;
  4953. typedef EVENTMSG NEAR* NPEVENTMSG;
  4954. typedef EVENTMSG FAR* LPEVENTMSG;
  4955.  
  4956. BOOL    WINAPI EnableHardwareInput(BOOL);
  4957.  
  4958. #endif  /* NOWH */
  4959.  
  4960.  
  4961. /****** Debugger support ****************************************************/
  4962.  
  4963. #if (WINVER >= 0x030a)
  4964. /* SetWindowsHook debug hook support */
  4965. #define WH_DEBUG            9
  4966.  
  4967. typedef struct tagDEBUGHOOKINFO
  4968. {
  4969.     HMODULE     hModuleHook;
  4970.     LPARAM      reserved;
  4971.     LPARAM      lParam;
  4972.     WPARAM      wParam;
  4973.     int         code;
  4974. } DEBUGHOOKINFO;
  4975. typedef DEBUGHOOKINFO FAR* LPDEBUGHOOKINFO;
  4976.  
  4977. #ifndef NOMSG
  4978. BOOL WINAPI QuerySendMessage(HANDLE h1, HANDLE h2, HANDLE h3, LPMSG lpmsg);
  4979. #endif  /* NOMSG */
  4980.  
  4981. BOOL WINAPI LockInput(HANDLE h1, HWND hwndInput, BOOL fLock);
  4982.  
  4983. LONG WINAPI GetSystemDebugState(void);
  4984. /* Flags returned by GetSystemDebugState.
  4985.  */
  4986. #define SDS_MENU        0x0001
  4987. #define SDS_SYSMODAL    0x0002
  4988. #define SDS_NOTASKQUEUE 0x0004
  4989. #define SDS_DIALOG      0x0008
  4990. #define SDS_TASKLOCKED  0x0010
  4991. #endif  /* WINVER >= 0x030a */
  4992.  
  4993. /****** Help support ********************************************************/
  4994.  
  4995. #ifndef NOHELP
  4996.  
  4997. BOOL WINAPI WinHelp(HWND hwndMain, LPCSTR lpszHelp, UINT usCommand, DWORD ulData);
  4998.  
  4999. /* WinHelp() commands */
  5000. #define HELP_CONTEXT      0x0001
  5001. #define HELP_QUIT         0x0002
  5002. #define HELP_INDEX        0x0003
  5003. #define HELP_CONTENTS     0x0003
  5004. #define HELP_HELPONHELP   0x0004
  5005. #define HELP_SETINDEX     0x0005
  5006. #define HELP_SETCONTENTS  0x0005
  5007. #define HELP_CONTEXTPOPUP 0x0008
  5008. #define HELP_FORCEFILE    0x0009
  5009. #define HELP_KEY          0x0101
  5010. #define HELP_COMMAND      0x0102
  5011. #define HELP_PARTIALKEY   0x0105
  5012. #define HELP_MULTIKEY     0x0201
  5013. #define HELP_SETWINPOS    0x0203
  5014.  
  5015. typedef struct tagMULTIKEYHELP
  5016. {
  5017.     UINT    mkSize;
  5018.     BYTE    mkKeylist;
  5019.     BYTE    szKeyphrase[1];
  5020. } MULTIKEYHELP;
  5021.  
  5022.  
  5023. typedef struct
  5024. {
  5025.     int  wStructSize;
  5026.     int  x;
  5027.     int  y;
  5028.     int  dx;
  5029.     int  dy;
  5030.     int  wMax;
  5031.     char rgchMember[2];
  5032. } HELPWININFO;
  5033. typedef HELPWININFO NEAR* PHELPWININFO;
  5034. typedef HELPWININFO FAR* LPHELPWININFO;
  5035.  
  5036. #endif  /* NOHELP */
  5037.  
  5038. /****** Sound support ******************************************************/
  5039.  
  5040. #ifndef NOSOUND
  5041.  
  5042. int     WINAPI OpenSound(void);
  5043. void    WINAPI CloseSound(void);
  5044.  
  5045. int     WINAPI StartSound(void);
  5046. int     WINAPI StopSound(void);
  5047.  
  5048. int     WINAPI SetVoiceQueueSize(int, int);
  5049. int     WINAPI SetVoiceNote(int, int, int, int);
  5050. int     WINAPI SetVoiceAccent(int, int, int, int, int);
  5051. int     WINAPI SetVoiceEnvelope(int, int, int);
  5052. int     WINAPI SetVoiceSound(int, DWORD, int);
  5053.  
  5054. int     WINAPI SetVoiceThreshold(int, int);
  5055. int FAR* WINAPI GetThresholdEvent(void);
  5056. int     WINAPI GetThresholdStatus(void);
  5057.  
  5058. int     WINAPI SetSoundNoise(int, int);
  5059.  
  5060. /* SetSoundNoise() Sources */
  5061. #define S_PERIOD512   0
  5062. #define S_PERIOD1024  1
  5063. #define S_PERIOD2048  2
  5064. #define S_PERIODVOICE 3
  5065. #define S_WHITE512    4
  5066. #define S_WHITE1024   5
  5067. #define S_WHITE2048   6
  5068. #define S_WHITEVOICE  7
  5069.  
  5070. int     WINAPI WaitSoundState(int);
  5071.  
  5072. /* WaitSoundState() constants */
  5073. #define S_QUEUEEMPTY        0
  5074. #define S_THRESHOLD         1
  5075. #define S_ALLTHRESHOLD      2
  5076.  
  5077. int     WINAPI SyncAllVoices(void);
  5078. int     WINAPI CountVoiceNotes(int);
  5079.  
  5080. /* Accent Modes */
  5081. #define S_NORMAL      0
  5082. #define S_LEGATO      1
  5083. #define S_STACCATO    2
  5084.  
  5085. /* Error return values */
  5086. #define S_SERDVNA     (-1)
  5087. #define S_SEROFM      (-2)
  5088. #define S_SERMACT     (-3)
  5089. #define S_SERQFUL     (-4)
  5090. #define S_SERBDNT     (-5)
  5091. #define S_SERDLN      (-6)
  5092. #define S_SERDCC      (-7)
  5093. #define S_SERDTP      (-8)
  5094. #define S_SERDVL      (-9)
  5095. #define S_SERDMD      (-10)
  5096. #define S_SERDSH      (-11)
  5097. #define S_SERDPT      (-12)
  5098. #define S_SERDFQ      (-13)
  5099. #define S_SERDDR      (-14)
  5100. #define S_SERDSR      (-15)
  5101. #define S_SERDST      (-16)
  5102.  
  5103. #endif  /* NOSOUND */
  5104.  
  5105. /****** Comm support ******************************************************/
  5106.  
  5107. #ifndef NOCOMM
  5108.  
  5109. #define NOPARITY            0
  5110. #define ODDPARITY           1
  5111. #define EVENPARITY          2
  5112. #define MARKPARITY          3
  5113. #define SPACEPARITY         4
  5114.  
  5115. #define ONESTOPBIT          0
  5116. #define ONE5STOPBITS        1
  5117. #define TWOSTOPBITS         2
  5118.  
  5119. #define IGNORE              0
  5120. #define INFINITE            0xFFFF
  5121.  
  5122. /* Error Flags */
  5123. #define CE_RXOVER           0x0001
  5124. #define CE_OVERRUN          0x0002
  5125. #define CE_RXPARITY         0x0004
  5126. #define CE_FRAME            0x0008
  5127. #define CE_BREAK            0x0010
  5128. #define CE_CTSTO            0x0020
  5129. #define CE_DSRTO            0x0040
  5130. #define CE_RLSDTO           0x0080
  5131. #define CE_TXFULL           0x0100
  5132. #define CE_PTO              0x0200
  5133. #define CE_IOE              0x0400
  5134. #define CE_DNS              0x0800
  5135. #define CE_OOP              0x1000
  5136. #define CE_MODE             0x8000
  5137.  
  5138. #define IE_BADID            (-1)
  5139. #define IE_OPEN             (-2)
  5140. #define IE_NOPEN            (-3)
  5141. #define IE_MEMORY           (-4)
  5142. #define IE_DEFAULT          (-5)
  5143. #define IE_HARDWARE         (-10)
  5144. #define IE_BYTESIZE         (-11)
  5145. #define IE_BAUDRATE         (-12)
  5146.  
  5147. /* Events */
  5148. #define EV_RXCHAR           0x0001
  5149. #define EV_RXFLAG           0x0002
  5150. #define EV_TXEMPTY          0x0004
  5151. #define EV_CTS              0x0008
  5152. #define EV_DSR              0x0010
  5153. #define EV_RLSD             0x0020
  5154. #define EV_BREAK            0x0040
  5155. #define EV_ERR              0x0080
  5156. #define EV_RING             0x0100
  5157. #define EV_PERR             0x0200
  5158. #define EV_CTSS             0x0400
  5159. #define EV_DSRS             0x0800
  5160. #define EV_RLSDS            0x1000
  5161. #define EV_RingTe           0x2000
  5162. #define EV_RINGTE           EV_RingTe
  5163.  
  5164. /* Escape Functions */
  5165. #define SETXOFF             1
  5166. #define SETXON              2
  5167. #define SETRTS              3
  5168. #define CLRRTS              4
  5169. #define SETDTR              5
  5170. #define CLRDTR              6
  5171. #define RESETDEV            7
  5172.  
  5173. #define LPTx                0x80
  5174.  
  5175. #if (WINVER >= 0x030a)
  5176.  
  5177. /* new escape functions */
  5178. #define GETMAXLPT           8
  5179. #define GETMAXCOM           9
  5180. #define GETBASEIRQ          10
  5181.  
  5182. /* Comm Baud Rate indices */
  5183. #define CBR_110      0xFF10
  5184. #define CBR_300      0xFF11
  5185. #define CBR_600      0xFF12
  5186. #define CBR_1200     0xFF13
  5187. #define CBR_2400     0xFF14
  5188. #define CBR_4800     0xFF15
  5189. #define CBR_9600     0xFF16
  5190. #define CBR_14400    0xFF17
  5191. #define CBR_19200    0xFF18
  5192. #define CBR_38400    0xFF1B
  5193. #define CBR_56000    0xFF1F
  5194. #define CBR_128000   0xFF23
  5195. #define CBR_256000   0xFF27
  5196.  
  5197. /* notifications passed in low word of lParam on WM_COMMNOTIFY messages */
  5198. #define CN_RECEIVE  0x0001
  5199. #define CN_TRANSMIT 0x0002
  5200. #define CN_EVENT    0x0004
  5201.  
  5202. #endif  /* WINVER >= 0x030a */
  5203.  
  5204. typedef struct tagDCB
  5205. {
  5206.     BYTE Id;
  5207.     UINT BaudRate;
  5208.     BYTE ByteSize;
  5209.     BYTE Parity;
  5210.     BYTE StopBits;
  5211.     UINT RlsTimeout;
  5212.     UINT CtsTimeout;
  5213.     UINT DsrTimeout;
  5214.  
  5215.     UINT fBinary        :1;
  5216.     UINT fRtsDisable    :1;
  5217.     UINT fParity        :1;
  5218.     UINT fOutxCtsFlow   :1;
  5219.     UINT fOutxDsrFlow   :1;
  5220.     UINT fDummy         :2;
  5221.     UINT fDtrDisable    :1;
  5222.  
  5223.     UINT fOutX          :1;
  5224.     UINT fInX           :1;
  5225.     UINT fPeChar        :1;
  5226.     UINT fNull          :1;
  5227.     UINT fChEvt         :1;
  5228.     UINT fDtrflow       :1;
  5229.     UINT fRtsflow       :1;
  5230.     UINT fDummy2        :1;
  5231.  
  5232.     char XonChar;
  5233.     char XoffChar;
  5234.     UINT XonLim;
  5235.     UINT XoffLim;
  5236.     char PeChar;
  5237.     char EofChar;
  5238.     char EvtChar;
  5239.     UINT TxDelay;
  5240. } DCB;
  5241. typedef DCB FAR* LPDCB;
  5242.  
  5243. #if (defined(STRICT) || (WINVER >= 0x030a))
  5244.  
  5245. typedef struct tagCOMSTAT
  5246. {
  5247.     BYTE status;
  5248.     UINT cbInQue;
  5249.     UINT cbOutQue;
  5250. } COMSTAT;
  5251.  
  5252. #define CSTF_CTSHOLD    0x01
  5253. #define CSTF_DSRHOLD    0x02
  5254. #define CSTF_RLSDHOLD   0x04
  5255. #define CSTF_XOFFHOLD   0x08
  5256. #define CSTF_XOFFSENT   0x10
  5257. #define CSTF_EOF        0x20
  5258. #define CSTF_TXIM       0x40
  5259.  
  5260. #else   /* (STRICT || WINVER >= 0x030a) */
  5261.  
  5262. /* NOTE: This structure declaration is not ANSI compatible! */
  5263. typedef struct tagCOMSTAT
  5264. {
  5265.     BYTE fCtsHold  :1;
  5266.     BYTE fDsrHold  :1;
  5267.     BYTE fRlsdHold :1;
  5268.     BYTE fXoffHold :1;
  5269.     BYTE fXoffSent :1;
  5270.     BYTE fEof      :1;
  5271.     BYTE fTxim     :1;
  5272.     UINT cbInQue;
  5273.     UINT cbOutQue;
  5274. } COMSTAT;
  5275.  
  5276. #endif  /* !(STRICT || WINVER >= 0x030a */
  5277.  
  5278. int     WINAPI BuildCommDCB(LPCSTR, DCB FAR*);
  5279.  
  5280. int     WINAPI OpenComm(LPCSTR, UINT, UINT);
  5281. int     WINAPI CloseComm(int);
  5282.  
  5283. int     WINAPI ReadComm(int, void FAR*, int);
  5284. int     WINAPI WriteComm(int, const void FAR*, int);
  5285. int     WINAPI UngetCommChar(int, char);
  5286. int     WINAPI FlushComm(int, int);
  5287. int     WINAPI TransmitCommChar(int, char);
  5288.  
  5289. int     WINAPI SetCommState(const DCB FAR*);
  5290. int     WINAPI GetCommState(int, DCB FAR*);
  5291. int     WINAPI GetCommError(int, COMSTAT FAR* );
  5292.  
  5293. int     WINAPI SetCommBreak(int);
  5294. int     WINAPI ClearCommBreak(int);
  5295.  
  5296. UINT FAR* WINAPI SetCommEventMask(int, UINT);
  5297. UINT    WINAPI GetCommEventMask(int, int);
  5298.  
  5299. LONG    WINAPI EscapeCommFunction(int, int);
  5300.  
  5301. #if (WINVER >= 0x030a)
  5302. BOOL    WINAPI EnableCommNotification(int, HWND, int, int);
  5303.  
  5304. #define WM_COMMNOTIFY           0x0044
  5305. #endif  /* WINVER >= 0x030a */
  5306.  
  5307. #endif  /* NOCOMM */
  5308.  
  5309. /****** String formatting support *******************************************/
  5310.  
  5311. int     WINAPI wvsprintf(LPSTR lpszOut, LPCSTR lpszFmt, const void FAR* lpParams);
  5312.  
  5313. #define wsprintf WSPRINTF
  5314. int     FAR CDECL wsprintf(LPSTR lpszOut, LPCSTR lpszFmt, ...);
  5315.  
  5316.  
  5317. /****** Driver support ******************************************************/
  5318.  
  5319. #if (WINVER >= 0x030a)
  5320.  
  5321. #ifndef NODRIVERS
  5322.  
  5323. DECLARE_HANDLE(HDRVR);
  5324.  
  5325. typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
  5326.  
  5327. /* Driver messages */
  5328. #define DRV_LOAD                0x0001
  5329. #define DRV_ENABLE              0x0002
  5330. #define DRV_OPEN                0x0003
  5331. #define DRV_CLOSE               0x0004
  5332. #define DRV_DISABLE             0x0005
  5333. #define DRV_FREE                0x0006
  5334. #define DRV_CONFIGURE           0x0007
  5335. #define DRV_QUERYCONFIGURE      0x0008
  5336. #define DRV_INSTALL             0x0009
  5337. #define DRV_REMOVE              0x000A
  5338. #define DRV_EXITSESSION         0x000B
  5339. #define DRV_EXITAPPLICATION     0x000C
  5340. #define DRV_POWER               0x000F
  5341.  
  5342. #define DRV_RESERVED            0x0800
  5343. #define DRV_USER                0x4000
  5344.  
  5345. /* LPARAM of DRV_CONFIGURE message */
  5346. typedef struct tagDRVCONFIGINFO
  5347. {
  5348.     DWORD   dwDCISize;
  5349.     LPCSTR  lpszDCISectionName;
  5350.     LPCSTR  lpszDCIAliasName;
  5351. } DRVCONFIGINFO;
  5352. typedef DRVCONFIGINFO NEAR* PDRVCONFIGINFO;
  5353. typedef DRVCONFIGINFO FAR* LPDRVCONFIGINFO;
  5354.  
  5355. /* Supported return values for DRV_CONFIGURE message */
  5356. #define DRVCNF_CANCEL           0x0000
  5357. #define DRVCNF_OK               0x0001
  5358. #define DRVCNF_RESTART          0x0002
  5359.  
  5360. /* Supported lParam1 of DRV_EXITAPPLICATION notification */
  5361. #define DRVEA_NORMALEXIT            0x0001
  5362. #define DRVEA_ABNORMALEXIT          0x0002
  5363.  
  5364. LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID, UINT message, LPARAM lParam1, LPARAM lParam2);
  5365.  
  5366. HDRVR   WINAPI OpenDriver(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
  5367. LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
  5368.  
  5369. LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
  5370.  
  5371. HINSTANCE WINAPI GetDriverModuleHandle(HDRVR hDriver);
  5372.  
  5373. HDRVR   WINAPI GetNextDriver(HDRVR, DWORD);
  5374.  
  5375. /* GetNextDriver flags */
  5376. #define GND_FIRSTINSTANCEONLY   0x00000001
  5377.  
  5378. #define GND_FORWARD             0x00000000
  5379. #define GND_REVERSE             0x00000002
  5380.  
  5381. typedef struct tagDRIVERINFOSTRUCT
  5382. {
  5383.     UINT    length;
  5384.     HDRVR   hDriver;
  5385.     HINSTANCE hModule;
  5386.     char    szAliasName[128];
  5387. } DRIVERINFOSTRUCT;
  5388. typedef DRIVERINFOSTRUCT FAR* LPDRIVERINFOSTRUCT;
  5389.  
  5390. BOOL    WINAPI GetDriverInfo(HDRVR, DRIVERINFOSTRUCT FAR*);
  5391.  
  5392. #endif  /* !NODRIVERS */
  5393. #endif  /* WINVER >= 0x030a */
  5394. #endif  /* NOUSER */
  5395.  
  5396. #else     /* defined __FLAT__ */
  5397.  
  5398.  
  5399. /*  If defined, the following flags inhibit definition
  5400.  *     of the indicated items.
  5401.  *
  5402.  *  NOGDICAPMASKS     - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
  5403.  *  NOVIRTUALKEYCODES - VK_*
  5404.  *  NOWINMESSAGES     - WM_*, EM_*, LB_*, CB_*
  5405.  *  NOWINSTYLES       - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
  5406.  *  NOSYSMETRICS      - SM_*
  5407.  *  NOMENUS           - MF_*
  5408.  *  NOICONS           - IDI_*
  5409.  *  NOKEYSTATES       - MK_*
  5410.  *  NOSYSCOMMANDS     - SC_*
  5411.  *  NORASTEROPS       - Binary and Tertiary raster ops
  5412.  *  NOSHOWWINDOW      - SW_*
  5413.  *  NOATOM            - Atom Manager routines
  5414.  *  NOCLIPBOARD       - Clipboard routines
  5415.  *  NOCOLOR           - Screen colors
  5416.  *  NOCTLMGR          - Control and Dialog routines
  5417.  *  NODRAWTEXT        - DrawText() and DT_*
  5418.  *  NOGDI             - All GDI defines and routines
  5419.  *  NOKERNEL          - All KERNEL defines and routines
  5420.  *  NOUSER            - All USER defines and routines
  5421.  *  NOMB              - MB_* and MessageBox()
  5422.  *  NOMEMMGR          - GMEM_*, LMEM_*, GHND, LHND, associated routines
  5423.  *  NOMETAFILE        - typedef METAFILEPICT
  5424.  *  NOMINMAX          - Macros min(a,b) and max(a,b)
  5425.  *  NOMSG             - typedef MSG and associated routines
  5426.  *  NOOPENFILE        - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
  5427.  *  NOSCROLL          - SB_* and scrolling routines
  5428.  *  NOSOUND           - Sound driver routines
  5429.  *  NOTEXTMETRIC      - typedef TEXTMETRIC and associated routines
  5430.  *  NOWH              - SetWindowsHook and WH_*
  5431.  *  NOWINOFFSETS      - GWL_*, GCL_*, associated routines
  5432.  *  NOCOMM            - COMM driver routines
  5433.  *  NOHELP            - Help engine interface.
  5434.  *  NOPROFILER        - Profiler interface.
  5435.  *  NODEFERWINDOWPOS  - DeferWindowPos routines
  5436.  */
  5437.  
  5438. #if defined(__BORLANDC__) && defined(__WIN32__)
  5439. #  ifndef _X86_
  5440. #    define _X86_
  5441. #  endif
  5442. #  define WIN32
  5443. #endif
  5444.  
  5445. #ifdef RC_INVOKED
  5446.  
  5447. /* Turn off a bunch of stuff to ensure that RC files compile OK. */
  5448. #define NOATOM
  5449. #define NOGDI
  5450. #define NOGDICAPMASKS
  5451. #define NOMETAFILE
  5452. #define NOMINMAX
  5453. #define NOMSG
  5454. #define NOOPENFILE
  5455. #define NORASTEROPS
  5456. #define NOSCROLL
  5457. #define NOSOUND
  5458. #define NOSYSMETRICS
  5459. #define NOTEXTMETRIC
  5460. #define NOWH
  5461. #define NOCOMM
  5462. #define NOKANJI
  5463.  
  5464. #endif /* RC_INVOKED */
  5465.  
  5466. #ifndef RC_INVOKED
  5467. #include <excpt.h>
  5468. #include <stdarg.h>
  5469. #endif /* RC_INVOKED */
  5470.  
  5471. #ifdef  __cplusplus
  5472. }
  5473. #endif
  5474.  
  5475. #include <windef.h>     /* exclude windef from extern "C" wrapper */
  5476.  
  5477. #ifdef __cplusplus
  5478. extern "C" {            /* Assume C declarations for C++ */
  5479. #endif  /* __cplusplus */
  5480.  
  5481. #include <winbase.h>
  5482. #include <wingdi.h>
  5483. #include <winuser.h>
  5484. #include <winnls.h>
  5485. #include <winmm.h>
  5486. #ifndef RC_INVOKED
  5487. #pragma pack(4)
  5488. #endif  /* RC_INVOKED */
  5489. #include <wincon.h>
  5490. #ifndef RC_INVOKED
  5491. #pragma pack(1)
  5492. #endif  /* RC_INVOKED */
  5493. #include <winver.h>
  5494. #include <winreg.h>
  5495. #include <winnetwk.h>
  5496.  
  5497. #ifndef WIN32_LEAN_AND_MEAN
  5498. #include <cderr.h>
  5499. #include <dde.h>
  5500. #include <ddeml.h>
  5501. #include <dlgs.h>
  5502. #include <lzexpand.h>
  5503. #include <mmsystem.h>
  5504. #include <nb30.h>
  5505. #if defined(INC_RPC)
  5506. #include <rpc.h>
  5507. #endif // Include RPC
  5508. #include <shellapi.h>
  5509. #include <winperf.h>
  5510. #include <winsock.h>
  5511. #ifndef NOGDI
  5512. #include <commdlg.h>
  5513. #include <drivinit.h>
  5514. #include <winspool.h>
  5515. #ifndef INC_OLE2
  5516. #include <ole.h>
  5517. #else
  5518. #include <ole2.h>
  5519. #endif /* OLE2 */
  5520.  
  5521. #endif // !NOGDI
  5522. #endif /* WIN32_LEAN_AND_MEAN */
  5523.  
  5524. #ifndef NOSERVICE
  5525. #include <winsvc.h>
  5526. #endif
  5527. #ifndef RC_INVOKED
  5528. #pragma pack()
  5529. #endif  /* RC_INVOKED */
  5530.  
  5531.  
  5532. #endif  /* __FLAT__ */
  5533.  
  5534. #ifdef  __cplusplus
  5535. }
  5536. #endif
  5537.  
  5538. #ifndef RC_INVOKED
  5539. #pragma option -a.      /* Revert to default packing */
  5540. #endif  /* RC_INVOKED */
  5541.  
  5542. #endif  /* __WINDOWS_H */
  5543.  
  5544.