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.

5941 lines
177 KiB

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