Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5373 lines
143 KiB

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