Leaked source code of windows server 2003
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.

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