home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / WINDOWS.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  165KB  |  5,633 lines

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