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.

6075 lines
184 KiB

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