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

8870 lines
354 KiB

  1. /*****************************************************************************\
  2. * *
  3. * windows.h - Windows functions, types, and definitions *
  4. * *
  5. * Version 4.00 *
  6. * *
  7. * Copyright (c) 1985-1995, Microsoft Corp. All rights reserved. *
  8. * *
  9. *******************************************************************************
  10. *
  11. * The following symbols control inclusion of various parts of this file:
  12. *
  13. * WINVER Windows version number (0x040A). To exclude
  14. * definitions introduced in version 4.1 (or above)
  15. * #define WINVER 0x0300
  16. * 0x0310 or 0x0400 before #including <windows.h>
  17. *
  18. * #define: To prevent inclusion of:
  19. *
  20. * NOKERNEL KERNEL APIs and definitions
  21. * NOGDI GDI APIs and definitions
  22. * NOUSER USER APIs and definitions
  23. * NOSOUND Sound APIs and definitions
  24. * NOCOMM Comm driver APIs and definitions
  25. * NODRIVERS Installable driver APIs and definitions
  26. * NOIMT Installable messge thunk APIs and definitions
  27. * NOMINMAX min() and max() macros
  28. * NOLOGERROR LogError() and related definitions
  29. * NOPROFILER Profiler APIs
  30. * NOMEMMGR Local and global memory management
  31. * NOLFILEIO _l* file I/O routines
  32. * NOOPENFILE OpenFile and related definitions
  33. * NORESOURCE Resource management
  34. * NOATOM Atom management
  35. * NOLANGUAGE Character test routines
  36. * NOLSTRING lstr* string management routines
  37. * NODBCS Double-byte character set routines
  38. * NOKEYBOARDINFO Keyboard driver routines
  39. * NOGDICAPMASKS GDI device capability constants
  40. * NOCOLOR COLOR_* color values
  41. * NOGDIOBJ GDI pens, brushes, fonts
  42. * NODRAWTEXT DrawText() and related definitions
  43. * NOTEXTMETRIC TEXTMETRIC and related APIs
  44. * NOSCALABLEFONT Truetype scalable font support
  45. * NOBITMAP Bitmap support
  46. * NORASTEROPS GDI Raster operation definitions
  47. * NOMETAFILE Metafile support
  48. * NOSYSMETRICS GetSystemMetrics() and related SM_* definitions
  49. * NOSYSTEMPARAMSINFO SystemParametersInfo() and SPI_* definitions
  50. * NOMSG APIs and definitions that use MSG structure
  51. * NOWINSTYLES Window style definitions
  52. * NOWINOFFSETS Get/SetWindowWord/Long offset definitions
  53. * NOSHOWWINDOW ShowWindow and related definitions
  54. * NODEFERWINDOWPOS DeferWindowPos and related definitions
  55. * NOVIRTUALKEYCODES VK_* virtual key codes
  56. * NOKEYSTATES MK_* message key state flags
  57. * NOWH SetWindowsHook and related WH_* definitions
  58. * NOMENUS Menu APIs
  59. * NOSCROLL Scrolling APIs and scroll bar control
  60. * NOCLIPBOARD Clipboard APIs and definitions
  61. * NOICONS IDI_* icon IDs
  62. * NOMB MessageBox and related definitions
  63. * NOSYSCOMMANDS WM_SYSCOMMAND SC_* definitions
  64. * NOMDI MDI support
  65. * NOCTLMGR Control management and controls
  66. * NOWINMESSAGES WM_* window messages
  67. * NOHELP Help support
  68. *
  69. \****************************************************************************/
  70. #ifndef _INC_WINDOWS
  71. #define _INC_WINDOWS /* #defined if windows.h has been included */
  72. #ifndef RC_INVOKED
  73. #pragma pack(1) /* Assume byte packing throughout */
  74. #endif /* RC_INVOKED */
  75. #ifdef __cplusplus
  76. extern "C" { /* Assume C declarations for C++ */
  77. #endif /* __cplusplus */
  78. #ifdef NOWIN31 /* ;Internal */
  79. #define WINVER 0x0300 /* ;Internal */
  80. #endif /* ;Internal */
  81. /* ;Internal */
  82. /* If WINVER is not defined, assume version 4.0 */
  83. #ifndef WINVER
  84. #define WINVER 0x040A
  85. #endif
  86. #ifdef RC_INVOKED
  87. /* Don't include definitions that RC.EXE can't parse */
  88. #define NOATOM
  89. #define NOGDICAPMASKS
  90. #define NOMETAFILE
  91. #define NOMINMAX
  92. #define NOMSG
  93. #define NOOPENFILE
  94. #define NORASTEROPS
  95. #define NOSCROLL
  96. #define NOSOUND
  97. #define NOSYSMETRICS
  98. #define NOTEXTMETRIC
  99. #define NOWH
  100. #define NODBCS
  101. #define NOSYSTEMPARAMSINFO
  102. #define NOCOMM
  103. #define NOOEMRESOURCE
  104. #endif /* RC_INVOKED */
  105. /* Temp internal compatibility hacks */ /* ;Internal */
  106. #define NOOEMRESOURCE /* ;Internal */
  107. #ifdef OEMRESOURCE /* ;Internal */
  108. #undef NOOEMRESOURCE /* ;Internal */
  109. #endif /* ;Internal */
  110. #define NOCOMM /* ;Internal */
  111. #ifdef USECOMM /* ;Internal */
  112. #undef NOCOMM /* ;Internal */
  113. #endif /* ;Internal */
  114. /* ;Internal */
  115. /* Handle OEMRESOURCE for 3.0 compatibility */
  116. #if (WINVER < 0x030a)
  117. #define NOOEMRESOURCE
  118. #ifdef OEMRESOURCE
  119. #undef NOOEMRESOURCE
  120. #endif
  121. #endif
  122. /******* Common definitions and typedefs ***********************************/
  123. #define VOID void
  124. #define FAR _far
  125. #define NEAR _near
  126. #define PASCAL _pascal
  127. #define CDECL _cdecl
  128. #define CONST const /* ;Internal */
  129. /* ;Internal */
  130. #ifdef BUILDDLL /* ;Internal */
  131. #define WINAPI _loadds _far _pascal /* ;Internal */
  132. #define CALLBACK _loadds _far _pascal /* ;Internal */
  133. /* Note that to use the BUILDDLL version of */ /* ;Internal */
  134. /* WINCAPI, you must compile with -GD */ /* ;Internal */
  135. #define WINCAPI _export _far _cdecl /* ;Internal */
  136. #else /* ;Internal */
  137. #define WINAPI _far _pascal
  138. #define CALLBACK _far _pascal
  139. #define WINCAPI _far _cdecl
  140. #endif /* ;Internal */
  141. /* ;Internal */
  142. #define API WINAPI /* ;Internal */
  143. /****** Simple types & common helper macros *********************************/
  144. typedef int BOOL;
  145. #define FALSE 0
  146. #define TRUE 1
  147. typedef unsigned char BYTE;
  148. typedef unsigned short WORD;
  149. typedef unsigned long DWORD;
  150. typedef WORD WCHAR;
  151. typedef unsigned int UINT;
  152. #ifdef STRICT
  153. typedef signed long LONG;
  154. #else
  155. #define LONG long
  156. #endif
  157. typedef short SHORT;
  158. typedef unsigned long ULONG;
  159. #define LOBYTE(w) ((BYTE)(w))
  160. #define HIBYTE(w) ((BYTE)(((UINT)(w) >> 8) & 0xFF))
  161. #define LOWORD(l) ((WORD)(DWORD)(l))
  162. #define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
  163. #define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
  164. #ifndef NOMINMAX
  165. #ifndef max
  166. #define max(a,b) (((a) > (b)) ? (a) : (b))
  167. #endif
  168. #ifndef min
  169. #define min(a,b) (((a) < (b)) ? (a) : (b))
  170. #endif
  171. #endif /* NOMINMAX */
  172. /* Types use for passing & returning polymorphic values */
  173. typedef UINT WPARAM;
  174. typedef LONG LPARAM;
  175. typedef LONG LRESULT;
  176. #define MAKELPARAM(low, high) ((LPARAM)MAKELONG(low, high))
  177. #define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high))
  178. /****** Common pointer types ************************************************/
  179. #ifndef NULL
  180. #define NULL 0
  181. #endif
  182. typedef char NEAR* PSTR;
  183. typedef char NEAR* NPSTR;
  184. #define SZ char /* ;Internal */
  185. /* ;Internal */
  186. typedef char FAR* LPSTR;
  187. typedef const char FAR* LPCSTR;
  188. typedef BYTE NEAR* PBYTE;
  189. typedef BYTE FAR* LPBYTE;
  190. typedef const BYTE FAR* LPCBYTE;
  191. typedef WCHAR FAR * LPWSTR;
  192. typedef const WCHAR FAR* LPCWSTR;
  193. typedef int NEAR* PINT;
  194. typedef int FAR* LPINT;
  195. typedef BOOL NEAR* PBOOL;
  196. typedef BOOL FAR* LPBOOL;
  197. typedef WORD NEAR* PWORD;
  198. typedef WORD FAR* LPWORD;
  199. typedef long NEAR* PLONG;
  200. typedef long FAR* LPLONG;
  201. typedef DWORD NEAR* PDWORD;
  202. typedef DWORD FAR* LPDWORD;
  203. typedef void FAR* LPVOID;
  204. #define MAKELP(sel, off) ((void FAR*)MAKELONG((off), (sel)))
  205. #define SELECTOROF(lp) HIWORD(lp)
  206. #define OFFSETOF(lp) LOWORD(lp)
  207. #define FIELDOFFSET(type, field) ((int)(&((type NEAR*)1)->field)-1)
  208. /****** Common handle types *************************************************/
  209. #ifdef STRICT
  210. typedef const void NEAR* HANDLE;
  211. #define DECLARE_HANDLE(name) struct name##__ { int unused; }; \
  212. typedef const struct name##__ NEAR* name
  213. #define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
  214. typedef const struct name##__ FAR* name
  215. #else /* STRICT */
  216. typedef UINT HANDLE;
  217. #define DECLARE_HANDLE(name) typedef UINT name
  218. #define DECLARE_HANDLE32(name) typedef DWORD name
  219. #endif /* !STRICT */
  220. typedef HANDLE* PHANDLE;
  221. typedef HANDLE NEAR* SPHANDLE;
  222. typedef HANDLE FAR* LPHANDLE;
  223. typedef HANDLE HGLOBAL;
  224. typedef HANDLE HLOCAL;
  225. typedef HANDLE GLOBALHANDLE;
  226. typedef HANDLE LOCALHANDLE;
  227. typedef UINT ATOM;
  228. #ifdef STRICT
  229. typedef void (CALLBACK* FARPROC)(void);
  230. typedef void (NEAR PASCAL* NEARPROC)(void);
  231. #else
  232. typedef int (CALLBACK* FARPROC)();
  233. typedef int (NEAR PASCAL* NEARPROC)();
  234. #endif
  235. DECLARE_HANDLE(HSTR);
  236. /****** KERNEL typedefs, structures, and functions **************************/
  237. DECLARE_HANDLE(HINSTANCE);
  238. typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */
  239. typedef DWORD HKL;
  240. #ifndef NOKERNEL
  241. /****** Application entry point function ************************************/
  242. #ifdef STRICT
  243. int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
  244. #endif
  245. /****** System Information **************************************************/
  246. DWORD WINAPI GetVersion(void);
  247. #if (WINVER >= 0x0400)
  248. typedef struct tagOSVERSIONINFO {
  249. DWORD dwOSVersionInfoSize;
  250. DWORD dwMajorVersion;
  251. DWORD dwMinorVersion;
  252. DWORD dwBuildNumber;
  253. DWORD dwPlatformId;
  254. char szCSDVersion[128];
  255. } OSVERSIONINFO, NEAR *POSVERSIONINFO, FAR *LPOSVERSIONINFO;
  256. #define VER_PLATFORM_WIN32s 0
  257. #define VER_PLATFORM_WIN32_WINDOWS 1
  258. #define VER_PLATFORM_WIN32_NT 2
  259. BOOL WINAPI GetVersionEx(LPOSVERSIONINFO lpBuffer);
  260. UINT WINAPI GetProductName(LPSTR, UINT);
  261. #endif /* WINVER >= 0x0400 */
  262. #if (WINVER >= 0x0400)
  263. #define GFS_PHYSICALRAMSIZE 0x1793
  264. #define GFS_NEARESTMEGRAMSIZE 0x1794
  265. #endif /* WINVER >= 0x0400 */
  266. DWORD WINAPI GetFreeSpace(UINT);
  267. UINT WINAPI GetCurrentPDB(void);
  268. UINT WINAPI GetWindowsDirectory(LPSTR, UINT);
  269. UINT WINAPI GetSystemDirectory(LPSTR, UINT);
  270. #if (WINVER >= 0x030a)
  271. UINT WINAPI GetFreeSystemResources(UINT);
  272. #define GFSR_SYSTEMRESOURCES 0x0000
  273. #define GFSR_GDIRESOURCES 0x0001
  274. #define GFSR_USERRESOURCES 0x0002
  275. #define GFSR_VALID 0x0002 /* ;Internal */
  276. #endif /* WINVER >= 0x030a */
  277. DWORD WINAPI GetWinFlags(void);
  278. #define WF_PMODE 0x0001
  279. #define WF_CPU286 0x0002
  280. #define WF_CPU386 0x0004
  281. #define WF_CPU486 0x0008
  282. #define WF_STANDARD 0x0010
  283. #define WF_WIN286 0x0010
  284. #define WF_ENHANCED 0x0020
  285. #define WF_WIN386 0x0020
  286. #define WF_CPU086 0x0040
  287. #define WF_CPU186 0x0080
  288. #if (WINVER < 0x030a)
  289. #define WF_LARGEFRAME 0x0100
  290. #define WF_SMALLFRAME 0x0200
  291. #endif
  292. #define WF_80x87 0x0400
  293. #define WF_PAGING 0x0800
  294. #define WF_DOSPAGING 0x1000
  295. #define WF_HASCPUID 0x2000
  296. #define WF_WINNT 0x4000
  297. #define WF_WLO 0x8000
  298. #define WF_CPUMASK 0xFC000000
  299. #define WF_CPU_X86 0
  300. #define WF_CPU_R4000 1
  301. #define WF_CPU_ALPHA 2
  302. #define WF_CPU_CLIPPER 3
  303. LPSTR WINAPI GetDOSEnvironment(void);
  304. DWORD WINAPI GetCurrentTime(void);
  305. DWORD WINAPI GetTickCount(void);
  306. DWORD WINAPI GetTimerResolution(void);
  307. /****** Error handling ******************************************************/
  308. #if (WINVER >= 0x030a)
  309. #ifndef NOLOGERROR
  310. void WINAPI LogError(UINT err, void FAR* lpInfo);
  311. void WINAPI LogParamError(UINT err, FARPROC lpfn, void FAR* param);
  312. /****** LogParamError/LogError values */
  313. /* Error modifier bits */
  314. #define ERR_WARNING 0x8000
  315. #define ERR_PARAM 0x4000
  316. /* Internal error value masks */ /* ;Internal */
  317. #define ERR_TYPE_MASK 0x0fff /* ;Internal */
  318. #define ERR_FLAGS_MASK 0xc000 /* ;Internal */
  319. /* ;Internal */
  320. #define ERR_SIZE_MASK 0x3000
  321. #define ERR_SIZE_SHIFT 12 /* ;Internal */
  322. #define ERR_BYTE 0x1000
  323. #define ERR_WORD 0x2000
  324. #define ERR_DWORD 0x3000
  325. /* ;Internal */
  326. // Error option flags (set by [kernel] ErrorOptions win.ini variable) /* ;Internal */
  327. /* ;Internal */
  328. #define ERO_PARAM_ERROR_BREAK 0x0001 /* ;Internal */
  329. #define ERO_BUFFER_FILL 0x0002 /* ;Internal */
  330. /****** LogParamError() values */
  331. /* Generic parameter values */
  332. #define ERR_BAD_VALUE 0x6001
  333. #define ERR_BAD_FLAGS 0x6002
  334. #define ERR_BAD_INDEX 0x6003
  335. #define ERR_BAD_DVALUE 0x7004
  336. #define ERR_BAD_DFLAGS 0x7005
  337. #define ERR_BAD_DINDEX 0x7006
  338. #define ERR_BAD_PTR 0x7007
  339. #define ERR_BAD_FUNC_PTR 0x7008
  340. #define ERR_BAD_SELECTOR 0x6009
  341. #define ERR_BAD_STRING_PTR 0x700a
  342. #define ERR_BAD_HANDLE 0x600b
  343. /* KERNEL parameter errors */
  344. #define ERR_BAD_HINSTANCE 0x6020
  345. #define ERR_BAD_HMODULE 0x6021
  346. #define ERR_BAD_GLOBAL_HANDLE 0x6022
  347. #define ERR_BAD_LOCAL_HANDLE 0x6023
  348. #define ERR_BAD_ATOM 0x6024
  349. #define ERR_BAD_HFILE 0x6025
  350. /* USER parameter errors */
  351. #define ERR_BAD_HWND 0x6040
  352. #define ERR_BAD_HMENU 0x6041
  353. #define ERR_BAD_HCURSOR 0x6042
  354. #define ERR_BAD_HICON 0x6043
  355. #define ERR_BAD_HDWP 0x6044
  356. #define ERR_BAD_CID 0x6045
  357. #define ERR_BAD_HDRVR 0x6046
  358. /* GDI parameter errors */
  359. #define ERR_BAD_COORDS 0x7060
  360. #define ERR_BAD_GDI_OBJECT 0x6061
  361. #define ERR_BAD_HDC 0x6062
  362. #define ERR_BAD_HPEN 0x6063
  363. #define ERR_BAD_HFONT 0x6064
  364. #define ERR_BAD_HBRUSH 0x6065
  365. #define ERR_BAD_HBITMAP 0x6066
  366. #define ERR_BAD_HRGN 0x6067
  367. #define ERR_BAD_HPALETTE 0x6068
  368. #define ERR_BAD_HMETAFILE 0x6069
  369. #define ERR_BAD_HDCEMF 0x606A /* ;Internal */
  370. #define ERR_BAD_HEMF 0x606B /* ;Internal */
  371. /* ;Internal */
  372. /* Debug fill constants */ /* ;Internal */
  373. /* ;Internal */
  374. #define DBGFILL_ALLOC 0xfd /* ;Internal */
  375. #define DBGFILL_FREE 0xfb /* ;Internal */
  376. #define DBGFILL_BUFFER 0xf9 /* ;Internal */
  377. #define DBGFILL_STACK 0xf7 /* ;Internal */
  378. /**** LogError() values */
  379. /* KERNEL errors */
  380. #define ERR_GALLOC 0x0001
  381. #define ERR_GREALLOC 0x0002
  382. #define ERR_GLOCK 0x0003
  383. #define ERR_LALLOC 0x0004
  384. #define ERR_LREALLOC 0x0005
  385. #define ERR_LLOCK 0x0006
  386. #define ERR_ALLOCRES 0x0007
  387. #define ERR_LOCKRES 0x0008
  388. #define ERR_LOADMODULE 0x0009
  389. /* USER errors */
  390. #define ERR_CREATEDLG 0x0040
  391. #define ERR_CREATEDLG2 0x0041
  392. #define ERR_REGISTERCLASS 0x0042
  393. #define ERR_DCBUSY 0x0043
  394. #define ERR_CREATEWND 0x0044
  395. #define ERR_STRUCEXTRA 0x0045
  396. #define ERR_LOADSTR 0x0046
  397. #define ERR_LOADMENU 0x0047
  398. #define ERR_NESTEDBEGINPAINT 0x0048
  399. #define ERR_BADINDEX 0x0049
  400. #define ERR_CREATEMENU 0x004a
  401. /* GDI errors */
  402. #define ERR_CREATEDC 0x0080
  403. #define ERR_CREATEMETA 0x0081
  404. #define ERR_DELOBJSELECTED 0x0082
  405. #define ERR_SELBITMAP 0x0083
  406. /* Debugging support (DEBUG SYSTEM ONLY) */
  407. typedef struct tagWINDEBUGINFO
  408. {
  409. UINT flags;
  410. DWORD dwOptions;
  411. DWORD dwFilter;
  412. char achAllocModule[8];
  413. DWORD dwAllocBreak;
  414. DWORD dwAllocCount;
  415. #if (WINVER >= 0x0400)
  416. WORD chDefRIP;
  417. #endif /* WINVER >= 0x0400 */
  418. } WINDEBUGINFO;
  419. BOOL WINAPI GetWinDebugInfo(WINDEBUGINFO FAR* lpwdi, UINT flags);
  420. BOOL WINAPI SetWinDebugInfo(const WINDEBUGINFO FAR* lpwdi);
  421. void FAR _cdecl DebugOutput(UINT flags, LPCSTR lpsz, ...);
  422. void WINAPI DebugFillBuffer(void FAR* lpb, UINT cb); /* ;Internal */
  423. /* WINDEBUGINFO flags values */
  424. #define WDI_OPTIONS 0x0001
  425. #define WDI_FILTER 0x0002
  426. #define WDI_ALLOCBREAK 0x0004
  427. #define WDI_DEFRIP 0x0008
  428. #define WDI_VALID 0x00015 /* ;Internal */
  429. /* dwOptions values */
  430. #define DBO_CHECKHEAP 0x0001
  431. #define DBO_BUFFERFILL 0x0004
  432. #define DBO_DISABLEGPTRAPPING 0x0010
  433. #define DBO_CHECKFREE 0x0020
  434. #define DBO_SILENT 0x8000
  435. #define DBO_TRACEBREAK 0x2000
  436. #define DBO_WARNINGBREAK 0x1000
  437. #define DBO_NOERRORBREAK 0x0800
  438. #define DBO_NOFATALBREAK 0x0400
  439. #define DBO_INT3BREAK 0x0100
  440. /* DebugOutput flags values */
  441. #define DBF_TRACE 0x0000
  442. #define DBF_WARNING 0x4000
  443. #define DBF_ERROR 0x8000
  444. #define DBF_FATAL 0xc000
  445. #define DBF_SEVMASK 0xc000 /* ;Internal */
  446. #define DBF_FILTERMASK 0x3fff /* ;Internal */
  447. /* dwFilter values */
  448. #define DBF_KERNEL 0x1000
  449. #define DBF_KRN_MEMMAN 0x0001
  450. #define DBF_KRN_LOADMODULE 0x0002
  451. #define DBF_KRN_SEGMENTLOAD 0x0004
  452. #define DBF_USER 0x0800
  453. #define DBF_GDI 0x0400
  454. #define DBF_MMSYSTEM 0x0040
  455. #define DBF_PENWIN 0x0020
  456. #define DBF_APPLICATION 0x0008
  457. #define DBF_DRIVER 0x0010
  458. #endif /* NOLOGERROR */
  459. #endif /* WINVER >= 0x030a */
  460. void WINAPI FatalExit(int);
  461. void WINAPI FatalAppExit(UINT, LPCSTR);
  462. BOOL WINAPI ExitWindows(DWORD dwReturnCode, UINT wReserved);
  463. #define EW_RESTARTWINDOWS 0x42
  464. #if (WINVER >= 0x030a)
  465. #define EW_REBOOTSYSTEM 0x43
  466. #define EW_EXITANDEXECAPP 0x44 /* ;Internal */
  467. BOOL WINAPI ExitWindowsExec(LPCSTR, LPCSTR);
  468. #endif /* WINVER >= 0x030a */
  469. #define EWX_LOGOFF 0 // ;Internal 4.0
  470. #define EWX_SHUTDOWN 1 // ;Internal 4.0
  471. #define EWX_REBOOT 2 // ;Internal 4.0
  472. #define EWX_FORCE 4 // ;Internal 4.0
  473. #define EWX_POWEROFF 8 // ;Internal 4.0
  474. #define EWX_REALLYLOGOFF 0x80000000 // ;Internal 4.0
  475. #if (WINVER >= 0x0400) // ;Internal
  476. BOOL SaveDesktopState(DWORD, DWORD, DWORD); // ;Internal
  477. #define SAVEDESKTOPSTATEN_EXITWINDOWS 1 // ;Internal
  478. #define SAVEDESKTOPSTATEN_SHUTDOWN 2 // ;Internal
  479. #define SAVEDESKTOPSTATEN_SUSPEND 3 // ;Internal
  480. // ;Internal
  481. #define SAVEDESKTOPSTATEF_NOPROMPT 1 // ;Internal
  482. #endif /* WINVER >= 0x0400 */ // ;Internal
  483. // ;Internal
  484. void WINAPI DebugBreak(void);
  485. void WINAPI OutputDebugString(LPCSTR);
  486. /* SetErrorMode() constants */
  487. #define SEM_FAILCRITICALERRORS 0x0001
  488. #define SEM_NOGPFAULTERRORBOX 0x0002
  489. #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004 // ;Internal NT only
  490. #define SEM_NOOPENFILEERRORBOX 0x8000
  491. UINT WINAPI SetErrorMode(UINT);
  492. #if (WINVER >= 0x0400)
  493. void WINAPI SetLastError(DWORD);
  494. DWORD WINAPI GetLastError(void);
  495. #endif /* WINVER >= 0x0400 */
  496. /****** Pointer validation **************************************************/
  497. #if (WINVER >= 0x030a)
  498. BOOL WINAPI IsBadReadPtr(const void FAR* lp, UINT cb);
  499. BOOL WINAPI IsBadWritePtr(void FAR* lp, UINT cb);
  500. BOOL WINAPI IsBadHugeReadPtr(const void _huge* lp, DWORD cb);
  501. BOOL WINAPI IsBadHugeWritePtr(void _huge* lp, DWORD cb);
  502. BOOL WINAPI IsBadCodePtr(FARPROC lpfn);
  503. BOOL WINAPI IsBadStringPtr(const void FAR* lpsz, UINT cchMax);
  504. #endif /* WINVER >= 0x030a */
  505. /****** Profiling support ***************************************************/
  506. #ifndef NOPROFILER
  507. int WINAPI ProfInsChk(void);
  508. void WINAPI ProfSetup(int,int);
  509. void WINAPI ProfSampRate(int,int);
  510. void WINAPI ProfStart(void);
  511. void WINAPI ProfStop(void);
  512. void WINAPI ProfClear(void);
  513. void WINAPI ProfFlush(void);
  514. void WINAPI ProfFinish(void);
  515. #if (WINVER >= 0x0400)
  516. void WINAPI ProfStart32(void);
  517. void WINAPI ProfStop32(void);
  518. void WINAPI ProfClear32(void);
  519. void WINAPI ProfFlush32(void);
  520. void WINAPI ProfFinish32(void);
  521. #endif /* WINVER >= 0x0400) */
  522. #endif /* NOPROFILER */
  523. /****** Catch/Throw and stack management ************************************/
  524. typedef int CATCHBUF[9];
  525. typedef int FAR* LPCATCHBUF;
  526. int WINAPI Catch(int FAR*);
  527. void WINAPI Throw(const int FAR*, int);
  528. void WINAPI SwitchStackBack(void);
  529. void WINAPI SwitchStackTo(UINT, UINT, UINT);
  530. /****** Module Management ***************************************************/
  531. #define HINSTANCE_ERROR ((HINSTANCE)32)
  532. LONG WINAPI GetExpWinVer(HINSTANCE); /* ;Internal */
  533. /* ;Internal */
  534. HINSTANCE WINAPI LoadModule(LPCSTR, LPVOID);
  535. BOOL WINAPI FreeModule(HINSTANCE);
  536. HINSTANCE WINAPI LoadLibrary(LPCSTR);
  537. void WINAPI FreeLibrary(HINSTANCE);
  538. UINT WINAPI WinExec(LPCSTR, UINT);
  539. HMODULE WINAPI GetModuleHandle(LPCSTR);
  540. int WINAPI GetModuleUsage(HINSTANCE);
  541. int WINAPI GetModuleFileName(HINSTANCE, LPSTR, int);
  542. #if (WINVER >= 0x0400) /* ;Internal */
  543. BOOL WINAPI GetModuleName(HINSTANCE, LPSTR, int); /* ;Internal */
  544. #endif /* WINVER >= 0x0400 */ /* ;Internal */
  545. /* ;Internal */
  546. FARPROC WINAPI GetProcAddress(HINSTANCE, LPCSTR);
  547. int WINAPI GetInstanceData(HINSTANCE, BYTE NEAR *, int);
  548. HGLOBAL WINAPI GetCodeHandle(FARPROC);
  549. typedef struct tagSEGINFO
  550. {
  551. UINT offSegment;
  552. UINT cbSegment;
  553. UINT flags;
  554. UINT cbAlloc;
  555. HGLOBAL h;
  556. UINT alignShift;
  557. UINT reserved[2];
  558. } SEGINFO;
  559. typedef SEGINFO FAR* LPSEGINFO;
  560. void WINAPI GetCodeInfo(FARPROC lpProc, SEGINFO FAR* lpSegInfo);
  561. FARPROC WINAPI MakeProcInstance(FARPROC, HINSTANCE);
  562. void WINAPI FreeProcInstance(FARPROC);
  563. LONG WINAPI SetSwapAreaSize(UINT);
  564. void WINAPI SwapRecording(UINT);
  565. void WINAPI ValidateCodeSegments(void);
  566. /* Windows Exit Procedure flag values */
  567. #define WEP_SYSTEM_EXIT 1
  568. #define WEP_FREE_DLL 0
  569. /****** Task Management *****************************************************/
  570. #endif /* NOKERNEL */
  571. DECLARE_HANDLE(HTASK);
  572. #ifndef NOKERNEL
  573. UINT WINAPI GetNumTasks(void);
  574. #if (WINVER >= 0x030a)
  575. BOOL WINAPI IsTask(HTASK);
  576. #endif /* WINVER >= 0x030a */
  577. HTASK WINAPI GetCurrentTask(void);
  578. int WINAPI SetPriority(HTASK, int); /* ;Internal */
  579. void WINAPI Yield(void);
  580. void WINAPI DirectedYield(HTASK);
  581. DWORD WINAPI GetAppCompatFlags(HTASK); // ;Internal
  582. // ;Internal
  583. /* GetAppCompatFlags flag values */ // ;Internal
  584. #define GACF_IGNORENODISCARD 0x00000001 // ;Internal
  585. #define GACF_FORCETEXTBAND 0x00000002 // ;Internal
  586. #define GACF_ONELANDGRXBAND 0x00000004 // ;Internal
  587. #define GACF_DISABLEWIDEFONT 0x00000008 // ;Internal new bit for PSCRIPT
  588. #define GACF_CALLTTDEVICE 0x00000010 // ;Internal
  589. #define GACF_MULTIPLEBANDS 0x00000020 // ;Internal
  590. #define GACF_ALWAYSSENDNCPAINT 0x00000040 // ;Internal
  591. #define GACF_STUPIDPALETTEAPP 0x00000080 // ;Internal
  592. #define GACF_MOREEXTRAWNDWORDS 0x00000100 // ;Internal
  593. #define GACF_TTIGNORERASTERDUPE 0x00000200 // ;Internal
  594. #define GACF_GLOBALHOOKSONLY16 0x00000400 // ;Internal
  595. #define GACF_DELAYHWHNDSHAKECHK 0x00000800 // ;Internal
  596. #define GACF_ENUMHELVNTMSRMN 0x00001000 // ;Internal
  597. #define GACF_ENUMTTNOTDEVICE 0x00002000 // ;Internal
  598. #define GACF_SUBTRACTCLIPSIBS 0x00004000 // ;Internal
  599. #define GACF_FORCETTGRAPHICS 0x00008000 // ;Internal
  600. #define GACF_NOHRGN1 0x00010000 // ;Internal
  601. #define GACF_NCCALCSIZEONMOVE 0x00020000 // ;Internal
  602. #define GACF_SENDMENUDBLCLK 0x00040000 // ;Internal not needed anymore
  603. #define GACF_MODULESPECIFIC 0x00040000 // ;Internal replaces sendmenudblclk
  604. #define GACF_30AVGWIDTH 0x00080000 // ;Internal
  605. #define GACF_GETDEVCAPSNUMLIE 0x00100000 // ;Internal NT only
  606. /* New flags for Win 4.0. */ // ;Internal
  607. #define GACF_IGNOREDIBWIDTH 0x00100000 // ;Internal re-use GACF_DEVCAPSNUMLIE
  608. #define GACF_WINVER31 0x00200000 // ;Internal
  609. #define GACF_INCREASESTACK 0x00400000 // ;Internal
  610. #define GACF_HEAPSLACK 0x00400000 // ;Internal
  611. #define GACF_FAFORCEDRAWBG 0x00400000 // ;Internal Used in FE only
  612. #define GACF_FORCEWIN31DEVMODESIZE 0x00800000 // ;Internal (replaces PEEKMESSAGEIDLE)
  613. #define GACF_31VALIDMASK 0xFFE484AF // ;Internal
  614. #define GACF_DISABLEFONTASSOC 0x01000000 // ;Internal Used in FE only
  615. #define GACF_JAPANESCAPEMENT 0x01000000 // ;Internal Used in FE only
  616. #define GACF_IGNOREFAULTS 0x02000000 // ;Internal
  617. #define GACF_DEQUOTIFYCMDLINE 0x02000000 // ;Internal
  618. #define GACF_NOEMFSPOOLING 0x04000000 // ;Internal
  619. #define GACF_RANDOM3XUI 0x08000000 // ;Internal
  620. #define GACF_USEPRINTINGESCAPES 0x00000004 // ;Internal re-use GACF_ONELANDGRXBAND
  621. #define GACF_FORCERASTERMODE 0x00008000 // ;Internal re-use GACF_FORCETTGRAPHICS
  622. #define GACF_FORCEREGPASSTHRU 0x00008000 // ;Internal re-use GACF_FORCERASTERMODE
  623. #define GACF_DONTJOURNALATTACH 0x10000000 // ;Internal
  624. #define GACF_DISABLEDBCSPROPTT 0x20000000 // ;Internal Used in FE only
  625. #define GACF_NOBRUSHCACHE 0x20000000 // ;Internal re-use GACF_DISABLEDBCSPROPTT
  626. #define GACF_55MSSYSTEMTIMER 0x20000000 // ;Internal re-use GACF_NOBRUSHCACHE since this is just used for some games and is system wide too
  627. #define GACF_MIRRORREGFONTS 0x40000000 // ;Internal
  628. #define GACF_UNUSED3 0x80000000 // ;Internal
  629. /* Module Compatibility flag values */ // ;Internal
  630. #define MCF_FIXEDSEGLOW 0x0001 // ;Internal Win31 behaviour for FIXED segs
  631. #define MCF_MODPATCH 0x0002 // ;Internal has module patches
  632. #define MCF_NODISCARD 0x0004 // ;Internal make all segments in the module not discardable
  633. /****** Global memory management ********************************************/
  634. #ifndef NOMEMMGR
  635. /* Global Memory Flags */
  636. #define GMEM_FIXED 0x0000
  637. #define GMEM_MOVEABLE 0x0002
  638. #define GMEM_NOCOMPACT 0x0010
  639. #define GMEM_NODISCARD 0x0020
  640. #define GMEM_ZEROINIT 0x0040
  641. #define GMEM_MODIFY 0x0080
  642. #define GMEM_DISCARDABLE 0x0100
  643. #define GMEM_NOT_BANKED 0x1000
  644. #define GMEM_SHARE 0x2000
  645. #define GMEM_DDESHARE 0x2000
  646. #define GMEM_NOTIFY 0x4000
  647. #define GMEM_LOWER GMEM_NOT_BANKED
  648. #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
  649. #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
  650. #define GlobalDiscard(h) GlobalReAlloc(h, 0L, GMEM_MOVEABLE)
  651. HGLOBAL WINAPI GlobalAlloc(UINT, DWORD);
  652. HGLOBAL WINAPI GlobalReAlloc(HGLOBAL, DWORD, UINT);
  653. HGLOBAL WINAPI GlobalFree(HGLOBAL);
  654. DWORD WINAPI GlobalDosAlloc(DWORD);
  655. UINT WINAPI GlobalDosFree(UINT);
  656. #ifdef STRICT
  657. void FAR* WINAPI GlobalLock(HGLOBAL);
  658. #else
  659. char FAR* WINAPI GlobalLock(HGLOBAL);
  660. #endif
  661. BOOL WINAPI GlobalUnlock(HGLOBAL);
  662. DWORD WINAPI GlobalSize(HGLOBAL);
  663. DWORD WINAPI GlobalHandle(UINT);
  664. /* GlobalFlags return flags (in addition to GMEM_DISCARDABLE) */
  665. #define GMEM_DISCARDED 0x4000
  666. #define GMEM_LOCKCOUNT 0x00FF
  667. UINT WINAPI GlobalFlags(HGLOBAL);
  668. #ifdef STRICT
  669. void FAR* WINAPI GlobalWire(HGLOBAL);
  670. #else
  671. char FAR* WINAPI GlobalWire(HGLOBAL);
  672. #endif
  673. BOOL WINAPI GlobalUnWire(HGLOBAL);
  674. UINT WINAPI GlobalPageLock(HGLOBAL);
  675. UINT WINAPI GlobalPageUnlock(HGLOBAL);
  676. #if (WINVER >= 0x0400)
  677. UINT WINAPI GlobalSmartPageLock(HGLOBAL);
  678. UINT WINAPI GlobalSmartPageUnlock(HGLOBAL);
  679. #endif /* WINVER >= 0x0400 */
  680. void WINAPI GlobalFix(HGLOBAL);
  681. void WINAPI GlobalUnfix(HGLOBAL);
  682. HGLOBAL WINAPI GlobalLRUNewest(HGLOBAL);
  683. HGLOBAL WINAPI GlobalLRUOldest(HGLOBAL);
  684. DWORD WINAPI GlobalCompact(DWORD);
  685. #ifdef STRICT
  686. typedef BOOL (CALLBACK* GNOTIFYPROC)(HGLOBAL);
  687. #else
  688. typedef FARPROC GNOTIFYPROC;
  689. #endif
  690. void WINAPI GlobalNotify(GNOTIFYPROC);
  691. HGLOBAL WINAPI LockSegment(UINT);
  692. void WINAPI UnlockSegment(UINT);
  693. #define LockData(dummy) LockSegment((UINT)-1)
  694. #define UnlockData(dummy) UnlockSegment((UINT)-1)
  695. UINT WINAPI AllocSelector(UINT);
  696. UINT WINAPI FreeSelector(UINT);
  697. UINT WINAPI AllocDStoCSAlias(UINT);
  698. UINT WINAPI PrestoChangoSelector(UINT sourceSel, UINT destSel);
  699. DWORD WINAPI GetSelectorBase(UINT);
  700. UINT WINAPI SetSelectorBase(UINT, DWORD);
  701. DWORD WINAPI GetSelectorLimit(UINT);
  702. UINT WINAPI SetSelectorLimit(UINT, DWORD);
  703. void WINAPI LimitEmsPages(DWORD);
  704. void WINAPI ValidateFreeSpaces(void);
  705. /***** Local Memory Management */
  706. /* Local Memory Flags */
  707. #define LMEM_FIXED 0x0000
  708. #define LMEM_MOVEABLE 0x0002
  709. #define LMEM_NOCOMPACT 0x0010
  710. #define LMEM_NODISCARD 0x0020
  711. #define LMEM_ZEROINIT 0x0040
  712. #define LMEM_MODIFY 0x0080
  713. #define LMEM_DISCARDABLE 0x0F00
  714. #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
  715. #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
  716. #define NONZEROLHND (LMEM_MOVEABLE)
  717. #define NONZEROLPTR (LMEM_FIXED)
  718. extern UINT NEAR* PASCAL pLocalHeap; /* ;Internal */
  719. #define LocalFreeze(dummy) (*(pLocalHeap+1) += 1) /* ;Internal */
  720. #define LocalMelt(dummy) (*(pLocalHeap+1) -= 1) /* ;Internal */
  721. /* ;Internal */
  722. #define LocalDiscard(h) LocalReAlloc(h, 0, LMEM_MOVEABLE)
  723. HLOCAL WINAPI LocalAlloc(UINT, UINT);
  724. HLOCAL WINAPI LocalReAlloc(HLOCAL, UINT, UINT);
  725. HLOCAL WINAPI LocalFree(HLOCAL);
  726. #ifdef STRICT
  727. void NEAR* WINAPI LocalLock(HLOCAL);
  728. #else
  729. char NEAR* WINAPI LocalLock(HLOCAL);
  730. #endif
  731. BOOL WINAPI LocalUnlock(HLOCAL);
  732. UINT WINAPI LocalSize(HLOCAL);
  733. #ifdef STRICT
  734. HLOCAL WINAPI LocalHandle(void NEAR*);
  735. #else
  736. HLOCAL WINAPI LocalHandle(UINT);
  737. #endif
  738. UINT WINAPI LocalHandleDelta(UINT); /* ;Internal */
  739. /* LocalFlags return flags (in addition to LMEM_DISCARDABLE) */
  740. #define LMEM_DISCARDED 0x4000
  741. #define LMEM_LOCKCOUNT 0x00FF
  742. UINT WINAPI LocalFlags(HLOCAL);
  743. BOOL WINAPI LocalInit(UINT, UINT, UINT);
  744. UINT WINAPI LocalCompact(UINT);
  745. UINT WINAPI LocalShrink(HLOCAL, UINT);
  746. /* ;Internal */
  747. /* LocalNotify callback */ /* ;Internal */
  748. #ifdef STRICT /* ;Internal */
  749. typedef BOOL (CALLBACK* LNOTIFYPROC)(UINT, HLOCAL, void NEAR*); /* ;Internal */
  750. #else /* ;Internal */
  751. typedef FARPROC LNOTIFYPROC; /* ;Internal */
  752. #endif /* ;Internal */
  753. /* ;Internal */
  754. #define LNOTIFY_OUTOFMEM 0 /* ;Internal */
  755. #define LNOTIFY_MOVE 1 /* ;Internal */
  756. #define LNOTIFY_DISCARD 2 /* ;Internal */
  757. /* ;Internal */
  758. LNOTIFYPROC WINAPI LocalNotify(LNOTIFYPROC); /* ;Internal */
  759. /* ;Internal */
  760. #endif /* NOMEMMGR */
  761. /****** File I/O ************************************************************/
  762. #ifndef NOLFILEIO
  763. typedef int HFILE; /* Polymorphic with C runtime file handle type */
  764. #define HFILE_ERROR ((HFILE)-1)
  765. #ifndef NOOPENFILE
  766. /* OpenFile() Structure */
  767. typedef struct tagOFSTRUCT
  768. {
  769. BYTE cBytes;
  770. BYTE fFixedDisk;
  771. UINT nErrCode;
  772. BYTE reserved[4];
  773. char szPathName[128];
  774. } OFSTRUCT;
  775. typedef OFSTRUCT* POFSTRUCT;
  776. typedef OFSTRUCT NEAR* NPOFSTRUCT;
  777. typedef OFSTRUCT FAR* LPOFSTRUCT;
  778. #if (WINVER >= 0x0400)
  779. /* OpenFileEx() Structure */
  780. typedef struct tagOFSTRUCTEX
  781. {
  782. WORD nBytes;
  783. BYTE fFixedDisk;
  784. UINT nErrCode;
  785. BYTE reserved[4];
  786. char szPathName[260];
  787. } OFSTRUCTEX;
  788. typedef OFSTRUCTEX* POFSTRUCTEX;
  789. typedef OFSTRUCTEX NEAR* NPOFSTRUCTEX;
  790. typedef OFSTRUCTEX FAR* LPOFSTRUCTEX;
  791. #endif /* WINVER >= 0x0400 */
  792. /* OpenFile() Flags */
  793. #define OF_READ 0x0000
  794. #define OF_WRITE 0x0001
  795. #define OF_READWRITE 0x0002
  796. #define OF_SHARE_COMPAT 0x0000
  797. #define OF_SHARE_EXCLUSIVE 0x0010
  798. #define OF_SHARE_DENY_WRITE 0x0020
  799. #define OF_SHARE_DENY_READ 0x0030
  800. #define OF_SHARE_DENY_NONE 0x0040
  801. #define OF_PARSE 0x0100
  802. #define OF_DELETE 0x0200
  803. #define OF_VERIFY 0x0400 /* Used with OF_REOPEN */
  804. #define OF_SEARCH 0x0400 /* Used without OF_REOPEN */
  805. #define OF_CANCEL 0x0800
  806. #define OF_CREATE 0x1000
  807. #define OF_PROMPT 0x2000
  808. #define OF_EXIST 0x4000
  809. #define OF_REOPEN 0x8000
  810. HFILE WINAPI OpenFile(LPCSTR, OFSTRUCT FAR*, UINT);
  811. #if (WINVER >= 0x0400)
  812. HFILE WINAPI OpenFileEx(LPCSTR, OFSTRUCTEX FAR*, UINT);
  813. #endif /* WINVER >= 0x0400 */
  814. #endif /* NOOPENFILE */
  815. /* _lopen() flags */
  816. #define READ 0
  817. #define WRITE 1
  818. #define READ_WRITE 2
  819. HFILE WINAPI _lopen(LPCSTR, int);
  820. HFILE WINAPI _lcreat(LPCSTR, int);
  821. HFILE WINAPI _lclose(HFILE);
  822. LONG WINAPI _llseek(HFILE, LONG, int);
  823. /* _llseek origin values */
  824. #define SEEK_SET 0
  825. #define SEEK_CUR 1
  826. #define SEEK_END 2
  827. UINT WINAPI _lread(HFILE, void _huge*, UINT);
  828. UINT WINAPI _lwrite(HFILE, const void _huge*, UINT);
  829. #if (WINVER >= 0x030a)
  830. long WINAPI _hread(HFILE, void _huge*, long);
  831. long WINAPI _hwrite(HFILE, const void _huge*, long);
  832. #endif /* WINVER >= 0x030a */
  833. UINT WINAPI DeletePathname(LPCSTR); /* ;Internal */
  834. /* ;Internal */
  835. #endif /* NOLFILEIO */
  836. #if (WINVER >= 0x0400)
  837. DWORD WINAPI GetCurrentDirectory(DWORD, LPSTR);
  838. BOOL WINAPI SetCurrentDirectory(LPCSTR);
  839. #define MAX_PATH 260
  840. #define _FILETIME_
  841. typedef struct _FILETIME {
  842. DWORD dwLowDateTime;
  843. DWORD dwHighDateTime;
  844. } FILETIME, NEAR *PFILETIME, FAR *LPFILETIME;
  845. typedef struct _WIN32_FIND_DATA {
  846. DWORD dwFileAttributes;
  847. FILETIME ftCreationTime;
  848. FILETIME ftLastAccessTime;
  849. FILETIME ftLastWriteTime;
  850. DWORD nFileSizeHigh;
  851. DWORD nFileSizeLow;
  852. DWORD dwReserved0;
  853. DWORD dwReserved1;
  854. char cFileName[ MAX_PATH ];
  855. char cAlternateFileName[ 14 ];
  856. } WIN32_FIND_DATA, NEAR *PWIN32_FIND_DATA, FAR *LPWIN32_FIND_DATA;
  857. #define FILE_ATTRIBUTE_READONLY 0x00000001
  858. #define FILE_ATTRIBUTE_HIDDEN 0x00000002
  859. #define FILE_ATTRIBUTE_SYSTEM 0x00000004
  860. #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  861. #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
  862. #define FILE_ATTRIBUTE_NORMAL 0x00000080
  863. #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
  864. #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200
  865. #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400
  866. DECLARE_HANDLE32(HFINDFILE);
  867. #define INVALID_HFINDFILE ((HFINDFILE)-1)
  868. HFINDFILE WINAPI FindFirstFile(LPCSTR, LPWIN32_FIND_DATA);
  869. BOOL WINAPI FindNextFile(HFINDFILE, LPWIN32_FIND_DATA);
  870. BOOL WINAPI FindClose(HFINDFILE);
  871. DWORD WINAPI GetFileAttributes(LPCSTR);
  872. BOOL WINAPI SetFileAttributes(LPCSTR, DWORD);
  873. BOOL WINAPI GetDiskFreeSpace(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
  874. BOOL WINAPI CreateDirectory(LPCSTR, LPVOID);
  875. BOOL WINAPI RemoveDirectory(LPCSTR);
  876. BOOL WINAPI DeleteFile(LPCSTR);
  877. #endif /* WINVER >= 0x0400 */
  878. /* GetTempFileName() Flags */
  879. #define TF_FORCEDRIVE (BYTE)0x80
  880. int WINAPI GetTempFileName(BYTE, LPCSTR, UINT, LPSTR);
  881. BYTE WINAPI GetTempDrive(char);
  882. /* GetDriveType return values */
  883. #define DRIVE_REMOVABLE 2
  884. #define DRIVE_FIXED 3
  885. #define DRIVE_REMOTE 4
  886. UINT WINAPI GetDriveType(int);
  887. UINT WINAPI SetHandleCount(UINT);
  888. /****** Network support *****************************************************/
  889. UINT WINAPI WNetAddConnection(LPSTR, LPSTR, LPSTR);
  890. UINT WINAPI WNetGetConnection(LPSTR, LPSTR, UINT FAR*);
  891. UINT WINAPI WNetCancelConnection(LPSTR, BOOL);
  892. /* Errors */
  893. #define WN_SUCCESS 0x0000
  894. #define WN_NOT_SUPPORTED 0x0001
  895. #define WN_NET_ERROR 0x0002
  896. #define WN_MORE_DATA 0x0003
  897. #define WN_BAD_POINTER 0x0004
  898. #define WN_BAD_VALUE 0x0005
  899. #define WN_BAD_PASSWORD 0x0006
  900. #define WN_ACCESS_DENIED 0x0007
  901. #define WN_FUNCTION_BUSY 0x0008
  902. #define WN_WINDOWS_ERROR 0x0009
  903. #define WN_BAD_USER 0x000A
  904. #define WN_OUT_OF_MEMORY 0x000B
  905. #define WN_CANCEL 0x000C
  906. #define WN_CONTINUE 0x000D
  907. /* Connection errors */
  908. #define WN_NOT_CONNECTED 0x0030
  909. #define WN_OPEN_FILES 0x0031
  910. #define WN_BAD_NETNAME 0x0032
  911. #define WN_BAD_LOCALNAME 0x0033
  912. #define WN_ALREADY_CONNECTED 0x0034
  913. #define WN_DEVICE_ERROR 0x0035
  914. #define WN_CONNECTION_CLOSED 0x0036
  915. /****** Resource Management *************************************************/
  916. DECLARE_HANDLE(HRSRC);
  917. HRSRC WINAPI FindResource(HINSTANCE, LPCSTR, LPCSTR);
  918. HGLOBAL WINAPI LoadResource(HINSTANCE, HRSRC);
  919. BOOL WINAPI FreeResource(HGLOBAL);
  920. #ifdef STRICT
  921. void FAR* WINAPI LockResource(HGLOBAL);
  922. #else
  923. char FAR* WINAPI LockResource(HGLOBAL);
  924. #endif
  925. #define UnlockResource(h) GlobalUnlock(h)
  926. DWORD WINAPI SizeofResource(HINSTANCE, HRSRC);
  927. int WINAPI AccessResource(HINSTANCE, HRSRC);
  928. HGLOBAL WINAPI AllocResource(HINSTANCE, HRSRC, DWORD);
  929. #ifdef STRICT
  930. typedef HGLOBAL (CALLBACK* RSRCHDLRPROC)(HGLOBAL, HINSTANCE, HRSRC);
  931. #else
  932. typedef FARPROC RSRCHDLRPROC;
  933. #endif
  934. RSRCHDLRPROC WINAPI SetResourceHandler(HINSTANCE, LPCSTR, RSRCHDLRPROC);
  935. #define MAKEINTRESOURCE(i) ((LPCSTR)MAKELP(0, (i)))
  936. #ifndef NORESOURCE
  937. /* Predefined Resource Types */
  938. #define RT_CURSOR MAKEINTRESOURCE(1)
  939. #define RT_BITMAP MAKEINTRESOURCE(2)
  940. #define RT_ICON MAKEINTRESOURCE(3)
  941. #define RT_MENU MAKEINTRESOURCE(4)
  942. #define RT_DIALOG MAKEINTRESOURCE(5)
  943. #define RT_STRING MAKEINTRESOURCE(6)
  944. #define RT_FONTDIR MAKEINTRESOURCE(7)
  945. #define RT_FONT MAKEINTRESOURCE(8)
  946. #define RT_ACCELERATOR MAKEINTRESOURCE(9)
  947. #define RT_RCDATA MAKEINTRESOURCE(10)
  948. #define RT_MESSAGETABLE MAKEINTRESOURCE(11) // reserved: NT ;Internal
  949. #define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
  950. #define RT_MENUEX MAKEINTRESOURCE(13) // RT_MENU subtype ;Internal
  951. #define RT_GROUP_ICON MAKEINTRESOURCE(14)
  952. #define RT_NAMETABLE MAKEINTRESOURCE(15) // removed in 3.1 ;Internal
  953. #define RT_VERSION MAKEINTRESOURCE(16) // reserved: NT ;Internal
  954. #define RT_DLGINCLUDE MAKEINTRESOURCE(17) // reserved: NT ;Internal
  955. #define RT_DIALOGEX MAKEINTRESOURCE(18) // RT_DIALOG subtype ;Internal
  956. #define RT_PLUGPLAY MAKEINTRESOURCE(19)
  957. #define RT_VXD MAKEINTRESOURCE(20)
  958. #define RT_LAST MAKEINTRESOURCE(20) // ;Internal
  959. #define RT_AFXFIRST MAKEINTRESOURCE(0xF0) // reserved: AFX ;Internal
  960. #define RT_AFXLAST MAKEINTRESOURCE(0xFF) // reserved: AFX ;Internal
  961. #endif /* NORESOURCE */
  962. #ifdef OEMRESOURCE
  963. /* OEM Resource Ordinal Numbers */
  964. #define OBM_CLOSE 32754
  965. #define OBM_UPARROW 32753
  966. #define OBM_DNARROW 32752
  967. #define OBM_RGARROW 32751
  968. #define OBM_LFARROW 32750
  969. #define OBM_REDUCE 32749
  970. #define OBM_ZOOM 32748
  971. #define OBM_RESTORE 32747
  972. #define OBM_REDUCED 32746
  973. #define OBM_ZOOMD 32745
  974. #define OBM_RESTORED 32744
  975. #define OBM_UPARROWD 32743
  976. #define OBM_DNARROWD 32742
  977. #define OBM_RGARROWD 32741
  978. #define OBM_LFARROWD 32740
  979. #define OBM_MNARROW 32739
  980. #define OBM_COMBO 32738
  981. #if (WINVER >= 0x030a)
  982. #define OBM_UPARROWI 32737
  983. #define OBM_DNARROWI 32736
  984. #define OBM_RGARROWI 32735
  985. #define OBM_LFARROWI 32734
  986. #endif /* WINVER >= 0x030a */
  987. #define OBM_OLD_CLOSE 32767
  988. #define OBM_SIZE 32766
  989. #define OBM_OLD_UPARROW 32765
  990. #define OBM_OLD_DNARROW 32764
  991. #define OBM_OLD_RGARROW 32763
  992. #define OBM_OLD_LFARROW 32762
  993. #define OBM_BTSIZE 32761
  994. #define OBM_CHECK 32760
  995. #define OBM_CHECKBOXES 32759
  996. #define OBM_BTNCORNERS 32758
  997. #define OBM_OLD_REDUCE 32757
  998. #define OBM_OLD_ZOOM 32756
  999. #define OBM_OLD_RESTORE 32755
  1000. #define OCR_NORMAL 32512
  1001. #define OCR_IBEAM 32513
  1002. #define OCR_WAIT 32514
  1003. #define OCR_CROSS 32515
  1004. #define OCR_UP 32516
  1005. #define OCR_NWPEN 32631 // ;Internal 4.0
  1006. #define OCR_SIZE 32640 /* OBSOLETE; use OCR_SIZEALL */
  1007. #define OCR_ICON 32641 /* OBSOLETE; use OCR_NORMAL */
  1008. #define OCR_SIZENWSE 32642
  1009. #define OCR_SIZENESW 32643
  1010. #define OCR_SIZEWE 32644
  1011. #define OCR_SIZENS 32645
  1012. #define OCR_SIZEALL 32646
  1013. #define OCR_ICOCUR 32647 /* OBSOLETE; use OIC_WINLOGO */
  1014. #define OCR_NO 32648
  1015. #define OCR_APPSTARTING 32650 // ;Internal NT 4.0
  1016. #if (WINVER >= 0x0400)
  1017. #define OCR_HELP 32651 // ;Internal 4.0
  1018. #endif /* WINVER >= 0x400 */
  1019. /* Default IDs to get original image from User */ // ;Internal
  1020. #define OCR_CONFIGURABLE_FIRST 100 // ;Internal
  1021. #define OCR_ARROW_DEFAULT 100 // ;Internal
  1022. #define OCR_IBEAM_DEFAULT 101 // ;Internal
  1023. #define OCR_WAIT_DEFAULT 102 // ;Internal
  1024. #define OCR_CROSS_DEFAULT 103 // ;Internal
  1025. #define OCR_UPARROW_DEFAULT 104 // ;Internal
  1026. #define OCR_SIZENWSE_DEFAULT 105 // ;Internal
  1027. #define OCR_SIZENESW_DEFAULT 106 // ;Internal
  1028. #define OCR_SIZEWE_DEFAULT 107 // ;Internal
  1029. #define OCR_SIZENS_DEFAULT 108 // ;Internal
  1030. #define OCR_SIZEALL_DEFAULT 109 // ;Internal
  1031. #define OCR_NO_DEFAULT 110 // ;Internal
  1032. #define OCR_APPSTARTING_DEFAULT 111 // ;Internal
  1033. #define OCR_HELP_DEFAULT 112 // ;Internal
  1034. #define OCR_NWPEN_DEFAULT 113 // ;Internal
  1035. #define OCR_ICON_DEFAULT 114 // ;Internal
  1036. #define OCR_CONFIGURABLE_LAST OCR_ICON_DEFAULT // ;Internal
  1037. #define COCR_CONFIGURABLE (OCR_CONFIGURABLE_LAST-OCR_CONFIGURABLE_FIRST+1) // ;Internal
  1038. #define OIC_SAMPLE 32512
  1039. #define OIC_ERROR 32513
  1040. #define OIC_QUES 32514
  1041. #define OIC_WARNING 32515
  1042. #define OIC_INFORMATION 32516
  1043. #define OIC_WINLOGO 32517 // ;Internal NT
  1044. #define OIC_HAND OIC_ERROR
  1045. #define OIC_BANG OIC_WARNING
  1046. #define OIC_NOTE OIC_INFORMATION
  1047. /* Default IDs to get original image from User */ // ;Internal
  1048. #define OIC_CONFIGURABLE_FIRST 100 // ;Internal
  1049. #define OIC_APPLICATION_DEFAULT 100 // ;Internal
  1050. #define OIC_WARNING_DEFAULT 101 // ;Internal
  1051. #define OIC_QUESTION_DEFAULT 102 // ;Internal
  1052. #define OIC_ERROR_DEFAULT 103 // ;Internal
  1053. #define OIC_INFORMATION_DEFAULT 104 // ;Internal
  1054. #define OIC_WINLOGO_DEFAULT 105 // ;Internal
  1055. #define OIC_CONFIGURABLE_LAST OIC_WINLOGO_DEFAULT // ;Internal
  1056. #define COIC_CONFIGURABLE (OIC_CONFIGURABLE_LAST-OIC_CONFIGURABLE_FIRST+1) // ;Internal
  1057. #endif /* OEMRESOURCE */
  1058. /****** Atom Management *****************************************************/
  1059. #define MAKEINTATOM(i) ((LPCSTR)MAKELP(0, (i)))
  1060. #ifndef NOATOM
  1061. BOOL WINAPI InitAtomTable(int);
  1062. ATOM WINAPI AddAtom(LPCSTR);
  1063. ATOM WINAPI DeleteAtom(ATOM);
  1064. ATOM WINAPI FindAtom(LPCSTR);
  1065. UINT WINAPI GetAtomName(ATOM, LPSTR, int);
  1066. ATOM WINAPI GlobalAddAtom(LPCSTR);
  1067. ATOM WINAPI GlobalDeleteAtom(ATOM);
  1068. ATOM WINAPI GlobalFindAtom(LPCSTR);
  1069. UINT WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
  1070. HLOCAL WINAPI GetAtomHandle(ATOM);
  1071. #endif /* NOATOM */
  1072. /****** WIN.INI Support *****************************************************/
  1073. /* User Profile Routines */
  1074. UINT WINAPI GetProfileInt(LPCSTR, LPCSTR, int);
  1075. int WINAPI GetProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int);
  1076. BOOL WINAPI WriteProfileString(LPCSTR, LPCSTR, LPCSTR);
  1077. UINT WINAPI GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
  1078. int WINAPI GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
  1079. BOOL WINAPI WritePrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPCSTR);
  1080. #if (WINVER >= 0x0400)
  1081. BOOL WINAPI GetPrivateProfileStruct(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
  1082. BOOL WINAPI WritePrivateProfileStruct(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
  1083. UINT WINAPI GetProfileSectionNames(LPSTR, UINT);
  1084. UINT WINAPI GetPrivateProfileSectionNames(LPSTR, UINT, LPCSTR);
  1085. int WINAPI GetPrivateProfileSection(LPCSTR, LPSTR, UINT, LPCSTR);
  1086. int WINAPI GetProfileSection(LPCSTR, LPSTR, UINT);
  1087. BOOL WINAPI WritePrivateProfileSection(LPCSTR, LPCSTR, LPCSTR);
  1088. BOOL WINAPI WriteProfileSection(LPCSTR, LPCSTR);
  1089. #endif /* WINVER >= 0x0400 */
  1090. /****** Registration Database Support ***************************************/
  1091. /* return codes from Registration functions */
  1092. /* Retained for win 3.x compatibility and not needed 4.0 onwards */
  1093. /* For 4.0 onwards you should be including winerror.h */
  1094. #if (WINVER < 0x0400)
  1095. #define ERROR_SUCCESS 0L
  1096. #define ERROR_BADDB 1L
  1097. #define ERROR_BADKEY 2L
  1098. #define ERROR_CANTOPEN 3L
  1099. #define ERROR_CANTREAD 4L
  1100. #define ERROR_CANTWRITE 5L
  1101. #define ERROR_INSUFFICIENT_MEMORY 6L
  1102. #define ERROR_INVALID_PARAMETER 7L
  1103. #define ERROR_ACCESS_DENIED 8L
  1104. #endif /* WINVER < 0x400 */
  1105. #define REG_SZ 0x0001
  1106. #if (WINVER >= 0x0400)
  1107. #define REG_BINARY 0x0003
  1108. #define REG_DWORD 0x0004
  1109. #endif
  1110. typedef DWORD HKEY;
  1111. typedef HKEY FAR* LPHKEY;
  1112. #if (WINVER < 0x0400) // Win 3.1 compatibility
  1113. #define HKEY_CLASSES_ROOT (( HKEY) 0x1)
  1114. #else // Win 4 upwards
  1115. #define HKEY_CLASSES_ROOT (( HKEY) 0x80000000)
  1116. #define HKEY_CURRENT_USER (( HKEY) 0x80000001)
  1117. #define HKEY_LOCAL_MACHINE (( HKEY) 0x80000002)
  1118. #define HKEY_USERS (( HKEY) 0x80000003)
  1119. #define HKEY_PERFORMANCE_DATA (( HKEY) 0x80000004)
  1120. #define HKEY_CURRENT_CONFIG (( HKEY) 0x80000005)
  1121. #define HKEY_DYN_DATA (( HKEY) 0x80000006)
  1122. #define HKEY_PREDEF_KEYS 7
  1123. #endif
  1124. LONG WINAPI RegOpenKey(HKEY, LPCSTR, LPHKEY);
  1125. LONG WINAPI RegCreateKey(HKEY, LPCSTR, LPHKEY);
  1126. LONG WINAPI RegCloseKey(HKEY);
  1127. LONG WINAPI RegDeleteKey(HKEY, LPCSTR);
  1128. LONG WINAPI RegSetValue(HKEY, LPCSTR, DWORD, LPCSTR, DWORD);
  1129. LONG WINAPI RegQueryValue(HKEY, LPCSTR, LPSTR, LONG FAR*);
  1130. LONG WINAPI RegEnumKey(HKEY, DWORD, LPSTR, DWORD);
  1131. #if (WINVER >= 0x0400)
  1132. LONG WINAPI RegDeleteValue(HKEY, LPCSTR);
  1133. LONG WINAPI RegEnumValue(HKEY, DWORD, LPCSTR,
  1134. LONG FAR *, DWORD, LONG FAR *, LPBYTE,
  1135. LONG FAR *);
  1136. LONG WINAPI RegQueryValueEx(HKEY, LPCSTR, LONG FAR *, LONG FAR *,
  1137. LPBYTE, LONG FAR *);
  1138. LONG WINAPI RegSetValueEx(HKEY, LPCSTR, DWORD, DWORD, LPBYTE, DWORD);
  1139. LONG WINAPI RegFlushKey(HKEY);
  1140. LONG WINAPI RegSaveKey(HKEY, LPCSTR,LPVOID);
  1141. LONG WINAPI RegLoadKey(HKEY, LPCSTR,LPCSTR);
  1142. LONG WINAPI RegUnLoadKey(HKEY, LPCSTR);
  1143. #endif // WINVER >= 0x0400
  1144. /****** International & Char Translation Support ****************************/
  1145. // ;Internal
  1146. // BOOL WINAPI CharToOem(LPCSTR, LPSTR); /* NT */ ;Internal
  1147. // BOOL WINAPI OemToChar(LPCSTR, LPSTR); /* NT */ ;Internal
  1148. // ;Internal
  1149. void WINAPI AnsiToOem(const char _huge*, char _huge*);
  1150. void WINAPI OemToAnsi(const char _huge*, char _huge*);
  1151. // ;Internal
  1152. // BOOL WINAPI CharToOemBuff(LPCSTR, LPSTR, UINT); /* NT */ ;Internal
  1153. // BOOL WINAPI OemToCharBuff(LPCSTR, LPSTR, DWORD); /* NT */ ;Internal
  1154. // ;Internal
  1155. void WINAPI AnsiToOemBuff(LPCSTR, LPSTR, UINT);
  1156. void WINAPI OemToAnsiBuff(LPCSTR, LPSTR, UINT);
  1157. // ;Internal
  1158. // LPSTR WINAPI CharNext(LPCSTR); /* NT */ ;Internal
  1159. // LPSTR WINAPI CharPrev(LPCSTR, LPCSTR); /* NT */ ;Internal
  1160. // ;Internal
  1161. LPSTR WINAPI AnsiNext(LPCSTR);
  1162. LPSTR WINAPI AnsiPrev(LPCSTR, LPCSTR);
  1163. // ;Internal
  1164. // LPSTR WINAPI CharUpper(LPSTR); /* NT */ ;Internal
  1165. // LPSTR WINAPI CharLower(LPSTR); /* NT */ ;Internal
  1166. // ;Internal
  1167. LPSTR WINAPI AnsiUpper(LPSTR);
  1168. LPSTR WINAPI AnsiLower(LPSTR);
  1169. // ;Internal
  1170. // LPSTR WINAPI CharUpperBuff(LPSTR, WORD); /* NT */ ;Internal
  1171. // LPSTR WINAPI CharLowerBuff(LPSTR, WORD); /* NT */ ;Internal
  1172. // ;Internal
  1173. UINT WINAPI AnsiUpperBuff(LPSTR, UINT);
  1174. UINT WINAPI AnsiLowerBuff(LPSTR, UINT);
  1175. /* Language driver entry point ordinal */ // ;Internal
  1176. #define ORD_LANGDRIVER 1 // ;Internal
  1177. // ;Internal
  1178. #ifndef NOLANGUAGE
  1179. BOOL WINAPI IsCharAlpha(char);
  1180. BOOL WINAPI IsCharAlphaNumeric(char);
  1181. BOOL WINAPI IsCharUpper(char);
  1182. BOOL WINAPI IsCharLower(char);
  1183. #endif
  1184. #ifndef NOLSTRING
  1185. int WINAPI lstrcmp(LPCSTR, LPCSTR);
  1186. int WINAPI lstrcmpi(LPCSTR, LPCSTR);
  1187. LPSTR WINAPI lstrcpy(LPSTR, LPCSTR);
  1188. LPSTR WINAPI lstrcat(LPSTR, LPCSTR);
  1189. int WINAPI lstrlen(LPCSTR);
  1190. #if (WINVER >= 0x030a)
  1191. LPSTR WINAPI lstrcpyn(LPSTR, LPCSTR, int);
  1192. void WINAPI hmemcpy(void _huge*, const void _huge*, DWORD);
  1193. #if (WINVER >= 0x0400)
  1194. LPSTR WINAPI lstrcatn(LPSTR, LPCSTR, int);
  1195. #endif /* WINVER >= 0x0400 */
  1196. #endif /* WINVER >= 0x030a */
  1197. #endif /* NOLSTRING */
  1198. #if (WINVER >= 0x030a)
  1199. #ifndef NODBCS
  1200. BOOL WINAPI IsDBCSLeadByte(BYTE);
  1201. #endif /* NODBCS */
  1202. #endif /* WINVER >= 0x030a */
  1203. int WINAPI LoadString(HINSTANCE, UINT, LPSTR, int);
  1204. #if (WINVER >= 0x0400) /* ;Internal NT */
  1205. #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100 /* ;Internal NT */
  1206. #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200 /* ;Internal NT */
  1207. #define FORMAT_MESSAGE_FROM_STRING 0x00000400 /* ;Internal NT */
  1208. #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800 /* ;Internal NT */
  1209. #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000 /* ;Internal NT */
  1210. //#define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000 /* ;Internal */
  1211. #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF /* ;Internal NT */
  1212. #define FORMAT_MESSAGE_VALID 0x00003FFF /* ;Internal */
  1213. /* ;Internal NT */
  1214. UINT FAR PASCAL FormatMessage(DWORD, LPVOID, UINT, UINT, LPSTR, UINT, LPDWORD); /* ;Internal NT */
  1215. #endif /* WINVER >= 0x0400 */ /* ;Internal NT */
  1216. /****** Keyboard Driver Functions *******************************************/
  1217. #ifndef NOKEYBOARDINFO
  1218. DWORD WINAPI OemKeyScan(UINT);
  1219. UINT WINAPI VkKeyScan(UINT);
  1220. UINT WINAPI VkKeyScanEx(UINT,HKL);
  1221. int WINAPI GetKeyboardType(int);
  1222. UINT WINAPI MapVirtualKey(UINT, UINT);
  1223. UINT WINAPI MapVirtualKeyEx(UINT,UINT,HKL);
  1224. int WINAPI GetKBCodePage(void);
  1225. int WINAPI GetKeyNameText(LONG, LPSTR, int);
  1226. int WINAPI ToAscii(UINT wVirtKey, UINT wScanCode, BYTE FAR* lpKeyState, DWORD FAR* lpChar, UINT wFlags);
  1227. int WINAPI ToAsciiEx(UINT wVirtKey, UINT wScanCode, BYTE FAR* lpKeyState, DWORD FAR* lpChar, UINT wFlags,HKL hkl);
  1228. #endif
  1229. #endif /* NOKERNEL */
  1230. /****** GDI typedefs, structures, and functions *****************************/
  1231. DECLARE_HANDLE(HDC);
  1232. #ifndef NOGDI
  1233. #ifdef STRICT
  1234. typedef const void NEAR* HGDIOBJ;
  1235. #else
  1236. DECLARE_HANDLE(HGDIOBJ);
  1237. #endif
  1238. #endif /* NOGDI */
  1239. DECLARE_HANDLE(HBITMAP);
  1240. DECLARE_HANDLE(HPEN);
  1241. DECLARE_HANDLE(HBRUSH);
  1242. DECLARE_HANDLE(HRGN);
  1243. DECLARE_HANDLE(HPALETTE);
  1244. DECLARE_HANDLE(HFONT);
  1245. typedef struct tagRECT
  1246. {
  1247. int left;
  1248. int top;
  1249. int right;
  1250. int bottom;
  1251. } RECT;
  1252. typedef RECT* PRECT;
  1253. typedef RECT NEAR* NPRECT;
  1254. typedef RECT FAR* LPRECT;
  1255. typedef const RECT FAR * LPCRECT;
  1256. typedef struct tagPOINT
  1257. {
  1258. int x;
  1259. int y;
  1260. } POINT;
  1261. typedef POINT* PPOINT;
  1262. typedef POINT NEAR* NPPOINT;
  1263. typedef POINT FAR* LPPOINT;
  1264. typedef const POINT FAR * LPCPOINT;
  1265. #if (WINVER >= 0x030a)
  1266. typedef struct tagSIZE
  1267. {
  1268. int cx;
  1269. int cy;
  1270. } SIZE;
  1271. typedef SIZE* PSIZE;
  1272. typedef SIZE NEAR* NPSIZE;
  1273. typedef SIZE FAR* LPSIZE;
  1274. #endif /* WINVER >= 0x030a */
  1275. #if (WINVER >= 0x0400)
  1276. /* Common structures for 4.X/Win32 GDI APIs */
  1277. typedef struct tagPOINTS
  1278. {
  1279. SHORT x;
  1280. SHORT y;
  1281. } POINTS;
  1282. typedef POINTS* PPOINTS;
  1283. typedef POINTS NEAR* NPPOINTS;
  1284. typedef POINTS FAR* LPPOINTS;
  1285. typedef const POINTS FAR* LPCPOINTS;
  1286. typedef struct tagPOINTL
  1287. {
  1288. LONG x;
  1289. LONG y;
  1290. } POINTL;
  1291. typedef POINTL* PPOINTL;
  1292. typedef POINTL NEAR* NPPOINTL;
  1293. typedef POINTL FAR* LPPOINTL;
  1294. typedef const POINTL FAR* LPCPOINTL;
  1295. typedef struct tagSIZEL
  1296. {
  1297. LONG cx;
  1298. LONG cy;
  1299. } SIZEL;
  1300. typedef SIZEL* PSIZEL;
  1301. typedef SIZEL NEAR* NPSIZEL;
  1302. typedef SIZEL FAR* LPSIZEL;
  1303. typedef const SIZEL FAR* LPCSIZEL;
  1304. typedef struct tagRECTL
  1305. {
  1306. LONG left;
  1307. LONG top;
  1308. LONG right;
  1309. LONG bottom;
  1310. } RECTL;
  1311. typedef RECTL* PRECTL;
  1312. typedef RECTL NEAR* NPRECTL;
  1313. typedef RECTL FAR* LPRECTL;
  1314. typedef const RECTL FAR* LPCRECTL;
  1315. /* ;Internal */
  1316. typedef struct tagXFORM /* SDK transform of IEEE floats. */ /* ;Internal */
  1317. { /* ;Internal */
  1318. float eM11; /* ;Internal */
  1319. float eM12; /* ;Internal */
  1320. float eM21; /* ;Internal */
  1321. float eM22; /* ;Internal */
  1322. float eDx; /* ;Internal */
  1323. float eDy; /* ;Internal */
  1324. /* ;Internal */
  1325. } XFORM; /* ;Internal */
  1326. typedef XFORM* PXFORM; /* ;Internal */
  1327. typedef XFORM NEAR* NPXFORM; /* ;Internal */
  1328. typedef XFORM FAR* LPXFORM; /* ;Internal */
  1329. typedef const XFORM FAR* LPCXFORM; /* ;Internal */
  1330. /* ;Internal */
  1331. #endif /* WINVER >= 0x0400 */
  1332. #define MAKEPOINT(l) (*((POINT FAR*)&(l)))
  1333. #ifndef NOGDI
  1334. /****** DC Management *******************************************************/
  1335. HDC WINAPI CreateDC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1336. HDC WINAPI CreateIC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1337. HDC WINAPI CreateCompatibleDC(HDC);
  1338. BOOL WINAPI DeleteDC(HDC);
  1339. DWORD WINAPI GetDCOrg(HDC);
  1340. DWORD WINAPI SetDCOrg(HDC, int, int); /* ;Internal */
  1341. int WINAPI SaveDC(HDC);
  1342. BOOL WINAPI RestoreDC(HDC, int);
  1343. int WINAPI SetEnvironment(LPCSTR, const void FAR*, UINT);
  1344. int WINAPI GetEnvironment(LPCSTR, void FAR*, UINT);
  1345. int WINAPI MulDiv(int, int, int);
  1346. #if (WINVER >= 0x030a)
  1347. /* Drawing bounds accumulation APIs */
  1348. UINT WINAPI SetBoundsRect(HDC hDC, LPCRECT lprcBounds, UINT flags);
  1349. UINT WINAPI GetBoundsRect(HDC hDC, LPRECT lprcBounds, UINT flags);
  1350. #define DCB_RESET 0x0001
  1351. #define DCB_ACCUMULATE 0x0002
  1352. #define DCB_DIRTY DCB_ACCUMULATE
  1353. #define DCB_SET (DCB_RESET | DCB_ACCUMULATE)
  1354. #define DCB_ENABLE 0x0004
  1355. #define DCB_DISABLE 0x0008
  1356. #define DCB_WINDOWMGR 0x8000 /* ;Internal */
  1357. /* ;Internal */
  1358. /* Internal SelectBitmap stuff */ /* ;Internal */
  1359. /*HBITMAP WINAPI SelectBitmap(HDC hDC, HBITMAP hbm);*/ /* ;Internal */
  1360. #endif /* WINVER >= 0x030a */
  1361. /****** Device Capabilities *************************************************/
  1362. int WINAPI GetDeviceCaps(HDC, int);
  1363. /* Device Parameters for GetDeviceCaps() */
  1364. #define DRIVERVERSION 0
  1365. #define TECHNOLOGY 2
  1366. #define HORZSIZE 4
  1367. #define VERTSIZE 6
  1368. #define HORZRES 8
  1369. #define VERTRES 10
  1370. #define BITSPIXEL 12
  1371. #define PLANES 14
  1372. #define NUMBRUSHES 16
  1373. #define NUMPENS 18
  1374. #define NUMMARKERS 20
  1375. #define NUMFONTS 22
  1376. #define NUMCOLORS 24
  1377. #define PDEVICESIZE 26
  1378. #define CURVECAPS 28
  1379. #define LINECAPS 30
  1380. #define POLYGONALCAPS 32
  1381. #define TEXTCAPS 34
  1382. #define CLIPCAPS 36
  1383. #define RASTERCAPS 38
  1384. #define ASPECTX 40
  1385. #define ASPECTY 42
  1386. #define ASPECTXY 44
  1387. #define LOGPIXELSX 88
  1388. #define LOGPIXELSY 90
  1389. #define CAPS1 94 // ;Internal
  1390. #define SIZEPALETTE 104
  1391. #define NUMRESERVED 106
  1392. #define COLORRES 108
  1393. #ifndef NOGDICAPMASKS
  1394. /* GetDeviceCaps() return value masks */
  1395. /* TECHNOLOGY */
  1396. #define DT_PLOTTER 0
  1397. #define DT_RASDISPLAY 1
  1398. #define DT_RASPRINTER 2
  1399. #define DT_RASCAMERA 3
  1400. #define DT_CHARSTREAM 4
  1401. #define DT_METAFILE 5
  1402. #define DT_DISPFILE 6
  1403. /* CURVECAPS */
  1404. #define CC_NONE 0x0000
  1405. #define CC_CIRCLES 0x0001
  1406. #define CC_PIE 0x0002
  1407. #define CC_CHORD 0x0004
  1408. #define CC_ELLIPSES 0x0008
  1409. #define CC_WIDE 0x0010
  1410. #define CC_STYLED 0x0020
  1411. #define CC_WIDESTYLED 0x0040
  1412. #define CC_INTERIORS 0x0080
  1413. #define CC_ROUNDRECT 0x0100
  1414. #define CC_POLYBEZIER 0x0200 /* ;Internal */
  1415. /* LINECAPS */
  1416. #define LC_NONE 0x0000
  1417. #define LC_POLYLINE 0x0002
  1418. #define LC_MARKER 0x0004
  1419. #define LC_POLYMARKER 0x0008
  1420. #define LC_WIDE 0x0010
  1421. #define LC_STYLED 0x0020
  1422. #define LC_WIDESTYLED 0x0040
  1423. #define LC_INTERIORS 0x0080
  1424. /* POLYGONALCAPS */
  1425. #define PC_NONE 0x0000
  1426. #define PC_POLYGON 0x0001
  1427. #define PC_RECTANGLE 0x0002
  1428. #define PC_WINDPOLYGON 0x0004
  1429. #define PC_SCANLINE 0x0008
  1430. #define PC_WIDE 0x0010
  1431. #define PC_STYLED 0x0020
  1432. #define PC_WIDESTYLED 0x0040
  1433. #define PC_INTERIORS 0x0080
  1434. #define PC_POLYPOLYGON 0x0100
  1435. #define PC_PATHS 0x0200
  1436. /* TEXTCAPS */
  1437. #define TC_OP_CHARACTER 0x0001
  1438. #define TC_OP_STROKE 0x0002
  1439. #define TC_CP_STROKE 0x0004
  1440. #define TC_CR_90 0x0008
  1441. #define TC_CR_ANY 0x0010
  1442. #define TC_SF_X_YINDEP 0x0020
  1443. #define TC_SA_DOUBLE 0x0040
  1444. #define TC_SA_INTEGER 0x0080
  1445. #define TC_SA_CONTIN 0x0100
  1446. #define TC_EA_DOUBLE 0x0200
  1447. #define TC_IA_ABLE 0x0400
  1448. #define TC_UA_ABLE 0x0800
  1449. #define TC_SO_ABLE 0x1000
  1450. #define TC_RA_ABLE 0x2000
  1451. #define TC_VA_ABLE 0x4000
  1452. #define TC_RESERVED 0x8000
  1453. /* CLIPCAPS */
  1454. #define CP_NONE 0x0000
  1455. #define CP_RECTANGLE 0x0001
  1456. #define CP_REGION 0x0002
  1457. /* RASTERCAPS */
  1458. #define RC_NONE
  1459. #define RC_BITBLT 0x0001
  1460. #define RC_BANDING 0x0002
  1461. #define RC_SCALING 0x0004
  1462. #define RC_BITMAP64 0x0008
  1463. #define RC_GDI20_OUTPUT 0x0010
  1464. #define RC_GDI20_STATE 0x0020
  1465. #define RC_SAVEBITMAP 0x0040
  1466. #define RC_DI_BITMAP 0x0080
  1467. #define RC_PALETTE 0x0100
  1468. #define RC_DIBTODEV 0x0200
  1469. #define RC_BIGFONT 0x0400
  1470. #define RC_STRETCHBLT 0x0800
  1471. #define RC_FLOODFILL 0x1000
  1472. #define RC_STRETCHDIB 0x2000
  1473. #define RC_OP_DX_OUTPUT 0x4000
  1474. #define RC_DEVBITS 0x8000
  1475. /* CAPS1 */ // ;Internal
  1476. #define C1_TRANSPARENT 0x0001 // ;Internal
  1477. #define TC_TT_ABLE 0x0002 // ;Internal
  1478. #define C1_TT_CR_ANY 0x0004 // ;Internal
  1479. #define C1_EMF_COMPLIANT 0x0008 // ;Internal
  1480. #define C1_DIBENGINE 0x0010 // ;Internal
  1481. #define C1_GAMMA_RAMP 0x0020 // ;Internal
  1482. #define C1_DIC 0x0040 // ;Internal
  1483. #define C1_REINIT_ABLE 0x0080 // ;Internal
  1484. #define C1_GLYPH_INDEX 0x0100 // ;Internal
  1485. #define C1_BIT_PACKED 0x0200 // ;Internal
  1486. #define C1_BYTE_PACKED 0x0400 // ;Internal
  1487. #define C1_COLORCURSOR 0x0800 // ;Internal
  1488. #define C1_CMYK_ABLE 0x1000 // ;Internal
  1489. #define C1_SLOW_CARD 0x2000 // ;Internal
  1490. #endif /* NOGDICAPMASKS */
  1491. /****** Coordinate transformation support ***********************************/
  1492. int WINAPI SetMapMode(HDC, int);
  1493. int WINAPI GetMapMode(HDC);
  1494. /* Map modes */
  1495. #define MM_TEXT 1
  1496. #define MM_LOMETRIC 2
  1497. #define MM_HIMETRIC 3
  1498. #define MM_LOENGLISH 4
  1499. #define MM_HIENGLISH 5
  1500. #define MM_TWIPS 6
  1501. #define MM_ISOTROPIC 7
  1502. #define MM_ANISOTROPIC 8
  1503. DWORD WINAPI SetWindowOrg(HDC, int, int);
  1504. DWORD WINAPI GetWindowOrg(HDC);
  1505. DWORD WINAPI SetWindowExt(HDC, int, int);
  1506. DWORD WINAPI GetWindowExt(HDC);
  1507. DWORD WINAPI OffsetWindowOrg(HDC, int, int);
  1508. DWORD WINAPI ScaleWindowExt(HDC, int, int, int, int);
  1509. DWORD WINAPI SetViewportOrg(HDC, int, int);
  1510. DWORD WINAPI GetViewportOrg(HDC);
  1511. DWORD WINAPI SetViewportExt(HDC, int, int);
  1512. DWORD WINAPI GetViewportExt(HDC);
  1513. DWORD WINAPI OffsetViewportOrg(HDC, int, int);
  1514. DWORD WINAPI ScaleViewportExt(HDC, int, int, int, int);
  1515. #if (WINVER >= 0x030a)
  1516. BOOL WINAPI SetWindowOrgEx(HDC, int, int, POINT FAR*);
  1517. BOOL WINAPI GetWindowOrgEx(HDC, POINT FAR*);
  1518. BOOL WINAPI SetWindowExtEx(HDC, int, int, SIZE FAR*);
  1519. BOOL WINAPI GetWindowExtEx(HDC, SIZE FAR*);
  1520. BOOL WINAPI OffsetWindowOrgEx(HDC, int, int, POINT FAR*);
  1521. BOOL WINAPI ScaleWindowExtEx(HDC, int, int, int, int, SIZE FAR*);
  1522. BOOL WINAPI SetViewportExtEx(HDC, int, int, SIZE FAR*);
  1523. BOOL WINAPI GetViewportExtEx(HDC, SIZE FAR*);
  1524. BOOL WINAPI SetViewportOrgEx(HDC, int, int, POINT FAR*);
  1525. BOOL WINAPI GetViewportOrgEx(HDC, POINT FAR*);
  1526. BOOL WINAPI OffsetViewportOrgEx(HDC, int, int, POINT FAR*);
  1527. BOOL WINAPI ScaleViewportExtEx(HDC, int, int, int, int, SIZE FAR*);
  1528. #endif /* WINVER >= 0x030a */
  1529. BOOL WINAPI DPtoLP(HDC, POINT FAR*, int);
  1530. BOOL WINAPI LPtoDP(HDC, POINT FAR*, int);
  1531. int WINAPI SetRelAbs(HDC, int); /* ;Internal */
  1532. int WINAPI GetRelAbs(HDC); /* ;Internal */
  1533. /* ;Internal */
  1534. /* Coordinate Modes */
  1535. #define ABSOLUTE 1
  1536. #define RELATIVE 2
  1537. /****** Color support *******************************************************/
  1538. typedef DWORD COLORREF;
  1539. #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
  1540. #define GetRValue(rgb) ((BYTE)(rgb))
  1541. #define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
  1542. #define GetBValue(rgb) ((BYTE)((rgb)>>16))
  1543. COLORREF WINAPI GetNearestColor(HDC, COLORREF);
  1544. #ifndef NOCOLOR
  1545. HBRUSH WINAPI GetSysColorBrush(int);
  1546. COLORREF WINAPI GetSysColor(int);
  1547. #ifdef tagWND // ;Internal
  1548. BOOL WINAPI SetSysColors(int, const int FAR*, const COLORREF FAR*); // ;Internal
  1549. #else // ;Internal
  1550. void WINAPI SetSysColors(int, const int FAR*, const COLORREF FAR*);
  1551. #endif // ;Internal
  1552. #define COLOR_SCROLLBAR 0
  1553. #define COLOR_DESKTOP 1
  1554. #define COLOR_ACTIVECAPTION 2
  1555. #define COLOR_INACTIVECAPTION 3
  1556. #define COLOR_MENU 4
  1557. #define COLOR_WINDOW 5
  1558. #define COLOR_WINDOWFRAME 6
  1559. #define COLOR_MENUTEXT 7
  1560. #define COLOR_WINDOWTEXT 8
  1561. #define COLOR_CAPTIONTEXT 9
  1562. #define COLOR_ACTIVEBORDER 10
  1563. #define COLOR_INACTIVEBORDER 11
  1564. #define COLOR_APPWORKSPACE 12
  1565. #define COLOR_HIGHLIGHT 13
  1566. #define COLOR_HIGHLIGHTTEXT 14
  1567. #define COLOR_3DFACE 15
  1568. #define COLOR_3DSHADOW 16
  1569. #define COLOR_GRAYTEXT 17
  1570. #define COLOR_BTNTEXT 18
  1571. #if (WINVER >= 0x030a)
  1572. #define COLOR_INACTIVECAPTIONTEXT 19
  1573. #define COLOR_3DHILIGHT 20
  1574. #if (WINVER >= 0x0400)
  1575. #define COLOR_3DDKSHADOW 21
  1576. #define COLOR_3DLIGHT 22
  1577. #define COLOR_INFOTEXT 23
  1578. #define COLOR_INFOBK 24
  1579. #if (WINVER >= 0x40A)
  1580. #define COLOR_3DALTFACE 25
  1581. #define COLOR_HOTLIGHT 26
  1582. #define COLOR_ENDCOLORS COLOR_HOTLIGHT /* ;Internal */
  1583. #else // ;Internal 4.1
  1584. #define COLOR_ENDCOLORS COLOR_INFOBK /* ;Internal */
  1585. #endif // (WINVER >= 0x40A)
  1586. #define COLOR_MAX (COLOR_ENDCOLORS+1) /* ;Internal */
  1587. #endif /* WINVER >= 0x0400 */
  1588. #endif /* WINVER >= 0x030a */
  1589. #define COLOR_BACKGROUND COLOR_DESKTOP
  1590. #define COLOR_BTNFACE COLOR_3DFACE
  1591. #define COLOR_BTNSHADOW COLOR_3DSHADOW
  1592. #define COLOR_BTNHIGHLIGHT COLOR_3DHILIGHT
  1593. HANDLE WINAPI SetSysColorsTemp(COLORREF FAR *, HBRUSH FAR *, UINT); /* ;Internal */
  1594. #endif /* NOCOLOR */
  1595. /****** GDI Object Support **************************************************/
  1596. #ifndef NOGDIOBJ
  1597. HGDIOBJ WINAPI GetStockObject(int);
  1598. BOOL WINAPI IsGDIObject(HGDIOBJ);
  1599. #define GDIOBJ_PEN 1 /* ;Internal */
  1600. #define GDIOBJ_BRUSH 2 /* ;Internal */
  1601. #define GDIOBJ_FONT 3 /* ;Internal */
  1602. #define GDIOBJ_PALETTE 4 /* ;Internal */
  1603. #define GDIOBJ_BITMAP 5 /* ;Internal */
  1604. #define GDIOBJ_RGN 6 /* ;Internal */
  1605. #define GDIOBJ_DC 7 /* ;Internal */
  1606. #define GDIOBJ_IC 8 /* ;Internal */
  1607. #define GDIOBJ_DISABLEDDC 9 /* ;Internal */
  1608. #define GDIOBJ_METADC 10 /* ;Internal */
  1609. #define GDIOBJ_METAFILE 11 /* ;Internal */
  1610. BOOL WINAPI DeleteObject(HGDIOBJ);
  1611. HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
  1612. int WINAPI GetObject(HGDIOBJ, int, void FAR*);
  1613. BOOL WINAPI UnrealizeObject(HGDIOBJ);
  1614. #ifdef STRICT
  1615. typedef (CALLBACK* GOBJENUMPROC)(void FAR*, LPARAM);
  1616. #else
  1617. typedef FARPROC GOBJENUMPROC;
  1618. #endif
  1619. #ifdef STRICT
  1620. int WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPARAM);
  1621. #else
  1622. int WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPSTR);
  1623. #endif
  1624. /* Object types for EnumObjects() */
  1625. #define OBJ_PEN 1
  1626. #define OBJ_BRUSH 2
  1627. #if (WINVER >= 0x0400)
  1628. HANDLE WINAPI SetObjectOwner(HGDIOBJ, HANDLE);
  1629. #endif
  1630. /****** Pen support *********************************************************/
  1631. /* Logical Pen */
  1632. typedef struct tagLOGPEN
  1633. {
  1634. UINT lopnStyle;
  1635. POINT lopnWidth;
  1636. COLORREF lopnColor;
  1637. } LOGPEN;
  1638. typedef LOGPEN* PLOGPEN;
  1639. typedef LOGPEN NEAR* NPLOGPEN;
  1640. typedef LOGPEN FAR* LPLOGPEN;
  1641. /* Pen Styles */
  1642. #define PS_SOLID 0
  1643. #define PS_DASH 1
  1644. #define PS_DOT 2
  1645. #define PS_DASHDOT 3
  1646. #define PS_DASHDOTDOT 4
  1647. #define PS_NULL 5
  1648. #define PS_INSIDEFRAME 6
  1649. HPEN WINAPI CreatePen(int, int, COLORREF);
  1650. HPEN WINAPI CreatePenIndirect(LOGPEN FAR*);
  1651. /* Stock pens for use with GetStockObject(); */
  1652. #define WHITE_PEN 6
  1653. #define BLACK_PEN 7
  1654. #define NULL_PEN 8
  1655. /****** Brush support *******************************************************/
  1656. /* Brush Styles */
  1657. #define BS_SOLID 0
  1658. #define BS_NULL 1
  1659. #define BS_HOLLOW BS_NULL
  1660. #define BS_HATCHED 2
  1661. #define BS_PATTERN 3
  1662. #define BS_INDEXED 4
  1663. #define BS_DIBPATTERN 5
  1664. /* Hatch Styles */
  1665. #define HS_HORIZONTAL 0
  1666. #define HS_VERTICAL 1
  1667. #define HS_FDIAGONAL 2
  1668. #define HS_BDIAGONAL 3
  1669. #define HS_CROSS 4
  1670. #define HS_DIAGCROSS 5
  1671. #define HS_API_MAX 6
  1672. /* Logical Brush (or Pattern) */
  1673. typedef struct tagLOGBRUSH
  1674. {
  1675. UINT lbStyle;
  1676. COLORREF lbColor;
  1677. int lbHatch;
  1678. } LOGBRUSH;
  1679. typedef LOGBRUSH* PLOGBRUSH;
  1680. typedef LOGBRUSH NEAR* NPLOGBRUSH;
  1681. typedef LOGBRUSH FAR* LPLOGBRUSH;
  1682. typedef LOGBRUSH PATTERN;
  1683. typedef PATTERN* PPATTERN;
  1684. typedef PATTERN NEAR* NPPATTERN;
  1685. typedef PATTERN FAR* LPPATTERN;
  1686. HBRUSH WINAPI CreateSolidBrush(COLORREF);
  1687. HBRUSH WINAPI CreateHatchBrush(int, COLORREF);
  1688. HBRUSH WINAPI CreatePatternBrush(HBITMAP);
  1689. HBRUSH WINAPI CreateDIBPatternBrush(HGLOBAL, UINT);
  1690. HBRUSH WINAPI CreateBrushIndirect(LOGBRUSH FAR*);
  1691. /* Stock brushes for use with GetStockObject() */
  1692. #define WHITE_BRUSH 0
  1693. #define LTGRAY_BRUSH 1
  1694. #define GRAY_BRUSH 2
  1695. #define DKGRAY_BRUSH 3
  1696. #define BLACK_BRUSH 4
  1697. #define NULL_BRUSH 5
  1698. #define HOLLOW_BRUSH NULL_BRUSH
  1699. DWORD WINAPI SetBrushOrg(HDC, int, int);
  1700. DWORD WINAPI GetBrushOrg(HDC);
  1701. #if (WINVER >= 0x030a)
  1702. BOOL WINAPI GetBrushOrgEx(HDC, POINT FAR*);
  1703. #endif /* WINVER >= 0x030a */
  1704. #endif /* NOGDIOBJ */
  1705. /****** Region support ******************************************************/
  1706. HRGN WINAPI CreateRectRgn(int, int, int, int);
  1707. HRGN WINAPI CreateRectRgnIndirect(LPCRECT);
  1708. HRGN WINAPI CreateEllipticRgnIndirect(LPCRECT);
  1709. HRGN WINAPI CreateEllipticRgn(int, int, int, int);
  1710. HRGN WINAPI CreatePolygonRgn(LPCPOINT, int, int);
  1711. HRGN WINAPI CreatePolyPolygonRgn(LPCPOINT, const int FAR*, int, int);
  1712. HRGN WINAPI CreateRoundRectRgn(int, int, int, int, int, int);
  1713. /* Region type flags */
  1714. #define ERROR 0
  1715. #define NULLREGION 1
  1716. #define SIMPLEREGION 2
  1717. #define COMPLEXREGION 3
  1718. void WINAPI SetRectRgn(HRGN, int, int, int, int);
  1719. int WINAPI CombineRgn(HRGN, HRGN, HRGN, int);
  1720. /* CombineRgn() command values */
  1721. #define RGN_AND 1
  1722. #define RGN_OR 2
  1723. #define RGN_XOR 3
  1724. #define RGN_DIFF 4
  1725. #define RGN_COPY 5
  1726. BOOL WINAPI EqualRgn(HRGN, HRGN);
  1727. int WINAPI OffsetRgn(HRGN, int, int);
  1728. int WINAPI GetRgnBox(HRGN, LPRECT);
  1729. BOOL WINAPI RectInRegion(HRGN, LPCRECT);
  1730. BOOL WINAPI PtInRegion(HRGN, int, int);
  1731. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  1732. /* ;Internal 4.0 */
  1733. /* structures for ExtCreateRegion / GetRegionData APIs */ /* ;Internal 4.0 */
  1734. /* ;Internal 4.0 */
  1735. typedef struct tagRGNDATAHEADER { /* ;Internal 4.0 */
  1736. DWORD dwSize; /* ;Internal 4.0 */
  1737. DWORD iType; /* ;Internal 4.0 */
  1738. DWORD nCount; /* ;Internal 4.0 */
  1739. DWORD nRgnSize; /* ;Internal 4.0 */
  1740. RECTL rcBound; /* ;Internal 4.0 */
  1741. } RGNDATAHEADER; /* ;Internal 4.0 */
  1742. typedef RGNDATAHEADER* PRGNDATAHEADER; /* ;Internal 4.0 */
  1743. typedef RGNDATAHEADER NEAR* NPRGNDATAHEADER; /* ;Internal 4.0 */
  1744. typedef RGNDATAHEADER FAR* LPRGNDATAHEADER; /* ;Internal 4.0 */
  1745. typedef const RGNDATAHEADER FAR* LPCRGNDATAHEADER; /* ;Internal 4.0 */
  1746. /* ;Internal 4.0 */
  1747. typedef struct tagRGNDATA { /* ;Internal 4.0 */
  1748. RGNDATAHEADER rdh; /* ;Internal 4.0 */
  1749. char Buffer[1]; /* ;Internal 4.0 */
  1750. } RGNDATA; /* ;Internal 4.0 */
  1751. typedef RGNDATA* PRGNDATA; /* ;Internal 4.0 */
  1752. typedef RGNDATA NEAR* NPRGNDATA; /* ;Internal 4.0 */
  1753. typedef RGNDATA FAR* LPRGNDATA; /* ;Internal 4.0 */
  1754. typedef const RGNDATA FAR* LPCRGNDATA; /* ;Internal 4.0 */
  1755. /* ;Internal 4.0 */
  1756. int WINAPI ExtSelectClipRgn(HDC, HRGN, int); /* ;Internal 4.0 */
  1757. DWORD WINAPI GetRegionData(HRGN, DWORD, LPRGNDATA); /* ;Internal 4.0 */
  1758. HRGN WINAPI ExtCreateRegion(LPCXFORM, DWORD, LPCRGNDATA); /* ;Internal 4.0 */
  1759. /* ;Internal 4.0 */
  1760. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  1761. /****** Color palette Support ************************************************/
  1762. #define PALETTERGB(r,g,b) (0x02000000L | RGB(r,g,b))
  1763. #define PALETTEINDEX(i) ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))
  1764. typedef struct tagPALETTEENTRY
  1765. {
  1766. BYTE peRed;
  1767. BYTE peGreen;
  1768. BYTE peBlue;
  1769. BYTE peFlags;
  1770. } PALETTEENTRY;
  1771. typedef PALETTEENTRY FAR* LPPALETTEENTRY;
  1772. /* Palette entry flags */
  1773. #define PC_RESERVED 0x01 /* palette index used for animation */
  1774. #define PC_EXPLICIT 0x02 /* palette index is explicit to device */
  1775. #define PC_NOCOLLAPSE 0x04 /* do not match color to system palette */
  1776. /* Logical Palette */
  1777. typedef struct tagLOGPALETTE
  1778. {
  1779. WORD palVersion;
  1780. WORD palNumEntries;
  1781. PALETTEENTRY palPalEntry[1];
  1782. } LOGPALETTE;
  1783. typedef LOGPALETTE* PLOGPALETTE;
  1784. typedef LOGPALETTE NEAR* NPLOGPALETTE;
  1785. typedef LOGPALETTE FAR* LPLOGPALETTE;
  1786. HPALETTE WINAPI CreatePalette(const LOGPALETTE FAR*);
  1787. HPALETTE WINAPI SelectPalette(HDC, HPALETTE, BOOL);
  1788. UINT WINAPI RealizePalette(HDC);
  1789. int WINAPI UpdateColors(HDC);
  1790. void WINAPI AnimatePalette(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1791. UINT WINAPI SetPaletteEntries(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1792. UINT WINAPI GetPaletteEntries(HPALETTE, UINT, UINT, PALETTEENTRY FAR*);
  1793. UINT WINAPI GetNearestPaletteIndex(HPALETTE, COLORREF);
  1794. BOOL WINAPI ResizePalette(HPALETTE, UINT);
  1795. UINT WINAPI GetSystemPaletteEntries(HDC, UINT, UINT, PALETTEENTRY FAR*);
  1796. UINT WINAPI GetSystemPaletteUse(HDC);
  1797. UINT WINAPI SetSystemPaletteUse(HDC, UINT);
  1798. /* Get/SetSystemPaletteUse() values */
  1799. #define SYSPAL_STATIC 1
  1800. #define SYSPAL_NOSTATIC 2
  1801. /****** Clipping support *****************************************************/
  1802. int WINAPI SelectClipRgn(HDC, HRGN);
  1803. int WINAPI GetClipBox(HDC, LPRECT);
  1804. int WINAPI IntersectClipRect(HDC, int, int, int, int);
  1805. int WINAPI OffsetClipRgn(HDC, int, int);
  1806. int WINAPI ExcludeClipRect(HDC, int, int, int, int);
  1807. BOOL WINAPI PtVisible(HDC, int, int);
  1808. BOOL WINAPI RectVisible(HDC, LPCRECT);
  1809. #if (WINVER >= 0x030a) /* ;Internal */
  1810. /* DC hook callback function */ /* ;Internal */
  1811. /* ;Internal */
  1812. typedef UINT (CALLBACK* DCHOOKPROC)(HDC hDC, UINT code, DWORD data, DWORD lParam); /* ;Internal */
  1813. /* ;Internal */
  1814. BOOL WINAPI SetDCHook(HDC hDC, DCHOOKPROC lpNewProc, DWORD data); /* ;Internal */
  1815. DWORD WINAPI GetDCHook(HDC hDC, DCHOOKPROC FAR* lplpproc); /* ;Internal */
  1816. /* ;Internal */
  1817. /* Callback reason code values */ /* ;Internal */
  1818. /* ;Internal */
  1819. #define DCHC_INVALIDVISRGN 0x0001 /* ;Internal */
  1820. #define DCHC_DELETEDC 0x0002 /* ;Internal */
  1821. /* ;Internal */
  1822. UINT WINAPI SetHookFlags(HDC hDC, UINT flags); /* ;Internal */
  1823. /* ;Internal */
  1824. #define DCHF_INVALIDATEVISRGN 0x0001 /* ;Internal */
  1825. #define DCHF_VALIDATEVISRGN 0x0002 /* ;Internal */
  1826. #endif /* WINVER >= 0x030a */ /* ;Internal */
  1827. /****** General drawing support ********************************************/
  1828. DWORD WINAPI MoveTo(HDC, int, int);
  1829. DWORD WINAPI GetCurrentPosition(HDC);
  1830. #if (WINVER >= 0x030a)
  1831. BOOL WINAPI MoveToEx(HDC, int, int, POINT FAR*);
  1832. BOOL WINAPI GetCurrentPositionEx(HDC, POINT FAR*);
  1833. #endif /* WINVER >= 0x030a */
  1834. BOOL WINAPI LineTo(HDC, int, int);
  1835. BOOL WINAPI Polyline(HDC, LPCPOINT, int);
  1836. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  1837. BOOL WINAPI PolyBezier(HDC, LPCPOINT, UINT); /* ;Internal 4.0 */
  1838. BOOL WINAPI PolyBezierTo(HDC, LPCPOINT, UINT); /* ;Internal 4.0 */
  1839. /* ;Internal 4.0 */
  1840. BOOL WINAPI AbortPath(HDC); /* ;Internal 4.0 */
  1841. BOOL WINAPI BeginPath(HDC); /* ;Internal 4.0 */
  1842. BOOL WINAPI CloseFigure(HDC); /* ;Internal 4.0 */
  1843. BOOL WINAPI EndPath(HDC); /* ;Internal 4.0 */
  1844. BOOL WINAPI FillPath(HDC); /* ;Internal 4.0 */
  1845. BOOL WINAPI FlattenPath(HDC); /* ;Internal 4.0 */
  1846. long WINAPI GetPath(HDC, LPPOINTL, LPBYTE, long); /* ;Internal 4.0 */
  1847. HRGN WINAPI PathToRegion(HDC); /* ;Internal 4.0 */
  1848. BOOL WINAPI SelectClipPath(HDC, int); /* ;Internal 4.0 */
  1849. BOOL WINAPI StrokeAndFillPath(HDC); /* ;Internal 4.0 */
  1850. BOOL WINAPI StrokePath(HDC); /* ;Internal 4.0 */
  1851. BOOL WINAPI WidenPath(HDC); /* ;Internal 4.0 */
  1852. /* ;Internal 4.0 */
  1853. #define PT_CLOSEFIGURE 0x01 /* GetPath byte flags */ /* ;Internal 4.0 */
  1854. #define PT_LINETO 0x02 /* ;Internal 4.0 */
  1855. #define PT_BEZIERTO 0x04 /* ;Internal 4.0 */
  1856. #define PT_MOVETO 0x06 /* ;Internal 4.0 */
  1857. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  1858. /* ;Internal 4.0 */
  1859. #ifdef STRICT
  1860. typedef void (CALLBACK* LINEDDAPROC)(int, int, LPARAM);
  1861. #else
  1862. typedef FARPROC LINEDDAPROC;
  1863. #endif
  1864. void WINAPI LineDDA(int, int, int, int, LINEDDAPROC, LPARAM);
  1865. BOOL WINAPI Rectangle(HDC, int, int, int, int);
  1866. BOOL WINAPI RoundRect(HDC, int, int, int, int, int, int);
  1867. BOOL WINAPI Ellipse(HDC, int, int, int, int);
  1868. BOOL WINAPI Arc(HDC, int, int, int, int, int, int, int, int);
  1869. BOOL WINAPI Chord(HDC, int, int, int, int, int, int, int, int);
  1870. BOOL WINAPI Pie(HDC, int, int, int, int, int, int, int, int);
  1871. BOOL WINAPI Polygon(HDC, LPCPOINT, int);
  1872. BOOL WINAPI PolyPolygon(HDC, LPCPOINT, int FAR*, int);
  1873. /* PolyFill Modes */
  1874. #define ALTERNATE 1
  1875. #define WINDING 2
  1876. int WINAPI SetPolyFillMode(HDC, int);
  1877. int WINAPI GetPolyFillMode(HDC);
  1878. BOOL WINAPI FloodFill(HDC, int, int, COLORREF);
  1879. BOOL WINAPI ExtFloodFill(HDC, int, int, COLORREF, UINT);
  1880. /* ExtFloodFill style flags */
  1881. #define FLOODFILLBORDER 0
  1882. #define FLOODFILLSURFACE 1
  1883. BOOL WINAPI FillRgn(HDC, HRGN, HBRUSH);
  1884. BOOL WINAPI FrameRgn(HDC, HRGN, HBRUSH, int, int);
  1885. BOOL WINAPI InvertRgn(HDC, HRGN);
  1886. BOOL WINAPI PaintRgn(HDC, HRGN);
  1887. /* Rectangle output routines */
  1888. int WINAPI FillRect(HDC, LPCRECT, HBRUSH);
  1889. int WINAPI FrameRect(HDC, LPCRECT, HBRUSH);
  1890. BOOL WINAPI InvertRect(HDC, LPCRECT);
  1891. void WINAPI DrawFocusRect(HDC, LPCRECT);
  1892. BOOL WINAPI FastWindowFrame(HDC, LPCRECT, UINT, UINT, DWORD); /* ;Internal */
  1893. /****** Text support ********************************************************/
  1894. BOOL WINAPI TextOut(HDC, int, int, LPCSTR, int);
  1895. LONG WINAPI TabbedTextOut(HDC, int, int, LPCSTR, int, int, int FAR*, int);
  1896. BOOL WINAPI ExtTextOut(HDC, int, int, UINT, LPCRECT, LPCSTR, UINT, int FAR*);
  1897. #define ETO_GRAYED 0x0001
  1898. #define ETO_OPAQUE 0x0002
  1899. #define ETO_CLIPPED 0x0004
  1900. #define ETO_GLYPH_INDEX 0x0010
  1901. #define ETO_RTLREADING 0x0080
  1902. DWORD WINAPI GetTextExtent(HDC, LPCSTR, int);
  1903. DWORD WINAPI GetTabbedTextExtent(HDC, LPCSTR, int, int, int FAR*);
  1904. #if (WINVER >= 0x030a)
  1905. BOOL WINAPI GetTextExtentPoint(HDC, LPCSTR, int, SIZE FAR*);
  1906. #endif /* WINVER >= 0x030a */
  1907. /* DrawText() Format Flags */
  1908. #ifndef NODRAWTEXT
  1909. #define DT_LEFT 0x0000
  1910. #define DT_CENTER 0x0001
  1911. #define DT_RIGHT 0x0002
  1912. #define DT_TOP 0x0000
  1913. #define DT_VCENTER 0x0004
  1914. #define DT_BOTTOM 0x0008
  1915. #define DT_WORDBREAK 0x0010
  1916. #define DT_SINGLELINE 0x0020
  1917. #define DT_EXPANDTABS 0x0040
  1918. #define DT_TABSTOP 0x0080
  1919. #define DT_NOCLIP 0x0100
  1920. #define DT_EXTERNALLEADING 0x0200
  1921. #define DT_CALCRECT 0x0400
  1922. #define DT_NOPREFIX 0x0800
  1923. #define DT_INTERNAL 0x1000
  1924. #define DT_EDITCONTROL 0x00002000
  1925. #define DT_PATH_ELLIPSIS 0x00004000 // ;Internal 4.0
  1926. #define DT_END_ELLIPSIS 0x00008000 // ;Internal 4.0
  1927. #define DT_MODIFYSTRING 0x00010000 // ;Internal 4.0
  1928. #define DT_RTLREADING 0x00020000 // ;Internal 4.0
  1929. #define DT_WORD_ELLIPSIS 0x00040000 // ;Internal 4.0
  1930. #define DT_VALID 0x0007ffff // ;Internal: Union of all those above
  1931. int WINAPI DrawText(HDC, LPCSTR, int, LPRECT, UINT);
  1932. #if (WINVER >= 0x0400)
  1933. typedef struct tagDRAWTEXTPARAMS
  1934. {
  1935. DWORD cbSize;
  1936. int iTabLength;
  1937. int iLeftMargin;
  1938. int iRightMargin;
  1939. UINT uiLengthDrawn;
  1940. } DRAWTEXTPARAMS, FAR *LPDRAWTEXTPARAMS;
  1941. int WINAPI DrawTextEx(HDC, LPSTR, int, LPRECT, DWORD, LPDRAWTEXTPARAMS);
  1942. #endif /* WINVER >= 0x0400 */
  1943. #endif /* NODRAWTEXT */
  1944. #ifdef STRICT
  1945. typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
  1946. #else
  1947. typedef FARPROC GRAYSTRINGPROC;
  1948. #endif
  1949. BOOL WINAPI GrayString(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
  1950. /* Monolithic state-drawing routine */
  1951. #if (WINVER >= 0x0400)
  1952. /* Image type */
  1953. #define DST_COMPLEX 0x0000
  1954. #define DST_TEXT 0x0001
  1955. #define DST_PREFIXTEXT 0x0002
  1956. #define DST_TEXTMAX 0x0002 /* ;Internal */
  1957. #define DST_ICON 0x0003
  1958. #define DST_BITMAP 0x0004
  1959. #define DST_GLYPH 0x0005 /* ;Internal */
  1960. #define DST_TYPEMASK 0x0007 /* ;Internal */
  1961. #define DST_GRAYSTRING 0x0008 /* ;Internal */
  1962. /* State type */
  1963. #define DSS_NORMAL 0x0000
  1964. #define DSS_UNION 0x0010 /* Old gray string appearance */
  1965. #define DSS_DISABLED 0x0020
  1966. #define DSS_DEFAULT 0x0040 // ;Internal BOGUS GOING AWAY
  1967. #define DSS_MONO 0x0080
  1968. #define DSS_RIGHT 0x8000
  1969. #ifdef STRICT
  1970. typedef BOOL (CALLBACK* DRAWSTATEPROC)(HDC, LPARAM, WPARAM, int, int);
  1971. #else
  1972. typedef FARPROC DRAWSTATEPROC;
  1973. #endif
  1974. BOOL WINAPI DrawState(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
  1975. #endif /* WINVER >= 0x0400 */
  1976. BOOL WINAPI GetCharWidth(HDC, UINT, UINT, int FAR*);
  1977. COLORREF WINAPI SetTextColor(HDC, COLORREF);
  1978. COLORREF WINAPI GetTextColor(HDC);
  1979. COLORREF WINAPI SetBkColor(HDC, COLORREF);
  1980. COLORREF WINAPI GetBkColor(HDC);
  1981. int WINAPI SetBkMode(HDC, int);
  1982. int WINAPI GetBkMode(HDC);
  1983. /* Background Modes */
  1984. #define TRANSPARENT 1
  1985. #define OPAQUE 2
  1986. #define TRANSPARENT1 3 /* ;Internal */
  1987. UINT WINAPI SetTextAlign(HDC, UINT);
  1988. UINT WINAPI GetTextAlign(HDC);
  1989. /* Text Alignment Options */
  1990. #define TA_NOUPDATECP 0x0000
  1991. #define TA_UPDATECP 0x0001
  1992. #define TA_LEFT 0x0000
  1993. #define TA_RIGHT 0x0002
  1994. #define TA_CENTER 0x0006
  1995. #define TA_TOP 0x0000
  1996. #define TA_BOTTOM 0x0008
  1997. #define TA_BASELINE 0x0018
  1998. #define TA_RTLREADING 0x0100
  1999. int WINAPI SetTextCharacterExtra(HDC, int);
  2000. int WINAPI GetTextCharacterExtra(HDC);
  2001. int WINAPI SetTextJustification(HDC, int, int);
  2002. /****** Font support ********************************************************/
  2003. /* Logical Font */
  2004. #define LF_FACESIZE 32
  2005. #ifndef NOGDIOBJ
  2006. typedef struct tagLOGFONT
  2007. {
  2008. int lfHeight;
  2009. int lfWidth;
  2010. int lfEscapement;
  2011. int lfOrientation;
  2012. int lfWeight;
  2013. BYTE lfItalic;
  2014. BYTE lfUnderline;
  2015. BYTE lfStrikeOut;
  2016. BYTE lfCharSet;
  2017. BYTE lfOutPrecision;
  2018. BYTE lfClipPrecision;
  2019. BYTE lfQuality;
  2020. BYTE lfPitchAndFamily;
  2021. char lfFaceName[LF_FACESIZE];
  2022. } LOGFONT;
  2023. typedef LOGFONT* PLOGFONT;
  2024. typedef LOGFONT NEAR* NPLOGFONT;
  2025. typedef LOGFONT FAR* LPLOGFONT;
  2026. /* weight values */
  2027. #define FW_DONTCARE 0
  2028. #define FW_THIN 100
  2029. #define FW_EXTRALIGHT 200
  2030. #define FW_LIGHT 300
  2031. #define FW_NORMAL 400
  2032. #define FW_MEDIUM 500
  2033. #define FW_SEMIBOLD 600
  2034. #define FW_BOLD 700
  2035. #define FW_EXTRABOLD 800
  2036. #define FW_HEAVY 900
  2037. #define FW_ULTRALIGHT FW_EXTRALIGHT
  2038. #define FW_REGULAR FW_NORMAL
  2039. #define FW_DEMIBOLD FW_SEMIBOLD
  2040. #define FW_ULTRABOLD FW_EXTRABOLD
  2041. #define FW_BLACK FW_HEAVY
  2042. /* CharSet values */
  2043. #define ANSI_CHARSET 0
  2044. #define DEFAULT_CHARSET 1
  2045. #define SYMBOL_CHARSET 2
  2046. #if (WINVER >= 0x0400)
  2047. #define MAC_CHARSET 77
  2048. #endif /* WINVER >= 0x0400 */
  2049. #define SHIFTJIS_CHARSET 128
  2050. #define HANGEUL_CHARSET 129
  2051. #define JOHAB_CHARSET 130
  2052. #define GB2312_CHARSET 134
  2053. #define CHINESEBIG5_CHARSET 136
  2054. #define GREEK_CHARSET 161
  2055. #define TURKISH_CHARSET 162
  2056. #define HEBREW_CHARSET 177
  2057. #define ARABIC_CHARSET 178
  2058. #define BALTIC_CHARSET 186
  2059. #define RUSSIAN_CHARSET 204
  2060. #define THAI_CHARSET 222
  2061. #define EASTEUROPE_CHARSET 238
  2062. #define OEM_CHARSET 255
  2063. /* OutPrecision values */
  2064. #define OUT_DEFAULT_PRECIS 0
  2065. #define OUT_STRING_PRECIS 1
  2066. #define OUT_CHARACTER_PRECIS 2
  2067. #define OUT_STROKE_PRECIS 3
  2068. #if (WINVER >= 0x030a)
  2069. #define OUT_TT_PRECIS 4
  2070. #define OUT_DEVICE_PRECIS 5
  2071. #define OUT_RASTER_PRECIS 6
  2072. #define OUT_TT_ONLY_PRECIS 7
  2073. #endif /* WINVER >= 0x030a */
  2074. /* ClipPrecision values */
  2075. #define CLIP_DEFAULT_PRECIS 0x00
  2076. #define CLIP_CHARACTER_PRECIS 0x01
  2077. #define CLIP_STROKE_PRECIS 0x02
  2078. #define CLIP_MASK 0x0F
  2079. #if (WINVER >= 0x030a)
  2080. #define CLIP_LH_ANGLES 0x10
  2081. #define CLIP_TT_ALWAYS 0x20
  2082. #define CLIP_EMBEDDED 0x80
  2083. #endif /* WINVER >= 0x030a */
  2084. /* Quality values */
  2085. #define DEFAULT_QUALITY 0
  2086. #define DRAFT_QUALITY 1
  2087. #define PROOF_QUALITY 2
  2088. #if (WINVER >= 0x400)
  2089. #define NONANTIALIASED_QUALITY 3
  2090. #define ANTIALIASED_QUALITY 4
  2091. #endif /* WINVER >= 0x400 */
  2092. /* PitchAndFamily pitch values (low 4 bits) */
  2093. #define DEFAULT_PITCH 0x00
  2094. #define FIXED_PITCH 0x01
  2095. #define VARIABLE_PITCH 0x02
  2096. #if (WINVER >= 0x400)
  2097. #define MONO_FONT 0x08
  2098. #endif
  2099. /* PitchAndFamily family values (high 4 bits) */
  2100. #define FF_DONTCARE 0x00
  2101. #define FF_ROMAN 0x10
  2102. #define FF_SWISS 0x20
  2103. #define FF_MODERN 0x30
  2104. #define FF_SCRIPT 0x40
  2105. #define FF_DECORATIVE 0x50
  2106. HFONT WINAPI CreateFont(int, int, int, int, int, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, LPCSTR);
  2107. HFONT WINAPI CreateFontIndirect(const LOGFONT FAR*);
  2108. /* Stock fonts for use with GetStockObject() */
  2109. #define OEM_FIXED_FONT 10
  2110. #define ANSI_FIXED_FONT 11
  2111. #define ANSI_VAR_FONT 12
  2112. #define SYSTEM_FONT 13
  2113. #define DEVICE_DEFAULT_FONT 14
  2114. #define DEFAULT_PALETTE 15
  2115. #define SYSTEM_FIXED_FONT 16
  2116. #define DEFAULT_GUI_FONT 17
  2117. DWORD WINAPI SetMapperFlags(HDC, DWORD);
  2118. #define ASPECT_FILTERING 0x00000001L
  2119. int WINAPI AddFontResource(LPCSTR);
  2120. BOOL WINAPI RemoveFontResource(LPCSTR);
  2121. #define GCP_DBCS 0x0001
  2122. #define GCP_REORDER 0x0002
  2123. #define GCP_USEKERNING 0x0008
  2124. #define GCP_GLYPHSHAPE 0x0010
  2125. #define GCP_LIGATE 0x0020
  2126. ///#define GCP_GLYPHINDEXING 0x0080
  2127. #define GCP_DIACRITIC 0x0100
  2128. #define GCP_KASHIDA 0x0400
  2129. #define GCP_ERROR 0x8000
  2130. #define FLI_MASK 0x103B
  2131. #define GCP_JUSTIFY 0x00010000L
  2132. //#define GCP_NODIACRITICS 0x00020000L
  2133. #define FLI_GLYPHS 0x00040000L
  2134. #define GCP_CLASSIN 0x00080000L
  2135. #define GCP_MAXEXTENT 0x00100000L
  2136. #define GCP_JUSTIFYIN 0x00200000L
  2137. #define GCP_DISPLAYZWG 0x00400000L
  2138. #define GCP_SYMSWAPOFF 0x00800000L
  2139. #define GCP_NUMERICOVERRIDE 0x01000000L
  2140. #define GCP_NEUTRALOVERRIDE 0x02000000L
  2141. #define GCP_NUMERICSLATIN 0x04000000L
  2142. #define GCP_NUMERICSLOCAL 0x08000000L
  2143. #define GCPCLASS_LATIN 1
  2144. #define GCPCLASS_HEBREW 2
  2145. #define GCPCLASS_ARABIC 2
  2146. #define GCPCLASS_NEUTRAL 3
  2147. #define GCPCLASS_LOCALNUMBER 4
  2148. #define GCPCLASS_LATINNUMBER 5
  2149. #define GCPCLASS_LATINNUMERICTERMINATOR 6
  2150. #define GCPCLASS_LATINNUMERICSEPARATOR 7
  2151. #define GCPCLASS_NUMERICSEPARATOR 8
  2152. #define GCPCLASS_PREBOUNDLTR 0x80
  2153. #define GCPCLASS_PREBOUNDRTL 0x40
  2154. #define GCPCLASS_POSTBOUNDLTR 0x20
  2155. #define GCPCLASS_POSTBOUNDRTL 0x10
  2156. #define GCPGLYPH_LINKBEFORE 0x8000
  2157. #define GCPGLYPH_LINKAFTER 0x4000
  2158. typedef struct
  2159. {
  2160. DWORD lStructSize;
  2161. LPSTR lpOutString;
  2162. UINT FAR *lpOrder;
  2163. int FAR *lpDx;
  2164. int FAR *lpCaretPos;
  2165. LPSTR lpClass;
  2166. UINT FAR *lpGlyphs;
  2167. UINT nGlyphs;
  2168. int nMaxFit;
  2169. } GCP_RESULTS, FAR* LPGCP_RESULTS;
  2170. DWORD WINAPI GetFontLanguageInfo( HDC );
  2171. DWORD WINAPI GetCharacterPlacement(HDC, LPCSTR, int, int, LPGCP_RESULTS, DWORD);
  2172. int WINAPI GetTextFace(HDC, int, LPSTR);
  2173. int WINAPI GetTextCharset(HDC); /* ;Internal 4.0 */
  2174. DWORD WINAPI GetAspectRatioFilter(HDC);
  2175. #if (WINVER >= 0x030a)
  2176. BOOL WINAPI GetAspectRatioFilterEx(HDC, SIZE FAR*);
  2177. #endif /* WINVER >= 0x030a */
  2178. #endif /* NOGDIOBJ */
  2179. typedef struct tagPANOSE
  2180. {
  2181. BYTE bFamilyType;
  2182. BYTE bSerifStyle;
  2183. BYTE bWeight;
  2184. BYTE bProportion;
  2185. BYTE bContrast;
  2186. BYTE bStrokeVariation;
  2187. BYTE bArmStyle;
  2188. BYTE bLetterform;
  2189. BYTE bMidline;
  2190. BYTE bXHeight;
  2191. } PANOSE, FAR* LPPANOSE;
  2192. #ifndef NOTEXTMETRIC
  2193. typedef struct tagTEXTMETRIC
  2194. {
  2195. int tmHeight;
  2196. int tmAscent;
  2197. int tmDescent;
  2198. int tmInternalLeading;
  2199. int tmExternalLeading;
  2200. int tmAveCharWidth;
  2201. int tmMaxCharWidth;
  2202. int tmWeight;
  2203. BYTE tmItalic;
  2204. BYTE tmUnderlined;
  2205. BYTE tmStruckOut;
  2206. BYTE tmFirstChar;
  2207. BYTE tmLastChar;
  2208. BYTE tmDefaultChar;
  2209. BYTE tmBreakChar;
  2210. BYTE tmPitchAndFamily;
  2211. BYTE tmCharSet;
  2212. int tmOverhang;
  2213. int tmDigitizedAspectX;
  2214. int tmDigitizedAspectY;
  2215. } TEXTMETRIC;
  2216. typedef TEXTMETRIC* PTEXTMETRIC;
  2217. typedef TEXTMETRIC NEAR* NPTEXTMETRIC;
  2218. typedef TEXTMETRIC FAR* LPTEXTMETRIC;
  2219. /* tmPitchAndFamily values */
  2220. #define TMPF_VARIABLE_PITCH 0x01
  2221. #define TMPF_VECTOR 0x02
  2222. #define TMPF_DEVICE 0x08
  2223. /*
  2224. * Yes, this looks bogus. But it's because we got confused and named the
  2225. * flag wrong. LOGFONTs have an lfPitchAndFamily field, where FIXED_PITCH
  2226. * is 0x01. But TEXTMETRICs have a tmPitchAndFamily field, where
  2227. * VARIABLE_PITCH is 0x01. It's easy to confuse the two. We're sorry.
  2228. */
  2229. #define TMPF_FIXED_PITCH TMPF_VARIABLE_PITCH
  2230. #if (WINVER >= 0x030a)
  2231. #define TMPF_TRUETYPE 0x04
  2232. #endif /* WINVER >= 0x030a */
  2233. BOOL WINAPI GetTextMetrics(HDC, TEXTMETRIC FAR*);
  2234. #if (WINVER >= 0x030a)
  2235. #ifndef NOSCALABLEFONT
  2236. #if (WINVER >= 0x0400)
  2237. #define PANOSE_COUNT 10
  2238. #define PAN_FAMILYTYPE_INDEX 0
  2239. #define PAN_SERIFSTYLE_INDEX 1
  2240. #define PAN_WEIGHT_INDEX 2
  2241. #define PAN_PROPORTION_INDEX 3
  2242. #define PAN_CONTRAST_INDEX 4
  2243. #define PAN_STROKEVARIATION_INDEX 5
  2244. #define PAN_ARMSTYLE_INDEX 6
  2245. #define PAN_LETTERFORM_INDEX 7
  2246. #define PAN_MIDLINE_INDEX 8
  2247. #define PAN_XHEIGHT_INDEX 9
  2248. #define PAN_CULTURE_LATIN 0
  2249. #define PAN_ANY 0 /* Any */
  2250. #define PAN_NO_FIT 1 /* No Fit */
  2251. #define PAN_FAMILY_TEXT_DISPLAY 2 /* Text and Display */
  2252. #define PAN_FAMILY_SCRIPT 3 /* Script */
  2253. #define PAN_FAMILY_DECORATIVE 4 /* Decorative */
  2254. #define PAN_FAMILY_PICTORIAL 5 /* Pictorial */
  2255. #define PAN_SERIF_COVE 2 /* Cove */
  2256. #define PAN_SERIF_OBTUSE_COVE 3 /* Obtuse Cove */
  2257. #define PAN_SERIF_SQUARE_COVE 4 /* Square Cove */
  2258. #define PAN_SERIF_OBTUSE_SQUARE_COVE 5 /* Obtuse Square Cove */
  2259. #define PAN_SERIF_SQUARE 6 /* Square */
  2260. #define PAN_SERIF_THIN 7 /* Thin */
  2261. #define PAN_SERIF_BONE 8 /* Bone */
  2262. #define PAN_SERIF_EXAGGERATED 9 /* Exaggerated */
  2263. #define PAN_SERIF_TRIANGLE 10 /* Triangle */
  2264. #define PAN_SERIF_NORMAL_SANS 11 /* Normal Sans */
  2265. #define PAN_SERIF_OBTUSE_SANS 12 /* Obtuse Sans */
  2266. #define PAN_SERIF_PERP_SANS 13 /* Prep Sans */
  2267. #define PAN_SERIF_FLARED 14 /* Flared */
  2268. #define PAN_SERIF_ROUNDED 15 /* Rounded */
  2269. #define PAN_WEIGHT_VERY_LIGHT 2 /* Very Light */
  2270. #define PAN_WEIGHT_LIGHT 3 /* Light */
  2271. #define PAN_WEIGHT_THIN 4 /* Thin */
  2272. #define PAN_WEIGHT_BOOK 5 /* Book */
  2273. #define PAN_WEIGHT_MEDIUM 6 /* Medium */
  2274. #define PAN_WEIGHT_DEMI 7 /* Demi */
  2275. #define PAN_WEIGHT_BOLD 8 /* Bold */
  2276. #define PAN_WEIGHT_HEAVY 9 /* Heavy */
  2277. #define PAN_WEIGHT_BLACK 10 /* Black */
  2278. #define PAN_WEIGHT_NORD 11 /* Nord */
  2279. #define PAN_PROP_OLD_STYLE 2 /* Old Style */
  2280. #define PAN_PROP_MODERN 3 /* Modern */
  2281. #define PAN_PROP_EVEN_WIDTH 4 /* Even Width */
  2282. #define PAN_PROP_EXPANDED 5 /* Expanded */
  2283. #define PAN_PROP_CONDENSED 6 /* Condensed */
  2284. #define PAN_PROP_VERY_EXPANDED 7 /* Very Expanded */
  2285. #define PAN_PROP_VERY_CONDENSED 8 /* Very Condensed */
  2286. #define PAN_PROP_MONOSPACED 9 /* Monospaced */
  2287. #define PAN_CONTRAST_NONE 2 /* None */
  2288. #define PAN_CONTRAST_VERY_LOW 3 /* Very Low */
  2289. #define PAN_CONTRAST_LOW 4 /* Low */
  2290. #define PAN_CONTRAST_MEDIUM_LOW 5 /* Medium Low */
  2291. #define PAN_CONTRAST_MEDIUM 6 /* Medium */
  2292. #define PAN_CONTRAST_MEDIUM_HIGH 7 /* Mediim High */
  2293. #define PAN_CONTRAST_HIGH 8 /* High */
  2294. #define PAN_CONTRAST_VERY_HIGH 9 /* Very High */
  2295. #define PAN_STROKE_GRADUAL_DIAG 2 /* Gradual/Diagonal */
  2296. #define PAN_STROKE_GRADUAL_TRAN 3 /* Gradual/Transitional */
  2297. #define PAN_STROKE_GRADUAL_VERT 4 /* Gradual/Vertical */
  2298. #define PAN_STROKE_GRADUAL_HORZ 5 /* Gradual/Horizontal */
  2299. #define PAN_STROKE_RAPID_VERT 6 /* Rapid/Vertical */
  2300. #define PAN_STROKE_RAPID_HORZ 7 /* Rapid/Horizontal */
  2301. #define PAN_STROKE_INSTANT_VERT 8 /* Instant/Vertical */
  2302. #define PAN_STRAIGHT_ARMS_HORZ 2 /* Straight Arms/Horizontal */
  2303. #define PAN_STRAIGHT_ARMS_WEDGE 3 /* Straight Arms/Wedge */
  2304. #define PAN_STRAIGHT_ARMS_VERT 4 /* Straight Arms/Vertical */
  2305. #define PAN_STRAIGHT_ARMS_SINGLE_SERIF 5 /* Straight Arms/Single-Serif */
  2306. #define PAN_STRAIGHT_ARMS_DOUBLE_SERIF 6 /* Straight Arms/Double-Serif */
  2307. #define PAN_BENT_ARMS_HORZ 7 /* Non-Straight Arms/Horizontal */
  2308. #define PAN_BENT_ARMS_WEDGE 8 /* Non-Straight Arms/Wedge */
  2309. #define PAN_BENT_ARMS_VERT 9 /* Non-Straight Arms/Vertical */
  2310. #define PAN_BENT_ARMS_SINGLE_SERIF 10 /* Non-Straight Arms/Single-Serif */
  2311. #define PAN_BENT_ARMS_DOUBLE_SERIF 11 /* Non-Straight Arms/Double-Serif */
  2312. #define PAN_LETT_NORMAL_CONTACT 2 /* Normal/Contact */
  2313. #define PAN_LETT_NORMAL_WEIGHTED 3 /* Normal/Weighted */
  2314. #define PAN_LETT_NORMAL_BOXED 4 /* Normal/Boxed */
  2315. #define PAN_LETT_NORMAL_FLATTENED 5 /* Normal/Flattened */
  2316. #define PAN_LETT_NORMAL_ROUNDED 6 /* Normal/Rounded */
  2317. #define PAN_LETT_NORMAL_OFF_CENTER 7 /* Normal/Off Center */
  2318. #define PAN_LETT_NORMAL_SQUARE 8 /* Normal/Square */
  2319. #define PAN_LETT_OBLIQUE_CONTACT 9 /* Oblique/Contact */
  2320. #define PAN_LETT_OBLIQUE_WEIGHTED 10 /* Oblique/Weighted */
  2321. #define PAN_LETT_OBLIQUE_BOXED 11 /* Oblique/Boxed */
  2322. #define PAN_LETT_OBLIQUE_FLATTENED 12 /* Oblique/Flattened */
  2323. #define PAN_LETT_OBLIQUE_ROUNDED 13 /* Oblique/Rounded */
  2324. #define PAN_LETT_OBLIQUE_OFF_CENTER 14 /* Oblique/Off Center */
  2325. #define PAN_LETT_OBLIQUE_SQUARE 15 /* Oblique/Square */
  2326. #define PAN_MIDLINE_STANDARD_TRIMMED 2 /* Standard/Trimmed */
  2327. #define PAN_MIDLINE_STANDARD_POINTED 3 /* Standard/Pointed */
  2328. #define PAN_MIDLINE_STANDARD_SERIFED 4 /* Standard/Serifed */
  2329. #define PAN_MIDLINE_HIGH_TRIMMED 5 /* High/Trimmed */
  2330. #define PAN_MIDLINE_HIGH_POINTED 6 /* High/Pointed */
  2331. #define PAN_MIDLINE_HIGH_SERIFED 7 /* High/Serifed */
  2332. #define PAN_MIDLINE_CONSTANT_TRIMMED 8 /* Constant/Trimmed */
  2333. #define PAN_MIDLINE_CONSTANT_POINTED 9 /* Constant/Pointed */
  2334. #define PAN_MIDLINE_CONSTANT_SERIFED 10 /* Constant/Serifed */
  2335. #define PAN_MIDLINE_LOW_TRIMMED 11 /* Low/Trimmed */
  2336. #define PAN_MIDLINE_LOW_POINTED 12 /* Low/Pointed */
  2337. #define PAN_MIDLINE_LOW_SERIFED 13 /* Low/Serifed */
  2338. #define PAN_XHEIGHT_CONSTANT_SMALL 2 /* Constant/Small */
  2339. #define PAN_XHEIGHT_CONSTANT_STD 3 /* Constant/Standard */
  2340. #define PAN_XHEIGHT_CONSTANT_LARGE 4 /* Constant/Large */
  2341. #define PAN_XHEIGHT_DUCKING_SMALL 5 /* Ducking/Small */
  2342. #define PAN_XHEIGHT_DUCKING_STD 6 /* Ducking/Standard */
  2343. #define PAN_XHEIGHT_DUCKING_LARGE 7 /* Ducking/Large */
  2344. #endif /* WINVER >= 0x0400 */
  2345. typedef struct tagOUTLINETEXTMETRIC
  2346. {
  2347. UINT otmSize;
  2348. TEXTMETRIC otmTextMetrics;
  2349. BYTE otmFiller;
  2350. PANOSE otmPanoseNumber;
  2351. UINT otmfsSelection;
  2352. UINT otmfsType;
  2353. int otmsCharSlopeRise;
  2354. int otmsCharSlopeRun;
  2355. int otmItalicAngle;
  2356. UINT otmEMSquare;
  2357. int otmAscent;
  2358. int otmDescent;
  2359. UINT otmLineGap;
  2360. UINT otmsCapEmHeight;
  2361. UINT otmsXHeight;
  2362. RECT otmrcFontBox;
  2363. int otmMacAscent;
  2364. int otmMacDescent;
  2365. UINT otmMacLineGap;
  2366. UINT otmusMinimumPPEM;
  2367. POINT otmptSubscriptSize;
  2368. POINT otmptSubscriptOffset;
  2369. POINT otmptSuperscriptSize;
  2370. POINT otmptSuperscriptOffset;
  2371. UINT otmsStrikeoutSize;
  2372. int otmsStrikeoutPosition;
  2373. int otmsUnderscorePosition;
  2374. int otmsUnderscoreSize;
  2375. PSTR otmpFamilyName;
  2376. PSTR otmpFaceName;
  2377. PSTR otmpStyleName;
  2378. PSTR otmpFullName;
  2379. } OUTLINETEXTMETRIC, FAR* LPOUTLINETEXTMETRIC;
  2380. WORD WINAPI GetOutlineTextMetrics(HDC, UINT, OUTLINETEXTMETRIC FAR*);
  2381. #endif /* NOSCALABLEFONT */
  2382. #endif /* WINVER >= 0x030a */
  2383. #ifndef NOGDIOBJ
  2384. #if (WINVER >= 0x030a)
  2385. /* Structure passed to FONTENUMPROC */
  2386. /* NOTE: NEWTEXTMETRIC is the same as TEXTMETRIC plus 4 new fields */
  2387. typedef struct tagNEWTEXTMETRIC
  2388. {
  2389. int tmHeight;
  2390. int tmAscent;
  2391. int tmDescent;
  2392. int tmInternalLeading;
  2393. int tmExternalLeading;
  2394. int tmAveCharWidth;
  2395. int tmMaxCharWidth;
  2396. int tmWeight;
  2397. BYTE tmItalic;
  2398. BYTE tmUnderlined;
  2399. BYTE tmStruckOut;
  2400. BYTE tmFirstChar;
  2401. BYTE tmLastChar;
  2402. BYTE tmDefaultChar;
  2403. BYTE tmBreakChar;
  2404. BYTE tmPitchAndFamily;
  2405. BYTE tmCharSet;
  2406. int tmOverhang;
  2407. int tmDigitizedAspectX;
  2408. int tmDigitizedAspectY;
  2409. DWORD ntmFlags;
  2410. UINT ntmSizeEM;
  2411. UINT ntmCellHeight;
  2412. UINT ntmAvgWidth;
  2413. } NEWTEXTMETRIC;
  2414. typedef NEWTEXTMETRIC* PNEWTEXTMETRIC;
  2415. typedef NEWTEXTMETRIC NEAR* NPNEWTEXTMETRIC;
  2416. typedef NEWTEXTMETRIC FAR* LPNEWTEXTMETRIC;
  2417. /* ntmFlags field flags */
  2418. #define NTM_REGULAR 0x00000040L
  2419. #define NTM_BOLD 0x00000020L
  2420. #define NTM_ITALIC 0x00000001L
  2421. #define LF_FULLFACESIZE 64
  2422. /* Structure passed to FONTENUMPROC */
  2423. typedef struct tagENUMLOGFONT
  2424. {
  2425. LOGFONT elfLogFont;
  2426. char elfFullName[LF_FULLFACESIZE];
  2427. char elfStyle[LF_FACESIZE];
  2428. #if (WINVER >= 0x0400)
  2429. char elfScript[LF_FACESIZE];
  2430. #endif
  2431. } ENUMLOGFONT, FAR* LPENUMLOGFONT;
  2432. #endif /* WINVER >= 0x030a */
  2433. #endif /* NOGDIOBJ */
  2434. #ifdef STRICT
  2435. #ifndef NOGDIOBJ
  2436. typedef int (CALLBACK* OLDFONTENUMPROC)(const LOGFONT FAR*, const TEXTMETRIC FAR*, int, LPARAM);
  2437. #if (WINVER >= 0x030a)
  2438. typedef int (CALLBACK* FONTENUMPROC)(const ENUMLOGFONT FAR*, const NEWTEXTMETRIC FAR*, int, LPARAM);
  2439. int WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPARAM);
  2440. int WINAPI EnumFontFamiliesEx(HDC, LPLOGFONT, FONTENUMPROC, LPARAM,DWORD);
  2441. #else /* WINVER >= 0x030a */
  2442. typedef OLDFONTENUMPROC FONTENUMPROC;
  2443. #endif /* WINVER >= 0x030a) */
  2444. int WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPARAM);
  2445. #endif /* NOGDIOBJ */
  2446. #else /* STRICT */
  2447. typedef FARPROC OLDFONTENUMPROC;
  2448. typedef FARPROC FONTENUMPROC;
  2449. int WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPSTR);
  2450. #if (WINVER >= 0x030a)
  2451. int WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPSTR);
  2452. #endif /* WINVER >= 0x030a */
  2453. #endif /* !STRICT */
  2454. /* EnumFonts font type values */
  2455. #define RASTER_FONTTYPE 0x0001
  2456. #define DEVICE_FONTTYPE 0X0002
  2457. #if (WINVER >= 0x030a)
  2458. #define TRUETYPE_FONTTYPE 0x0004
  2459. #endif /* WINVER >= 0x030a */
  2460. #endif /* NOTEXTMETRIC */
  2461. #ifndef NOSCALABLEFONT
  2462. #if (WINVER >= 0x030a)
  2463. DWORD WINAPI ConvertOutlineFontFile(LPCSTR, LPCSTR, LPCSTR); /* ;Internal */
  2464. DWORD WINAPI GetFontData(HDC, DWORD, DWORD, void FAR*, DWORD);
  2465. BOOL WINAPI CreateScalableFontResource(UINT, LPCSTR, LPCSTR, LPCSTR);
  2466. typedef struct tagGLYPHMETRICS
  2467. {
  2468. UINT gmBlackBoxX;
  2469. UINT gmBlackBoxY;
  2470. POINT gmptGlyphOrigin;
  2471. int gmCellIncX;
  2472. int gmCellIncY;
  2473. } GLYPHMETRICS, FAR* LPGLYPHMETRICS;
  2474. typedef struct tagFIXED
  2475. {
  2476. UINT fract;
  2477. int value;
  2478. } FIXED, FAR* LPFIXED;
  2479. typedef struct tagMAT2
  2480. {
  2481. FIXED eM11;
  2482. FIXED eM12;
  2483. FIXED eM21;
  2484. FIXED eM22;
  2485. } MAT2, FAR* LPMAT2;
  2486. DWORD WINAPI GetGlyphOutline(HDC, UINT, UINT, GLYPHMETRICS FAR*, DWORD, void FAR*, const MAT2 FAR*);
  2487. /* GetGlyphOutline constants */
  2488. #define GGO_METRICS 0
  2489. #define GGO_BITMAP 1
  2490. #define GGO_NATIVE 2
  2491. #if (WINVER >= 0x0400)
  2492. #define GGO_GRAY2_BITMAP 4
  2493. #define GGO_GRAY4_BITMAP 5
  2494. #define GGO_GRAY8_BITMAP 6
  2495. #endif /* WINVER >= 0x0400 */
  2496. #define TT_POLYGON_TYPE 24
  2497. #define TT_PRIM_LINE 1
  2498. #define TT_PRIM_QSPLINE 2
  2499. typedef struct tagPOINTFX
  2500. {
  2501. FIXED x;
  2502. FIXED y;
  2503. } POINTFX, FAR* LPPOINTFX;
  2504. typedef struct tagTTPOLYCURVE
  2505. {
  2506. UINT wType;
  2507. UINT cpfx;
  2508. POINTFX apfx[1];
  2509. } TTPOLYCURVE, FAR* LPTTPOLYCURVE;
  2510. typedef struct tagTTPOLYGONHEADER
  2511. {
  2512. DWORD cb;
  2513. DWORD dwType;
  2514. POINTFX pfxStart;
  2515. } TTPOLYGONHEADER, FAR* LPTTPOLYGONHEADER;
  2516. typedef UINT FAR* LPFONTDIR; /* ;Internal */
  2517. /* ;Internal */
  2518. DWORD WINAPI EngineMakeFontDir(HDC, LPFONTDIR, LPCSTR); /* ;Internal */
  2519. /* ;Internal */
  2520. typedef struct tagABC
  2521. {
  2522. int abcA;
  2523. UINT abcB;
  2524. int abcC;
  2525. } ABC;
  2526. typedef ABC FAR* LPABC;
  2527. BOOL WINAPI GetCharABCWidths(HDC, UINT, UINT, ABC FAR*);
  2528. typedef struct tagKERNINGPAIR
  2529. {
  2530. WORD wFirst;
  2531. WORD wSecond;
  2532. int iKernAmount;
  2533. } KERNINGPAIR, FAR* LPKERNINGPAIR;
  2534. int WINAPI GetKerningPairs(HDC, int, KERNINGPAIR FAR*);
  2535. typedef struct tagRASTERIZER_STATUS
  2536. {
  2537. int nSize;
  2538. int wFlags;
  2539. int nLanguageID;
  2540. } RASTERIZER_STATUS;
  2541. typedef RASTERIZER_STATUS FAR* LPRASTERIZER_STATUS;
  2542. /* bits defined in wFlags of RASTERIZER_STATUS */
  2543. #define TT_AVAILABLE 0x0001
  2544. #define TT_ENABLED 0x0002
  2545. BOOL WINAPI GetRasterizerCaps(RASTERIZER_STATUS FAR*, int);
  2546. #endif /* WINVER >= 0x030a */
  2547. #endif /* NOSCALABLEFONT */
  2548. /****** Bitmap support ******************************************************/
  2549. #ifndef NOBITMAP
  2550. typedef struct tagBITMAP
  2551. {
  2552. int bmType;
  2553. int bmWidth;
  2554. int bmHeight;
  2555. int bmWidthBytes;
  2556. BYTE bmPlanes;
  2557. BYTE bmBitsPixel;
  2558. void FAR* bmBits;
  2559. } BITMAP;
  2560. typedef BITMAP* PBITMAP;
  2561. typedef BITMAP NEAR* NPBITMAP;
  2562. typedef BITMAP FAR* LPBITMAP;
  2563. /* Bitmap Header structures */
  2564. typedef struct tagRGBTRIPLE
  2565. {
  2566. BYTE rgbtBlue;
  2567. BYTE rgbtGreen;
  2568. BYTE rgbtRed;
  2569. } RGBTRIPLE;
  2570. typedef RGBTRIPLE FAR* LPRGBTRIPLE;
  2571. typedef struct tagRGBQUAD
  2572. {
  2573. BYTE rgbBlue;
  2574. BYTE rgbGreen;
  2575. BYTE rgbRed;
  2576. BYTE rgbReserved;
  2577. } RGBQUAD;
  2578. typedef RGBQUAD FAR* LPRGBQUAD;
  2579. /* structures for defining DIBs */
  2580. typedef struct tagBITMAPCOREHEADER
  2581. {
  2582. DWORD bcSize;
  2583. short bcWidth;
  2584. short bcHeight;
  2585. WORD bcPlanes;
  2586. WORD bcBitCount;
  2587. } BITMAPCOREHEADER;
  2588. typedef BITMAPCOREHEADER* PBITMAPCOREHEADER;
  2589. typedef BITMAPCOREHEADER FAR* LPBITMAPCOREHEADER;
  2590. typedef struct tagBITMAPINFOHEADER
  2591. {
  2592. DWORD biSize;
  2593. LONG biWidth;
  2594. LONG biHeight;
  2595. WORD biPlanes;
  2596. WORD biBitCount;
  2597. DWORD biCompression;
  2598. DWORD biSizeImage;
  2599. LONG biXPelsPerMeter;
  2600. LONG biYPelsPerMeter;
  2601. DWORD biClrUsed;
  2602. DWORD biClrImportant;
  2603. } BITMAPINFOHEADER;
  2604. typedef BITMAPINFOHEADER* PBITMAPINFOHEADER;
  2605. typedef BITMAPINFOHEADER FAR* LPBITMAPINFOHEADER;
  2606. /* constants for the biCompression field */
  2607. #define BI_RGB 0L
  2608. #define BI_RLE8 1L
  2609. #define BI_RLE4 2L
  2610. #define BI_BITFIELDS 3L
  2611. typedef struct tagBITMAPINFO
  2612. {
  2613. BITMAPINFOHEADER bmiHeader;
  2614. RGBQUAD bmiColors[1];
  2615. } BITMAPINFO;
  2616. typedef BITMAPINFO* PBITMAPINFO;
  2617. typedef BITMAPINFO FAR* LPBITMAPINFO;
  2618. typedef struct tagBITMAPCOREINFO
  2619. {
  2620. BITMAPCOREHEADER bmciHeader;
  2621. RGBTRIPLE bmciColors[1];
  2622. } BITMAPCOREINFO;
  2623. typedef BITMAPCOREINFO* PBITMAPCOREINFO;
  2624. typedef BITMAPCOREINFO FAR* LPBITMAPCOREINFO;
  2625. typedef struct tagBITMAPFILEHEADER
  2626. {
  2627. UINT bfType;
  2628. DWORD bfSize;
  2629. UINT bfReserved1;
  2630. UINT bfReserved2;
  2631. DWORD bfOffBits;
  2632. } BITMAPFILEHEADER;
  2633. typedef BITMAPFILEHEADER* PBITMAPFILEHEADER;
  2634. typedef BITMAPFILEHEADER FAR* LPBITMAPFILEHEADER;
  2635. /* Pel Array */ /* ;Internal */
  2636. typedef struct tagPELARRAY /* ;Internal */
  2637. { /* ;Internal */
  2638. int paXCount; /* ;Internal */
  2639. int paYCount; /* ;Internal */
  2640. int paXExt; /* ;Internal */
  2641. int paYExt; /* ;Internal */
  2642. BYTE paRGBs; /* ;Internal */
  2643. } PELARRAY; /* ;Internal */
  2644. typedef PELARRAY* PPELARRAY; /* ;Internal */
  2645. typedef PELARRAY NEAR* NPPELARRAY; /* ;Internal */
  2646. typedef PELARRAY FAR* LPPELARRAY; /* ;Internal */
  2647. /* ;Internal */
  2648. HBITMAP WINAPI CreateBitmap(int, int, UINT, UINT, const void FAR*);
  2649. HBITMAP WINAPI CreateBitmapIndirect(BITMAP FAR* );
  2650. HBITMAP WINAPI CreateCompatibleBitmap(HDC, int, int);
  2651. HBITMAP WINAPI CreateDiscardableBitmap(HDC, int, int);
  2652. HBITMAP WINAPI CreateDIBitmap(HDC, BITMAPINFOHEADER FAR*, DWORD, const void FAR*, BITMAPINFO FAR*, UINT);
  2653. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  2654. HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO FAR*, UINT, LPVOID FAR*, DWORD, DWORD); /* ;Internal 4.0 */
  2655. UINT WINAPI SetDIBColorTable(HDC, UINT, UINT, const RGBQUAD FAR *); /* ;Internal 4.0 */
  2656. UINT WINAPI GetDIBColorTable(HDC, UINT, UINT, LPRGBQUAD); /* ;Internal 4.0 */
  2657. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  2658. /* ;Internal 4.0 */
  2659. #ifdef tagWND // ;Internal
  2660. HBITMAP WINAPI OwnerLoadBitmap(HINSTANCE, LPCSTR, HANDLE); // ;Internal
  2661. #else // ;Internal
  2662. HBITMAP WINAPI LoadBitmap(HINSTANCE, LPCSTR);
  2663. #endif // ;Internal
  2664. /* DIB color table identifiers */
  2665. #define DIB_RGB_COLORS 0
  2666. #define DIB_PAL_COLORS 1
  2667. /* constants for CreateDIBitmap */
  2668. #define CBM_INIT 0x00000004L
  2669. #endif /* NOBITMAP */
  2670. #ifndef NORASTEROPS
  2671. /* Binary raster ops */
  2672. #define R2_BLACK 1
  2673. #define R2_NOTMERGEPEN 2
  2674. #define R2_MASKNOTPEN 3
  2675. #define R2_NOTCOPYPEN 4
  2676. #define R2_MASKPENNOT 5
  2677. #define R2_NOT 6
  2678. #define R2_XORPEN 7
  2679. #define R2_NOTMASKPEN 8
  2680. #define R2_MASKPEN 9
  2681. #define R2_NOTXORPEN 10
  2682. #define R2_NOP 11
  2683. #define R2_MERGENOTPEN 12
  2684. #define R2_COPYPEN 13
  2685. #define R2_MERGEPENNOT 14
  2686. #define R2_MERGEPEN 15
  2687. #define R2_WHITE 16
  2688. /* Ternary raster operations */
  2689. #define SRCCOPY 0x00CC0020L
  2690. #define SRCPAINT 0x00EE0086L
  2691. #define SRCAND 0x008800C6L
  2692. #define SRCINVERT 0x00660046L
  2693. #define SRCERASE 0x00440328L
  2694. #define NOTSRCCOPY 0x00330008L
  2695. #define NOTSRCERASE 0x001100A6L
  2696. #define MERGECOPY 0x00C000CAL
  2697. #define MERGEPAINT 0x00BB0226L
  2698. #define PATCOPY 0x00F00021L
  2699. #define PATOR 0x00FA0089L
  2700. #define PATPAINT 0x00FB0A09L
  2701. #define PATINVERT 0x005A0049L
  2702. #define DSTINVERT 0x00550009L
  2703. #define BLACKNESS 0x00000042L
  2704. #define WHITENESS 0x00FF0062L
  2705. #define SRCSTENCIL 0x00B8074AL
  2706. #define SRCINVSTENCIL 0x00E20746L
  2707. #endif /* NORASTEROPS */
  2708. #ifndef NOBITMAP
  2709. BOOL WINAPI BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
  2710. BOOL WINAPI PatBlt(HDC, int, int, int, int, DWORD);
  2711. BOOL WINAPI StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
  2712. int WINAPI StretchDIBits(HDC, int, int, int, int, int,
  2713. int, int, int, const void FAR*, LPBITMAPINFO, UINT, DWORD);
  2714. COLORREF WINAPI SetPixel(HDC, int, int, COLORREF);
  2715. COLORREF WINAPI GetPixel(HDC, int, int);
  2716. /* StretchBlt() Modes */
  2717. #define BLACKONWHITE 1
  2718. #define WHITEONBLACK 2
  2719. #define COLORONCOLOR 3
  2720. /* new StretchBlt() Modes (simpler names) */
  2721. #define STRETCH_ANDSCANS 1
  2722. #define STRETCH_ORSCANS 2
  2723. #define STRETCH_DELETESCANS 3
  2724. // ;Internal
  2725. // #define HALFTONE 4 /* NT */ ;Internal
  2726. // #define STRETCH_HALFSCANS 4 /* NT */ ;Internal
  2727. // ;Internal
  2728. int WINAPI SetStretchBltMode(HDC, int);
  2729. int WINAPI GetStretchBltMode(HDC);
  2730. DWORD WINAPI SetBitmapDimension(HBITMAP, int, int);
  2731. DWORD WINAPI GetBitmapDimension(HBITMAP);
  2732. #if (WINVER >= 0x030a)
  2733. BOOL WINAPI SetBitmapDimensionEx(HBITMAP, int, int, SIZE FAR*);
  2734. BOOL WINAPI GetBitmapDimensionEx(HBITMAP, SIZE FAR*);
  2735. #endif /* WINVER >= 0x030a */
  2736. int WINAPI SetROP2(HDC, int);
  2737. int WINAPI GetROP2(HDC);
  2738. LONG WINAPI SetBitmapBits(HBITMAP, DWORD, const void FAR*);
  2739. LONG WINAPI GetBitmapBits(HBITMAP, LONG, void FAR*);
  2740. int WINAPI SetDIBits(HDC, HBITMAP, UINT, UINT, const void FAR*, BITMAPINFO FAR*, UINT);
  2741. int WINAPI GetDIBits(HDC, HBITMAP, UINT, UINT, void FAR*, BITMAPINFO FAR*, UINT);
  2742. int WINAPI SetDIBitsToDevice(HDC, int, int, int, int, int, int, UINT, UINT,
  2743. void FAR*, BITMAPINFO FAR*, UINT);
  2744. #endif /* NOBITMAP */
  2745. /****** Metafile support ****************************************************/
  2746. #ifndef NOMETAFILE
  2747. DECLARE_HANDLE(HMETAFILE);
  2748. HDC WINAPI CreateMetaFile(LPCSTR);
  2749. HMETAFILE WINAPI CloseMetaFile(HDC);
  2750. HMETAFILE WINAPI GetMetaFile(LPCSTR);
  2751. BOOL WINAPI DeleteMetaFile(HMETAFILE);
  2752. HMETAFILE WINAPI CopyMetaFile(HMETAFILE, LPCSTR);
  2753. BOOL WINAPI PlayMetaFile(HDC, HMETAFILE);
  2754. HGLOBAL WINAPI GetMetaFileBits(HMETAFILE);
  2755. HMETAFILE WINAPI SetMetaFileBits(HGLOBAL);
  2756. #if (WINVER >= 0x030a)
  2757. HMETAFILE WINAPI SetMetaFileBitsBetter(HGLOBAL);
  2758. #endif /* WINVER >= 0x030a */
  2759. /* Clipboard Metafile Picture Structure */
  2760. typedef struct tagMETAFILEPICT
  2761. {
  2762. int mm;
  2763. int xExt;
  2764. int yExt;
  2765. HMETAFILE hMF;
  2766. } METAFILEPICT;
  2767. typedef METAFILEPICT FAR* LPMETAFILEPICT;
  2768. typedef struct tagMETAHEADER
  2769. {
  2770. UINT mtType;
  2771. UINT mtHeaderSize;
  2772. UINT mtVersion;
  2773. DWORD mtSize;
  2774. UINT mtNoObjects;
  2775. DWORD mtMaxRecord;
  2776. UINT mtNoParameters;
  2777. } METAHEADER;
  2778. typedef struct tagHANDLETABLE
  2779. {
  2780. HGDIOBJ objectHandle[1];
  2781. } HANDLETABLE;
  2782. typedef HANDLETABLE* PHANDLETABLE;
  2783. typedef HANDLETABLE FAR* LPHANDLETABLE;
  2784. typedef struct tagMETARECORD
  2785. {
  2786. DWORD rdSize;
  2787. UINT rdFunction;
  2788. UINT rdParm[1];
  2789. } METARECORD;
  2790. typedef METARECORD* PMETARECORD;
  2791. typedef METARECORD FAR* LPMETARECORD;
  2792. /* Metafile Functions */
  2793. #define META_SETBKCOLOR 0x0201
  2794. #define META_SETBKMODE 0x0102
  2795. #define META_SETMAPMODE 0x0103
  2796. #define META_SETROP2 0x0104
  2797. #define META_SETRELABS 0x0105
  2798. #define META_SETPOLYFILLMODE 0x0106
  2799. #define META_SETSTRETCHBLTMODE 0x0107
  2800. #define META_SETTEXTCHAREXTRA 0x0108
  2801. #define META_SETTEXTCOLOR 0x0209
  2802. #define META_SETTEXTJUSTIFICATION 0x020A
  2803. #define META_SETWINDOWORG 0x020B
  2804. #define META_SETWINDOWEXT 0x020C
  2805. #define META_SETVIEWPORTORG 0x020D
  2806. #define META_SETVIEWPORTEXT 0x020E
  2807. #define META_OFFSETWINDOWORG 0x020F
  2808. #define META_SCALEWINDOWEXT 0x0410
  2809. #define META_OFFSETVIEWPORTORG 0x0211
  2810. #define META_SCALEVIEWPORTEXT 0x0412
  2811. #define META_LINETO 0x0213
  2812. #define META_MOVETO 0x0214
  2813. #define META_EXCLUDECLIPRECT 0x0415
  2814. #define META_INTERSECTCLIPRECT 0x0416
  2815. #define META_ARC 0x0817
  2816. #define META_ELLIPSE 0x0418
  2817. #define META_FLOODFILL 0x0419
  2818. #define META_PIE 0x081A
  2819. #define META_RECTANGLE 0x041B
  2820. #define META_ROUNDRECT 0x061C
  2821. #define META_PATBLT 0x061D
  2822. #define META_SAVEDC 0x001E
  2823. #define META_SETPIXEL 0x041F
  2824. #define META_OFFSETCLIPRGN 0x0220
  2825. #define META_TEXTOUT 0x0521
  2826. #define META_BITBLT 0x0922
  2827. #define META_STRETCHBLT 0x0B23
  2828. #define META_POLYGON 0x0324
  2829. #define META_POLYLINE 0x0325
  2830. #define META_ESCAPE 0x0626
  2831. #define META_RESTOREDC 0x0127
  2832. #define META_FILLREGION 0x0228
  2833. #define META_FRAMEREGION 0x0429
  2834. #define META_INVERTREGION 0x012A
  2835. #define META_PAINTREGION 0x012B
  2836. #define META_SELECTCLIPREGION 0x012C
  2837. #define META_SELECTOBJECT 0x012D
  2838. #define META_SETTEXTALIGN 0x012E
  2839. #define META_DRAWTEXT 0x062F
  2840. #define META_CHORD 0x0830
  2841. #define META_SETMAPPERFLAGS 0x0231
  2842. #define META_EXTTEXTOUT 0x0a32
  2843. #define META_SETDIBTODEV 0x0d33
  2844. #define META_SELECTPALETTE 0x0234
  2845. #define META_REALIZEPALETTE 0x0035
  2846. #define META_ANIMATEPALETTE 0x0436
  2847. #define META_SETPALENTRIES 0x0037
  2848. #define META_POLYPOLYGON 0x0538
  2849. #define META_RESIZEPALETTE 0x0139
  2850. #define META_DIBBITBLT 0x0940
  2851. #define META_DIBSTRETCHBLT 0x0b41
  2852. #define META_DIBCREATEPATTERNBRUSH 0x0142
  2853. #define META_STRETCHDIB 0x0f43
  2854. #define META_EXTFLOODFILL 0x0548
  2855. #define META_RESETDC 0x014C
  2856. #define META_STARTDOC 0x014D
  2857. #define META_STARTPAGE 0x004F
  2858. #define META_ENDPAGE 0x0050
  2859. #define META_ABORTDOC 0x0052
  2860. #define META_ENDDOC 0x005E
  2861. #define META_DELETEOBJECT 0x01f0
  2862. #define META_CREATEPALETTE 0x00f7
  2863. #define META_CREATEBRUSH 0x00F8
  2864. #define META_CREATEPATTERNBRUSH 0x01F9
  2865. #define META_CREATEPENINDIRECT 0x02FA
  2866. #define META_CREATEFONTINDIRECT 0x02FB
  2867. #define META_CREATEBRUSHINDIRECT 0x02FC
  2868. #define META_CREATEBITMAPINDIRECT 0x02FD
  2869. #define META_CREATEBITMAP 0x06FE
  2870. #define META_CREATEREGION 0x06FF
  2871. void WINAPI PlayMetaFileRecord(HDC, HANDLETABLE FAR*, METARECORD FAR*, UINT);
  2872. #ifdef STRICT
  2873. typedef int (CALLBACK* MFENUMPROC)(HDC, HANDLETABLE FAR*, METARECORD FAR*, int, LPARAM);
  2874. #else
  2875. typedef FARPROC MFENUMPROC;
  2876. #endif
  2877. BOOL WINAPI EnumMetaFile(HDC, HMETAFILE, MFENUMPROC, LPARAM);
  2878. #endif /* NOMETAFILE */
  2879. /****** Enhanced Metafile support *******************************************/ /* ;Internal 4.0 */
  2880. #if ((WINVER >= 0x0400) && !defined(NOGDI) && !defined(NOMETAFILE)) /* ;Internal 4.0 */
  2881. /* ;Internal 4.0 */
  2882. typedef struct tagMRMETAFILE /* ;Internal 4.0 */
  2883. { /* ;Internal 4.0 */
  2884. DWORD iType; /* ;Internal 4.0 */
  2885. DWORD nSize; /* ;Internal 4.0 */
  2886. RECTL rclBounds; /* ;Internal 4.0 */
  2887. RECTL rclFrame; /* ;Internal 4.0 */
  2888. DWORD dSignature; /* ;Internal 4.0 */
  2889. DWORD nVersion; /* ;Internal 4.0 */
  2890. DWORD nBytes; /* ;Internal 4.0 */
  2891. DWORD nRecords; /* ;Internal 4.0 */
  2892. WORD nHandles; /* ;Internal 4.0 */
  2893. WORD sReserved; /* ;Internal 4.0 */
  2894. DWORD nDescription; /* ;Internal 4.0 */
  2895. DWORD offDescription; /* ;Internal 4.0 */
  2896. DWORD nPalEntries; /* ;Internal 4.0 */
  2897. SIZEL szlDevice; /* ;Internal 4.0 */
  2898. SIZEL szlMillimeters; /* ;Internal 4.0 */
  2899. /* ;Internal 4.0 */
  2900. } MRMETAFILE, NEAR* PMRMETAFILE, FAR* LPMRMETAFILE; /* ;Internal 4.0 */
  2901. /* ;Internal 4.0 */
  2902. typedef struct tagENHMETARECORD /* ;Internal 4.0 */
  2903. { /* ;Internal 4.0 */
  2904. DWORD iType; /* ;Internal 4.0 */
  2905. DWORD nSize; /* ;Internal 4.0 */
  2906. DWORD dParm[1]; /* ;Internal 4.0 */
  2907. } ENHMETARECORD, NEAR* PENHMETARECORD, FAR* LPENHMETARECORD; /* ;Internal 4.0 */
  2908. /* ;Internal 4.0 */
  2909. /* MRMETAFILE constants */ /* ;Internal 4.0 */
  2910. /* ;Internal 4.0 */
  2911. #define ENHMETA_SIGNATURE 0x464D4520 /* Mandatory signature. */ /* ;Internal 4.0 */
  2912. /* ;Internal 4.0 */
  2913. /* Stock object flag used in the object handle index in the enhanced */ /* ;Internal 4.0 */
  2914. /* metafile records. */ /* ;Internal 4.0 */
  2915. /* E.g. The object handle index (META_STOCK_OBJECT | BLACK_BRUSH) */ /* ;Internal 4.0 */
  2916. /* represents the stock object BLACK_BRUSH. */ /* ;Internal 4.0 */
  2917. /* ;Internal 4.0 */
  2918. #define ENHMETA_STOCK_OBJECT 0x80000000L /* ;Internal 4.0 */
  2919. /* ;Internal 4.0 */
  2920. typedef HANDLE HENHMETAFILE; /* ;Internal 4.0 */
  2921. /* ;Internal 4.0 */
  2922. typedef LONG INT32; /* Signed or unsigned integers under NT which must */ /* ;Internal 4.0 */
  2923. typedef ULONG UINT32; /* always remain 32-bits under Chicago. */ /* ;Internal 4.0 */
  2924. /* ;Internal 4.0 */
  2925. typedef INT32 (CALLBACK* ENHMFENUMPROC)(HDC, LPHANDLETABLE, LPENHMETARECORD, INT32, LPARAM); /* ;Internal 4.0 */
  2926. /* ;Internal 4.0 */
  2927. /* Enhanced metafile APIs */ /* ;Internal 4.0 */
  2928. /* ;Internal 4.0 */
  2929. HENHMETAFILE WINAPI CloseEnhMetaFile(HDC); /* ;Internal 4.0 */
  2930. HENHMETAFILE WINAPI CopyEnhMetaFile(HENHMETAFILE, LPCSTR); /* ;Internal 4.0 */
  2931. HDC WINAPI CreateEnhMetaFile(HDC, LPCSTR, LPCRECTL, LPCSTR); /* ;Internal 4.0 */
  2932. BOOL WINAPI DeleteEnhMetaFile(HENHMETAFILE); /* ;Internal 4.0 */
  2933. BOOL WINAPI EnumEnhMetaFile(HDC, HENHMETAFILE, ENHMFENUMPROC, LPVOID, LPCRECTL); /* ;Internal 4.0 */
  2934. BOOL WINAPI GdiComment(HDC, UINT32, LPBYTE); /* ;Internal 4.0 */
  2935. HENHMETAFILE WINAPI GetEnhMetaFile(LPCSTR); /* ;Internal 4.0 */
  2936. UINT32 WINAPI GetEnhMetaFileBits(HENHMETAFILE, UINT32, LPBYTE); /* ;Internal 4.0 */
  2937. UINT32 WINAPI GetEnhMetaFileDescription(HENHMETAFILE, UINT32, LPSTR); /* ;Internal 4.0 */
  2938. UINT32 WINAPI GetEnhMetaFileHeader(HENHMETAFILE, UINT32, LPMRMETAFILE); /* ;Internal 4.0 */
  2939. UINT32 WINAPI GetEnhMetaFilePaletteEntries(HENHMETAFILE, UINT32, LPPALETTEENTRY); /* ;Internal 4.0 */
  2940. UINT32 WINAPI GetWinMetaFileBits(HENHMETAFILE, UINT32, LPBYTE, int, HDC); /* ;Internal 4.0 */
  2941. BOOL WINAPI PlayEnhMetaFile(HDC, HENHMETAFILE, LPCRECTL); /* ;Internal 4.0 */
  2942. BOOL WINAPI PlayEnhMetaFileRecord(HDC, LPHANDLETABLE, LPENHMETARECORD, UINT32); /* ;Internal 4.0 */
  2943. HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT32, LPCBYTE); /* ;Internal 4.0 */
  2944. HENHMETAFILE WINAPI SetWinMetaFileBits(UINT32, LPBYTE, HDC, LPMETAFILEPICT); /* ;Internal 4.0 */
  2945. int WINAPI SetMetaRgn(HDC); /* ;Internal 4.0 */
  2946. /* ;Internal 4.0 */
  2947. #endif /* WINVER >= 0x0400 etc. */ /* ;Internal 4.0 */
  2948. /****** Printing support ****************************************************/
  2949. #ifdef STRICT
  2950. typedef BOOL (CALLBACK* ABORTPROC)(HDC, int);
  2951. #else
  2952. typedef FARPROC ABORTPROC;
  2953. #endif
  2954. #if (WINVER >= 0x030a)
  2955. int WINAPI SetAbortProc(HDC, ABORTPROC);
  2956. HANDLE WINAPI SpoolFile(LPSTR, LPSTR, LPSTR, LPSTR);
  2957. BOOL WINAPI QueryJob(HANDLE, int); /* ;Internal */
  2958. #endif /* WINVER >= 0x030a */
  2959. typedef struct {
  2960. short cbSize;
  2961. LPSTR lpszDocName;
  2962. LPSTR lpszOutput;
  2963. LPSTR lpszDatatype;
  2964. DWORD fwType;
  2965. } DOCINFO, FAR * LPDOCINFO;
  2966. /* bit flags for DOCINFO.fwType */
  2967. #define DI_APPBANDING 0x0001
  2968. #define DI_ROPS_READ_DESTINATION 0x0002 // ;will use rops that read destination
  2969. // ;pixel values to print the doc.
  2970. // ;Ex: R2_XORPEN, PATINVERT (DPx).
  2971. int WINAPI StartDoc(HDC, DOCINFO FAR*);
  2972. int WINAPI StartPage(HDC);
  2973. int WINAPI EndPage(HDC);
  2974. int WINAPI EndDoc(HDC);
  2975. int WINAPI AbortDoc(HDC);
  2976. BOOL WINAPI QueryAbort(HDC, int);
  2977. /* Spooler Error Codes */
  2978. #define SP_NOTREPORTED 0x4000
  2979. #define SP_ERROR (-1)
  2980. #define SP_APPABORT (-2)
  2981. #define SP_USERABORT (-3)
  2982. #define SP_OUTOFDISK (-4)
  2983. #define SP_OUTOFMEMORY (-5)
  2984. #define PR_JOBSTATUS 0x0000
  2985. #endif /* NOGDI */
  2986. #ifndef NOGDI
  2987. /******* GDI Escape support *************************************************/
  2988. int WINAPI Escape(HDC, int, int, LPCSTR, void FAR*);
  2989. /* GDI Escapes */
  2990. #define NEWFRAME 1
  2991. #define ABORTDOC 2
  2992. #define NEXTBAND 3
  2993. #define SETCOLORTABLE 4
  2994. #define GETCOLORTABLE 5
  2995. #define FLUSHOUTPUT 6
  2996. #define DRAFTMODE 7
  2997. #define QUERYESCSUPPORT 8
  2998. #define SETABORTPROC 9
  2999. #define STARTDOC 10
  3000. #define ENDDOC 11
  3001. #define GETPHYSPAGESIZE 12
  3002. #define GETPRINTINGOFFSET 13
  3003. #define GETSCALINGFACTOR 14
  3004. #define MFCOMMENT 15
  3005. #define GETPENWIDTH 16
  3006. #define SETCOPYCOUNT 17
  3007. #define SELECTPAPERSOURCE 18
  3008. #define DEVICEDATA 19
  3009. #define PASSTHROUGH 19
  3010. #define GETTECHNOLGY 20
  3011. #define GETTECHNOLOGY 20
  3012. #define SETLINECAP 21
  3013. #define SETLINEJOIN 22
  3014. #define SETMITERLIMIT 23
  3015. #define BANDINFO 24
  3016. #define DRAWPATTERNRECT 25
  3017. #define GETVECTORPENSIZE 26
  3018. #define GETVECTORBRUSHSIZE 27
  3019. #define ENABLEDUPLEX 28
  3020. #define GETSETPAPERBINS 29
  3021. #define GETSETPRINTORIENT 30
  3022. #define ENUMPAPERBINS 31
  3023. #define SETDIBSCALING 32
  3024. #define EPSPRINTING 33
  3025. #define ENUMPAPERMETRICS 34
  3026. #define GETSETPAPERMETRICS 35
  3027. #define POSTSCRIPT_DATA 37
  3028. #define POSTSCRIPT_IGNORE 38
  3029. #define MOUSETRAILS 39
  3030. #define GETEXTENDEDTEXTMETRICS 256
  3031. #define GETEXTENTTABLE 257
  3032. #define GETPAIRKERNTABLE 258
  3033. #define GETTRACKKERNTABLE 259
  3034. #define EXTTEXTOUT 512
  3035. #define GETFACENAME 513
  3036. #define ENABLERELATIVEWIDTHS 768
  3037. #define ENABLEPAIRKERNING 769
  3038. #define SETKERNTRACK 770
  3039. #define SETALLJUSTVALUES 771
  3040. #define SETCHARSET 772
  3041. #define STRETCHBLT 2048
  3042. #define GETSETSCREENPARAMS 3072
  3043. #define QUERYDIBSUPPORT 3073
  3044. #define QDI_SETDIBITS 0x0001
  3045. #define QDI_GETDIBITS 0x0002
  3046. #define QDI_DIBTOSCREEN 0x0004
  3047. #define QDI_STRETCHDIB 0x0008
  3048. #define BEGIN_PATH 4096
  3049. #define CLIP_TO_PATH 4097
  3050. #define END_PATH 4098
  3051. #define EXT_DEVICE_CAPS 4099
  3052. #define RESTORE_CTM 4100
  3053. #define SAVE_CTM 4101
  3054. #define SET_ARC_DIRECTION 4102
  3055. #define SET_BACKGROUND_COLOR 4103
  3056. #define SET_POLY_MODE 4104
  3057. #define SET_SCREEN_ANGLE 4105
  3058. #define SET_SPREAD 4106
  3059. #define TRANSFORM_CTM 4107
  3060. #define SET_CLIP_BOX 4108
  3061. #define SET_BOUNDS 4109
  3062. #endif /* NOGDI */
  3063. /****** USER typedefs, structures, and functions *****************************/
  3064. #ifdef tagWND // ;Internal
  3065. #define BASED __based32(__segname("_DATA")) // ;Internal
  3066. #ifdef DEBUG // ;Internal
  3067. #define HWND HWND_16 // ;Internal
  3068. #define HWNDC HWND_16 // ;Internal
  3069. #else // ;Internal
  3070. typedef struct tagWND BASED *HWND; // ;Internal
  3071. typedef HWND HWNDC; // ;Internal
  3072. #endif // ;Internal
  3073. typedef UINT HWND_16; // ;Internal
  3074. #else // ;Internal
  3075. DECLARE_HANDLE(HWND);
  3076. #endif // ;Internal
  3077. #ifndef NOUSER
  3078. #ifdef tagWND // ;Internal
  3079. #ifdef DEBUG // ;Internal
  3080. #define HMENU HMENU_16 // ;Internal
  3081. #else // ;Internal
  3082. typedef struct tagMENU FAR* HMENU; // ;Internal
  3083. #endif // ;Internal
  3084. typedef UINT HMENU_16; // ;Internal
  3085. #else // ;Internal
  3086. DECLARE_HANDLE(HMENU);
  3087. #endif // ;Internal
  3088. DECLARE_HANDLE(HICON);
  3089. typedef HICON HCURSOR; /* HICONs & HCURSORs are polymorphic */
  3090. /****** System Metrics *******************************************************/
  3091. #ifndef NOSYSMETRICS
  3092. int WINAPI GetSystemMetrics(int);
  3093. /* GetSystemMetrics() codes */
  3094. #define SM_CXSCREEN 0
  3095. #define SM_CYSCREEN 1
  3096. #define SM_CXVSCROLL 2
  3097. #define SM_CYHSCROLL 3
  3098. #define SM_CYCAPTION 4
  3099. #define SM_CXBORDER 5
  3100. #define SM_CYBORDER 6
  3101. #define SM_CXFIXEDFRAME 7
  3102. #define SM_CYFIXEDFRAME 8
  3103. #define SM_CYVTHUMB 9
  3104. #define SM_CXHTHUMB 10
  3105. #define SM_CXICON 11
  3106. #define SM_CYICON 12
  3107. #define SM_CXCURSOR 13
  3108. #define SM_CYCURSOR 14
  3109. #define SM_CYMENU 15
  3110. #define SM_CXFULLSCREEN 16
  3111. #define SM_CYFULLSCREEN 17
  3112. #define SM_CYKANJIWINDOW 18
  3113. #define SM_MOUSEPRESENT 19
  3114. #define SM_CYVSCROLL 20
  3115. #define SM_CXHSCROLL 21
  3116. #define SM_DEBUG 22
  3117. #define SM_SWAPBUTTON 23
  3118. #define SM_RESERVED1 24
  3119. #define SM_RESERVED2 25
  3120. #define SM_RESERVED3 26
  3121. #define SM_RESERVED4 27
  3122. #define SM_CXMIN 28
  3123. #define SM_CYMIN 29
  3124. #define SM_CXSIZE 30
  3125. #define SM_CYSIZE 31
  3126. #define SM_CXSIZEFRAME 32
  3127. #define SM_CYSIZEFRAME 33
  3128. #define SM_CXMINTRACK 34
  3129. #define SM_CYMINTRACK 35
  3130. #if (WINVER >= 0x030a)
  3131. #define SM_CXDOUBLECLK 36
  3132. #define SM_CYDOUBLECLK 37
  3133. #define SM_CXICONSPACING 38
  3134. #define SM_CYICONSPACING 39
  3135. #define SM_MENUDROPALIGNMENT 40
  3136. #define SM_PENWINDOWS 41
  3137. #define SM_DBCSENABLED 42
  3138. #define SM_CMOUSEBUTTONS 43
  3139. #define SM_SECURE 44
  3140. #endif /* WINVER >= 0x030a */
  3141. /* ;Internal 4.0 */
  3142. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  3143. #define SM_CXEDGE 45 /* ;Internal 4.0 */
  3144. #define SM_CYEDGE 46 /* ;Internal 4.0 */
  3145. #define SM_CXMINSPACING 47 /* ;Internal 4.0 */
  3146. #define SM_CYMINSPACING 48 /* ;Internal 4.0 */
  3147. #define SM_CXSMICON 49 /* ;Internal 4.0 */
  3148. #define SM_CYSMICON 50 /* ;Internal 4.0 */
  3149. #define SM_CYSMCAPTION 51 /* ;Internal 4.0 */
  3150. #define SM_CXSMSIZE 52 /* ;Internal 4.0 */
  3151. #define SM_CYSMSIZE 53 /* ;Internal 4.0 */
  3152. #define SM_CXMENUSIZE 54 /* ;Internal 4.0 */
  3153. #define SM_CYMENUSIZE 55 /* ;Internal 4.0 */
  3154. #define SM_ARRANGE 56 /* ;Internal 4.0 */
  3155. #define SM_CXMINIMIZED 57 /* ;Internal 4.0 */
  3156. #define SM_CYMINIMIZED 58 /* ;Internal 4.0 */
  3157. #define SM_CXMAXTRACK 59 /* ;Internal 4.0 */
  3158. #define SM_CYMAXTRACK 60 /* ;Internal 4.0 */
  3159. #define SM_CXMAXIMIZED 61 /* ;Internal 4.0 */
  3160. #define SM_CYMAXIMIZED 62 /* ;Internal 4.0 */
  3161. #define SM_NETWORK 63 /* ;Internal 4.0 */
  3162. #define SM_CLEANBOOT 67 /* ;Internal 4.0 */
  3163. #define SM_CXDRAG 68 /* ;Internal 4.0 */
  3164. #define SM_CYDRAG 69 /* ;Internal 4.0 */
  3165. #define SM_SHOWSOUNDS 70 /* ;Internal 4.0 */
  3166. #define SM_CXMENUCHECK 71 /* ;Internal 4.0 */
  3167. #define SM_CYMENUCHECK 72 /* ;Internal 4.0 */
  3168. #define SM_SLOWMACHINE 73 /* ;Internal 4.0 */
  3169. #define SM_MIDEASTENABLED 74 /* ;Internal 4.0 */
  3170. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  3171. #if (WINVER >= 0x040A) /* ;Internal 4.1 */
  3172. #define SM_XVIRTUALSCREEN 75 /* ;Internal 4.1 */
  3173. #define SM_YVIRTUALSCREEN 76 /* ;Internal 4.1 */
  3174. #define SM_CXVIRTUALSCREEN 77 /* ;Internal 4.1 */
  3175. #define SM_CYVIRTUALSCREEN 78 /* ;Internal 4.1 */
  3176. #endif /* WINVER >= 0x040A */ /* ;Internal 4.1 */
  3177. #define SM_CXDLGFRAME SM_CXFIXEDFRAME
  3178. #define SM_CYDLGFRAME SM_CYFIXEDFRAME
  3179. #define SM_CXFRAME SM_CXSIZEFRAME
  3180. #define SM_CYFRAME SM_CYSIZEFRAME
  3181. #define SM_CYCAPTIONICON SM_CYSMICON // ;Internal BOGUS TEMPORARY
  3182. #define SM_CYSMCAPTIONICON SM_CYSMICON // ;Internal BOGUS TEMPORARY
  3183. #define SM_CXWORKAREA SM_CXSCREEN // ;Internal BOGUS TEMPORARY
  3184. #define SM_CYWORKAREA SM_CYSCREEN // ;Internal BOGUS TEMPORARY
  3185. #define SM_XWORKAREA SM_CXBORDER // ;Internal BOGUS TEMPORARY
  3186. #define SM_YWORKAREA SM_CYBORDER // ;Internal BOGUS TEMPORARY
  3187. // WARNING: If you modify SM_CMETRICS or SM_MAX make sure you ;Internal
  3188. // modify the corresponding values in user.inc, user.api, ;Internal
  3189. // windows.inc and winuser.h ;Internal
  3190. #define SM_MAX 78 // ;Internal
  3191. #define SM_CMETRICS 79
  3192. #endif /* NOSYSMETRICS */
  3193. UINT WINAPI GetDoubleClickTime(void);
  3194. void WINAPI SetDoubleClickTime(UINT);
  3195. #define ARW_BOTTOMLEFT 0x0000 // ;Internal 4.0
  3196. #define ARW_BOTTOMRIGHT 0x0001 // ;Internal 4.0
  3197. #define ARW_TOPLEFT 0x0002 // ;Internal 4.0
  3198. #define ARW_TOPRIGHT 0x0003 // ;Internal 4.0
  3199. #define ARW_STARTMASK 0x0003 // ;Internal 4.0
  3200. #define ARW_STARTRIGHT 0x0001 // ;Internal 4.0
  3201. #define ARW_STARTTOP 0x0002 // ;Internal 4.0
  3202. // ;Internal 4.0
  3203. #define ARW_LEFT 0x0000 // ;Internal 4.0
  3204. #define ARW_RIGHT 0x0000 // ;Internal 4.0
  3205. #define ARW_UP 0x0004 // ;Internal 4.0
  3206. #define ARW_DOWN 0x0004 // ;Internal 4.0
  3207. #define ARW_HIDE 0x0008 // ;Internal 4.0
  3208. #define ARW_VALID 0x000F // ;Internal 4.0
  3209. #define ARW_ARRANGEMASK 0x0007 // ;Internal 4.0
  3210. // ;Internal 4.0
  3211. #define MMI_MINSIZE 0 // ;Internal 4.0
  3212. #define MMI_MAXSIZE 1 // ;Internal 4.0
  3213. #define MMI_MAXPOS 2 // ;Internal 4.0
  3214. #define MMI_MINTRACK 3 // ;Internal 4.0
  3215. #define MMI_MAXTRACK 4 // ;Internal 4.0
  3216. /****** System Parameters support ********************************************/
  3217. #if (WINVER >= 0x030a)
  3218. #ifndef NOSYSTEMPARAMSINFO
  3219. BOOL WINAPI SystemParametersInfo(UINT, UINT, VOID FAR*, UINT);
  3220. #if (WINVER >= 0x0400) // ;Internal 4.0
  3221. // ;Internal 4.0
  3222. #ifndef NOGDI // ;Internal 4.0
  3223. typedef struct tagCOMMONFONT // ;Internal 4.0
  3224. { // ;Internal 4.0
  3225. BYTE lfItalic; // ;Internal 4.0
  3226. BYTE lfUnderline; // ;Internal 4.0
  3227. BYTE lfStrikeOut; // ;Internal 4.0
  3228. BYTE lfCharSet; // ;Internal 4.0
  3229. BYTE lfOutPrecision; // ;Internal 4.0
  3230. BYTE lfClipPrecision; // ;Internal 4.0
  3231. BYTE lfQuality; // ;Internal 4.0
  3232. BYTE lfPitchAndFamily; // ;Internal 4.0
  3233. char lfFaceName[LF_FACESIZE]; // ;Internal 4.0
  3234. } COMMONFONT, FAR *LPCOMMONFONT; // ;Internal 4.0
  3235. // ;Internal 4.0
  3236. typedef struct tagLOGFONT_32 // ;Internal 4.0
  3237. { // ;Internal 4.0
  3238. LONG lfHeight; // ;Internal 4.0
  3239. LONG lfWidth; // ;Internal 4.0
  3240. LONG lfEscapement; // ;Internal 4.0
  3241. LONG lfOrientation; // ;Internal 4.0
  3242. LONG lfWeight; // ;Internal 4.0
  3243. COMMONFONT lfCommon; // ;Internal 4.0
  3244. } LOGFONT_32, *PLOGFONT_32, FAR *LPLOGFONT_32; // ;Internal 4.0
  3245. // ;Internal 4.0
  3246. #define METRICS_USEDEFAULT -1 // ;Internal 4.0
  3247. typedef struct tagNONCLIENTMETRICS // ;Internal 4.0
  3248. { // ;Internal 4.0
  3249. DWORD cbSize; // ;Internal 4.0
  3250. LONG iBorderWidth; // ;Internal 4.0
  3251. LONG iScrollWidth; // ;Internal 4.0
  3252. LONG iScrollHeight; // ;Internal 4.0
  3253. LONG iCaptionWidth; // ;Internal 4.0
  3254. LONG iCaptionHeight; // ;Internal 4.0
  3255. LOGFONT_32 lfCaptionFont; // ;Internal 4.0
  3256. LONG iSmCaptionWidth; // ;Internal 4.0
  3257. LONG iSmCaptionHeight; // ;Internal 4.0
  3258. LOGFONT_32 lfSmCaptionFont; // ;Internal 4.0
  3259. LONG iMenuWidth; // ;Internal 4.0
  3260. LONG iMenuHeight; // ;Internal 4.0
  3261. LOGFONT_32 lfMenuFont; // ;Internal 4.0
  3262. LOGFONT_32 lfStatusFont; // ;Internal 4.0
  3263. LOGFONT_32 lfMessageFont; // ;Internal 4.0
  3264. } NONCLIENTMETRICS, FAR* LPNONCLIENTMETRICS; // ;Internal 4.0
  3265. // ;Internal 4.0
  3266. typedef struct tagICONMETRICS // ;Internal 4.0
  3267. { // ;Internal 4.0
  3268. DWORD cbSize; // ;Internal 4.0
  3269. LONG iHorzSpacing; // ;Internal 4.0
  3270. LONG iVertSpacing; // ;Internal 4.0
  3271. LONG iTitleWrap; // ;Internal 4.0
  3272. LOGFONT_32 lfFont; // ;Internal 4.0
  3273. } ICONMETRICS, FAR *LPICONMETRICS; // ;Internal 4.0
  3274. #endif /* NOGDI */ // ;Internal 4.0
  3275. // ;Internal 4.0
  3276. typedef struct tagMINIMIZEDMETRICS // ;Internal 4.0
  3277. { // ;Internal 4.0
  3278. DWORD cbSize; // ;Internal 4.0
  3279. LONG iWidth; // ;Internal 4.0
  3280. LONG iHorzGap; // ;Internal 4.0
  3281. LONG iVertGap; // ;Internal 4.0
  3282. LONG iArrange; // ;Internal 4.0
  3283. } MINIMIZEDMETRICS, FAR *LPMINIMIZEDMETRICS; // ;Internal 4.0
  3284. // ;Internal 4.0
  3285. typedef struct tagANIMATIONINFO // ;Internal 4.0
  3286. { // ;Internal 4.0
  3287. DWORD cbSize; // ;Internal 4.0
  3288. LONG iMinAnimate; // ;Internal 4.0
  3289. } ANIMATIONINFO, FAR *LPANIMATIONINFO; // ;Internal 4.0
  3290. // ;Internal 4.0
  3291. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  3292. // ;Internal 4.0
  3293. #define SPI_GETBEEP 1
  3294. #define SPI_SETBEEP 2
  3295. #define SPI_GETMOUSE 3
  3296. #define SPI_SETMOUSE 4
  3297. #define SPI_GETBORDER 5
  3298. #define SPI_SETBORDER 6
  3299. #define SPI_TIMEOUTS 7 // ;Internal
  3300. #define SPI_KANJIMENU 8 // ;Internal
  3301. #define SPI_GETKEYBOARDSPEED 10
  3302. #define SPI_SETKEYBOARDSPEED 11
  3303. #define SPI_LANGDRIVER 12
  3304. #define SPI_ICONHORIZONTALSPACING 13
  3305. #define SPI_GETSCREENSAVETIMEOUT 14
  3306. #define SPI_SETSCREENSAVETIMEOUT 15
  3307. #define SPI_GETSCREENSAVEACTIVE 16
  3308. #define SPI_SETSCREENSAVEACTIVE 17
  3309. #define SPI_GETGRIDGRANULARITY 18
  3310. #define SPI_SETGRIDGRANULARITY 19
  3311. #define SPI_SETDESKWALLPAPER 20
  3312. #define SPI_SETDESKPATTERN 21
  3313. #define SPI_GETKEYBOARDDELAY 22
  3314. #define SPI_SETKEYBOARDDELAY 23
  3315. #define SPI_ICONVERTICALSPACING 24
  3316. #define SPI_GETICONTITLEWRAP 25
  3317. #define SPI_SETICONTITLEWRAP 26
  3318. #define SPI_GETMENUDROPALIGNMENT 27
  3319. #define SPI_SETMENUDROPALIGNMENT 28
  3320. #define SPI_SETDOUBLECLKWIDTH 29
  3321. #define SPI_SETDOUBLECLKHEIGHT 30
  3322. #define SPI_GETICONTITLELOGFONT 31
  3323. #define SPI_SETDOUBLECLICKTIME 32
  3324. #define SPI_SETMOUSEBUTTONSWAP 33
  3325. #define SPI_SETICONTITLELOGFONT 34
  3326. #define SPI_GETFASTTASKSWITCH 35
  3327. #define SPI_SETFASTTASKSWITCH 36
  3328. #define SPI_SETDRAGFULLWINDOWS 37 // ;Internal NT
  3329. #define SPI_GETDRAGFULLWINDOWS 38 // ;Internal NT
  3330. #define SPI_GETNONCLIENTMETRICS 41 // ;Internal 4.0
  3331. #define SPI_SETNONCLIENTMETRICS 42 // ;Internal 4.0
  3332. #define SPI_GETMINIMIZEDMETRICS 43 // ;Internal 4.0
  3333. #define SPI_SETMINIMIZEDMETRICS 44 // ;Internal 4.0
  3334. #define SPI_GETICONMETRICS 45 // ;Internal 4.0
  3335. #define SPI_SETICONMETRICS 46 // ;Internal 4.0
  3336. #define SPI_SETWORKAREA 47 // ;Internal 4.0
  3337. #define SPI_GETWORKAREA 48 // ;Internal 4.0
  3338. #define SPI_SETPENWINDOWS 49 // ;Internal 4.0
  3339. #define SPI_GETFILTERKEYS 50 // ;Internal 4.0
  3340. #define SPI_SETFILTERKEYS 51 // ;Internal 4.0
  3341. #define SPI_GETTOGGLEKEYS 52 // ;Internal 4.0
  3342. #define SPI_SETTOGGLEKEYS 53 // ;Internal 4.0
  3343. #define SPI_GETMOUSEKEYS 54 // ;Internal 4.0
  3344. #define SPI_SETMOUSEKEYS 55 // ;Internal 4.0
  3345. #define SPI_GETSHOWSOUNDS 56 // ;Internal 4.0
  3346. #define SPI_SETSHOWSOUNDS 57 // ;Internal 4.0
  3347. #define SPI_GETSTICKYKEYS 58 // ;Internal 4.0
  3348. #define SPI_SETSTICKYKEYS 59 // ;Internal 4.0
  3349. #define SPI_GETACCESSTIMEOUT 60 // ;Internal 4.0
  3350. #define SPI_SETACCESSTIMEOUT 61 // ;Internal 4.0
  3351. #define SPI_GETSERIALKEYS 62 // ;Internal 4.0
  3352. #define SPI_SETSERIALKEYS 63 // ;Internal 4.0
  3353. #define SPI_GETSOUNDSENTRY 64 // ;Internal 4.0
  3354. #define SPI_SETSOUNDSENTRY 65 // ;Internal 4.0
  3355. #define SPI_GETHIGHCONTRAST 66 // ;Internal 4.0
  3356. #define SPI_SETHIGHCONTRAST 67 // ;Internal 4.0
  3357. #define SPI_GETKEYBOARDPREF 68 // ;Internal 4.0
  3358. #define SPI_SETKEYBOARDPREF 69 // ;Internal 4.0
  3359. #define SPI_GETSCREENREADER 70 // ;Internal 4.0
  3360. #define SPI_SETSCREENREADER 71 // ;Internal 4.0
  3361. #define SPI_GETANIMATION 72 // ;Internal 4.0
  3362. #define SPI_SETANIMATION 73 // ;Internal 4.0
  3363. #define SPI_GETFONTSMOOTHING 74 // ;Internal 4.0
  3364. #define SPI_SETFONTSMOOTHING 75 // ;Internal 4.0
  3365. #define SPI_SETDRAGWIDTH 76 // ;Internal 4.0
  3366. #define SPI_SETDRAGHEIGHT 77 // ;Internal 4.0
  3367. #define SPI_SETHANDHELD 78 // ;Internal 4.0
  3368. #define SPI_GETLOWPOWERTIMEOUT 79 // ;Internal 4.0
  3369. #define SPI_GETPOWEROFFTIMEOUT 80 // ;Internal 4.0
  3370. #define SPI_SETLOWPOWERTIMEOUT 81 // ;Internal 4.0
  3371. #define SPI_SETPOWEROFFTIMEOUT 82 // ;Internal 4.0
  3372. #define SPI_GETLOWPOWERACTIVE 83 // ;Internal 4.0
  3373. #define SPI_GETPOWEROFFACTIVE 84 // ;Internal 4.0
  3374. #define SPI_SETLOWPOWERACTIVE 85 // ;Internal 4.0
  3375. #define SPI_SETPOWEROFFACTIVE 86 // ;Internal 4.0
  3376. #define SPI_SETCURSORS 87 // ;Internal 4.0
  3377. #define SPI_SETICONS 88 // ;Internal 4.0
  3378. #define SPI_GETDEFAULTINPUTLANG 89 // ;Internal 4.0
  3379. #define SPI_SETDEFAULTINPUTLANG 90 // ;Internal 4.0
  3380. #define SPI_SETLANGTOGGLE 91 // ;Internal 4.0
  3381. #define SPI_GETWINDOWSEXTENSION 92 // ;Internal 4.0
  3382. #define SPI_SETMOUSETRAILS 93 // ;Internal 4.0
  3383. #define SPI_GETMOUSETRAILS 94 // ;Internal 4.0
  3384. #define SPI_GETSNAPTODEFBUTTON 95 // ;Internal NT
  3385. #define SPI_SETSNAPTODEFBUTTON 96 // ;internal NT
  3386. #define SPI_SCREENSAVERRUNNING 97 // ;Internal 4.0
  3387. #define SPI_MAX 97 // ;Internal
  3388. #ifdef FE_IME // ;Internal 4.1
  3389. #define SPI_GETSHOWIMEUI 99 // ;Internal 4.1
  3390. #define SPI_SETSHOWIMEUI 100 // ;Internal 4.1
  3391. #undef SPI_MAX // ;Internal 4.1
  3392. #define SPI_MAX 100 // ;Internal 4.1
  3393. #endif // FE_IME // ;Internal 4.1
  3394. /* SystemParametersInfo flags */
  3395. #define SPIF_UPDATEINIFILE 0x0001
  3396. #define SPIF_SENDCHANGE 0x0002
  3397. #define SPIF_SENDWININICHANGE SPIF_SENDCHANGE
  3398. #define SPIF_VALID 0x0003 /* ;Internal */
  3399. typedef struct tagFILTERKEYS // ;Internal 4.0
  3400. { // ;Internal 4.0
  3401. DWORD cbSize; // ;Internal 4.0
  3402. DWORD dwFlags; // ;Internal 4.0
  3403. DWORD iWaitMSec; // ;Internal 4.0
  3404. DWORD iDelayMSec; // ;Internal 4.0
  3405. DWORD iRepeatMSec; // ;Internal 4.0
  3406. DWORD iBounceMSec; // ;Internal 4.0
  3407. } FILTERKEYS, FAR* LPFILTERKEYS; // ;Internal 4.0
  3408. // ;Internal 4.0
  3409. #define FKF_FILTERKEYSON 0x00000001 // ;Internal 4.0
  3410. #define FKF_AVAILABLE 0x00000002 // ;Internal 4.0
  3411. #define FKF_HOTKEYACTIVE 0x00000004 // ;Internal 4.0
  3412. #define FKF_CONFIRMHOTKEY 0x00000008 // ;Internal 4.0
  3413. #define FKF_HOTKEYSOUND 0x00000010 // ;Internal 4.0
  3414. #define FKF_INDICATOR 0x00000020 // ;Internal 4.0
  3415. #define FKF_CLICKON 0x00000040 // ;Internal 4.0
  3416. // ;Internal 4.0
  3417. typedef struct tagSTICKYKEYS // ;Internal 4.0
  3418. { // ;Internal 4.0
  3419. DWORD cbSize; // ;Internal 4.0
  3420. DWORD dwFlags; // ;Internal 4.0
  3421. } STICKYKEYS, FAR* LPSTICKYKEYS; // ;Internal 4.0
  3422. // ;Internal 4.0
  3423. #define SKF_STICKYKEYSON 0x00000001 // ;Internal 4.0
  3424. #define SKF_AVAILABLE 0x00000002 // ;Internal 4.0
  3425. #define SKF_HOTKEYACTIVE 0x00000004 // ;Internal 4.0
  3426. #define SKF_CONFIRMHOTKEY 0x00000008 // ;Internal 4.0
  3427. #define SKF_HOTKEYSOUND 0x00000010 // ;Internal 4.0
  3428. #define SKF_INDICATOR 0x00000020 // ;Internal 4.0
  3429. #define SKF_AUDIBLEFEEDBACK 0x00000040 // ;Internal 4.0
  3430. #define SKF_TRISTATE 0x00000080 // ;Internal 4.0
  3431. #define SKF_TWOKEYSOFF 0x00000100 // ;Internal 4.0
  3432. // ;Internal 4.0
  3433. typedef struct tagMOUSEKEYS // ;Internal 4.0
  3434. { // ;Internal 4.0
  3435. DWORD cbSize; // ;Internal 4.0
  3436. DWORD dwFlags; // ;Internal 4.0
  3437. DWORD iMaxSpeed; // ;Internal 4.0
  3438. DWORD iTimeToMaxSpeed; // ;Internal 4.0
  3439. DWORD iCtrlSpeed; // ;Internal 4.0
  3440. DWORD dwReserved1; // ;Internal 4.0
  3441. DWORD dwReserved2; // ;Internal 4.0
  3442. } MOUSEKEYS, FAR* LPMOUSEKEYS; // ;Internal 4.0
  3443. // ;Internal 4.0
  3444. #define MKF_MOUSEKEYSON 0x00000001 // ;Internal 4.0
  3445. #define MKF_AVAILABLE 0x00000002 // ;Internal 4.0
  3446. #define MKF_HOTKEYACTIVE 0x00000004 // ;Internal 4.0
  3447. #define MKF_CONFIRMHOTKEY 0x00000008 // ;Internal 4.0
  3448. #define MKF_HOTKEYSOUND 0x00000010 // ;Internal 4.0
  3449. #define MKF_INDICATOR 0x00000020 // ;Internal 4.0
  3450. #define MKF_NOMODIFIERS 0x00000040 // ;Internal 4.0
  3451. // ;Internal 4.0
  3452. typedef struct tagACCESSTIMEOUT // ;Internal 4.0
  3453. { // ;Internal 4.0
  3454. DWORD cbSize; // ;Internal 4.0
  3455. DWORD dwFlags; // ;Internal 4.0
  3456. DWORD iTimeOutMSec; // ;Internal 4.0
  3457. } ACCESSTIMEOUT, FAR* LPACCESSTIMEOUT;// ;Internal 4.0
  3458. // ;Internal 4.0
  3459. #define ATF_TIMEOUTON 0x00000001 // ;Internal 4.0
  3460. #define ATF_ONOFFFEEDBACK 0x00000002 // ;Internal 4.0
  3461. // ;Internal 4.0
  3462. typedef struct tagSOUNDSENTRY // ;Internal 4.0
  3463. { // ;Internal 4.0
  3464. DWORD cbSize; // ;Internal 4.0
  3465. DWORD dwFlags; // ;Internal 4.0
  3466. DWORD iFSTextEffect; // ;Internal 4.0
  3467. DWORD iFSTextEffectMSec; // ;Internal 4.0
  3468. DWORD iFSTextEffectColorBits; // ;Internal 4.0
  3469. DWORD iFSGrafEffect; // ;Internal 4.0
  3470. DWORD iFSGrafEffectMSec; // ;Internal 4.0
  3471. DWORD iFSGrafEffectColor; // ;Internal 4.0
  3472. DWORD iWindowsEffect; // ;Internal 4.0
  3473. DWORD iWindowsEffectMSec; // ;Internal 4.0
  3474. LPSTR lpszWindowsEffectDLL; // ;Internal 4.0
  3475. DWORD iWindowsEffectOrdinal; // ;Internal 4.0
  3476. } SOUNDSENTRY, FAR* LPSOUNDSENTRY; // ;Internal 4.0
  3477. // ;Internal 4.0
  3478. #define SSF_SOUNDSENTRYON 0x00000001 // ;Internal 4.0
  3479. #define SSF_AVAILABLE 0x00000002 // ;Internal 4.0
  3480. #define SSF_INDICATOR 0x00000004 // ;Internal 4.0
  3481. // ;Internal 4.0
  3482. #define SSTF_NONE 0x00000001 // ;Internal 4.0
  3483. #define SSTF_CHARS 0x00000002 // ;Internal 4.0
  3484. #define SSTF_BORDER 0x00000004 // ;Internal 4.0
  3485. #define SSTF_DISPLAY 0x00000008 // ;Internal 4.0
  3486. // ;Internal 4.0
  3487. #define SSGF_NONE 0x00000001 // ;Internal 4.0
  3488. #define SSGF_DISPLAY 0x00000002 // ;Internal 4.0
  3489. // ;Internal 4.0
  3490. #define SSWF_NONE 0x00000001 // ;Internal 4.0
  3491. #define SSWF_TITLE 0x00000002 // ;Internal 4.0
  3492. #define SSWF_WINDOW 0x00000004 // ;Internal 4.0
  3493. #define SSWF_DISPLAY 0x00000008 // ;Internal 4.0
  3494. #define SSWF_CUSTOM 0x00000010 // ;Internal 4.0
  3495. // ;Internal 4.0
  3496. typedef struct tagTOGGLEKEYS // ;Internal 4.0
  3497. { // ;Internal 4.0
  3498. DWORD cbSize; // ;Internal 4.0
  3499. DWORD dwFlags; // ;Internal 4.0
  3500. } TOGGLEKEYS, FAR* LPTOGGLEKEYS; // ;Internal 4.0
  3501. // ;Internal 4.0
  3502. #define TKF_TOGGLEKEYSON 0x00000001 // ;Internal 4.0
  3503. #define TKF_AVAILABLE 0x00000002 // ;Internal 4.0
  3504. #define TKF_HOTKEYACTIVE 0x00000004 // ;Internal 4.0
  3505. #define TKF_CONFIRMHOTKEY 0x00000008 // ;Internal 4.0
  3506. #define TKF_HOTKEYSOUND 0x00000020 // ;Internal 4.0
  3507. #define TKF_INDICATOR 0x00000040 // ;Internal 4.0
  3508. // ;Internal 4.0
  3509. typedef struct tagSERIALKEYS // ;Internal 4.0
  3510. { // ;Internal 4.0
  3511. DWORD cbSize; // ;Internal 4.0
  3512. DWORD dwFlags; // ;Internal 4.0
  3513. LPSTR lpszActivePort; // ;Internal 4.0
  3514. LPSTR lpszPort; // ;Internal 4.0
  3515. DWORD iBaudRate; // ;Internal 4.0
  3516. DWORD iPortState; // ;Internal 4.0
  3517. DWORD iActive; // ;Internal 4.0
  3518. } SERIALKEYS, FAR* LPSERIALKEYS; // ;Internal 4.0
  3519. // ;Internal 4.0
  3520. #define SERKF_SERIALKEYSON 0x00000001 // ;Internal 4.0
  3521. #define SERKF_AVAILABLE 0x00000002 // ;Internal 4.0
  3522. #define SERKF_INDICATOR 0x00000004 // ;Internal 4.0
  3523. // ;Internal 4.0
  3524. typedef struct tagHIGHCONTRAST // ;Internal 4.0
  3525. { // ;Internal 4.0
  3526. DWORD cbSize; // ;Internal 4.0
  3527. DWORD dwFlags; // ;Internal 4.0
  3528. LPSTR lpszDefaultScheme; // ;Internal 4.0
  3529. } HIGHCONTRAST, FAR* LPHIGHCONTRAST; // ;Internal 4.0
  3530. // ;Internal 4.0
  3531. #define HCF_HIGHCONTRASTON 0x00000001 // ;Internal 4.0
  3532. #define HCF_AVAILABLE 0x00000002 // ;Internal 4.0
  3533. #define HCF_HOTKEYACTIVE 0x00000004 // ;Internal 4.0
  3534. #define HCF_CONFIRMHOTKEY 0x00000008 // ;Internal 4.0
  3535. #define HCF_HOTKEYSOUND 0x00000010 // ;Internal 4.0
  3536. #define HCF_INDICATOR 0x00000020 // ;Internal 4.0
  3537. #define HCF_HOTKEYAVAILABLE 0x00000040 // ;Internal 4.0
  3538. // ;Internal 4.0
  3539. #endif /* NOSYSTEMPARAMSINFO */
  3540. #endif /* WINVER >= 0x030a */
  3541. #if (WINVER >= 0x0400)
  3542. /* Flags for ChangeDisplaySettings */
  3543. #define CDS_UPDATEREGISTRY 0x00000001
  3544. #define CDS_TEST 0x00000002
  3545. #define CDS_FULLSCREEN 0x00000004
  3546. #define CDS_GLOBAL 0x00000008
  3547. #define CDS_EXCLUSIVE 0x80000000 // ;Internal
  3548. #define CDS_RESET 0x40000000
  3549. #define CDS_SETRECT 0x20000000
  3550. #define CDS_NORESET 0x10000000
  3551. #define CDS_VALID 0xF000000F // ;Internal
  3552. /* Return values for ChangeDisplaySettings */
  3553. #define DISP_CHANGE_SUCCESSFUL 0
  3554. #define DISP_CHANGE_RESTART 1
  3555. #define DISP_CHANGE_FAILED -1
  3556. #define DISP_CHANGE_BADMODE -2
  3557. #define DISP_CHANGE_NOTUPDATED -3
  3558. #define DISP_CHANGE_BADFLAGS -4
  3559. #define DISP_CHANGE_BADPARAM -5
  3560. typedef struct tagDEVMODE FAR*LPDEVMODE;
  3561. LONG WINAPI ChangeDisplaySettings(LPDEVMODE lpDevMode, DWORD flags);
  3562. #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
  3563. #define ENUM_REGISTRY_SETTINGS ((DWORD)-2)
  3564. BOOL WINAPI EnumDisplaySettings(
  3565. LPCSTR lpszDeviceName,
  3566. DWORD iModeNum,
  3567. LPDEVMODE lpDevMode);
  3568. #if (WINVER >= 0x40A)
  3569. LONG WINAPI ChangeDisplaySettingsEx(
  3570. LPCSTR lpszDeviceName,
  3571. LPDEVMODE lpDevMode,
  3572. #ifdef tagWND /* ;Internal */
  3573. HWND_16 hwnd, /* ;Internal */
  3574. #else /* ;Internal */
  3575. HWND hwnd,
  3576. #endif /* ;Internal */
  3577. DWORD flags,
  3578. LPVOID lParam);
  3579. #endif /* WINVER >=0x040A */
  3580. #endif /* WINVER >=0x0400 */
  3581. /****** Rectangle support ****************************************************/
  3582. void WINAPI SetRect(LPRECT, int, int, int, int);
  3583. void WINAPI SetRectEmpty(LPRECT);
  3584. void WINAPI CopyRect(LPRECT, LPCRECT);
  3585. BOOL WINAPI IsRectEmpty(LPCRECT);
  3586. BOOL WINAPI EqualRect(LPCRECT, LPCRECT);
  3587. BOOL WINAPI IntersectRect(LPRECT, LPCRECT, LPCRECT);
  3588. BOOL WINAPI UnionRect(LPRECT, LPCRECT, LPCRECT);
  3589. BOOL WINAPI SubtractRect(LPRECT, LPCRECT, LPCRECT);
  3590. void WINAPI OffsetRect(LPRECT, int, int);
  3591. void WINAPI InflateRect(LPRECT, int, int);
  3592. BOOL WINAPI PtInRect(LPCRECT, POINT);
  3593. /****** Window message support ***********************************************/
  3594. UINT WINAPI RegisterWindowMessage(LPCSTR);
  3595. #ifndef NOMSG
  3596. /* Queued message structure */
  3597. typedef struct tagMSG
  3598. {
  3599. #ifdef tagWND /* ;Internal */
  3600. HWND_16 hwnd; /* ;Internal */
  3601. #else /* ;Internal */
  3602. HWND hwnd;
  3603. #endif /* ;Internal */
  3604. UINT message;
  3605. WPARAM wParam;
  3606. LPARAM lParam;
  3607. DWORD time;
  3608. POINT pt;
  3609. } MSG, * PMSG, NEAR* NPMSG, FAR* LPMSG;
  3610. BOOL WINAPI GetMessage(LPMSG, HWND, UINT, UINT);
  3611. BOOL WINAPI PeekMessage(LPMSG, HWND, UINT, UINT, UINT);
  3612. /* PeekMessage() options */
  3613. #define PM_NOREMOVE 0x0000
  3614. #define PM_REMOVE 0x0001
  3615. #define PM_NOYIELD 0x0002
  3616. #define PM_VALID 0x0003 /* ;Internal */
  3617. #ifdef tagWND // ;Internal
  3618. BOOL WINAPI WaitMessage(void); // ;Internal
  3619. #else // ;Internal
  3620. void WINAPI WaitMessage(void);
  3621. #endif // ;Internal
  3622. DWORD WINAPI GetMessagePos(void);
  3623. LONG WINAPI GetMessageTime(void);
  3624. #if (WINVER >= 0x030a)
  3625. LPARAM WINAPI GetMessageExtraInfo(void);
  3626. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  3627. LPARAM WINAPI SetMessageExtraInfo(LPARAM); /* ;Internal 4.0 */
  3628. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  3629. #endif /* WINVER >= 0x030a */
  3630. BOOL WINAPI TranslateMessage(const MSG FAR*);
  3631. LONG WINAPI DispatchMessage(const MSG FAR*);
  3632. BOOL WINAPI SetMessageQueue(int);
  3633. BOOL WINAPI GetInputState(void);
  3634. #if (WINVER >= 0x030a)
  3635. DWORD WINAPI GetQueueStatus(UINT flags);
  3636. /* GetQueueStatus flags */
  3637. #define QS_KEY 0x0001
  3638. #define QS_MOUSEMOVE 0x0002
  3639. #define QS_MOUSEBUTTON 0x0004
  3640. #define QS_MOUSE (QS_MOUSEMOVE | QS_MOUSEBUTTON)
  3641. #define QS_POSTMESSAGE 0x0008
  3642. #define QS_TIMER 0x0010
  3643. #define QS_PAINT 0x0020
  3644. #define QS_SENDMESSAGE 0x0040
  3645. #if (WINVER >= 0x40A)
  3646. #define QS_ALLPOSTMESSAGE 0x0100
  3647. #endif // (WINVER >= 0x40A)
  3648. // #define QS_HOTKEY 0x0080 // ;Internal NT
  3649. // #define QS_ALLINPUT 0x00ff // ;Internal NT
  3650. #define QS_ALLINPUT 0x007f
  3651. #define QS_TRANSFER 0x4000 // ;Internal
  3652. #define QS_VALID 0x40FF // ;Internal
  3653. #endif /* WINVER >= 0x030a */
  3654. #endif /* NOMSG */
  3655. #ifdef tagWND /* ;Internal */
  3656. BOOL WINAPI PostMessage(HWND_16, UINT, WPARAM, LPARAM); /* ;Internal */
  3657. #else /* ;Internal */
  3658. BOOL WINAPI PostMessage(HWND, UINT, WPARAM, LPARAM);
  3659. #endif /* ;Internal */
  3660. LRESULT WINAPI SendMessage(HWND, UINT, WPARAM, LPARAM);
  3661. #if (WINVER >= 0x0400) // ;Internal 4.0
  3662. #define SMTO_NORMAL 0x0000 // ;Internal NT
  3663. #define SMTO_BLOCK 0x0001 // ;Internal NT
  3664. #define SMTO_ABORTIFHUNG 0x0002 // ;Internal NT
  3665. #define SMTO_BROADCAST 0x0004 // ;Internal 4.0
  3666. #define SMTO_NOTIMEOUTIFNOTHUNG 0x0008 // ;Internal 4.0
  3667. #define SMTO_VALID 0x000F // ;Internal NT
  3668. // ;Internal NT
  3669. #ifdef tagWND // ;Internal NT
  3670. typedef VOID (CALLBACK* SENDASYNCPROC)(HWND_16, UINT, DWORD, LRESULT); /* ;Internal NT */
  3671. #else // ;Internal NT
  3672. typedef VOID (CALLBACK* SENDASYNCPROC)(HWND, UINT, DWORD, LRESULT); /* ;Internal NT */
  3673. #endif // ;Internal NT
  3674. // ;Internal 4.0
  3675. long WINAPI BroadcastSystemMessage(DWORD, LPDWORD, UINT, WPARAM, LPARAM); // ;Internal 4.0
  3676. #define BROADCAST_QUERY_DENY 0x424D5144 // Return this value to deny a query.
  3677. // ;Internal 4.0
  3678. #define BSM_ALLCOMPONENTS 0x00000000 // ;Internal 4.0
  3679. #define BSM_VXDS 0x00000001 // ;Internal 4.0
  3680. #define BSM_NETDRIVER 0x00000002 // ;Internal 4.0
  3681. #define BSM_INSTALLABLEDRIVERS 0x00000004 // ;Internal 4.0
  3682. #define BSM_APPLICATIONS 0x00000008 // ;Internal 4.0
  3683. // ;Internal 4.0
  3684. #define BSF_QUERY 0x00000001 // ;Internal 4.0
  3685. #define BSF_IGNORECURRENTTASK 0x00000002 // ;Internal 4.0
  3686. #define BSF_FLUSHDISK 0x00000004 // ;Internal 4.0
  3687. #define BSF_NOHANG 0x00000008 // ;Internal 4.0
  3688. #define BSF_POSTMESSAGE 0x00000010 // ;Internal 4.0
  3689. #define BSF_FORCEIFHUNG 0x00000020 // ;Internal 4.0
  3690. #define BSF_NOTIMEOUTIFNOTHUNG 0x00000040 // ;Internal 4.0
  3691. #define BSF_SYSTEMSHUTDOWN 0x40000000 // ;Internal 4.0
  3692. #define BSF_MSGSRV32ISOK 0x80000000 // ;Internal 4.0
  3693. #define BSF_VALID 0xC000007F // ;Internal 4.0
  3694. // ;Internal 4.0
  3695. /* Flags for wParam of WM_DEVICECHANGE message */ // ;Internal 4.0
  3696. #define DBWF_LPARAMPOINTER 0x8000 // ;Internal 4.0
  3697. // ;Internal 4.0
  3698. typedef struct tagBROADCASTSYSMSG // ;Internal 4.0
  3699. { // ;Internal 4.0
  3700. /* DWORD cbSize; */ // ;Internal BOGUS
  3701. UINT uiMessage; // ;Internal 4.0
  3702. WPARAM wParam; // ;Internal 4.0
  3703. LPARAM lParam; // ;Internal 4.0
  3704. } BROADCASTSYSMSG; // ;Internal 4.0
  3705. typedef BROADCASTSYSMSG FAR *LPBROADCASTSYSMSG; // ;Internal 4.0
  3706. // ;Internal 4.0
  3707. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  3708. /* ;Internal 4.0 */
  3709. #ifndef NOMSG
  3710. BOOL WINAPI PostAppMessage(HTASK, UINT, WPARAM, LPARAM);
  3711. #ifdef tagWND // ;Internal
  3712. BOOL WINAPI ReplyMessage(LRESULT); // ;Internal
  3713. #else // ;Internal
  3714. void WINAPI ReplyMessage(LRESULT);
  3715. #endif // ;Internal
  3716. BOOL WINAPI InSendMessage(void);
  3717. /* Special HWND value for use with PostMessage() and SendMessage() */
  3718. #define HWND_BROADCAST ((HWND)-1)
  3719. BOOL WINAPI CallMsgFilter(LPMSG, int);
  3720. #define WH_GETMESSAGE 3
  3721. #define WH_CALLWNDPROC 4
  3722. #define WH_CALLWNDPROCRET 12 // ;Internal 4.0
  3723. // ;Internal
  3724. typedef struct tagCWPRETSTRUCT // ;Internal 4.0
  3725. { // ;Internal 4.0
  3726. LRESULT lResult; // ;Internal 4.0
  3727. WPARAM wParamHi; // ;Internal 4.0
  3728. LPARAM lParam; // ;Internal 4.0
  3729. WPARAM wParamLo; // ;Internal 4.0
  3730. UINT message; // ;Internal 4.0
  3731. #ifdef tagWND // ;Internal
  3732. HWND_16 hwnd; // ;Internal
  3733. #else // ;Internal
  3734. HWND hwnd; // ;Internal 4.0
  3735. #endif // ;Internal
  3736. } CWPRETSTRUCT, FAR * LPCWPRETSTRUCT; // ;Internal 4.0
  3737. // #define WC_INIT 1 // ;Internal NT
  3738. // #define WC_SWP 2 // ;Internal NT
  3739. // #define WC_DEFWINDOWPROC 3 // ;Internal NT
  3740. // #define WC_MINMAX 4 // ;Internal NT
  3741. // #define WC_MOVE 5 // ;Internal NT
  3742. // #define WC_SIZE 6 // ;Internal NT
  3743. // #define WC_DRAWCAPTION 7 // ;Internal NT
  3744. // ;Internal
  3745. #define WH_MSGFILTER (-1)
  3746. #define WH_SYSMSGFILTER 6
  3747. #define WH_FOREGROUNDIDLE 11 // ;Internal NT
  3748. /* CallMsgFilter() and WH_SYS/MSGFILTER context codes */
  3749. #define MSGF_DIALOGBOX 0
  3750. #define MSGF_MESSAGEBOX 1 // ;Internal
  3751. #define MSGF_MENU 2
  3752. #define MSGF_MOVE 3
  3753. #define MSGF_SIZE 4
  3754. #define MSGF_SCROLLBAR 5
  3755. #define MSGF_NEXTWINDOW 6
  3756. #define MSGF_CBTHOSEBAGSUSEDTHIS 7 // ;Internal
  3757. #define MSGF_MAINLOOP 8
  3758. #define MSGF_USER 4096
  3759. #endif /* NOMSG */
  3760. /* Standard window messages */
  3761. /* NOTE: All messages below 0x0400 are RESERVED by Windows */
  3762. #define WM_NULL 0x0000
  3763. #define WM_CREATE 0x0001
  3764. #define WM_DESTROY 0x0002
  3765. #define WM_MOVE 0x0003
  3766. #define WM_SIZEWAIT 0x0004 // ;Internal
  3767. #define WM_SIZE 0x0005
  3768. #define WM_ACTIVATE 0x0006
  3769. #define WM_SETFOCUS 0x0007
  3770. #define WM_KILLFOCUS 0x0008
  3771. #define WM_SETVISIBLE 0x0009 // ;Internal
  3772. #define WM_ENABLE 0x000A
  3773. #define WM_SETREDRAW 0x000B
  3774. #define WM_SETTEXT 0x000C
  3775. #define WM_GETTEXT 0x000D
  3776. #define WM_GETTEXTLENGTH 0x000E
  3777. #define WM_PAINT 0x000F
  3778. #define WM_CLOSE 0x0010
  3779. #define WM_QUERYENDSESSION 0x0011
  3780. #define WM_QUIT 0x0012
  3781. #define WM_QUERYOPEN 0x0013
  3782. #define WM_ERASEBKGND 0x0014
  3783. #define WM_SYSCOLORCHANGE 0x0015
  3784. #define WM_ENDSESSION 0x0016
  3785. #define WM_SYSTEMERROR 0x0017 // ;Internal
  3786. #define WM_SHOWWINDOW 0x0018
  3787. #define WM_CTLCOLOR 0x0019
  3788. #define WM_SETTINGCHANGE 0x001A
  3789. #define WM_WININICHANGE WM_SETTINGCHANGE
  3790. #define WM_DEVMODECHANGE 0x001B
  3791. #define WM_ACTIVATEAPP 0x001C
  3792. #define WM_FONTCHANGE 0x001D
  3793. #define WM_TIMECHANGE 0x001E
  3794. #define WM_CANCELMODE 0x001F
  3795. #define WM_SETCURSOR 0x0020
  3796. #define WM_MOUSEACTIVATE 0x0021
  3797. #define WM_CHILDACTIVATE 0x0022
  3798. #define WM_QUEUESYNC 0x0023
  3799. #define WM_GETMINMAXINFO 0x0024
  3800. #define WM_LOGOFF 0x0025 // ;Internal NT
  3801. #define WM_PAINTICON 0x0026 // ;Internal
  3802. #define WM_ICONERASEBKGND 0x0027
  3803. #define WM_NEXTDLGCTL 0x0028
  3804. #define WM_ALTTABACTIVE 0x0029 // ;Internal
  3805. #define WM_SPOOLERSTATUS 0x002A
  3806. #define WM_DRAWITEM 0x002B
  3807. #define WM_MEASUREITEM 0x002C
  3808. #define WM_DELETEITEM 0x002D
  3809. #define WM_VKEYTOITEM 0x002E
  3810. #define WM_CHARTOITEM 0x002F
  3811. #define WM_SETFONT 0x0030
  3812. #define WM_GETFONT 0x0031
  3813. #define WM_SETHOTKEY 0x0032 // ;Internal
  3814. #define WM_GETHOTKEY 0x0033 // ;Internal
  3815. #define WM_FILESYSCHANGE 0x0034 // ;Internal
  3816. #define WM_SHELLNOTIFY 0x0034 // ;Internal
  3817. #define SHELLNOTIFY_DISKFULL 0x0001 // ;Internal
  3818. #define SHELLNOTIFY_OLELOADED 0x0002 // ;Internal
  3819. #define SHELLNOTIFY_OLEUNLOADED 0x0003 // ;Internal
  3820. #define SHELLNOTIFY_WALLPAPERCHANGED 0x0004 // ;Internal
  3821. #define SHELLNOTIFY_SWAPGROWFAILED 0x0005 // ;Internal
  3822. // ;Internal
  3823. #define WM_ISACTIVEICON 0x0035 // ;Internal
  3824. #define WM_UNUSED0036 0x0036 // ;Internal
  3825. #define WM_QUERYDRAGICON 0x0037
  3826. #define WM_WINHELP 0x0038 // ;Internal 4.0
  3827. #define WM_COMPAREITEM 0x0039
  3828. #define WM_FULLSCREEN 0x003A // ;Internal NT
  3829. #define WM_CLIENTSHUTDOWN 0x003B // ;Internal NT
  3830. #define WM_DDEMLEVENT 0x003C // ;Internal NT
  3831. // ;Internal
  3832. #define WMOBJ_ID 0x0000 // ;Internal
  3833. #define WMOBJ_SAMETHREAD 0x8000 // ;Internal
  3834. #define WMOBJID_SELF 0x00000000 // ;Internal
  3835. // ;Internal
  3836. #define WM_GETOBJECT 0x003D // ;Internal
  3837. #define MM_CALCSCROLL 0x003F // ;Internal NT
  3838. #define WM_TESTING 0x0040 // ;Internal
  3839. #define WM_COMPACTING 0x0041
  3840. #define WM_OTHERWINDOWCREATED 0x0042 // ;Internal NT
  3841. #define WM_OTHERWINDOWDESTROYED 0x0043 // ;Internal NT
  3842. #define WM_COMMNOTIFY 0x0044
  3843. #define WM_MEDIASTATUSCHANGE 0x0045 // ;Internal 4.0
  3844. #define WM_WINDOWPOSCHANGING 0x0046
  3845. #define WM_WINDOWPOSCHANGED 0x0047
  3846. #define WM_POWER 0x0048
  3847. #define WM_COPYGLOBALDATA 0x0049 // ;Internal NT
  3848. #define WM_COPYDATA 0x004A // ;Internal NT
  3849. #define WM_CANCELJOURNAL 0x004B // ;Internal NT
  3850. #define WM_LOGONNOTIFY 0x004C // ;Internal NT
  3851. #define WM_KEYF1 0x004D // ;Internal 4.0
  3852. #define WM_NOTIFY 0x004E
  3853. #define WM_ACCESS_WINDOW 0x004F // ;Internal NT
  3854. #define WM_INPUTLANGCHANGEREQUEST 0x0050 // ;Internal 4.0
  3855. #define WM_INPUTLANGCHANGE 0x0051 // ;Internal 4.0
  3856. #define WM_TCARD 0x0052
  3857. #define WM_HELP 0x0053
  3858. #define WM_USERCHANGED 0x0054
  3859. #define WM_NOTIFYFORMAT 0x0055 // ;Internal 4.0
  3860. #define NFR_ANSI 1 // ;Internal 4.0
  3861. #define NFR_UNICODE 2 // ;Internal 4.0
  3862. #define NF_QUERY 3 // ;Internal 4.0
  3863. #define NF_REQUERY 4 // ;Internal 4.0
  3864. // ;Internal
  3865. #define WM_FINALDESTROY 0x0070 // ;Internal NT
  3866. #define WM_MEASUREITEM_CLIENTDATA 0x0071 // ;Internal NT
  3867. #define WM_CONTEXTMENU 0x007B
  3868. #define WM_STYLECHANGING 0x007C // ;Internal 4.0
  3869. #define WM_STYLECHANGED 0x007D // ;Internal 4.0
  3870. #define WM_DISPLAYCHANGE 0x007E // ;Internal 4.0
  3871. #define WM_GETICON 0x007F // ;Internal 4.0
  3872. #define WM_SETICON 0x0080 // ;Internal 4.0
  3873. #define WM_NCCREATE 0x0081
  3874. #define WM_NCDESTROY 0x0082
  3875. #define WM_NCCALCSIZE 0x0083
  3876. #define WM_NCHITTEST 0x0084
  3877. #define WM_NCPAINT 0x0085
  3878. #define WM_NCACTIVATE 0x0086
  3879. #define WM_GETDLGCODE 0x0087
  3880. #define WM_SYNCPAINT 0x0088 // ;Internal
  3881. #define WM_SYNCTASK 0x0089 // ;Internal
  3882. #define WM_NCMOUSEMOVE 0x00A0
  3883. #define WM_NCLBUTTONDOWN 0x00A1
  3884. #define WM_NCLBUTTONUP 0x00A2
  3885. #define WM_NCLBUTTONDBLCLK 0x00A3
  3886. #define WM_NCRBUTTONDOWN 0x00A4
  3887. #define WM_NCRBUTTONUP 0x00A5
  3888. #define WM_NCRBUTTONDBLCLK 0x00A6
  3889. #define WM_NCMBUTTONDOWN 0x00A7
  3890. #define WM_NCMBUTTONUP 0x00A8
  3891. #define WM_NCMBUTTONDBLCLK 0x00A9
  3892. #define EM_FIRST_32 0x00B0 // ;Internal
  3893. // #define EM_GETSEL 0x00B0 // ;Internal NT
  3894. // #define EM_SETSEL 0x00B1 // ;Internal NT
  3895. // #define EM_GETRECT 0x00B2 // ;Internal NT
  3896. // #define EM_SETRECT 0x00B3 // ;Internal NT
  3897. // #define EM_SETRECTNP 0x00B4 // ;Internal NT
  3898. // #define EM_SCROLL 0x00B5 // ;Internal NT
  3899. // #define EM_LINESCROLL 0x00B6 // ;Internal NT
  3900. // #define EM_SCROLLCARET 0x00B7 // ;Internal NT
  3901. // #define EM_GETMODIFY 0x00B8 // ;Internal NT
  3902. // #define EM_SETMODIFY 0x00B9 // ;Internal NT
  3903. // #define EM_GETLINECOUNT 0x00BA // ;Internal NT
  3904. // #define EM_LINEINDEX 0x00BB // ;Internal NT
  3905. // #define EM_SETHANDLE 0x00BC // ;Internal NT
  3906. // #define EM_GETHANDLE 0x00BD // ;Internal NT
  3907. // #define EM_GETTHUMB 0x00BE // ;Internal NT
  3908. // #define EM_LINELENGTH 0x00C1 // ;Internal NT
  3909. // #define EM_REPLACESEL 0x00C2 // ;Internal NT
  3910. // #define EM_SETFONT 0x00C3 // ;Internal NT
  3911. // #define EM_GETLINE 0x00C4 // ;Internal NT
  3912. // #define EM_LIMITTEXT 0x00C5 // ;Internal NT
  3913. // #define EM_CANUNDO 0x00C6 // ;Internal NT
  3914. // #define EM_UNDO 0x00C7 // ;Internal NT
  3915. // #define EM_FMTLINES 0x00C8 // ;Internal NT
  3916. // #define EM_LINEFROMCHAR 0x00C9 // ;Internal NT
  3917. // #define EM_SETWORDBREAK 0x00CA // ;Internal NT
  3918. // #define EM_SETTABSTOPS 0x00CB // ;Internal NT
  3919. // #define EM_SETPASSWORDCHAR 0x00CC // ;Internal NT
  3920. // #define EM_EMPTYUNDOBUFFER 0x00CD // ;Internal NT
  3921. // #define EM_GETFIRSTVISIBLELINE 0x00CE // ;Internal NT
  3922. // #define EM_SETREADONLY 0x00CF // ;Internal NT
  3923. // #define EM_SETWORDBREAKPROC 0x00D0 // ;Internal NT
  3924. // #define EM_GETWORDBREAKPROC 0x00D1 // ;Internal NT
  3925. // #define EM_GETPASSWORDCHAR 0x00D2 // ;Internal NT
  3926. // #define EM_SETMARGINS 0x00D3 // ;Internal NT 4.0
  3927. // #define EM_GETMARGINS 0x00D4 // ;Internal NT 4.0
  3928. // #define EM_POSFROMCHAR 0x00D5 // ;Internal NT 4.0
  3929. // #define EM_CHARFROMPOS 0x00D6 // ;Internal NT 4.0
  3930. #define EM_LAST_32 0x00D6 // ;Internal
  3931. // ;Internal
  3932. #define SBM_FIRST_32 0x00E0 // ;Internal
  3933. // #define SBM_SETPOS 0x00E0 // ;Internal NT
  3934. // #define SBM_GETPOS 0x00E1 // ;Internal NT
  3935. // #define SBM_SETRANGE 0x00E2 // ;Internal NT
  3936. // #define SBM_GETRANGE 0x00E3 // ;Internal NT
  3937. // #define SBM_ENABLE_ARROWS 0x00E4 // ;Internal NT
  3938. // #define SBM_SETRANGEREDRAW 0x00E6 // ;Internal NT
  3939. // #define SBM_SETSCROLLINFO 0x00E9 // ;Internal NT 4.0
  3940. // #define SBM_GETSCROLLINFO 0x00EA // ;Internal NT 4.0
  3941. #define SBM_LAST_32 0x00EA // ;Internal
  3942. // ;Internal
  3943. #define BM_FIRST_32 0x00F0 // ;Internal
  3944. // #define BM_GETCHECK 0x00F0 // ;Internal NT
  3945. // #define BM_SETCHECK 0x00F1 // ;Internal NT
  3946. // #define BM_GETSTATE 0x00F2 // ;Internal NT
  3947. // #define BM_SETSTATE 0x00F3 // ;Internal NT
  3948. // #define BM_SETSTYLE 0x00F4 // ;Internal NT
  3949. // #define BM_CLICK 0x00F5 // ;Internal NT
  3950. // #define BM_GETIMAGE 0x00F6 // ;Internal NT 4.0
  3951. // #define BM_SETIMAGE 0x00F7 // ;Internal NT 4.0
  3952. #define BM_LAST_32 0x00F7 // ;Internal
  3953. #define WM_KEYFIRST 0x0100
  3954. #define WM_KEYDOWN 0x0100
  3955. #define WM_KEYUP 0x0101
  3956. #define WM_CHAR 0x0102
  3957. #define WM_DEADCHAR 0x0103
  3958. #define WM_SYSKEYDOWN 0x0104
  3959. #define WM_SYSKEYUP 0x0105
  3960. #define WM_SYSCHAR 0x0106
  3961. #define WM_SYSDEADCHAR 0x0107
  3962. #define WM_YOMICHAR 0x0108 /* ;Internal JAPAN */
  3963. #define WM_KEYLAST 0x0108
  3964. #define WM_CONVERTREQUEST 0x010A /* ;Internal JAPAN */
  3965. #define WM_CONVERTRESULT 0x010B /* ;Internal JAPAN */
  3966. #define WM_INTERIM 0x010C /* ;Internal KOREA */
  3967. #define WM_INITDIALOG 0x0110
  3968. #define WM_COMMAND 0x0111
  3969. #define WM_SYSCOMMAND 0x0112
  3970. #define WM_TIMER 0x0113
  3971. #define WM_HSCROLL 0x0114
  3972. #define WM_VSCROLL 0x0115
  3973. #define WM_INITMENU 0x0116
  3974. #define WM_INITMENUPOPUP 0x0117
  3975. #define WM_SYSTIMER 0x0118 // ;Internal
  3976. #define WM_MENUSELECT 0x011F
  3977. #define WM_MENUCHAR 0x0120
  3978. #define WM_ENTERIDLE 0x0121
  3979. #if (WINVER >= 0x40A) // ;Internal 4.1
  3980. #define WM_MENURBUTTONUP 0x0122 // ;Internal 4.1
  3981. #endif // (WINVER >= 0x40A) // ;Internal 4.1
  3982. // ;Internal NT
  3983. #define WM_LBTRACKPOINT 0x0131 // ;Internal
  3984. // #define WM_CTLCOLORFIRST 0x0132 // ;Internal NT
  3985. // #define WM_CTLCOLORMSGBOX 0x0132 // ;Internal NT
  3986. // #define WM_CTLCOLOREDIT 0x0133 // ;Internal NT
  3987. // #define WM_CTLCOLORLISTBOX 0x0134 // ;Internal NT
  3988. // #define WM_CTLCOLORBTN 0x0135 // ;Internal NT
  3989. // #define WM_CTLCOLORDLG 0x0136 // ;Internal NT
  3990. // #define WM_CTLCOLORSCROLLBAR 0x0137 // ;Internal NT
  3991. // #define WM_CTLCOLORSTATIC 0x0138 // ;Internal NT
  3992. // #define WM_CTLCOLORLAST 0x0138 // ;Internal NT
  3993. // ;Internal NT
  3994. #define CB_FIRST_32 0x0140 // ;Internal
  3995. // #define CB_GETEDITSEL 0x0140 // ;Internal NT
  3996. // #define CB_LIMITTEXT 0x0141 // ;Internal NT
  3997. // #define CB_SETEDITSEL 0x0142 // ;Internal NT
  3998. // #define CB_ADDSTRING 0x0143 // ;Internal NT
  3999. // #define CB_DELETESTRING 0x0144 // ;Internal NT
  4000. // #define CB_DIR 0x0145 // ;Internal NT
  4001. // #define CB_GETCOUNT 0x0146 // ;Internal NT
  4002. // #define CB_GETCURSEL 0x0147 // ;Internal NT
  4003. // #define CB_GETLBTEXT 0x0148 // ;Internal NT
  4004. // #define CB_GETLBTEXTLEN 0x0149 // ;Internal NT
  4005. // #define CB_INSERTSTRING 0x014A // ;Internal NT
  4006. // #define CB_RESETCONTENT 0x014B // ;Internal NT
  4007. // #define CB_FINDSTRING 0x014C // ;Internal NT
  4008. // #define CB_SELECTSTRING 0x014D // ;Internal NT
  4009. // #define CB_SETCURSEL 0x014E // ;Internal NT
  4010. // #define CB_SHOWDROPDOWN 0x014F // ;Internal NT
  4011. // ;Internal NT
  4012. // #define CB_GETITEMDATA 0x0150 // ;Internal NT
  4013. // #define CB_SETITEMDATA 0x0151 // ;Internal NT
  4014. // #define CB_GETDROPPEDCONTROLRECT 0x0152 // ;Internal NT
  4015. // #define CB_SETITEMHEIGHT 0x0153 // ;Internal NT
  4016. // #define CB_GETITEMHEIGHT 0x0154 // ;Internal NT
  4017. // #define CB_SETEXTENDEDUI 0x0155 // ;Internal NT
  4018. // #define CB_GETEXTENDEDUI 0x0156 // ;Internal NT
  4019. // #define CB_GETDROPPEDSTATE 0x0157 // ;Internal NT
  4020. // #define CB_FINDSTRINGEXACT 0x0158 // ;Internal NT
  4021. // #define CB_SETLOCALE 0x0159 // ;Internal NT
  4022. // #define CB_GETLOCALE 0x015A // ;Internal NT
  4023. // #define CB_GETTOPINDEX 0x015B // ;Internal NT 4.0
  4024. // #define CB_SETTOPINDEX 0x015C // ;Internal NT 4.0
  4025. // #define CB_GETHORIZONTALEXTENT 0x015D // ;Internal NT 4.0
  4026. // #define CB_SETHORIZONTALEXTENT 0x015E // ;Internal NT 4.0
  4027. // #define CB_GETDROPPEDWIDTH 0x015F // ;Internal NT 4.0
  4028. // #define CB_SETDROPPEDWIDTH 0x0160 // ;Internal NT 4.0
  4029. // #define CB_INITSTORAGE 0x0161 // ;Internal NT 4.0
  4030. #define CB_LAST_32 0x0161 // ;Internal
  4031. // ;Internal
  4032. #define STM_FIRST_32 0x0170 // ;Internal
  4033. // #define STM_SETICON 0x0170 // ;Internal NT
  4034. // #define STM_GETICON 0x0171 // ;Internal NT
  4035. // #define STM_SETIMAGE 0x0172 // ;Internal NT 4.0
  4036. // #define STM_GETIMAGE 0x0173 // ;Internal NT 4.0
  4037. #define STM_LAST_32 0x0173 // ;Internal
  4038. // ;Internal
  4039. #define LB_FIRST_32 0x0180 // ;Internal
  4040. // #define LB_ADDSTRING 0x0180 // ;Internal NT
  4041. // #define LB_INSERTSTRING 0x0181 // ;Internal NT
  4042. // #define LB_DELETESTRING 0x0182 // ;Internal NT
  4043. // #define LB_SELITEMRANGEEX 0x0183 // ;Internal NT
  4044. // #define LB_RESETCONTENT 0x0184 // ;Internal NT
  4045. // #define LB_SETSEL 0x0185 // ;Internal NT
  4046. // #define LB_SETCURSEL 0x0186 // ;Internal NT
  4047. // #define LB_GETSEL 0x0187 // ;Internal NT
  4048. // #define LB_GETCURSEL 0x0188 // ;Internal NT
  4049. // #define LB_GETTEXT 0x0189 // ;Internal NT
  4050. // #define LB_GETTEXTLEN 0x018A // ;Internal NT
  4051. // #define LB_GETCOUNT 0x018B // ;Internal NT
  4052. // #define LB_SELECTSTRING 0x018C // ;Internal NT
  4053. // #define LB_DIR 0x018D // ;Internal NT
  4054. // #define LB_GETTOPINDEX 0x018E // ;Internal NT
  4055. // #define LB_FINDSTRING 0x018F // ;Internal NT
  4056. // ;Internal NT
  4057. // #define LB_GETSELCOUNT 0x0190 // ;Internal NT
  4058. // #define LB_GETSELITEMS 0x0191 // ;Internal NT
  4059. // #define LB_SETTABSTOPS 0x0192 // ;Internal NT
  4060. // #define LB_GETHORIZONTALEXTENT 0x0193 // ;Internal NT
  4061. // #define LB_SETHORIZONTALEXTENT 0x0194 // ;Internal NT
  4062. // #define LB_SETCOLUMNWIDTH 0x0195 // ;Internal NT
  4063. // #define LB_ADDFILE 0x0196 // ;Internal NT
  4064. // #define LB_SETTOPINDEX 0x0197 // ;Internal NT
  4065. // #define LB_GETITEMRECT 0x0198 // ;Internal NT
  4066. // #define LB_GETITEMDATA 0x0199 // ;Internal NT
  4067. // #define LB_SETITEMDATA 0x019A // ;Internal NT
  4068. // #define LB_SELITEMRANGE 0x019B // ;Internal NT
  4069. // #define LB_SETANCHORINDEX 0x019C // ;Internal NT
  4070. // #define LB_GETANCHORINDEX 0x019D // ;Internal NT
  4071. // #define LB_SETCARETINDEX 0x019E // ;Internal NT
  4072. // #define LB_GETCARETINDEX 0x019F // ;Internal NT
  4073. // ;Internal NT
  4074. // #define LB_SETITEMHEIGHT 0x01A0 // ;Internal NT
  4075. // #define LB_GETITEMHEIGHT 0x01A1 // ;Internal NT
  4076. // #define LB_FINDSTRINGEXACT 0x01A2 // ;Internal NT
  4077. // #define LBCB_CARETON 0x01A3 // ;Internal NT
  4078. // #define LBCB_CARETOFF 0x01A4 // ;Internal NT
  4079. // #define LB_SETLOCALE 0x01A5 // ;Internal NT
  4080. // #define LB_GETLOCALE 0x01A6 // ;Internal NT
  4081. // #define LB_SETCOUNT 0x01A7 // ;Internal NT
  4082. // #define LB_INITSTORAGE 0x01A8 // ;Internal NT 4.0
  4083. // #define LB_ITEMFROMPOINT 0x01A9 // ;Internal NT 4.0
  4084. // #define LB_INSERTSTRINGUPPER 0x01AA // ;Internal NT 4.0
  4085. // #define LB_INSERTSTRINGLOWER 0x01AB // ;Internal NT 4.0
  4086. // #define LB_ADDSTRINGUPPER 0x01AC // ;Internal NT 4.0
  4087. // #define LB_ADDSTRINGLOWER 0x01AD // ;Internal NT 4.0
  4088. #define LB_LAST_32 0x01AD // ;Internal
  4089. // ;Internal
  4090. #define MN_FIRST_32 0x01E0 // ;Internal
  4091. // #define MN_SETHMENU 0x01E0 // ;Internal NT
  4092. // #define MN_GETHMENU 0x01E1 // ;Internal NT
  4093. // #define MN_SIZEWINDOW 0x01E2 // ;Internal NT
  4094. // #define MN_OPENHIERARCHY 0x01E3 // ;Internal NT
  4095. // #define MN_CLOSEHIERARCHY 0x01E4 // ;Internal NT
  4096. // #define MN_SELECTITEM 0x01E5 // ;Internal NT
  4097. // #define MN_CANCELMENUS 0x01E6 // ;Internal NT
  4098. // #define MN_SELECTFIRSTVALIDITEM 0x01E7 // ;Internal NT
  4099. // #define MN_GETPPOPUPMENU 0x01EA // ;Internal NT
  4100. // #define MN_FINDMENUWINDOWFROMPOINT 0x01EB // ;Internal NT
  4101. // #define MN_SHOWPOPUPWINDOW 0x01EC // ;Internal NT
  4102. // #define MN_BUTTONDOWN 0x01ED // ;Internal NT
  4103. // #define MN_MOUSEMOVE 0x01EE // ;Internal NT
  4104. // #define MN_BUTTONUP 0x01EF // ;Internal NT
  4105. // #define MN_SETTIMERTOOPENHIERARCHY 0x01F0 // ;Internal NT
  4106. // #define MN_DBLCLK 0x01F1 // ;Internal NT 4.0
  4107. #define MN_LAST_32 0x01E7 // ;Internal
  4108. #define WM_MOUSEFIRST 0x0200
  4109. #define WM_MOUSEMOVE 0x0200
  4110. #define WM_LBUTTONDOWN 0x0201
  4111. #define WM_LBUTTONUP 0x0202
  4112. #define WM_LBUTTONDBLCLK 0x0203
  4113. #define WM_RBUTTONDOWN 0x0204
  4114. #define WM_RBUTTONUP 0x0205
  4115. #define WM_RBUTTONDBLCLK 0x0206
  4116. #define WM_MBUTTONDOWN 0x0207
  4117. #define WM_MBUTTONUP 0x0208
  4118. #define WM_MBUTTONDBLCLK 0x0209
  4119. #define WM_MOUSELAST 0x0209
  4120. #define WM_PARENTNOTIFY 0x0210
  4121. #define WM_ENTERMENULOOP 0x0211 // ;Internal
  4122. #define WM_EXITMENULOOP 0x0212 // ;Internal
  4123. #define WM_NEXTMENU 0x0213 // ;Internal
  4124. #define WM_SIZING 0x0214 // ;Internal 4.0
  4125. #define WM_CAPTURECHANGED 0x0215 // ;Internal 4.0
  4126. #define WM_MOVING 0x0216 // ;Internal 4.0
  4127. #define WM_POWERBROADCAST 0x0218 // ;Internal 4.0
  4128. #define WM_DEVICECHANGE 0x0219 // ;Internal 4.0
  4129. #define WM_MDICREATE 0x0220
  4130. #define WM_MDIDESTROY 0x0221
  4131. #define WM_MDIACTIVATE 0x0222
  4132. #define WM_MDIRESTORE 0x0223
  4133. #define WM_MDINEXT 0x0224
  4134. #define WM_MDIMAXIMIZE 0x0225
  4135. #define WM_MDITILE 0x0226
  4136. #define WM_MDICASCADE 0x0227
  4137. #define WM_MDIICONARRANGE 0x0228
  4138. #define WM_MDIGETACTIVE 0x0229
  4139. #define WM_DROPOBJECT 0x022A // ;Internal
  4140. #define WM_QUERYDROPOBJECT 0x022B // ;Internal
  4141. #define WM_BEGINDRAG 0x022C // ;Internal
  4142. #define WM_DRAGLOOP 0x022D // ;Internal
  4143. #define WM_DRAGSELECT 0x022E // ;Internal
  4144. #define WM_DRAGMOVE 0x022F // ;Internal
  4145. #define WM_MDISETMENU 0x0230
  4146. #define WM_ENTERSIZEMOVE 0x0231
  4147. #define WM_EXITSIZEMOVE 0x0232
  4148. #define WM_DROPFILES 0x0233
  4149. #define WM_MDIREFRESHMENU 0x0234 // ;Internal NT
  4150. // ;Internal JAPAN/KOREA
  4151. #define WM_KANJIFIRST 0x0280 // ;Internal JAPAN
  4152. #define WM_KANJILAST 0x029F // ;Internal JAPAN
  4153. #define WM_HANGEULFIRST 0x0280 // ;Internal KOREA
  4154. #define WM_HANGEULLAST 0x029F // ;Internal KOREA
  4155. #if (WINVER >= 0x40A)
  4156. #define WM_TRACKMOUSEEVENT_FIRST 0x02A0 // ;Internal
  4157. #define WM_NCMOUSEHOVER 0x02A0
  4158. #define WM_MOUSEHOVER 0x02A1
  4159. #define WM_NCMOUSELEAVE 0x02A2
  4160. #define WM_MOUSELEAVE 0x02A3
  4161. #define WM_TRACKMOUSEEVENT_LAST 0x02AF // ;Internal
  4162. #endif // (WINVER >=0x40A)
  4163. #define WM_CUT 0x0300
  4164. #define WM_COPY 0x0301
  4165. #define WM_PASTE 0x0302
  4166. #define WM_CLEAR 0x0303
  4167. #define WM_UNDO 0x0304
  4168. #define WM_RENDERFORMAT 0x0305
  4169. #define WM_RENDERALLFORMATS 0x0306
  4170. #define WM_DESTROYCLIPBOARD 0x0307
  4171. #define WM_DRAWCLIPBOARD 0x0308
  4172. #define WM_PAINTCLIPBOARD 0x0309
  4173. #define WM_SIZECLIPBOARD 0x030B
  4174. #define WM_VSCROLLCLIPBOARD 0x030A
  4175. #define WM_ASKCBFORMATNAME 0x030C
  4176. #define WM_CHANGECBCHAIN 0x030D
  4177. #define WM_HSCROLLCLIPBOARD 0x030E
  4178. #define WM_QUERYNEWPALETTE 0x030F
  4179. #define WM_PALETTEISCHANGING 0x0310
  4180. #define WM_PALETTEGONNACHANGE WM_PALETTEISCHANGING // ;Internal
  4181. #define WM_PALETTECHANGED 0x0311
  4182. #define WM_CHANGEPALETTE WM_PALETTECHANGED // ;Internal
  4183. #define WM_HOTKEY 0x0312 // ;Internal NT
  4184. #define WM_SYSMENU 0x0313 // ;Internal
  4185. #define WM_HOOKMSG 0x0314 // ;Internal NT
  4186. #define WM_EXITPROCESS 0x0315 // ;Internal NT
  4187. #define WM_WAKETHREAD 0x0316 // ;Internal NT
  4188. #define WM_PRINT 0x0317
  4189. #define WM_PRINTCLIENT 0x0318
  4190. /* WinPad specific messages */
  4191. #define WM_HANDHELDFIRST 0x0358
  4192. #define WM_HANDHELDLAST 0x035F
  4193. // ;Internal
  4194. /* Reserved for AFX */ // ;Internal
  4195. #define WM_AFXFIRST 0x0360 // ;Internal
  4196. #define WM_AFXLAST 0x037F // ;Internal
  4197. /* PenWindows specific messages */
  4198. #define WM_PENWINFIRST 0x0380
  4199. #define WM_PENWINLAST 0x038F
  4200. /* Coalescing messages */
  4201. #define WM_INTERNAL_COALESCE_FIRST 0x0390 // ;Internal
  4202. #define WM_COALESCE_FIRST 0x0390
  4203. #define WM_COALESCE_LAST 0x039F
  4204. #define WM_INTERNAL_COALESCE_LAST 0x03B0 // ;Internal
  4205. /* Multimedia messages */ /* ;Internal */
  4206. #define WM_MM_RESERVED_FIRST 0x03A0 /* ;Internal */
  4207. #define WM_MM_RESERVED_LAST 0x03DF /* ;Internal */
  4208. /* ;Internal */
  4209. /* DDE messages */ /* ;Internal */
  4210. #define WM_INTERNAL_DDE_FIRST 0x03E0 /* ;Internal */
  4211. /* #define WM_DDE_INITIATE 0x03E0 */ /* ;Internal */
  4212. /* #define WM_DDE_TERMINATE 0x03E1 */ /* ;Internal */
  4213. /* #define WM_DDE_ADVISE 0x03E2 */ /* ;Internal */
  4214. /* #define WM_DDE_UNADVISE 0x03E3 */ /* ;Internal */
  4215. /* #define WM_DDE_ACK 0x03E4 */ /* ;Internal */
  4216. /* #define WM_DDE_DATA 0x03E5 */ /* ;Internal */
  4217. /* #define WM_DDE_REQUEST 0x03E6 */ /* ;Internal */
  4218. /* #define WM_DDE_POKE 0x03E7 */ /* ;Internal */
  4219. /* #define WM_DDE_EXECUTE 0x03E8 */ /* ;Internal */
  4220. #define WM_INTERNAL_DDE_LAST 0x03EF /* ;Internal */
  4221. /* ;Internal */
  4222. /* CBT messages */ /* ;Internal */
  4223. #define WM_CBT_RESERVED_FIRST 0x03F0 /* ;Internal */
  4224. #define WM_CBT_RESERVED_LAST 0x03FF /* ;Internal */
  4225. /* ;Internal */
  4226. #define WM_USER 0x0400
  4227. /* NOTE: All messages between WM_APP and 0xBFFF are for exclusive use by apps */
  4228. #define WM_APP 0x8000
  4229. #if (WINVER >= 0x030a)
  4230. /****** Power management ****************************************************/
  4231. /* wParam for WM_POWER window message and DRV_POWER driver notification */
  4232. #define PWR_OK 1
  4233. #define PWR_FAIL (-1)
  4234. #define PWR_SUSPENDREQUEST 1
  4235. #define PWR_SUSPENDRESUME 2
  4236. #define PWR_CRITICALRESUME 3
  4237. #endif /* WINVER >= 0x030a */
  4238. #if (WINVER >= 0x0400)
  4239. /* wParam for WM_SIZING message */
  4240. #define WMSZ_KEYSIZE 0 // ;Internal
  4241. #define WMSZ_LEFT 1
  4242. #define WMSZ_RIGHT 2
  4243. #define WMSZ_TOP 3
  4244. #define WMSZ_TOPLEFT 4
  4245. #define WMSZ_TOPRIGHT 5
  4246. #define WMSZ_BOTTOM 6
  4247. #define WMSZ_BOTTOMLEFT 7
  4248. #define WMSZ_BOTTOMRIGHT 8
  4249. #define WMSZ_MOVE 9 // ;Internal
  4250. #define WMSZ_KEYMOVE 10 // ;Internal
  4251. #define WMSZ_SIZEFIRST WMSZ_LEFT // ;Internal
  4252. #endif /* WINVER >= 0x400 */
  4253. /****** Application termination *********************************************/
  4254. #ifdef tagWND // ;Internal
  4255. BOOL WINAPI PostQuitMessage(int); // ;Internal
  4256. #else // ;Internal
  4257. void WINAPI PostQuitMessage(int);
  4258. #endif // ;Internal
  4259. /****** Window class management *********************************************/
  4260. #ifdef tagWND /* ;Internal */
  4261. typedef LRESULT (CALLBACK* WNDPROC)(HWND_16, UINT, WPARAM, LPARAM); /* ;Internal */
  4262. #else /* ;Internal */
  4263. typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
  4264. #endif /* ;Internal */
  4265. typedef struct tagWNDCLASS
  4266. {
  4267. UINT style;
  4268. WNDPROC lpfnWndProc;
  4269. int cbClsExtra;
  4270. int cbWndExtra;
  4271. HINSTANCE hInstance;
  4272. HICON hIcon;
  4273. HCURSOR hCursor;
  4274. HBRUSH hbrBackground;
  4275. LPCSTR lpszMenuName;
  4276. LPCSTR lpszClassName;
  4277. } WNDCLASS;
  4278. typedef WNDCLASS* PWNDCLASS;
  4279. typedef WNDCLASS NEAR* NPWNDCLASS;
  4280. typedef WNDCLASS FAR* LPWNDCLASS;
  4281. /* ;Internal 4.0 */
  4282. typedef struct tagWNDCLASSEX /* ;Internal 4.0 */
  4283. { /* ;Internal 4.0 */
  4284. DWORD cbSize; /* ;Internal 4.0 */
  4285. DWORD style; /* ;Internal 4.0 */
  4286. WNDPROC lpfnWndProc; /* ;Internal 4.0 */
  4287. int cbClsExtra; /* ;Internal 4.0 */
  4288. int cbWndExtra; /* ;Internal 4.0 */
  4289. HINSTANCE hInstance; /* ;Internal 4.0 */
  4290. HICON hIcon; /* ;Internal 4.0 */
  4291. HCURSOR hCursor; /* ;Internal 4.0 */
  4292. HBRUSH hbrBackground; /* ;Internal 4.0 */
  4293. LPCSTR lpszMenuName; /* ;Internal 4.0 */
  4294. LPCSTR lpszClassName; /* ;Internal 4.0 */
  4295. HICON hIconSm; /* ;Internal 4.0 */
  4296. } WNDCLASSEX, FAR* LPWNDCLASSEX; /* ;Internal 4.0 */
  4297. ATOM WINAPI RegisterClass(const WNDCLASS FAR*);
  4298. ATOM WINAPI RegisterClassEx(const WNDCLASSEX FAR *); /* ;Internal 4.0 */
  4299. BOOL WINAPI UnregisterClass(LPCSTR, HINSTANCE);
  4300. BOOL WINAPI GetClassInfo(HINSTANCE, LPCSTR, LPWNDCLASS);
  4301. BOOL WINAPI GetClassInfoEx(HINSTANCE, LPCSTR, LPWNDCLASSEX); /* ;Internal 4.0 */
  4302. int WINAPI GetClassName(HWND, LPSTR, int);
  4303. #ifndef NOWINSTYLES
  4304. /* Class styles */
  4305. #define CS_VREDRAW 0x0001
  4306. #define CS_HREDRAW 0x0002
  4307. #define CS_KEYCVTWINDOW 0x0004
  4308. #define CS_DBLCLKS 0x0008
  4309. #define CS_OEMCHARS 0x0010 // ;Internal
  4310. #define CS_OWNDC 0x0020
  4311. #define CS_CLASSDC 0x0040
  4312. #define CS_PARENTDC 0x0080
  4313. #define CS_NOKEYCVT 0x0100
  4314. #define CS_NOCLOSE 0x0200
  4315. #define CS_LVB 0x0400 // ;Internal
  4316. #define CS_SAVEBITS 0x0800
  4317. #define CS_BYTEALIGNCLIENT 0x1000
  4318. #define CS_BYTEALIGNWINDOW 0x2000
  4319. #define CS_GLOBALCLASS 0x4000
  4320. #define CS_32BITCLASS 0x00008000 // ;Internal ONLY FOR USER.EXE
  4321. #define CS_SYSTEMCLASS 0x08000000 // ;Internal ONLY FOR USER.EXE
  4322. #define CS_SHORTCUT 0x10000000 // ;Internal ONLY FOR USER.EXE
  4323. #define CS_IME 0x00010000 // ;Internal for 4.0 IME.
  4324. #endif /* NOWINSTYLES */
  4325. #ifndef NOWINOFFSETS
  4326. WORD WINAPI GetClassWord(HWND, int);
  4327. WORD WINAPI SetClassWord(HWND, int, WORD);
  4328. LONG WINAPI GetClassLong(HWND, int);
  4329. LONG WINAPI SetClassLong(HWND, int, LONG);
  4330. /* Class field offsets for GetClassLong() and GetClassWord() */
  4331. #define GCL_MENUNAME (-8)
  4332. #define GCW_HBRBACKGROUND (-10)
  4333. #define GCW_HCURSOR (-12)
  4334. #define GCW_HICON (-14)
  4335. #define GCW_HMODULE (-16)
  4336. #define GCW_CBWNDEXTRA (-18)
  4337. #define GCW_CBCLSEXTRA (-20)
  4338. #define GCL_WNDPROC (-24)
  4339. #define GCW_STYLE (-26)
  4340. #if (WINVER >= 0x030a)
  4341. #define GCW_ATOM (-32)
  4342. #if (WINVER >= 0x0400) // ;Internal 4.0
  4343. #define GCW_HICONSM (-34) // ;Internal 4.0
  4344. #define GCL_STYLE GCW_STYLE // ;Internal 4.0
  4345. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  4346. #endif /* WINVER >= 0x030a */
  4347. #endif /* NOWINOFFSETS */
  4348. /****** Window creation/destroy *********************************************/
  4349. /* Window Styles */
  4350. #ifndef NOWINSTYLES
  4351. /* Basic window types */
  4352. #define WS_OVERLAPPED 0x00000000L
  4353. #define WS_POPUP 0x80000000L
  4354. #define WS_CHILD 0x40000000L
  4355. /* Clipping styles */
  4356. #define WS_CLIPSIBLINGS 0x04000000L
  4357. #define WS_CLIPCHILDREN 0x02000000L
  4358. /* Generic window states */
  4359. #define WS_VISIBLE 0x10000000L
  4360. #define WS_DISABLED 0x08000000L
  4361. /* Main window states */
  4362. #define WS_MINIMIZE 0x20000000L
  4363. #define WS_MAXIMIZE 0x01000000L
  4364. /* Main window styles */
  4365. #define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */
  4366. #define WS_BORDERMASK 0x00C00000L // ;Internal
  4367. #define WS_BORDER 0x00800000L
  4368. #define WS_DLGFRAME 0x00400000L
  4369. #define WS_VSCROLL 0x00200000L
  4370. #define WS_HSCROLL 0x00100000L
  4371. #define WS_SYSMENU 0x00080000L
  4372. #define WS_THICKFRAME 0x00040000L
  4373. #define WS_MINIMIZEBOX 0x00020000L
  4374. #define WS_MAXIMIZEBOX 0x00010000L
  4375. /* Control window styles */
  4376. #define WS_GROUP 0x00020000L
  4377. #define WS_TABSTOP 0x00010000L
  4378. /* Common Window Styles */
  4379. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  4380. #define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
  4381. #define WS_CHILDWINDOW (WS_CHILD)
  4382. /* Extended Window Styles */
  4383. #define WS_EX_DLGMODALFRAME 0x00000001L
  4384. #define WS_EX_DRAGOBJECT 0x00000002L // ;Internal
  4385. #define WS_EX_NOPARENTNOTIFY 0x00000004L
  4386. #if (WINVER >= 0x030a)
  4387. #define WS_EX_TOPMOST 0x00000008L
  4388. #define WS_EX_ACCEPTFILES 0x00000010L
  4389. #define WS_EX_TRANSPARENT 0x00000020L
  4390. // ;Internal 4.0
  4391. #if (WINVER >= 0x0400) // ;Internal 4.0
  4392. #define WS_EX_MDICHILD 0x00000040L // ;Internal NT
  4393. #define WS_EX_TOOLWINDOW 0x00000080L // ;Internal 4.0
  4394. #define WS_EX_WINDOWEDGE 0x00000100L // ;Internal 4.0
  4395. #define WS_EX_CLIENTEDGE 0x00000200L // ;Internal 4.0
  4396. #define WS_EX_EDGEMASK (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) // ;Internal 4.0
  4397. #define WS_EX_CONTEXTHELP 0x00000400L // ;Internal 4.0
  4398. // ;Internal 4.0
  4399. #define WS_EX_RIGHT 0x00001000L // ;Internal 4.0
  4400. #define WS_EX_LEFT 0x00000000L // ;Internal 4.0
  4401. #define WS_EX_RTLREADING 0x00002000L // ;Internal 4.0
  4402. #define WS_EX_LTRREADING 0x00000000L // ;Internal 4.0
  4403. #define WS_EX_LEFTSCROLLBAR 0x00004000L // ;Internal 4.0
  4404. #define WS_EX_RIGHTSCROLLBAR 0x00000000L // ;Internal 4.0
  4405. #define WS_EX_CONTROLPARENT 0x00010000L // ;Internal 4.0
  4406. #define WS_EX_STATICEDGE 0x00020000L // ;Internal 4.0
  4407. #define WS_EX_APPWINDOW 0x00040000L // ;Internal 4.0
  4408. #define WS_EX_ANSICREATOR 0x80000000L // ;Internal NT
  4409. // ;Internal 4.0
  4410. #define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) // ;Internal 4.0
  4411. #define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST) // ;Internal 4.0
  4412. // ;Internal 4.0
  4413. #endif // ;Internal WINVER >= 0x0400
  4414. #endif /* WINVER >= 0x030a */
  4415. #define WS_EX_VALID 0x80077FFFL /* ;Internal */
  4416. /* ;Internal */
  4417. /* Obsolete style names */
  4418. #define WS_TILED WS_OVERLAPPED
  4419. #define WS_ICONIC WS_MINIMIZE
  4420. #define WS_SIZEBOX WS_THICKFRAME
  4421. #define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
  4422. #define WS_VALID 0xffff0000L /* ;Internal */
  4423. /* ;Internal */
  4424. #endif /* NOWINSTYLES */
  4425. #if (WINVER >= 0x0400) // ;Internal
  4426. /* WM_PRINT flags */ // ;Internal 4.0
  4427. #define PRF_CHECKVISIBLE 0x00000001L // ;Internal 4.0
  4428. #define PRF_NONCLIENT 0x00000002L // ;Internal 4.0
  4429. #define PRF_CLIENT 0x00000004L // ;Internal 4.0
  4430. #define PRF_ERASEBKGND 0x00000008L // ;Internal 4.0
  4431. #define PRF_CHILDREN 0x00000010L // ;Internal 4.0
  4432. #define PRF_OWNED 0x00000020L // ;Internal 4.0
  4433. // ;Internal 4.0
  4434. /* 3D border styles */ // ;Internal 4.0
  4435. #define BDR_RAISEDOUTER 0x0001 // ;Internal 4.0
  4436. #define BDR_SUNKENOUTER 0x0002 // ;Internal 4.0
  4437. #define BDR_RAISEDINNER 0x0004 // ;Internal 4.0
  4438. #define BDR_SUNKENINNER 0x0008 // ;Internal 4.0
  4439. // ;Internal 4.0
  4440. #define BDR_OUTER 0x0003 // ;Internal 4.0
  4441. #define BDR_INNER 0x000c // ;Internal 4.0
  4442. #define BDR_RAISED 0x0005 // ;Internal 4.0
  4443. #define BDR_SUNKEN 0x000a // ;Internal 4.0
  4444. // ;Internal 4.0
  4445. #define BDR_VALID 0x000F // ;Internal 4.0
  4446. // ;Internal 4.0
  4447. #define EDGE_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER) // ;Internal 4.0
  4448. #define EDGE_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER) // ;Internal 4.0
  4449. #define EDGE_ETCHED (BDR_SUNKENOUTER | BDR_RAISEDINNER) // ;Internal 4.0
  4450. #define EDGE_BUMP (BDR_RAISEDOUTER | BDR_SUNKENINNER) // ;Internal 4.0
  4451. // ;Internal 4.0
  4452. /* Border flags */ // ;Internal 4.0
  4453. #define BF_LEFT 0x0001 // ;Internal 4.0
  4454. #define BF_TOP 0x0002 // ;Internal 4.0
  4455. #define BF_RIGHT 0x0004 // ;Internal 4.0
  4456. #define BF_BOTTOM 0x0008 // ;Internal 4.0
  4457. // ;Internal 4.0
  4458. #define BF_TOPLEFT (BF_TOP | BF_LEFT) // ;Internal 4.0
  4459. #define BF_TOPRIGHT (BF_TOP | BF_RIGHT) // ;Internal 4.0
  4460. #define BF_BOTTOMLEFT (BF_BOTTOM | BF_LEFT) // ;Internal 4.0
  4461. #define BF_BOTTOMRIGHT (BF_BOTTOM | BF_RIGHT) // ;Internal 4.0
  4462. #define BF_RECT (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM) // ;Internal 4.0
  4463. // ;Internal 4.0
  4464. #define BF_DIAGONAL 0x0010 // ;Internal 4.0
  4465. // ;Internal 4.0
  4466. #define BF_DIAGONAL_ENDTOPRIGHT (BF_DIAGONAL | BF_TOP | BF_RIGHT) // ;Internal 4.0
  4467. #define BF_DIAGONAL_ENDTOPLEFT (BF_DIAGONAL | BF_TOP | BF_LEFT) // ;Internal 4.0
  4468. #define BF_DIAGONAL_ENDBOTTOMLEFT (BF_DIAGONAL | BF_BOTTOM | BF_LEFT) // ;Internal 4.0
  4469. #define BF_DIAGONAL_ENDBOTTOMRIGHT (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT) // ;Internal 4.0
  4470. // ;Internal 4.0
  4471. #define BF_MIDDLE 0x0800 // ;Internal 4.0
  4472. #define BF_SOFT 0x1000 // ;Internal 4.0
  4473. #define BF_ADJUST 0x2000 // ;Internal 4.0
  4474. #define BF_FLAT 0x4000 // ;Internal 4.0
  4475. #define BF_MONO 0x8000 // ;Internal 4.0
  4476. // ;Internal 4.0
  4477. // ;Internal 4.0
  4478. BOOL WINAPI DrawEdge(HDC, LPRECT, UINT, UINT); // ;Internal 4.0
  4479. // ;Internal 4.0
  4480. /* flags for DrawFrameControl */ // ;Internal 4.0
  4481. #define DFC_CAPTION 1 // ;Internal 4.0
  4482. #define DFC_MENU 2 // ;Internal 4.0
  4483. #define DFC_SCROLL 3 // ;Internal 4.0
  4484. #define DFC_BUTTON 4 // ;Internal 4.0
  4485. #define DFC_CACHE 0xFFFF // ;Internal 4.0
  4486. // ;Internal 4.0
  4487. #define DFCS_CAPTIONCLOSE 0x0000 // ;Internal 4.0
  4488. #define DFCS_CAPTIONMIN 0x0001 // ;Internal 4.0
  4489. #define DFCS_CAPTIONMAX 0x0002 // ;Internal 4.0
  4490. #define DFCS_CAPTIONRESTORE 0x0003 // ;Internal 4.0
  4491. #define DFCS_CAPTIONHELP 0x0004 // ;Internal 4.0
  4492. #define DFCS_INMENU 0x0040 // ;Internal 4.0
  4493. #define DFCS_INSMALL 0x0080 // ;Internal 4.0
  4494. // ;Internal 4.0
  4495. #define DFCS_MENUARROW 0x0000 // ;Internal 4.0
  4496. #define DFCS_MENUCHECK 0x0001 // ;Internal 4.0
  4497. #define DFCS_MENUBULLET 0x0002 // ;Internal 4.0
  4498. #define DFCS_MENUARROWRIGHT 0x0004 // ;Internal 4.0
  4499. #if (WINVER >= 0x40A) // ;Internal 4.1
  4500. #define DFCS_MENUARROWUP 0x0008 // ;Internal 4.1
  4501. #define DFCS_MENUARROWDOWN 0x0010 // ;Internal 4.1
  4502. #endif // (WINVER >= 0x40A) // ;Internal 4.1
  4503. // ;Internal 4.0
  4504. #define DFCS_SCROLLMIN 0x0000 // ;Internal 4.0
  4505. #define DFCS_SCROLLVERT 0x0000 // ;Internal 4.0
  4506. #define DFCS_SCROLLMAX 0x0001 // ;Internal 4.0
  4507. #define DFCS_SCROLLHORZ 0x0002 // ;Internal 4.0
  4508. #define DFCS_SCROLLLINE 0x0004 // ;Internal 4.0
  4509. // ;Internal 4.0
  4510. #define DFCS_SCROLLUP 0x0000 // ;Internal 4.0
  4511. #define DFCS_SCROLLDOWN 0x0001 // ;Internal 4.0
  4512. #define DFCS_SCROLLLEFT 0x0002 // ;Internal 4.0
  4513. #define DFCS_SCROLLRIGHT 0x0003 // ;Internal 4.0
  4514. #define DFCS_SCROLLCOMBOBOX 0x0005 // ;Internal 4.0
  4515. #define DFCS_SCROLLSIZEGRIP 0x0008 // ;Internal 4.0
  4516. #define DFCS_SCROLLSIZEGRIPRIGHT 0x0010 // ;Internal 4.0
  4517. // ;Internal 4.0
  4518. #define DFCS_BUTTONCHECK 0x0000 // ;Internal 4.0
  4519. #define DFCS_BUTTONRADIOIMAGE 0x0001 // ;Internal 4.0
  4520. #define DFCS_BUTTONRADIOMASK 0x0002 // ;Internal 4.0
  4521. #define DFCS_BUTTONRADIO 0x0004 // ;Internal 4.0
  4522. #define DFCS_BUTTON3STATE 0x0008 // ;Internal 4.0
  4523. #define DFCS_BUTTONPUSH 0x0010 // ;Internal 4.0
  4524. // ;Internal 4.0
  4525. #define DFCS_CACHEICON 0x0000 // ;Internal 4.0
  4526. #define DFCS_CACHEBUTTONS 0x0001 // ;Internal 4.0
  4527. // ;Internal 4.0
  4528. #define DFCS_INACTIVE 0x0100 // ;Internal 4.0
  4529. #define DFCS_PUSHED 0x0200 // ;Internal 4.0
  4530. #define DFCS_CHECKED 0x0400 // ;Internal 4.0
  4531. #if (WINVER >= 0x40A) // ;Internal 4.1
  4532. #define DFCS_TRANSPARENT 0x0800 // ;Internal 4.1
  4533. #define DFCS_HOT 0x1000 // ;Internal 4.1
  4534. #endif // (WINVER >= 0x40A) // ;Internal 4.1
  4535. #define DFCS_ADJUSTRECT 0x2000 // ;Internal 4.0
  4536. #define DFCS_FLAT 0x4000 // ;Internal 4.0
  4537. #define DFCS_MONO 0x8000 // ;Internal 4.0
  4538. // ;Internal 4.0
  4539. BOOL WINAPI DrawFrameControl(HDC, LPRECT, UINT, UINT); // ;Internal 4.0
  4540. // ;Internal 4.0
  4541. /* flags for DrawCaption */ // ;Internal 4.0
  4542. #define DC_ACTIVE 0x0001 // ;Internal 4.0
  4543. #define DC_SMALLCAP 0x0002 // ;Internal 4.0
  4544. #define DC_ICON 0x0004 // ;Internal 4.0
  4545. #define DC_TEXT 0x0008 // ;Internal 4.0
  4546. #define DC_INBUTTON 0x0010 // ;Internal 4.0
  4547. #define DC_NOVISIBLE 0x0800 // ;Internal
  4548. #define DC_BUTTONS 0x1000 // ;Internal
  4549. #define DC_NOSENDMSG 0x2000 // ;Internal
  4550. #define DC_CENTER 0x4000 // ;Internal
  4551. #define DC_FRAME 0x8000 // ;Internal
  4552. #define DC_CAPTION (DC_ICON | DC_TEXT | DC_BUTTONS)// ;Internal
  4553. #define DC_NC (DC_CAPTION | DC_FRAME) // ;Internal
  4554. // ;Internal 4.0
  4555. BOOL WINAPI DrawCaption(HWND, HDC, LPRECT, UINT); // ;Internal 4.0
  4556. BOOL WINAPI DrawCaptionTemp(HWND, HDC, LPRECT, HFONT, HICON, LPSTR, UINT); // ;Internal 4.0
  4557. // ;Internal 4.0
  4558. BOOL WINAPI PlaySoundEvent(int idSound); // ;Internal
  4559. // ;Internal 4.0
  4560. #define IDANI_OPEN 1 // ;Internal 4.0
  4561. #define IDANI_CLOSE 2 // ;Internal 4.0
  4562. #define IDANI_CAPTION 3 // ;Internal 4.0
  4563. #if (WINVER >= 0x40A) // ;Internal 4.1
  4564. #define IDANI_BORDER 4 // ;Internal 4.1
  4565. #define IDANI_SLIDE 5 // ;Internal 4.1
  4566. #endif // (WINVER >=0x40A) // ;Internal 4.1
  4567. BOOL WINAPI DrawAnimatedRects(HWND, int, LPCRECT, LPCRECT); // ;Internal 4.0
  4568. #endif // WINVER >= VER40 // ;Internal
  4569. #if (WINVER >= 0x40A) // ;Internal 4.1
  4570. #define PAS_IN 0x0001 // ;Internal 4.1
  4571. #define PAS_OUT 0x0002 // ;Internal 4.1
  4572. #define PAS_LEFT 0x0004 // ;Internal 4.1
  4573. #define PAS_RIGHT 0x0008 // ;Internal 4.1
  4574. #define PAS_UP 0x0010 // ;Internal 4.1
  4575. #define PAS_DOWN 0x0020 // ;Internal 4.1
  4576. #define PAS_HORZ (PAS_LEFT | PAS_RIGHT) // ;Internal
  4577. #define PAS_VERT (PAS_UP | PAS_DOWN) // ;Internal
  4578. #endif // (WINVER >=0x40A) // ;Internal 4.1
  4579. /* Special value for CreateWindow, et al. */
  4580. #define HWND_DESKTOP ((HWND)0)
  4581. #if (WINVER >= 0x40A) // ;Internal 4.1
  4582. #define HWND_MESSAGE ((HWND)-3)
  4583. #endif // (WINVER >=0x40A) // ;Internal 4.1
  4584. #ifdef tagWND // ;Internal
  4585. BOOL WINAPI IsWindow(HWND_16); // ;Internal
  4586. #else // ;Internal
  4587. BOOL WINAPI IsWindow(HWND);
  4588. #endif // tagWND // ;Internal
  4589. #ifdef tagWND /* ;Internal */
  4590. HWND_16 WINAPI CreateWindow(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND_16, HMENU_16, HINSTANCE, void FAR*); /* ;Internal */
  4591. HWND_16 WINAPI CreateWindowEx(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND_16, HMENU_16, HINSTANCE, void FAR*); /* ;Internal */
  4592. #else /* ;Internal */
  4593. HWND WINAPI CreateWindow(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  4594. HWND WINAPI CreateWindowEx(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  4595. #endif /* ;Internal */
  4596. /* WM_CREATE/WM_NCCREATE lParam struct */
  4597. typedef struct tagCREATESTRUCT
  4598. {
  4599. void FAR* lpCreateParams;
  4600. HINSTANCE hInstance;
  4601. #ifdef tagWND /* ;Internal */
  4602. HMENU_16 hMenu; /* ;Internal */
  4603. HWND_16 hwndParent; /* ;Internal */
  4604. #else /* ;Internal */
  4605. HMENU hMenu;
  4606. HWND hwndParent;
  4607. #endif /* ;Internal */
  4608. int cy;
  4609. int cx;
  4610. int y;
  4611. int x;
  4612. LONG style;
  4613. LPCSTR lpszName;
  4614. LPCSTR lpszClass;
  4615. DWORD dwExStyle;
  4616. } CREATESTRUCT, FAR * LPCREATESTRUCT;
  4617. BOOL WINAPI DestroyWindow(HWND);
  4618. /* Basic window attributes */
  4619. HTASK WINAPI GetWindowTask(HWND);
  4620. BOOL WINAPI IsChild(HWND, HWND);
  4621. #ifdef tagWND /* ;Internal */
  4622. HWND_16 WINAPI GetParent(HWND); /* ;Internal */
  4623. HWND_16 WINAPI SetParent(HWND, HWND);/* ;Internal */
  4624. #else /* ;Internal */
  4625. HWND WINAPI GetParent(HWND);
  4626. HWND WINAPI SetParent(HWND, HWND);
  4627. #endif /* ;Internal */
  4628. BOOL WINAPI IsWindowVisible(HWND);
  4629. BOOL WINAPI ShowWindow(HWND, int);
  4630. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  4631. BOOL WINAPI ShowWindowAsync(HWND, int); /* ;Internal 4.0 */
  4632. #endif /* ;Internal 4.0 */
  4633. #ifndef NOSHOWWINDOW
  4634. #define SW_HIDE 0
  4635. #define SW_SHOWNORMAL 1
  4636. #define SW_NORMAL SW_SHOWNORMAL
  4637. #define SW_SHOWMINIMIZED 2
  4638. #define SW_SHOWMAXIMIZED 3
  4639. #define SW_MAXIMIZE SW_SHOWMAXIMIZED
  4640. #define SW_SHOWNOACTIVATE 4
  4641. #define SW_SHOW 5
  4642. #define SW_MINIMIZE 6
  4643. #define SW_SHOWMINNOACTIVE 7
  4644. #define SW_SHOWNA 8
  4645. #define SW_RESTORE 9
  4646. #define SW_SHOWDEFAULT 10 /* ;Internal NT */
  4647. #define SW_MAX 10 /* ;Internal */
  4648. /* Obsolete ShowWindow() command names */
  4649. #define HIDE_WINDOW SW_HIDE
  4650. #define SHOW_OPENWINDOW SW_SHOWNORMAL
  4651. #define SHOW_ICONWINDOW SW_SHOWMINIMIZED
  4652. #define SHOW_FULLSCREEN SW_SHOWMAXIMIZED
  4653. #define SHOW_OPENNOACTIVATE SW_SHOWNOACTIVATE
  4654. /* WM_SHOWWINDOW wParam codes */
  4655. #define SW_PARENTCLOSING 1
  4656. #define SW_OTHERMAXIMIZED 2
  4657. #define SW_PARENTOPENING 3
  4658. #define SW_OTHERRESTORED 4
  4659. /* Obsolete constant names */
  4660. #define SW_OTHERZOOM SW_OTHERMAXIMIZED
  4661. #define SW_OTHERUNZOOM SW_OTHERRESTORED
  4662. #endif /* NOSHOWWINDOW */
  4663. /* Enabled state */
  4664. BOOL WINAPI EnableWindow(HWND,BOOL);
  4665. BOOL WINAPI IsWindowEnabled(HWND);
  4666. /* Window text */
  4667. #ifdef tagWND // ;Internal
  4668. BOOL WINAPI SetWindowText(HWND, LPCSTR); // ;Internal
  4669. DWORD WINAPI GetWindowTextLength(HWND); // ;Internal
  4670. #else // ;Internal
  4671. void WINAPI SetWindowText(HWND, LPCSTR);
  4672. int WINAPI GetWindowTextLength(HWND);
  4673. #endif // ;Internal
  4674. int WINAPI GetWindowText(HWND, LPSTR, int);
  4675. /* Window words */
  4676. WORD WINAPI GetWindowWord(HWND, int);
  4677. WORD WINAPI SetWindowWord(HWND, int, WORD);
  4678. LONG WINAPI GetWindowLong(HWND, int);
  4679. LONG WINAPI SetWindowLong(HWND, int, LONG);
  4680. /* Window field offsets for GetWindowLong() and GetWindowWord() */
  4681. #ifndef NOWINOFFSETS
  4682. #define GWL_WNDPROC (-4)
  4683. #define GWW_HINSTANCE (-6)
  4684. #define GWW_HWNDPARENT (-8)
  4685. #define GWW_ID (-12)
  4686. #define GWL_STYLE (-16)
  4687. #define GWL_EXSTYLE (-20)
  4688. #define GWL_USERDATA (-21) /* ;Internal NT */
  4689. #endif /* NOWINOFFSETS */
  4690. /* ;Internal NT */
  4691. // BOOL WINAPI IsWindowUnicode(HWND); /* ;Internal NT */
  4692. #ifdef FE_IME // ;Internal IMM
  4693. #define SWIMC_SET (0) // ;internal IMM
  4694. #define SWIMC_RESET (1) // ;internal IMM
  4695. #define SWIMC_HIMC (2) // ;internal IMM
  4696. #define SWIMC_HSAVEDIMC (3) // ;internal IMM
  4697. #define SWIMC_RESETFORTHISIMC (4) // ;internal IMM
  4698. #define SWIMC_SETNULLTOIMC (5) // ;internal IMM
  4699. #endif // ;Internal IMM
  4700. /****** Window size, position, Z-order, and visibility **********************/
  4701. #define CW_USEDEFAULT ((int)0x8000)
  4702. #ifdef tagWND // ;Internal
  4703. BOOL WINAPI GetClientRect(HWND, LPRECT); // ;Internal
  4704. BOOL WINAPI GetWindowRect(HWND, LPRECT); // ;Internal
  4705. #else // ;Internal
  4706. void WINAPI GetClientRect(HWND, LPRECT);
  4707. void WINAPI GetWindowRect(HWND, LPRECT);
  4708. #endif // ;Internal
  4709. // Multiple Monitor APIs // ;Internal
  4710. #if (WINVER >= 0x040A) // ;Internal
  4711. // ;Internal
  4712. #ifdef tagWND // ;Internal
  4713. #define HMONITOR PMONITOR // ;Internal
  4714. #else // ;Internal
  4715. DECLARE_HANDLE(HMONITOR); // ;Internal
  4716. #endif // tagWND // ;Internal
  4717. // ;Internal
  4718. #define MONITOR_DEFAULTTONULL 0x0000 // ;Internal
  4719. #define MONITOR_DEFAULTTOPRIMARY 0x0001 // ;Internal
  4720. #define MONITOR_VALID 0x0001 // ;Internal
  4721. // ;Internal
  4722. HMONITOR WINAPI MonitorFromPoint(POINT, UINT); // ;Internal
  4723. HMONITOR WINAPI MonitorFromRect(LPCRECT, UINT); // ;Internal
  4724. HMONITOR WINAPI MonitorFromWindow(HWND, UINT); // ;Internal
  4725. // ;Internal
  4726. // ;Internal
  4727. typedef struct tagMONITORINFO // ;Internal
  4728. { // ;Internal
  4729. DWORD cbSize; // ;Internal
  4730. RECT rcMonitor; // ;Internal
  4731. RECT rcWork; // ;Internal
  4732. UINT BitCount; // ;Internal
  4733. char szDevice[32]; // ;Internal
  4734. } MONITORINFO, FAR * LPMONITORINFO; // ;Internal
  4735. // ;Internal
  4736. BOOL WINAPI GetMonitorInfo(HMONITOR, LPMONITORINFO); // ;Internal
  4737. // ;Internal
  4738. // ;Internal
  4739. typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); // ;Internal
  4740. BOOL WINAPI EnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM); // ;Internal
  4741. #endif // WINVER >= 0x040A // ;Internal
  4742. #if (WINVER >= 0x030a)
  4743. typedef struct tagWINDOWPLACEMENT
  4744. {
  4745. UINT length;
  4746. UINT flags;
  4747. UINT showCmd;
  4748. POINT ptMinPosition;
  4749. POINT ptMaxPosition;
  4750. RECT rcNormalPosition;
  4751. } WINDOWPLACEMENT;
  4752. typedef WINDOWPLACEMENT *PWINDOWPLACEMENT;
  4753. typedef WINDOWPLACEMENT FAR* LPWINDOWPLACEMENT;
  4754. #define WPF_SETMINPOSITION 0x0001
  4755. #define WPF_RESTORETOMAXIMIZED 0x0002
  4756. #define WPF_VALID 0x0003 /* ;Internal */
  4757. BOOL WINAPI GetWindowPlacement(HWND, WINDOWPLACEMENT FAR*);
  4758. BOOL WINAPI SetWindowPlacement(HWND, const WINDOWPLACEMENT FAR*);
  4759. #endif /* WINVER >= 0x030a */
  4760. #ifdef tagWND // ;Internal
  4761. BOOL WINAPI SetWindowPos(HWND, HWNDC, int, int, int, int, UINT); // ;Internal
  4762. #else // ;Internal
  4763. BOOL WINAPI SetWindowPos(HWND, HWND, int, int, int, int, UINT);
  4764. #endif // ;Internal
  4765. // ;Internal
  4766. /* SetWindowPos() and WINDOWPOS flags */
  4767. #define SWP_NOSIZE 0x0001
  4768. #define SWP_NOMOVE 0x0002
  4769. #define SWP_NOZORDER 0x0004
  4770. #define SWP_NOREDRAW 0x0008
  4771. #define SWP_NOACTIVATE 0x0010
  4772. #define SWP_FRAMECHANGED 0x0020 /* The frame changed: send WM_NCCALCSIZE */
  4773. #define SWP_SHOWWINDOW 0x0040
  4774. #define SWP_HIDEWINDOW 0x0080
  4775. #define SWP_NOCOPYBITS 0x0100
  4776. #define SWP_NOOWNERZORDER 0x0200 /* Don't do owner Z ordering */
  4777. #define SWP_DRAWFRAME SWP_FRAMECHANGED
  4778. #define SWP_NOREPOSITION SWP_NOOWNERZORDER
  4779. #define SWP_NOCLIENTSIZE 0x0800 // Client didn't resize ;Internal
  4780. #define SWP_NOCLIENTMOVE 0x1000 // Client didn't move ;Internal
  4781. #define SWP_NOSENDCHANGING 0x0400
  4782. #define SWP_DEFERERASE 0x2000
  4783. #define SWP_ASYNCWINDOWPOS 0x4000 /* ;Internal NT BOGUS - make sure this is the same as NT! */
  4784. #define SWP_STATECHANGE 0x8000 /* ;Internal Force size, move messages */
  4785. /* Don't do any drawing or erasing */ /* ;Internal */
  4786. #define SWP_DEFERDRAWING SWP_DEFERERASE /* ;Internal */
  4787. /* ;Internal */
  4788. #define SWP_CHANGEMASK (SWP_NOSIZE | SWP_NOMOVE | /* ;Internal */ \
  4789. SWP_NOZORDER | SWP_FRAMECHANGED | /* ;Internal */ \
  4790. SWP_SHOWWINDOW | SWP_HIDEWINDOW | /* ;Internal */ \
  4791. SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)/* ;Internal */
  4792. /* ;Internal */
  4793. #define SWP_NOCHANGE (SWP_NOSIZE | SWP_NOMOVE | /* ;Internal */ \
  4794. SWP_NOZORDER | SWP_NOCLIENTSIZE | /* ;Internal */ \
  4795. SWP_NOCLIENTMOVE) /* ;Internal */
  4796. #define SWP_VALID 0x67ff /* ;Internal */
  4797. /* ;Internal */
  4798. /* SetWindowPos() hwndInsertAfter field values */
  4799. #define HWND_TOP ((HWND)0)
  4800. #define HWND_BOTTOM ((HWND)1)
  4801. #define HWND_TOPMOST ((HWND)-1)
  4802. #define HWND_NOTOPMOST ((HWND)-2)
  4803. #define HWND_GROUPTOTOP HWND_TOPMOST /* ;Internal */
  4804. #ifndef NODEFERWINDOWPOS
  4805. DECLARE_HANDLE(HDWP);
  4806. HDWP WINAPI BeginDeferWindowPos(int);
  4807. #ifdef tagWND // ;Internal
  4808. HDWP WINAPI DeferWindowPos(HDWP, HWND, HWNDC, int, int, int, int, UINT); // ;Internal
  4809. #else // ;Internal
  4810. HDWP WINAPI DeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT);
  4811. #endif // ;Internal
  4812. BOOL WINAPI EndDeferWindowPos(HDWP);
  4813. #if (WINVER >= 0x0400) // ;Internal
  4814. BOOL WINAPI EndDeferWindowPosEx(HDWP, BOOL); // ;Internal NT
  4815. #endif // ;Internal
  4816. #endif /* NODEFERWINDOWPOS */
  4817. BOOL WINAPI MoveWindow(HWND, int, int, int, int, BOOL);
  4818. BOOL WINAPI BringWindowToTop(HWND);
  4819. #if (WINVER >= 0x030a)
  4820. /* WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam */
  4821. typedef struct tagWINDOWPOS
  4822. {
  4823. #ifdef tagWND /* ;Internal */
  4824. HWND_16 hwnd; /* ;Internal */
  4825. HWND_16 hwndInsertAfter; /* ;Internal */
  4826. #else /* ;Internal */
  4827. HWND hwnd;
  4828. HWND hwndInsertAfter;
  4829. #endif /* ;Internal */
  4830. int x;
  4831. int y;
  4832. int cx;
  4833. int cy;
  4834. UINT flags;
  4835. } WINDOWPOS;
  4836. typedef WINDOWPOS FAR* LPWINDOWPOS;
  4837. #endif /* WINVER >= 0x030a */
  4838. /* WM_SIZE message wParam values */
  4839. #define SIZE_RESTORED 0
  4840. #define SIZE_MINIMIZED 1
  4841. #define SIZE_MAXIMIZED 2
  4842. #define SIZE_MAXSHOW 3
  4843. #define SIZE_MAXHIDE 4
  4844. /* Obsolete constant names */
  4845. #define SIZENORMAL SIZE_RESTORED
  4846. #define SIZEICONIC SIZE_MINIMIZED
  4847. #define SIZEFULLSCREEN SIZE_MAXIMIZED
  4848. #define SIZEZOOMSHOW SIZE_MAXSHOW
  4849. #define SIZEZOOMHIDE SIZE_MAXHIDE
  4850. /****** Window proc implementation & subclassing support *********************/
  4851. LRESULT WINAPI DefWindowProc(HWND, UINT, WPARAM, LPARAM);
  4852. #ifdef STRICT
  4853. LRESULT WINAPI CallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM);
  4854. #else
  4855. LRESULT WINAPI CallWindowProc(FARPROC, HWND, UINT, WPARAM, LPARAM);
  4856. #endif
  4857. /****** Main window support **************************************************/
  4858. void WINAPI AdjustWindowRect(LPRECT, DWORD, BOOL);
  4859. #ifdef tagWND // ;Internal
  4860. BOOL WINAPI AdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD); // ;Internal
  4861. #else // ;Internal
  4862. void WINAPI AdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD);
  4863. #endif // ;Internal
  4864. /* Struct pointed to by WM_GETMINMAXINFO lParam */
  4865. typedef struct tagMINMAXINFO
  4866. {
  4867. #if (WINVER >= 0x40A)
  4868. POINT ptMinSize;
  4869. #else
  4870. POINT ptReserved;
  4871. #endif // (WINVER >= 0x40A)
  4872. POINT ptMaxSize;
  4873. POINT ptMaxPosition;
  4874. POINT ptMinTrackSize;
  4875. POINT ptMaxTrackSize;
  4876. } MINMAXINFO, FAR * LPMINMAXINFO;
  4877. BOOL WINAPI FlashWindow(HWND, BOOL);
  4878. #ifdef tagWND // ;Internal
  4879. BOOL WINAPI ShowOwnedPopups(HWND, BOOL); // ;Internal
  4880. #else // ;Internal
  4881. void WINAPI ShowOwnedPopups(HWND, BOOL);
  4882. #endif // ;Internal
  4883. /* Obsolete functions */
  4884. BOOL WINAPI OpenIcon(HWND);
  4885. #ifdef tagWND // ;Internal
  4886. BOOL WINAPI CloseWindow(HWND); // ;Internal
  4887. #else // ;Internal
  4888. void WINAPI CloseWindow(HWND);
  4889. #endif // ;Internal
  4890. BOOL WINAPI AnyPopup(void);
  4891. BOOL WINAPI IsIconic(HWND);
  4892. BOOL WINAPI IsZoomed(HWND);
  4893. /****** Window coordinate mapping and hit-testing ***************************/
  4894. #ifdef tagWND // ;Internal
  4895. BOOL WINAPI ClientToScreen(HWND, LPPOINT); // ;Internal
  4896. BOOL WINAPI ScreenToClient(HWND, LPPOINT); // ;Internal
  4897. #else // ;Internal
  4898. void WINAPI ClientToScreen(HWND, LPPOINT);
  4899. void WINAPI ScreenToClient(HWND, LPPOINT);
  4900. #endif // ;Internal
  4901. #if (WINVER >= 0x030a)
  4902. void WINAPI MapWindowPoints(HWND hwndFrom, HWND hwndTo, POINT FAR* lppt, UINT cpt);
  4903. #endif /* WINVER >= 0x030a */
  4904. #ifdef tagWND /* ;Internal */
  4905. HWND_16 WINAPI WindowFromPoint(POINT); /* ;Internal */
  4906. HWND_16 WINAPI ChildWindowFromPoint(HWND, POINT); /* ;Internal */
  4907. #else /* ;Internal */
  4908. HWND WINAPI WindowFromPoint(POINT);
  4909. HWND WINAPI ChildWindowFromPoint(HWND, POINT);
  4910. #endif /* ;Internal */
  4911. /* ;Internal 4.0 */
  4912. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  4913. #define CWP_ALL 0x0000 /* ;Internal 4.0 */
  4914. #define CWP_SKIPINVISIBLE 0x0001 /* ;Internal 4.0 */
  4915. #define CWP_SKIPDISABLED 0x0002 /* ;Internal 4.0 */
  4916. #define CWP_SKIPTRANSPARENT 0x0004 /* ;Internal 4.0 */
  4917. #define CWP_VALID 0x0007 /* ;Internal 4.0 */
  4918. /* ;Internal 4.0 */
  4919. #ifdef tagWND /* ;Internal 4.0 */
  4920. HWND_16 WINAPI ChildWindowFromPointEx(HWND, POINT, UINT); /* ;Internal 4.0 */
  4921. #else /* ;Internal 4.0 */
  4922. HWND WINAPI ChildWindowFromPointEx(HWND, POINT, UINT); /* ;Internal 4.0 */
  4923. #endif /* ;Internal 4.0 */
  4924. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  4925. /****** Window query and enumeration ****************************************/
  4926. #ifdef tagWND /* ;Internal */
  4927. HWND_16 WINAPI GetDesktopWindow(void); /* ;Internal */
  4928. HWND_16 WINAPI FindWindow(LPCSTR, LPCSTR); /* ;Internal */
  4929. HWND_16 WINAPI FindWindowEx(HWND, HWND, LPCSTR, LPCSTR); /* ;Internal 4.0 */
  4930. HWND_16 WINAPI GetShellWindow(void); /* ;Internal 4.0 */
  4931. BOOL WINAPI SetShellWindow(HWND_16); /* ;Internal 4.0 */
  4932. #else /* ;Internal */
  4933. HWND WINAPI GetDesktopWindow(void);
  4934. HWND WINAPI FindWindow(LPCSTR, LPCSTR);
  4935. HWND WINAPI FindWindowEx(HWND, HWND, LPCSTR, LPCSTR); /* ;Internal 4.0 */
  4936. HWND WINAPI GetShellWindow(void); /* ;Internal 4.0 */
  4937. BOOL WINAPI SetShellWindow(HWND); /* ;Internal 4.0 */
  4938. #endif /* ;Internal */
  4939. #ifdef STRICT
  4940. #ifdef tagWND /* ;Internal */
  4941. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND_16, LPARAM); /* ;Internal */
  4942. #else /* ;Internal */
  4943. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
  4944. #endif /* ;Internal */
  4945. #else
  4946. typedef FARPROC WNDENUMPROC;
  4947. #endif
  4948. BOOL WINAPI EnumWindows(WNDENUMPROC, LPARAM);
  4949. BOOL WINAPI EnumChildWindows(HWND, WNDENUMPROC, LPARAM);
  4950. BOOL WINAPI EnumTaskWindows(HTASK, WNDENUMPROC, LPARAM);
  4951. #if (WINVER >= 0x0400) // ;Internal 4.0
  4952. BOOL WINAPI EnumWindowsEx(DWORD, HWND, WNDENUMPROC, LPARAM); // ;Internal 4.0
  4953. #endif // ;Internal 4.0
  4954. #ifdef tagWND /* ;Internal */
  4955. HWND_16 WINAPI GetTopWindow(HWND); /* ;Internal */
  4956. HWND_16 WINAPI GetWindow(HWND, UINT); /* ;Internal */
  4957. HWND_16 WINAPI GetNextWindow(HWND, UINT); /* ;Internal */
  4958. #else /* ;Internal */
  4959. HWND WINAPI GetTopWindow(HWND);
  4960. HWND WINAPI GetWindow(HWND, UINT);
  4961. HWND WINAPI GetNextWindow(HWND, UINT);
  4962. #endif /* ;Internal */
  4963. /* GetWindow() constants */
  4964. #define GW_HWNDFIRST 0
  4965. #define GW_HWNDLAST 1
  4966. #define GW_HWNDNEXT 2
  4967. #define GW_HWNDPREV 3
  4968. #define GW_OWNER 4
  4969. #define GW_CHILD 5
  4970. #define GW_MAX 5 /* ;Internal */
  4971. /* ;Internal */
  4972. #ifdef tagWND /* ;Internal */
  4973. HWND_16 WINAPI GetNextQueueWindow(HWND, int); /* ;Internal */
  4974. #else /* ;Internal */
  4975. HWND WINAPI GetNextQueueWindow(HWND, int); /* ;Internal */
  4976. #endif /* ;Internal */
  4977. /****** Window property support *********************************************/
  4978. BOOL WINAPI SetProp(HWND, LPCSTR, HANDLE);
  4979. HANDLE WINAPI GetProp(HWND, LPCSTR);
  4980. HANDLE WINAPI RemoveProp(HWND, LPCSTR);
  4981. /* ;Internal 4.0 */
  4982. #if (WINVER >= 0x400) /* ;Internal 4.0 */
  4983. BOOL WINAPI SetPropEx(HWND, LPCSTR, DWORD); /* ;Internal 4.0 */
  4984. DWORD WINAPI GetPropEx(HWND, LPCSTR); /* ;Internal 4.0 */
  4985. DWORD WINAPI RemovePropEx(HWND, LPCSTR); /* ;Internal 4.0 */
  4986. #endif /* (WINVER >= 0x400) */ /* ;Internal 4.0 */
  4987. #ifdef STRICT
  4988. #ifdef tagWND /* ;Internal */
  4989. typedef BOOL (CALLBACK* PROPENUMPROC)(HWND_16, LPCSTR, HANDLE); /* ;Internal */
  4990. #else /* ;Internal */
  4991. typedef BOOL (CALLBACK* PROPENUMPROC)(HWND, LPCSTR, HANDLE);
  4992. #endif /* ;Internal */
  4993. #else
  4994. typedef FARPROC PROPENUMPROC;
  4995. #endif
  4996. int WINAPI EnumProps(HWND, PROPENUMPROC);
  4997. /****** Window drawing support **********************************************/
  4998. HDC WINAPI GetDC(HWND);
  4999. int WINAPI ReleaseDC(HWND, HDC);
  5000. HDC WINAPI GetWindowDC(HWND);
  5001. #if (WINVER >= 0x030a)
  5002. HDC WINAPI GetDCEx(register HWND hwnd, HRGN hrgnClip, DWORD flags);
  5003. #define DCX_WINDOW 0x00000001L
  5004. #define DCX_CACHE 0x00000002L
  5005. #define DCX_NORESETATTRS 0x00000004L // ;Internal
  5006. #define DCX_CLIPCHILDREN 0x00000008L
  5007. #define DCX_CLIPSIBLINGS 0x00000010L
  5008. #define DCX_PARENTCLIP 0x00000020L
  5009. #define DCX_EXCLUDERGN 0x00000040L
  5010. #define DCX_INTERSECTRGN 0x00000080L
  5011. #define DCX_EXCLUDEUPDATE 0x00000100L // ;Internal
  5012. #define DCX_INTERSECTUPDATE 0x00000200L // ;Internal
  5013. #define DCX_LOCKWINDOWUPDATE 0x00000400L
  5014. #define DCX_INVALID 0x00000800L // ;Internal
  5015. #define DCX_INUSE 0x00001000L // ;Internal
  5016. #define DCX_SAVEDRGNINVALID 0x00002000L // ;Internal
  5017. #if (WINVER >= 0x040A) // ;Internal
  5018. #define DCX_MONITOR 0x00004000L // ;Internal
  5019. #endif // (WINVER >=0x040A) // ;Internal
  5020. #define DCX_USESTYLE 0x00010000L
  5021. #define DCX_NEEDFONT 0x00020000L // ;Internal OBSOLETE
  5022. #define DCX_NODELETERGN 0x00040000L // ;Internal
  5023. #define DCX_NOCLIPCHILDREN 0x00080000L // ;Internal
  5024. #define DCX_NORECOMPUTE 0x00100000L // ;Internal
  5025. #define DCX_VALIDATE 0x00200000L // ;Internal
  5026. // ;Internal
  5027. #define DCX_MATCHMASK (DCX_WINDOW | DCX_CLIPCHILDREN | /* ;Internal */ \
  5028. DCX_CACHE | DCX_CLIPSIBLINGS | /* ;Internal */ \
  5029. DCX_LOCKWINDOWUPDATE) /* ;Internal */
  5030. #define DCX_VALID 0x000104fbL /* ;Internal */
  5031. #endif /* WINVER >= 0x030a */
  5032. /* ;Internal NT */
  5033. #if (WINVER >= 0x0400) /* ;Internal NT */
  5034. #ifdef tagWND /* ;Internal NT */
  5035. HWND_16 WINAPI WindowFromDC(HDC); /* ;Internal NT */
  5036. #else /* ;Internal NT */
  5037. HWND WINAPI WindowFromDC(HDC); /* ;Internal NT */
  5038. #endif /* ;Internal NT */
  5039. #endif /* WINVER >= 0x0400 */ /* ;Internal NT */
  5040. /****** Window repainting ***************************************************/
  5041. // /* WM_SYNCTASK commands */ /* ;Internal NT */
  5042. // #define ST_BEGINSWP 0 /* ;Internal NT */
  5043. // #define ST_ENDSWP 1 /* ;Internal NT */
  5044. /* BeginPaint() return structure */
  5045. typedef struct tagPAINTSTRUCT
  5046. {
  5047. HDC hdc;
  5048. BOOL fErase;
  5049. RECT rcPaint;
  5050. BOOL fRestore;
  5051. BOOL fIncUpdate;
  5052. BYTE rgbReserved[16];
  5053. // BYTE rgbReserved[32]; /* ;Internal NT */
  5054. } PAINTSTRUCT;
  5055. typedef PAINTSTRUCT* PPAINTSTRUCT;
  5056. typedef PAINTSTRUCT NEAR* NPPAINTSTRUCT;
  5057. typedef PAINTSTRUCT FAR* LPPAINTSTRUCT;
  5058. HDC WINAPI BeginPaint(HWND, LPPAINTSTRUCT);
  5059. #ifdef tagWND // ;Internal
  5060. BOOL WINAPI EndPaint(HWND, const PAINTSTRUCT FAR*); // ;Internal
  5061. #else // ;Internal
  5062. void WINAPI EndPaint(HWND, const PAINTSTRUCT FAR*);
  5063. #endif // ;Internal
  5064. #ifdef tagWND // ;Internal
  5065. BOOL WINAPI UpdateWindow(HWND); // ;Internal
  5066. #else // ;Internal
  5067. void WINAPI UpdateWindow(HWND);
  5068. #endif // ;Internal
  5069. int WINAPI ExcludeUpdateRgn(HDC, HWND);
  5070. #if (WINVER >= 0x030a)
  5071. BOOL WINAPI LockWindowUpdate(HWND hwndLock);
  5072. #endif /* WINVER >= 0x030a */
  5073. BOOL WINAPI GetUpdateRect(HWND, LPRECT, BOOL);
  5074. int WINAPI GetUpdateRgn(HWND, HRGN, BOOL);
  5075. #ifdef tagWND // ;Internal
  5076. BOOL WINAPI InvalidateRect(HWND, LPCRECT, BOOL); // ;Internal
  5077. BOOL WINAPI ValidateRect(HWND, LPCRECT); // ;Internal
  5078. BOOL WINAPI InvalidateRgn(HWND, HRGN, BOOL); // ;Internal
  5079. BOOL WINAPI ValidateRgn(HWND, HRGN); // ;Internal
  5080. #else // ;Internal
  5081. void WINAPI InvalidateRect(HWND, LPCRECT, BOOL);
  5082. void WINAPI ValidateRect(HWND, LPCRECT);
  5083. void WINAPI InvalidateRgn(HWND, HRGN, BOOL);
  5084. void WINAPI ValidateRgn(HWND, HRGN);
  5085. #endif // ;Internal
  5086. int WINAPI GetWindowRgn(HWND, HRGN); // ;Internal 4.0
  5087. int WINAPI SetWindowRgn(HWND, HRGN, BOOL); // ;Internal 4.0
  5088. #if (WINVER >= 0x030a)
  5089. BOOL WINAPI RedrawWindow(HWND hwnd, LPCRECT lprcUpdate, HRGN hrgnUpdate, UINT flags);
  5090. #define RDW_INVALIDATE 0x0001
  5091. #define RDW_INTERNALPAINT 0x0002
  5092. #define RDW_ERASE 0x0004
  5093. #define RDW_VALIDATE 0x0008
  5094. #define RDW_NOINTERNALPAINT 0x0010
  5095. #define RDW_NOERASE 0x0020
  5096. #define RDW_NOCHILDREN 0x0040
  5097. #define RDW_ALLCHILDREN 0x0080
  5098. #define RDW_UPDATENOW 0x0100
  5099. #define RDW_ERASENOW 0x0200
  5100. #define RDW_FRAME 0x0400
  5101. #define RDW_NOFRAME 0x0800
  5102. // ;Internal
  5103. #define RDW_REDRAWWINDOW 0x1000 // ;Internal Called from RedrawWindow()
  5104. #define RDW_SUBTRACTSELF 0x2000 // ;Internal Subtract self from hrgn
  5105. #define RDW_COPYRGN 0x4000 // ;Internal Copy the passed-in region
  5106. #define RDW_IGNOREUPDATEDIRTY 0x8000 // ;Internal ignore WFUPDATEDIRTY
  5107. #define RDW_VALID 0x0fff /* ;Internal */
  5108. #endif /* WINVER >= 0x030a */
  5109. /* ;Internal 4.0 */
  5110. BOOL WINAPI PaintDesktop(HDC hdc); /* ;Internal 4.0 */
  5111. /****** Window scrolling ****************************************************/
  5112. void WINAPI ScrollWindow(HWND, int, int, LPCRECT, LPCRECT);
  5113. BOOL WINAPI ScrollDC(HDC, int, int, LPCRECT, LPCRECT, HRGN, LPRECT);
  5114. #if (WINVER >= 0x030a)
  5115. int WINAPI ScrollWindowEx(HWND, int, int, LPCRECT, LPCRECT, HRGN, LPRECT, UINT);
  5116. #define SW_SCROLLCHILDREN 0x0001
  5117. #define SW_INVALIDATE 0x0002
  5118. #define SW_ERASE 0x0004
  5119. #define SW_SCROLLWINDOW 0x8000 /* ;Internal */
  5120. #define SW_VALID 0x8007 /* ;Internal */
  5121. #endif /* WINVER >= 0x030a */
  5122. /****** Non-client window area management ************************************/
  5123. #if (WINVER >= 0x030a)
  5124. /* WM_NCCALCSIZE return flags */
  5125. #define WVR_ALIGNTOP 0x0010
  5126. #define WVR_ALIGNLEFT 0x0020
  5127. #define WVR_ALIGNBOTTOM 0x0040
  5128. #define WVR_ALIGNRIGHT 0x0080
  5129. #define WVR_HREDRAW 0x0100
  5130. #define WVR_VREDRAW 0x0200
  5131. #define WVR_REDRAW (WVR_HREDRAW | WVR_VREDRAW)
  5132. #define WVR_VALIDRECTS 0x0400
  5133. /* ;Internal */
  5134. #define WVR_MINVALID WVR_ALIGNTOP /* ;Internal */
  5135. #define WVR_MAXVALID WVR_VALIDRECTS /* ;Internal */
  5136. /* WM_NCCALCSIZE parameter structure */
  5137. typedef struct tagNCCALCSIZE_PARAMS
  5138. {
  5139. RECT rgrc[3];
  5140. WINDOWPOS FAR* lppos;
  5141. } NCCALCSIZE_PARAMS;
  5142. #else /* WINVER >= 0x030a */
  5143. typedef struct tagNCCALCSIZE_PARAMS
  5144. {
  5145. RECT rgrc[2];
  5146. } NCCALCSIZE_PARAMS;
  5147. #endif /* WINVER >= 0x030a */
  5148. typedef NCCALCSIZE_PARAMS FAR* LPNCCALCSIZE_PARAMS;
  5149. /* WM_NCHITTEST return codes */
  5150. #define HTERROR (-2)
  5151. #define HTTRANSPARENT (-1)
  5152. #define HTNOWHERE 0
  5153. #define HTCLIENT 1
  5154. #define HTCAPTION 2
  5155. #define HTSYSMENU 3
  5156. #define HTSIZE 4
  5157. #define HTMENU 5
  5158. #define HTHSCROLL 6
  5159. #define HTVSCROLL 7
  5160. #define HTMINBUTTON 8
  5161. #define HTMAXBUTTON 9
  5162. #define HTLEFT 10
  5163. #define HTRIGHT 11
  5164. #define HTTOP 12
  5165. #define HTTOPLEFT 13
  5166. #define HTTOPRIGHT 14
  5167. #define HTBOTTOM 15
  5168. #define HTBOTTOMLEFT 16
  5169. #define HTBOTTOMRIGHT 17
  5170. #define HTBORDER 18
  5171. #define HTGROWBOX HTSIZE
  5172. #define HTREDUCE HTMINBUTTON
  5173. #define HTZOOM HTMAXBUTTON
  5174. #define HTSIZEFIRST HTLEFT /* ;Internal */
  5175. #define HTSIZELAST HTBOTTOMRIGHT /* ;Internal */
  5176. #define HTOBJECT 19 // ;Internal 4.0
  5177. #define HTCLOSE 20 // ;Internal 4.0
  5178. #define HTHELP 21 // ;Internal 4.0
  5179. #define HTMAX 21 // ;Internal
  5180. //***** Drag-and-drop support ********************************* ;Internal
  5181. // ;Internal
  5182. // The rest of this section was formerly in userproc.h // ;Internal
  5183. // ;Internal
  5184. typedef struct _dropstruct // ;Internal
  5185. { // ;Internal
  5186. #ifdef tagWND // ;Internal
  5187. HWND_16 hwndSource; // ;Internal
  5188. HWND_16 hwndSink; // ;Internal
  5189. #else // ;Internal
  5190. HWND hwndSource; // ;Internal
  5191. HWND hwndSink; // ;Internal
  5192. #endif // ;Internal
  5193. WORD wFmt; // ;Internal
  5194. DWORD dwData; // ;Internal
  5195. POINT ptDrop; // ;Internal
  5196. DWORD dwControlData; // ;Internal
  5197. } DROPSTRUCT; // ;Internal
  5198. // ;Internal
  5199. typedef DROPSTRUCT FAR * LPDROPSTRUCT; // ;Internal
  5200. // ;Internal
  5201. #define DOF_EXECUTABLE 0x8001 // ;Internal
  5202. #define DOF_DOCUMENT 0x8002 // ;Internal
  5203. #define DOF_DIRECTORY 0x8003 // ;Internal
  5204. #define DOF_MULTIPLE 0x8004 // ;Internal
  5205. #define DOF_PROGMAN 0x0001 // ;Internal
  5206. #define DOF_SHELLDATA 0x0002 // ;Internal
  5207. // ;Internal
  5208. // special responses to WM_DROPOBJECT // ;Internal
  5209. // DO_DROPFILE -> send a WM_DROPFILES message // ;Internal
  5210. // DO_PRINTFILE -> print the files being dragged // ;Internal
  5211. #define DO_DROPFILE 0x454C4946L // ;Internal
  5212. #define DO_PRINTFILE 0x544E5250L // ;Internal
  5213. // ;Internal
  5214. WORD API GetInternalWindowPos(HWND,LPRECT,LPPOINT); // ;Internal
  5215. BOOL API SetInternalWindowPos(HWND,WORD,LPRECT,LPPOINT); // ;Internal
  5216. // ;Internal
  5217. #ifdef tagWND // ;Internal
  5218. // DragObject goes through layer! // ;Internal
  5219. LRESULT API DragObject(HWND, HWND, WORD, DWORD, HANDLE); // ;Internal
  5220. BOOL API DragDetect(HWND_16, POINT); // ;Internal
  5221. // ;Internal
  5222. // FillWindow goes through layer! // ;Internal
  5223. void CALLBACK FillWindow(HWND, HWND, HDC, HBRUSH); // ;Internal
  5224. #else // ;Internal
  5225. // DragObject goes through layer! // ;Internal
  5226. LRESULT API DragObject(HWND, HWND, WORD, DWORD, HANDLE); // ;Internal
  5227. BOOL API DragDetect(HWND, POINT); // ;Internal
  5228. // ;Internal
  5229. void CALLBACK FillWindow(HWND, HWND, HDC, HBRUSH); // ;Internal
  5230. #endif // ;Internal
  5231. // ;Internal
  5232. /****** Window activation ***************************************************/
  5233. #ifdef tagWND // ;Internal
  5234. HWND_16 WINAPI SetActiveWindow(HWND); // ;Internal
  5235. HWND_16 WINAPI GetActiveWindow(void); // ;Internal
  5236. HWND_16 WINAPI GetLastActivePopup(HWND); // ;Internal
  5237. BOOL WINAPI SetForegroundWindow(HWND); // ;Internal NT
  5238. HWND_16 WINAPI GetForegroundWindow(void); // ;Internal NT
  5239. #else // ;Internal
  5240. HWND WINAPI SetActiveWindow(HWND);
  5241. HWND WINAPI GetActiveWindow(void);
  5242. HWND WINAPI GetLastActivePopup(HWND);
  5243. #if (WINVER >= 0x0400) // ;Internal
  5244. BOOL WINAPI SetForegroundWindow(HWND); // ;Internal NT
  5245. HWND WINAPI GetForegroundWindow(void); // ;Internal NT
  5246. #endif // ;Internal
  5247. #endif // ;Internal
  5248. /* WM_ACTIVATE state values */
  5249. #define WA_INACTIVE 0
  5250. #define WA_ACTIVE 1
  5251. #define WA_CLICKACTIVE 2
  5252. //***** Server ********************************************* ;Internal NT
  5253. // ;Internal NT
  5254. // /* Desktops */ ;Internal NT
  5255. // #define DESKTOP_ENUMWINDOWS 0x0001L ;Internal NT
  5256. // #define DESKTOP_CREATEWINDOW 0x0002L ;Internal NT
  5257. // #define DESKTOP_CREATEMENU 0x0004L ;Internal NT
  5258. // #define DESKTOP_HOOKCONTROL 0x0008L ;Internal NT
  5259. // #define DESKTOP_JOURNALRECORD 0x0010L ;Internal NT
  5260. // #define DESKTOP_JOURNALPLAYBACK 0x0020L ;Internal NT
  5261. // #define DESKTOP_ENUMERATE 0x0040L ;Internal NT
  5262. // ;Internal NT
  5263. // HDESK WINAPI GetThreadDesktop(DWORD idThread); ;Internal NT
  5264. // ;Internal NT
  5265. // /* WinStations */ ;Internal NT
  5266. // #define WINSTA_ENUMDESKTOPS 0x0001L ;Internal NT
  5267. // #define WINSTA_READATTRIBUTES 0x0002L ;Internal NT
  5268. // #define WINSTA_ACCESSCLIPBOARD 0x0004L ;Internal NT
  5269. // #define WINSTA_CREATEDESKTOP 0x0008L ;Internal NT
  5270. // #define WINSTA_WRITEATTRIBUTES 0x0010L ;Internal NT
  5271. // #define WINSTA_ACCESSGLOBALATOMS 0x0020L ;Internal NT
  5272. // #define WINSTA_EXITWINDOWS 0x0040L ;Internal NT
  5273. // #define WINSTA_ENUMERATE 0x0100L ;Internal NT
  5274. // #define WINSTA_READSCREEN 0x0200L ;Internal NT
  5275. // ;Internal NT
  5276. // HWINSTA WINAPI GetProcessWindowStation(); ;Internal NT
  5277. // ;Internal NT
  5278. // /* Security */ ;Internal NT
  5279. // #define WIN_ACCESSWINDOW 0x0001L ;Internal NT
  5280. // #define WIN_ENUMERATE 0x0002L ;Internal NT
  5281. // #define MENU_ACCESSMENU 0x0001L ;Internal NT
  5282. // ;Internal NT
  5283. // BOOL WINAPI SetUserObjectSecurity(HANDLE, ;Internal NT
  5284. // PSECURITY_INFORMATION, PSECURITY_DESCRIPTOR); ;Internal NT
  5285. // BOOL WINAPI GetUserObjectSecurity(HANDLE, ;Internal NT
  5286. // PSECURITY_INFORMATION, PSECURITY_DESCRIPTOR, ;Internal NT
  5287. // DWORD, LPDWORD); ;Internal NT
  5288. // BOOL WINAPI ImpersonateDDEClientWindow(HWND, HWND); ;Internal NT
  5289. // ;Internal NT
  5290. /****** Keyboard input support **********************************************/
  5291. #ifdef tagWND /* ;Internal */
  5292. HWND_16 WINAPI SetFocus(HWND); /* ;Internal */
  5293. HWND_16 WINAPI GetFocus(void); /* ;Internal */
  5294. #else /* ;Internal */
  5295. HWND WINAPI SetFocus(HWND);
  5296. HWND WINAPI GetFocus(void);
  5297. #endif /* ;Internal */
  5298. int WINAPI GetKeyState(int);
  5299. int WINAPI GetAsyncKeyState(int);
  5300. #ifdef tagWND // ;Internal
  5301. BOOL WINAPI GetKeyboardState(LPBYTE); // ;Internal
  5302. BOOL WINAPI GetKeyboardState(LPBYTE); // ;Internal
  5303. #else // ;Internal
  5304. void WINAPI GetKeyboardState(LPBYTE);
  5305. void WINAPI SetKeyboardState(LPBYTE);
  5306. #endif // ;Internalx
  5307. /* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
  5308. #define KF_EXTENDED 0x0100
  5309. #define KF_DLGMODE 0x0800
  5310. #define KF_MENUMODE 0x1000
  5311. #define KF_ALTDOWN 0x2000
  5312. #define KF_REPEAT 0x4000
  5313. #define KF_UP 0x8000
  5314. /* Virtual key codes */
  5315. #ifndef NOVIRTUALKEYCODES
  5316. #define VK_LBUTTON 0x01
  5317. #define VK_RBUTTON 0x02
  5318. #define VK_CANCEL 0x03
  5319. #define VK_MBUTTON 0x04
  5320. #define VK_BACK 0x08
  5321. #define VK_TAB 0x09
  5322. #define VK_CLEAR 0x0C
  5323. #define VK_RETURN 0x0D
  5324. #define VK_SHIFT 0x10
  5325. #define VK_CONTROL 0x11
  5326. #define VK_MENU 0x12
  5327. #define VK_PAUSE 0x13
  5328. #define VK_CAPITAL 0x14
  5329. #define VK_KANA 0x15 /* ;Internal JAPAN */
  5330. #define VK_KANJI 0x19 /* ;Internal JAPAN */
  5331. #define VK_HANGEUL 0x15 /* ;Internal KOREA */
  5332. #define VK_JUNJA 0x17 /* ;Internal KOREA */
  5333. #define VK_HANJA 0x19 /* ;Internal KOREA */
  5334. #define VK_ESCAPE 0x1B
  5335. #define VK_SPACE 0x20
  5336. #define VK_PRIOR 0x21
  5337. #define VK_NEXT 0x22
  5338. #define VK_END 0x23
  5339. #define VK_HOME 0x24
  5340. #define VK_LEFT 0x25
  5341. #define VK_UP 0x26
  5342. #define VK_RIGHT 0x27
  5343. #define VK_DOWN 0x28
  5344. #define VK_SELECT 0x29
  5345. #define VK_PRINT 0x2A
  5346. #define VK_EXECUTE 0x2B
  5347. #define VK_SNAPSHOT 0x2C
  5348. #define VK_INSERT 0x2D
  5349. #define VK_DELETE 0x2E
  5350. #define VK_HELP 0x2F
  5351. #define VK_LWIN 0x5B
  5352. #define VK_RWIN 0x5C
  5353. #define VK_APPS 0x5D
  5354. #define VK_NUMPAD0 0x60
  5355. #define VK_NUMPAD1 0x61
  5356. #define VK_NUMPAD2 0x62
  5357. #define VK_NUMPAD3 0x63
  5358. #define VK_NUMPAD4 0x64
  5359. #define VK_NUMPAD5 0x65
  5360. #define VK_NUMPAD6 0x66
  5361. #define VK_NUMPAD7 0x67
  5362. #define VK_NUMPAD8 0x68
  5363. #define VK_NUMPAD9 0x69
  5364. #define VK_MULTIPLY 0x6A
  5365. #define VK_ADD 0x6B
  5366. #define VK_SEPARATOR 0x6C
  5367. #define VK_SUBTRACT 0x6D
  5368. #define VK_DECIMAL 0x6E
  5369. #define VK_DIVIDE 0x6F
  5370. #define VK_F1 0x70
  5371. #define VK_F2 0x71
  5372. #define VK_F3 0x72
  5373. #define VK_F4 0x73
  5374. #define VK_F5 0x74
  5375. #define VK_F6 0x75
  5376. #define VK_F7 0x76
  5377. #define VK_F8 0x77
  5378. #define VK_F9 0x78
  5379. #define VK_F10 0x79
  5380. #define VK_F11 0x7A
  5381. #define VK_F12 0x7B
  5382. #define VK_F13 0x7C
  5383. #define VK_F14 0x7D
  5384. #define VK_F15 0x7E
  5385. #define VK_F16 0x7F
  5386. #define VK_F17 0x80
  5387. #define VK_F18 0x81
  5388. #define VK_F19 0x82
  5389. #define VK_F20 0x83
  5390. #define VK_F21 0x84
  5391. #define VK_F22 0x85
  5392. #define VK_F23 0x86
  5393. #define VK_F24 0x87
  5394. #define VK_NUMLOCK 0x90
  5395. #define VK_SCROLL 0x91
  5396. /* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
  5397. /* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '9' */
  5398. #endif /* NOVIRTUALKEYCODES */
  5399. /* ;Internal */
  5400. BOOL WINAPI IsTwoByteCharPrefix(char); /* ;Internal */
  5401. /* ;Internal NT */
  5402. /* Keyboard Layout */ /* ;Internal NT */
  5403. #define HKL_PREV 0 /* ;Internal NT */
  5404. #define HKL_NEXT 1 /* ;Internal NT */
  5405. /* ;Internal NT */
  5406. #define KLF_ACTIVATE 0x1 /* ;Internal NT */
  5407. #define KLF_SUBSTITUTE_OK 0x2 /* ;Internal NT */
  5408. #define KLF_UNLOADPREVIOUS 0x4 /* ;Internal NT */
  5409. #define KLF_REORDER 0x8 /* ;Internal NT */
  5410. /* ;Internal NT */
  5411. #define KLF_REPLACELANG 0x10 /* ;Internal 4.0 */
  5412. #define KLF_NOTELLSHELL 0x80 /* ;Internal 4.0 */
  5413. #define KL_NAMELENGTH 9 /* ;Internal NT */
  5414. HKL WINAPI LoadKeyboardLayout(LPCSTR, UINT); /* ;Internal NT */
  5415. HKL WINAPI GetKeyboardLayout(DWORD); /* ;Internal 4.0 */
  5416. UINT WINAPI GetKeyboardLayoutList(UINT, HKL FAR *); /* ;Internal 4.0 */
  5417. HKL WINAPI ActivateKeyboardLayout(HKL, UINT); /* ;Internal NT */
  5418. BOOL WINAPI UnloadKeyboardLayout(HKL); /* ;Internal NT */
  5419. BOOL WINAPI GetKeyboardLayoutName(LPSTR); /* ;Internal NT */
  5420. /* SetWindowsHook() keyboard hook */
  5421. #define WH_KEYBOARD 2
  5422. /****** Mouse input support *************************************************/
  5423. #ifdef tagWND // ;Internal
  5424. HWND_16 WINAPI SetCapture(HWND); // ;Internal
  5425. HWND_16 WINAPI GetCapture(void); // ;Internal
  5426. BOOL WINAPI ReleaseCapture(void); // ;Internal
  5427. #else // ;Internal
  5428. HWND WINAPI SetCapture(HWND);
  5429. HWND WINAPI GetCapture(void);
  5430. void WINAPI ReleaseCapture(void);
  5431. #endif // ;Internal
  5432. BOOL WINAPI SwapMouseButton(BOOL);
  5433. /* Mouse message wParam key states */
  5434. #ifndef NOKEYSTATES
  5435. #define MK_LBUTTON 0x0001
  5436. #define MK_RBUTTON 0x0002
  5437. #define MK_SHIFT 0x0004
  5438. #define MK_CONTROL 0x0008
  5439. #define MK_MBUTTON 0x0010
  5440. #endif /* NOKEYSTATES */
  5441. #if (WINVER >= 0x40A)
  5442. #ifndef NOTRACKMOUSEEVENT
  5443. #define TME_HOVER 0x00000001
  5444. #define TME_LEAVE 0x00000002
  5445. #define TME_NONCLIENT 0x00000010
  5446. #define TME_QUERY 0x40000000
  5447. #define TME_CANCEL 0x80000000
  5448. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_NONCLIENT | TME_QUERY | TME_CANCEL) // ;Internal
  5449. #define HOVER_DEFAULT 0xFFFFFFFF
  5450. typedef struct tagTRACKMOUSEEVENT {
  5451. DWORD cbSize;
  5452. DWORD dwFlags;
  5453. #ifdef tagWND /* ;Internal */
  5454. HWND_16 hwndTrack; /* ;Internal */
  5455. #else /* ;Internal */
  5456. HWND hwndTrack;
  5457. #endif /* ;Internal */
  5458. DWORD dwHoverTime;
  5459. } TRACKMOUSEEVENT, FAR *LPTRACKMOUSEEVENT;
  5460. BOOL WINAPI TrackMouseEvent(LPTRACKMOUSEEVENT);
  5461. #endif /* !NOTRACKMOUSEEVENT */
  5462. #endif // (WINVER >=0x40A)
  5463. /* WM_MOUSEACTIVATE return codes */
  5464. #define MA_ACTIVATE 1
  5465. #define MA_ACTIVATEANDEAT 2
  5466. #define MA_NOACTIVATE 3
  5467. #if (WINVER >= 0x030a)
  5468. #define MA_NOACTIVATEANDEAT 4
  5469. #endif /* WINVER >= 0x030a */
  5470. /* SetWindowsHook() mouse hook */
  5471. #ifndef NOWH
  5472. #define WH_MOUSE 7
  5473. typedef struct tagMOUSEHOOKSTRUCT
  5474. {
  5475. POINT pt;
  5476. #ifdef tagWND /* ;Internal */
  5477. HWND_16 hwnd; /* ;Internal */
  5478. #else /* ;Internal */
  5479. HWND hwnd;
  5480. #endif /* ;Internal */
  5481. UINT wHitTestCode;
  5482. DWORD dwExtraInfo;
  5483. } MOUSEHOOKSTRUCT;
  5484. typedef MOUSEHOOKSTRUCT FAR* LPMOUSEHOOKSTRUCT;
  5485. #endif /* NOWH */
  5486. /****** Mode control ********************************************************/
  5487. #ifdef tagWND /* ;Internal */
  5488. HWND_16 WINAPI GetSysModalWindow(void); /* ;Internal */
  5489. HWND_16 WINAPI SetSysModalWindow(HWND); /* ;Internal */
  5490. #else /* ;Internal */
  5491. HWND WINAPI GetSysModalWindow(void);
  5492. HWND WINAPI SetSysModalWindow(HWND);
  5493. #endif /* ;Internal */
  5494. /****** Timer support *******************************************************/
  5495. #ifdef STRICT
  5496. #ifdef tagWND /* ;Internal */
  5497. typedef void (CALLBACK* TIMERPROC)(HWND_16, UINT, UINT, DWORD); /* ;Internal */
  5498. #else /* ;Internal */
  5499. typedef void (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD);
  5500. #endif /* ;Internal */
  5501. #else
  5502. typedef FARPROC TIMERPROC;
  5503. #endif
  5504. UINT WINAPI SetTimer(HWND, UINT, UINT, TIMERPROC);
  5505. BOOL WINAPI KillTimer(HWND, UINT);
  5506. /* ;Internal */
  5507. WORD FAR SetSystemTimer(HWND, int, int, TIMERPROC); /* ;Internal */
  5508. BOOL FAR KillSystemTimer(HWND, int); /* ;Internal */
  5509. HBRUSH CALLBACK GetControlBrush(HWND, HDC, UINT); /* ;Internal */
  5510. void CALLBACK PaintRect(HWND, HWND, HDC, HBRUSH, LPRECT); /* ;Internal */
  5511. VOID WINAPI SwitchToThisWindow(HWND, BOOL); /* ;Internal */
  5512. /****** Accelerator support *************************************************/
  5513. DECLARE_HANDLE(HACCEL);
  5514. HACCEL WINAPI LoadAccelerators(HINSTANCE, LPCSTR);
  5515. #ifndef NOMSG
  5516. int WINAPI TranslateAccelerator(HWND, HACCEL, LPMSG);
  5517. #endif
  5518. /* ;Internal NT */
  5519. #define FVIRTKEY 0x01 /* ;Internal NT */
  5520. #define FNOINVERT 0x02 /* ;Internal NT */
  5521. #define FSHIFT 0x04 /* ;Internal NT */
  5522. #define FCONTROL 0x08 /* ;Internal NT */
  5523. #define FALT 0x10 /* ;Internal NT */
  5524. #define FLASTKEY 0x80 /* ;Internal NT */
  5525. /* ;Internal NT */
  5526. typedef struct tagACCEL /* ;Internal NT */
  5527. { /* ;Internal NT */
  5528. BYTE fVirt; /* ;Internal NT */
  5529. WORD key; /* ;Internal NT */
  5530. WORD cmd; /* ;Internal NT */
  5531. } /* ;Internal NT */
  5532. ACCEL, FAR* LPACCEL; /* ;Internal NT */
  5533. /* ;Internal NT */
  5534. HACCEL WINAPI CreateAcceleratorTable(LPACCEL, int); /* ;Internal NT */
  5535. int WINAPI CopyAcceleratorTable(HACCEL, LPACCEL, int); /* ;Internal NT */
  5536. BOOL WINAPI DestroyAcceleratorTable(HACCEL); /* ;Internal NT */
  5537. /* ;Internal NT */
  5538. // #define IDHOT_SNAPWINDOW (-1) /* ;Internal NT */
  5539. // #define IDHOT_SNAPDESKTOP (-2) /* ;Internal NT */
  5540. /* ;Internal NT */
  5541. #ifdef tagWND /* ;Internal NT */
  5542. BOOL WINAPI RegisterHotKey(HWND_16, DWORD, UINT, UINT); /* ;Internal NT */
  5543. BOOL WINAPI UnregisterHotKey(HWND_16, DWORD); /* ;Internal NT */
  5544. #else /* ;Internal NT */
  5545. BOOL WINAPI RegisterHotKey(HWND, DWORD, UINT, UINT); /* ;Internal NT */
  5546. BOOL WINAPI UnregisterHotKey(HWND, DWORD); /* ;Internal NT */
  5547. #endif /* ;Internal NT */
  5548. #define MOD_ALT 0x0001 /* ;Internal NT */
  5549. #define MOD_CONTROL 0x0002 /* ;Internal NT */
  5550. #define MOD_SHIFT 0x0004 /* ;Internal NT */
  5551. #define MOD_WIN 0x0008 /* ;Internal NT */
  5552. /****** Menu support ********************************************************/
  5553. #ifndef NOMENUS
  5554. /* Menu template header */
  5555. typedef struct tagMENUITEMTEMPLATEHEADER
  5556. {
  5557. UINT versionNumber;
  5558. UINT offset;
  5559. } MENUITEMTEMPLATEHEADER;
  5560. /* Menu template item struct */
  5561. typedef struct tagMENUITEMTEMPLATE
  5562. {
  5563. UINT mtOption;
  5564. UINT mtID;
  5565. char mtString[1];
  5566. } MENUITEMTEMPLATE;
  5567. #if (WINVER >= 0x0400) // ;Internal 4.0
  5568. typedef struct tagMENUEXTEMPLATE // ;Internal 4.0
  5569. { // ;Internal 4.0
  5570. WORD wMenuVer; // ;Internal 4.0
  5571. WORD dwHdrSize; // ;Internal 4.0
  5572. } MENUEXTEMPLATE, FAR *LPMENUEXTEMPLATE; // ;Internal 4.0
  5573. // ;Internal 4.0
  5574. typedef struct tagMENUEXHEADER // ;Internal 4.0
  5575. { // ;Internal 4.0
  5576. DWORD dwHelpID; // ;Internal 4.0
  5577. } MENUEXHEADER, FAR *LPMENUEXHEADER; // ;Internal 4.0
  5578. // ;Internal 4.0
  5579. typedef struct tagMENUEXITEMTEMPLATE // ;Internal 4.0
  5580. { // ;Internal 4.0
  5581. DWORD fType; // ;Internal 4.0
  5582. DWORD fState; // ;Internal 4.0
  5583. WORD wID; // ;Internal 4.0
  5584. BYTE bResInfo; // ;Internal 4.0
  5585. } MENUEXITEMTEMPLATE, FAR *LPMENUEXITEMTEMPLATE; // ;Internal 4.0
  5586. /* Menu String */ // ;Internal 4.0
  5587. /* if popup, MENUEXHEADER */ // ;Internal 4.0
  5588. #endif // ;Internal 4.0
  5589. // ;Internal 4.0
  5590. #if (WINVER >= 0x030a) // ;Internal
  5591. #ifdef tagWND // ;Internal
  5592. BOOL WINAPI IsMenu(HMENU_16); // ;Internal
  5593. #else // ;Internal
  5594. BOOL WINAPI IsMenu(HMENU);
  5595. #endif // tagWND // ;Internal
  5596. #endif /* WINVER >= 0x030a */ // ;Internal
  5597. HMENU WINAPI CreateMenu(void);
  5598. HMENU WINAPI CreatePopupMenu(void);
  5599. HMENU WINAPI LoadMenu(HINSTANCE, LPCSTR);
  5600. HMENU WINAPI LoadMenuIndirect(const void FAR*);
  5601. #ifdef tagWND // ;Internal
  5602. DWORD WINAPI GetMenu(HWND); // ;Internal
  5603. HMENU_16 WINAPI GetSystemMenu(HWND, BOOL); // ;Internal
  5604. HMENU_16 WINAPI GetSubMenu(HMENU, UINT); // ;Internal
  5605. BOOL WINAPI InsertMenu(HMENU_16, UINT, UINT, UINT, LPCSTR); // ;Internal
  5606. BOOL WINAPI AppendMenu(HMENU_16, UINT, UINT, LPCSTR); // ;Internal
  5607. BOOL WINAPI ModifyMenu(HMENU_16, UINT, UINT, UINT, LPCSTR); // ;Internal
  5608. BOOL WINAPI ChangeMenu(HMENU_16, UINT, LPCSTR, UINT, UINT); // ;Internal
  5609. BOOL WINAPI SetMenuItemBitmaps(HMENU_16, UINT, UINT, HBITMAP, HBITMAP); // ;Internal
  5610. int WINAPI GetMenuString(HMENU_16, UINT, LPSTR, int, UINT); // ;Internal
  5611. #else // ;Internal
  5612. HMENU WINAPI GetMenu(HWND);
  5613. HMENU WINAPI GetSystemMenu(HWND, BOOL);
  5614. HMENU WINAPI GetSubMenu(HMENU, UINT);
  5615. BOOL WINAPI InsertMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  5616. BOOL WINAPI AppendMenu(HMENU, UINT, UINT, LPCSTR);
  5617. BOOL WINAPI ModifyMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  5618. BOOL WINAPI ChangeMenu(HMENU, UINT, LPCSTR, UINT, UINT);
  5619. BOOL WINAPI SetMenuItemBitmaps(HMENU, UINT, UINT, HBITMAP, HBITMAP);
  5620. int WINAPI GetMenuString(HMENU, UINT, LPSTR, int, UINT);
  5621. #endif // tagWND // ;Internal
  5622. BOOL WINAPI DestroyMenu(HMENU);
  5623. BOOL WINAPI SetMenu(HWND, HMENU);
  5624. BOOL WINAPI SetSystemMenu(HWND, HMENU); /* ;Internal */
  5625. #ifdef tagWND // ;Internal
  5626. BOOL WINAPI DrawMenuBar(HWND); // ;Internal
  5627. #else // ;Internal
  5628. void WINAPI DrawMenuBar(HWND);
  5629. #endif // ;Internal
  5630. int WINAPI DrawMenuBarTemp(HWND, HDC, LPRECT, HMENU, HFONT); // ;Internal
  5631. BOOL WINAPI HiliteMenuItem(HWND, HMENU, UINT, UINT);
  5632. BOOL WINAPI RemoveMenu(HMENU, UINT, UINT);
  5633. BOOL WINAPI DeleteMenu(HMENU, UINT, UINT);
  5634. #define MF_INSERT 0x0000 /* Obsolete -- only used by ChangeMenu */
  5635. #define MF_CHANGE 0x0080 /* Obsolete -- only used by ChangeMenu */
  5636. #define MF_APPEND 0x0100 /* Obsolete -- only used by ChangeMenu */
  5637. #define MF_DELETE 0x0200 /* Obsolete -- only used by ChangeMenu */
  5638. #define MF_REMOVE 0x1000 /* Obsolete -- only used by ChangeMenu */
  5639. #define MF_BYCOMMAND 0x0000 /* Obsolete -- only old APIs use these */
  5640. #define MF_BYPOSITION 0x0400 /* Obsolete -- only old APIs use these */
  5641. #define MF_USECHECKBITMAPS 0x0200 /* Obsolete -- replaced by MF_RADIOCHECK */
  5642. #define MF_HELP 0x4000 /* Obsolete -- use MF_RIGHTJUSTIFY */
  5643. #define MF_POPUP 0x0010 /* Obsolete -- replace by hSubMenu field */
  5644. #define MF_END 0x0080 /* Obsolete -- only used by old RES files */
  5645. #define MF_SYSMENU 0x2000 /* Passed back during WM_MENUSELECT */
  5646. #define MF_MOUSESELECT 0x8000 /* Passed back during WM_MENUSELECT */
  5647. #if (WINVER >= 0x40A)
  5648. #define MFT_STRING 0x0001 /* Obsolete -- use MIIM_STRING instead */
  5649. #else
  5650. #define MFT_STRING 0x0000
  5651. #endif
  5652. #define MFT_BITMAP 0x0004 /* Obsolete -- use MIIM_BITMAP instead */
  5653. #define MFT_MENUBARBREAK 0x0020
  5654. #define MFT_MENUBREAK 0x0040
  5655. #define MFT_OWNERDRAW 0x0100
  5656. #define MFT_RADIOCHECK 0x0200
  5657. #define MFT_SEPARATOR 0x0800
  5658. #define MFT_RIGHTORDER 0x2000
  5659. #define MFT_RIGHTJUSTIFY 0x4000
  5660. #define MFT_MASK 0x6B65 // ;Internal
  5661. #define MFS_GRAYED 0x0003
  5662. #define MFS_DISABLED MFS_GRAYED
  5663. #define MFS_CHECKED 0x0008
  5664. #define MFS_HILITE 0x0080
  5665. #define MFS_ENABLED 0x0000
  5666. #define MFS_UNCHECKED 0x0000
  5667. #define MFS_UNHILITE 0x0000
  5668. #if (WINVER >= 0x40A) // ;Internal 4.1
  5669. #define MFS_HOTTRACK 0x0100 // ;Internal 4.1
  5670. #endif // (WINVER >= 0x40A) // ;Internal 4.1
  5671. #define MFS_DEFAULT 0x1000
  5672. #define MFS_MASK 0x118B // ;Internal
  5673. #define MFR_POPUP 0x01
  5674. #define MFR_END 0x80
  5675. /* old names for menu types & states */
  5676. #define MF_SEPARATOR MFT_SEPARATOR
  5677. #define MF_GRAYED 0x0001
  5678. #define MF_DISABLED 0x0002
  5679. #define MF_CHECKED MFS_CHECKED
  5680. #define MF_ENABLED MFS_ENABLED
  5681. #define MF_UNCHECKED MFS_UNCHECKED
  5682. #define MF_UNHILITE MFS_UNHILITE
  5683. #define MF_STRING 0x0000 /* Obsolete -- use MIIM_STRING instead */
  5684. #define MF_BITMAP MFT_BITMAP /* Obsolete -- use MIIM_BITMAP instead */
  5685. #define MF_OWNERDRAW MFT_OWNERDRAW
  5686. #define MF_MENUBARBREAK MFT_MENUBARBREAK
  5687. #define MF_MENUBREAK MFT_MENUBREAK
  5688. #define MF_HILITE MFS_HILITE
  5689. #define MF_DEFAULT MFS_DEFAULT
  5690. #define MF_RIGHTJUSTIFY MFT_RIGHTJUSTIFY
  5691. #define MFT_OLDAPI_MASK 0x4B64 // ;Internal
  5692. #define MFS_OLDAPI_MASK 0x008B // ;Internal
  5693. #define MFT_NONSTRING 0x0904 // MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR ;Internal
  5694. #define MFT_BREAK 0x0060 // MF_MENUBREAK | MF_MENUBARBREAK ;Internal
  5695. #ifdef tagWND // ;Internal
  5696. DWORD WINAPI EnableMenuItem(HMENU, UINT, UINT); // ;Internal
  5697. DWORD WINAPI CheckMenuItem(HMENU, UINT, UINT); // ;Internal
  5698. #else // ;Internal
  5699. UINT WINAPI EnableMenuItem(HMENU, UINT, UINT);
  5700. UINT WINAPI CheckMenuItem(HMENU, UINT, UINT);
  5701. #endif // ;Internal
  5702. BOOL WINAPI CheckMenuRadioItem(HMENU, UINT, UINT, UINT, UINT); // ;Internal 4.0
  5703. int WINAPI GetMenuItemCount(HMENU);
  5704. #ifdef tagWND // ;Internal
  5705. DWORD WINAPI GetMenuItemID(HMENU, UINT); // ;Internal
  5706. DWORD WINAPI GetMenuState(HMENU, UINT, UINT); // ;Internal
  5707. #else // ;Internal
  5708. UINT WINAPI GetMenuItemID(HMENU, UINT);
  5709. UINT WINAPI GetMenuState(HMENU, UINT, UINT);
  5710. #endif // ;Internal
  5711. DWORD WINAPI GetMenuCheckMarkDimensions(void);
  5712. BOOL WINAPI TrackPopupMenu(HMENU, UINT, int, int, int, HWND, LPCRECT);
  5713. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  5714. /* return codes for WM_MENUCHAR */ /* ;Internal 4.0 */
  5715. #define MNC_IGNORE 0 /* ;Internal 4.0 */
  5716. #define MNC_CLOSE 1 /* ;Internal 4.0 */
  5717. #define MNC_EXECUTE 2 /* ;Internal 4.0 */
  5718. #define MNC_SELECT 3 /* ;Internal 4.0 */
  5719. /* ;Internal 4.0 */
  5720. typedef struct tagTPMPARAMS /* ;Internal 4.0 */
  5721. { /* ;Internal 4.0 */
  5722. DWORD cbSize; /* ;Internal 4.0 */
  5723. RECT rcExclude; /* ;Internal 4.0 */
  5724. } /* ;Internal 4.0 */
  5725. TPMPARAMS, FAR *LPTPMPARAMS; /* ;Internal 4.0 */
  5726. /* ;Internal 4.0 */
  5727. BOOL WINAPI TrackPopupMenuEx(HMENU, UINT, int, int, HWND, LPTPMPARAMS); /* ;Internal 4.0 */
  5728. /* ;Internal 4.0 */
  5729. #if (WINVER >= 0x40A) /* ;Internal 4.1 */
  5730. #define MNS_NOCHECK 0x00000001 /* ;Internal 4.1 */
  5731. #define MNS_VALID 0x00000001 // ;Internal
  5732. /* ;Internal 4.1 */
  5733. #define MIM_MAXHEIGHT 0x00000001 /* ;Internal 4.1 */
  5734. #define MIM_BACKGROUND 0x00000002 /* ;Internal 4.1 */
  5735. #define MIM_HELPID 0x00000004 /* ;Internal 4.1 */
  5736. #define MIM_MENUDATA 0x00000008 /* ;Internal 4.1 */
  5737. #define MIM_STYLE 0x00000010 /* ;Internal 4.1 */
  5738. #define MIM_MASK 0x0000001F // ;Internal
  5739. /* ;Internal 4.1 */
  5740. typedef struct tagMENUINFO /* ;Internal 4.1 */
  5741. { /* ;Internal 4.1 */
  5742. DWORD cbSize; /* ;Internal 4.1 */
  5743. DWORD fMask; /* ;Internal 4.1 */
  5744. DWORD dwStyle; /* ;Internal 4.1 */
  5745. DWORD cyMax; /* ;Internal 4.1 */
  5746. DWORD hbrBack; /* ;Internal 4.1 */
  5747. DWORD dwContextHelpID; /* ;Internal 4.1 */
  5748. DWORD dwMenuData; /* ;Internal 4.1 */
  5749. } /* ;Internal 4.1 */
  5750. MENUINFO, FAR *LPMENUINFO; /* ;Internal 4.1 */
  5751. typedef const MENUINFO FAR *LPCMENUINFO; /* ;Internal 4.1 */
  5752. #endif // (WINVER >= 0x40A) /* ;Internal 4.1 */
  5753. /* ;Internal 4.0 */
  5754. #define MIIM_STATE 0x00000001 /* ;Internal 4.0 */
  5755. #define MIIM_ID 0x00000002 /* ;Internal 4.0 */
  5756. #define MIIM_SUBMENU 0x00000004 /* ;Internal 4.0 */
  5757. #define MIIM_CHECKMARKS 0x00000008 /* ;Internal 4.0 */
  5758. #define MIIM_TYPE 0x00000010 /* ;Internal 4.0 */
  5759. #define MIIM_DATA 0x00000020 /* ;Internal 4.0 */
  5760. #if (WINVER >= 0x40A) /* ;Internal 4.1 */
  5761. #define MIIM_STRING 0x00000040 /* ;Internal 4.1 */
  5762. #define MIIM_BITMAP 0x00000080 /* ;Internal 4.1 */
  5763. #define MIIM_FTYPE 0x00000100 /* ;Internal 4.1 */
  5764. #endif // (WINVER >= 0x40A) /* ;Internal 4.1 */
  5765. #define MIIM_MASK 0x000001FF // ;Internal
  5766. /* ;Internal 4.0 */
  5767. typedef struct tagMENUITEMINFO /* ;Internal 4.0 */
  5768. { /* ;Internal 4.0 */
  5769. DWORD cbSize; /* ;Internal 4.0 */
  5770. DWORD fMask; /* ;Internal 4.0 */
  5771. UINT fType; /* ;Internal 4.0 */
  5772. UINT fState; /* ;Internal 4.0 */
  5773. UINT wID; /* ;Internal 4.0 */
  5774. #ifdef tagWND /* ;Internal 4.0 */
  5775. HMENU_16 hSubMenu; /* ;Internal 4.0 */
  5776. #else /* ;Internal 4.0 */
  5777. HMENU hSubMenu; /* ;Internal 4.0 */
  5778. #endif /* ;Internal 4.0 */
  5779. HBITMAP hbmpChecked; /* ;Internal 4.0 */
  5780. HBITMAP hbmpUnchecked; /* ;Internal 4.0 */
  5781. DWORD dwItemData; /* ;Internal 4.0 */
  5782. LPSTR dwTypeData; /* ;Internal 4.0 */
  5783. UINT cch; /* ;Internal 4.0 */
  5784. #if (WINVER >= 0x40A) /* ;Internal 4.1 */
  5785. HBITMAP hbmpItem; /* ;Internal 4.1 */
  5786. #endif // (WINVER >= 0x40A) /* ;Internal 4.1 */
  5787. } /* ;Internal 4.0 */
  5788. MENUITEMINFO, FAR* LPMENUITEMINFO; /* ;Internal 4.0 */
  5789. typedef const MENUITEMINFO FAR * LPCMENUITEMINFO; /* ;Internal 4.0 */
  5790. /* ;Internal 4.0 */
  5791. BOOL WINAPI InsertMenuItem (HMENU, UINT, BOOL, LPCMENUITEMINFO); /* ;Internal 4.0 */
  5792. BOOL WINAPI GetMenuItemInfo(HMENU, UINT, BOOL, LPMENUITEMINFO); /* ;Internal 4.0 */
  5793. BOOL WINAPI SetMenuItemInfo(HMENU, UINT, BOOL, LPCMENUITEMINFO); /* ;Internal 4.0 */
  5794. #if (WINVER >= 0x40A) /* ;Internal 4.1 */
  5795. BOOL WINAPI GetMenuInfo(HMENU, LPMENUINFO); /* ;Internal 4.1 */
  5796. BOOL WINAPI SetMenuInfo(HMENU, LPCMENUINFO); /* ;Internal 4.1 */
  5797. #endif // (WINVER >= 0x40A) /* ;Internal 4.1 */
  5798. /* ;Internal 4.0 */
  5799. #define GMDI_USEDISABLED 0x0001 /* ;Internal 4.0 */
  5800. #define GMDI_GOINTOPOPUPS 0x0002 /* ;Internal 4.0 */
  5801. DWORD WINAPI GetMenuDefaultItem(HMENU, BOOL, UINT); /* ;Internal 4.0 */
  5802. BOOL WINAPI SetMenuDefaultItem(HMENU, UINT, BOOL); /* ;Internal 4.0 */
  5803. /* ;Internal 4.0 */
  5804. BOOL WINAPI GetMenuItemRect(HWND, HMENU, UINT, LPRECT); /* ;Internal 4.0 */
  5805. int WINAPI MenuItemFromPoint(HWND, HMENU, POINT); /* ;Internal 4.0 */
  5806. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  5807. /* ;Internal 4.0 */
  5808. /* Flags for TrackPopupMenu */
  5809. #define TPM_LEFTBUTTON 0x0000
  5810. #if (WINVER >= 0x030a)
  5811. #define TPM_RIGHTBUTTON 0x0002
  5812. #define TPM_LEFTALIGN 0x0000
  5813. #define TPM_CENTERALIGN 0x0004
  5814. #define TPM_RIGHTALIGN 0x0008
  5815. // ;Internal
  5816. #if (WINVER >= 0x0400) // ;Internal
  5817. #define TPM_TOPALIGN 0x0000 // ;Internal 4.0
  5818. #define TPM_VCENTERALIGN 0x0010 // ;Internal 4.0
  5819. #define TPM_BOTTOMALIGN 0x0020 // ;Internal 4.0
  5820. // ;Internal 4.0
  5821. #define TPM_HORIZONTAL 0x0000 // ;Internal 4.0
  5822. #define TPM_VERTICAL 0x0040 // ;Internal 4.0
  5823. #define TPM_NONOTIFY 0x0080 // ;Internal 4.0
  5824. #define TPM_RETURNCMD 0x0100 // ;Internal 4.0
  5825. #define TPM_SYSMENU 0x0200 // ;Internal
  5826. #if (WINVER >= 0x040A) // ;Internal 4.1
  5827. #define TPM_RECURSE 0x0001 // ;Internal 4.1
  5828. #endif /* WINVER >= 0x040A */ // ;Internal 4.1
  5829. #endif /* WINVER >= 0x0400 */ // ;Internal
  5830. #endif /* WINVER >= 0x030a */
  5831. #endif /* NOMENUS */
  5832. /****** Scroll bar support **************************************************/
  5833. #ifndef NOSCROLL
  5834. /* WM_H/VSCROLL commands */
  5835. #define SB_LINEUP 0
  5836. #define SB_LINELEFT 0
  5837. #define SB_LINEDOWN 1
  5838. #define SB_LINERIGHT 1
  5839. #define SB_PAGEUP 2
  5840. #define SB_PAGELEFT 2
  5841. #define SB_PAGEDOWN 3
  5842. #define SB_PAGERIGHT 3
  5843. #define SB_THUMBPOSITION 4
  5844. #define SB_THUMBTRACK 5
  5845. #define SB_TOP 6
  5846. #define SB_LEFT 6
  5847. #define SB_BOTTOM 7
  5848. #define SB_RIGHT 7
  5849. #define SB_ENDSCROLL 8
  5850. #define SB_MSGCMD_MAX 8 /* ;Internal */
  5851. /* Scroll bar selection constants */
  5852. #define SB_HORZ 0
  5853. #define SB_VERT 1
  5854. #define SB_CTL 2
  5855. #define SB_BOTH 3
  5856. #define SB_MAX 3 // ;Internal
  5857. int WINAPI SetScrollPos(HWND, int, int, BOOL);
  5858. #ifdef tagWND // ;Internal
  5859. LONG WINAPI GetScrollPos(HWND, int); // ;Internal
  5860. BOOL WINAPI GetScrollRange(HWND, int, LPINT, LPINT); // ;Internal
  5861. BOOL WINAPI SetScrollRange(HWND, int, int, int, BOOL); // ;Internal
  5862. BOOL WINAPI ShowScrollBar(HWND, int, BOOL); // ;Internal
  5863. #else // ;Internal
  5864. int WINAPI GetScrollPos(HWND, int);
  5865. void WINAPI GetScrollRange(HWND, int, LPINT, LPINT);
  5866. void WINAPI SetScrollRange(HWND, int, int, int, BOOL);
  5867. void WINAPI ShowScrollBar(HWND, int, BOOL);
  5868. #endif // ;Internal
  5869. BOOL WINAPI EnableScrollBar(HWND, int, UINT);
  5870. /* EnableScrollBar() flags */
  5871. #define ESB_ENABLE_BOTH 0x0000
  5872. #define ESB_DISABLE_BOTH 0x0003
  5873. #define ESB_DISABLE_LEFT 0x0001
  5874. #define ESB_DISABLE_RIGHT 0x0002
  5875. #define ESB_DISABLE_UP 0x0001
  5876. #define ESB_DISABLE_DOWN 0x0002
  5877. #define ESB_DISABLE_LTUP ESB_DISABLE_LEFT
  5878. #define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT
  5879. #define ESB_MAX 0x0003 // ;Internal
  5880. #define SB_DISABLE_MASK ESB_DISABLE_BOTH // ;Internal
  5881. // ;Internal
  5882. #define SBM_FIRST_16 WM_USER // ;Internal
  5883. #define SBM_SETPOS (WM_USER) // ;Internal
  5884. #define SBM_GETPOS (WM_USER+1) // ;Internal
  5885. #define SBM_SETRANGE (WM_USER+2) // ;Internal
  5886. #define SBM_GETRANGE (WM_USER+3) // ;Internal
  5887. #define SBM_ENABLE_ARROWS (WM_USER+4) // ;Internal
  5888. // ;Internal
  5889. #if (WINVER >= 0x0400) // ;Internal 4.0
  5890. #define SBM_SETRANGEREDRAW (WM_USER+6) // ;Internal 4.0
  5891. #define SBM_SETSCROLLINFO (WM_USER+9) // ;Internal 4.0
  5892. #define SBM_GETSCROLLINFO (WM_USER+10) // ;Internal 4.0
  5893. #define SBM_MSGMAX (WM_USER+11) // ;Internal 4.0
  5894. // ;Internal 4.0
  5895. #define SIF_RANGE 0x0001 // ;Internal 4.0
  5896. #define SIF_PAGE 0x0002 // ;Internal 4.0
  5897. #define SIF_POS 0x0004 // ;Internal 4.0
  5898. #define SIF_DISABLENOSCROLL 0x0008 // ;Internal 4.0
  5899. #define SIF_TRACKPOS 0x0010 // ;Internal 4.0
  5900. #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)// ;Internal
  5901. #define SIF_RETURNOLDPOS 0x1000 // ;Internal
  5902. #define SIF_NOSCROLL 0x2000 // ;Internal
  5903. #define SIF_MASK 0x701F // ;Internal
  5904. // ;Internal 4.0
  5905. typedef struct tagSCROLLINFO // ;Internal 4.0
  5906. { // ;Internal 4.0
  5907. DWORD cbSize; // ;Internal 4.0
  5908. DWORD fMask; // ;Internal 4.0
  5909. LONG nMin; // ;Internal 4.0
  5910. LONG nMax; // ;Internal 4.0
  5911. DWORD nPage; // ;Internal 4.0
  5912. LONG nPos; // ;Internal 4.0
  5913. LONG nTrackPos; // ;Internal 4.0
  5914. } // ;Internal 4.0
  5915. SCROLLINFO, FAR *LPSCROLLINFO; // ;Internal 4.0
  5916. typedef const SCROLLINFO FAR *LPCSCROLLINFO; // ;Internal 4.0
  5917. // ;Internal 4.0
  5918. LONG WINAPI SetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL); // ;Internal 4.0
  5919. BOOL WINAPI GetScrollInfo(HWND, int, LPSCROLLINFO); // ;Internal 4.0
  5920. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  5921. #endif /* NOSCROLL */
  5922. /******* Clipboard manager **************************************************/
  5923. #ifndef NOCLIPBOARD
  5924. /* Predefined Clipboard Formats */
  5925. #define CF_FIRST 1
  5926. #define CF_TEXT 1
  5927. #define CF_BITMAP 2
  5928. #define CF_METAFILEPICT 3
  5929. #define CF_SYLK 4
  5930. #define CF_DIF 5
  5931. #define CF_TIFF 6
  5932. #define CF_OEMTEXT 7
  5933. #define CF_DIB 8
  5934. #define CF_PALETTE 9
  5935. #define CF_PENDATA 10
  5936. #define CF_RIFF 11
  5937. #define CF_WAVE 12
  5938. #define CF_UNICODETEXT 13 // ;Internal NT
  5939. #define CF_ENHMETAFILE 14 // ;Internal NT
  5940. #define CF_HDROP 15 // ;Internal 4.0
  5941. #define CF_LOCALE 16 // ;Internal 4.0
  5942. #define CF_MAX 17 // ;Internal 4.0
  5943. #define CF_OWNERDISPLAY 0x0080
  5944. #define CF_DSPTEXT 0x0081
  5945. #define CF_DSPBITMAP 0x0082
  5946. #define CF_DSPMETAFILEPICT 0x0083
  5947. #define CF_DSPENHMETAFILE 0x008E /* ;Internal NT */
  5948. /* "Private" formats don't get GlobalFree()'d */
  5949. #define CF_PRIVATEFIRST 0x0200
  5950. #define CF_PRIVATELAST 0x02FF
  5951. /* "GDIOBJ" formats do get DeleteObject()'d */
  5952. #define CF_GDIOBJFIRST 0x0300
  5953. #define CF_GDIOBJLAST 0x03FF
  5954. /* Clipboard Manager Functions */
  5955. BOOL WINAPI OpenClipboard(HWND);
  5956. BOOL WINAPI CloseClipboard(void);
  5957. BOOL WINAPI EmptyClipboard(void);
  5958. #if (WINVER >= 0x030a)
  5959. #ifdef tagWND /* ;Internal */
  5960. HWND_16 WINAPI GetOpenClipboardWindow(void); /* ;Internal */
  5961. #else /* ;Internal */
  5962. HWND WINAPI GetOpenClipboardWindow(void);
  5963. #endif /* ;Internal */
  5964. #endif /* WINVER >= 0x030a */
  5965. #ifdef tagWND /* ;Internal */
  5966. HWND_16 WINAPI GetClipboardOwner(void); /* ;Internal */
  5967. HWND_16 WINAPI SetClipboardViewer(HWND); /* ;Internal */
  5968. HWND_16 WINAPI GetClipboardViewer(void); /* ;Internal */
  5969. #else /* ;Internal */
  5970. HWND WINAPI GetClipboardOwner(void);
  5971. HWND WINAPI SetClipboardViewer(HWND);
  5972. HWND WINAPI GetClipboardViewer(void);
  5973. #endif /* ;Internal */
  5974. HANDLE WINAPI SetClipboardData(UINT, HANDLE);
  5975. HANDLE WINAPI GetClipboardData(UINT);
  5976. BOOL WINAPI IsClipboardFormatAvailable(UINT);
  5977. #ifdef tagWND // ;Internal
  5978. DWORD WINAPI GetPriorityClipboardFormat(UINT FAR*, int); // ;Internal
  5979. #else // ;Internal
  5980. int WINAPI GetPriorityClipboardFormat(UINT FAR*, int);
  5981. #endif // ;Internal
  5982. UINT WINAPI RegisterClipboardFormat(LPCSTR);
  5983. int WINAPI CountClipboardFormats(void);
  5984. UINT WINAPI EnumClipboardFormats(UINT);
  5985. int WINAPI GetClipboardFormatName(UINT, LPSTR, int);
  5986. BOOL WINAPI ChangeClipboardChain(HWND, HWND);
  5987. #endif /* NOCLIPBOARD */
  5988. /* ;Internal NT */
  5989. // /* LPARAM of WM_COPYDATA */ /* ;Internal NT */
  5990. // typedef struct tagCOPYDATASTRUCT /* ;Internal NT */
  5991. // { /* ;Internal NT */
  5992. // DWORD dwData; /* ;Internal NT */
  5993. // DWORD cbData; /* ;Internal NT */
  5994. // LPSTR lpData; /* ;Internal NT */
  5995. // } COPYDATASTRUCT, FAR *LPCOPYDATASTRUCT; /* ;Internal NT */
  5996. /****** Mouse cursor support *************************************************/
  5997. HCURSOR WINAPI LoadCursor(HINSTANCE, LPCSTR);
  5998. HCURSOR WINAPI CreateCursor(HINSTANCE, int, int, int, int, const void FAR*, const void FAR*);
  5999. BOOL WINAPI DestroyCursor(HCURSOR);
  6000. #if (WINVER >= 0x030a)
  6001. HCURSOR WINAPI CopyCursor(HINSTANCE, HCURSOR);
  6002. #endif /* WINVER >= 0x030a */
  6003. int WINAPI ShowCursor(BOOL);
  6004. #ifdef tagWND // ;Internal
  6005. BOOL WINAPI ClipCursor(LPCRECT); // ;Internal
  6006. BOOL WINAPI SetCursorPos(int, int); // ;Internal
  6007. BOOL WINAPI GetCursorPos(LPPOINT); // ;Internal
  6008. #else // ;Internal
  6009. void WINAPI ClipCursor(LPCRECT);
  6010. void WINAPI SetCursorPos(int, int);
  6011. void WINAPI GetCursorPos(LPPOINT);
  6012. #endif // ;Internal
  6013. HCURSOR WINAPI SetCursor(HCURSOR);
  6014. #if (WINVER >= 0x030a)
  6015. HCURSOR WINAPI GetCursor(void);
  6016. #ifdef tagWND // ;Internal
  6017. BOOL WINAPI GetClipCursor(LPRECT); // ;Internal
  6018. #else // ;Internal
  6019. void WINAPI GetClipCursor(LPRECT);
  6020. #endif // ;Internal
  6021. #endif /* WINVER >= 0x030a */
  6022. /* Standard cursor resource IDs */
  6023. #define IDC_ARROW MAKEINTRESOURCE(32512)
  6024. #define IDC_IBEAM MAKEINTRESOURCE(32513)
  6025. #define IDC_WAIT MAKEINTRESOURCE(32514)
  6026. #define IDC_CROSS MAKEINTRESOURCE(32515)
  6027. #define IDC_UPARROW MAKEINTRESOURCE(32516)
  6028. #define IDC_NWPEN MAKEINTRESOURCE(32631) // ;Internal
  6029. #define IDC_HUNG MAKEINTRESOURCE(32632) // ;Internal
  6030. #define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
  6031. #define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
  6032. #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
  6033. #define IDC_SIZENESW MAKEINTRESOURCE(32643)
  6034. #define IDC_SIZEWE MAKEINTRESOURCE(32644)
  6035. #define IDC_SIZENS MAKEINTRESOURCE(32645)
  6036. #define IDC_SIZEALL MAKEINTRESOURCE(32646)
  6037. #define IDC_NO MAKEINTRESOURCE(32648)
  6038. #define IDC_APPSTARTING MAKEINTRESOURCE(32650) // ;Internal NT 4.0
  6039. #if (WINVER >= 0x0400) // ;Internal 4.0
  6040. #define IDC_HELP MAKEINTRESOURCE(32651) // ;Internal 4.0
  6041. #endif /* WINVER >= 0x400 */ // ;Internal 4.0
  6042. /****** Icon support *********************************************************/
  6043. HICON WINAPI LoadIcon(HINSTANCE, LPCSTR);
  6044. HICON WINAPI CreateIcon(HINSTANCE, int, int, BYTE, BYTE, const void FAR*, const void FAR*);
  6045. BOOL WINAPI DestroyIcon(HICON);
  6046. #if (WINVER >= 0x030a)
  6047. HICON WINAPI CopyIcon(HINSTANCE, HICON);
  6048. /* ;Internal NT */
  6049. /* Icon/cursor information */ /* ;Internal NT */
  6050. typedef struct tagICONINFO /* ;Internal NT */
  6051. { /* ;Internal NT */
  6052. BOOL fIcon; /* ;Internal NT */
  6053. int xHotspot; /* ;Internal NT */
  6054. int yHotspot; /* ;Internal NT */
  6055. HBITMAP hbmMask; /* ;Internal NT */
  6056. HBITMAP hbmColor; /* ;Internal NT */
  6057. } ICONINFO, *PICONINFO, FAR *LPICONINFO; /* ;Internal NT */
  6058. /* ;Internal NT */
  6059. HICON WINAPI CreateIconIndirect(const ICONINFO FAR *); /* ;Internal NT */
  6060. BOOL WINAPI GetIconInfo(HICON, LPICONINFO); /* ;Internal NT */
  6061. /* ;Internal 4.0 */
  6062. #define RES_ICON 1 /* ;Internal 4.0 */
  6063. #define RES_CURSOR 2 /* ;Internal 4.0 */
  6064. typedef struct tagNEWHEADER
  6065. {
  6066. WORD Reserved;
  6067. WORD ResType; /* RES_ICON or RES_CURSOR */
  6068. WORD ResCount;
  6069. } NEWHEADER, FAR *LPNEWHEADER;
  6070. // ;Internal
  6071. #ifdef STRICT // ;Internal
  6072. int WINAPI LookupIconIdFromDirectoryEx(LPNEWHEADER, BOOL, int, int, UINT); // ;Internal 4.0
  6073. #else // ;Internal
  6074. int WINAPI LookupIconIdFromDirectoryEx(LPVOID, BOOL, int, int, UINT); // ;Internal 4.0
  6075. #endif /* STRICT */ // ;Internal
  6076. // ;Internal 4.0
  6077. HICON WINAPI CreateIconFromResourceEx(LPVOID, DWORD, BOOL, DWORD, // ;Internal 4.0
  6078. UINT, UINT, UINT); // ;Internal 4.0
  6079. #if (WINVER >= 0x0400)
  6080. /* Icon/Cursor header */
  6081. typedef struct tagCURSORSHAPE
  6082. {
  6083. int xHotSpot;
  6084. int yHotSpot;
  6085. int cx;
  6086. int cy;
  6087. int cbWidth;
  6088. BYTE Planes;
  6089. BYTE BitsPixel;
  6090. } CURSORSHAPE, FAR *LPCURSORSHAPE;
  6091. #define IMAGE_BITMAP 0 // ;Internal 4.0
  6092. #define IMAGE_ICON 1 // ;Internal 4.0
  6093. #define IMAGE_CURSOR 2 // ;Internal 4.0
  6094. #define IMAGE_ENHMETAFILE 3 // ;Internal 4.0
  6095. #define IMAGE_MAX 4 // ;Internal 4.0
  6096. // ;Internal 4.0
  6097. HANDLE WINAPI LoadImage(HINSTANCE, LPCSTR, UINT, int, int, UINT); // ;Internal 4.0
  6098. HANDLE WINAPI CopyImage(HINSTANCE, HANDLE, UINT, int, int, UINT); // ;Internal 4.0
  6099. // ;Internal 4.0
  6100. #define LR_DEFAULTCOLOR 0x0000 // ;Internal 4.0
  6101. #define LR_MONOCHROME 0x0001 // ;Internal 4.0
  6102. #define LR_COLOR 0x0002 // ;Internal 4.0
  6103. #define LR_COPYRETURNORG 0x0004 // ;Internal 4.0
  6104. #define LR_COPYDELETEORG 0x0008 // ;Internal 4.0
  6105. #define LR_LOADFROMFILE 0x0010 // ;Internal 4.0
  6106. #define LR_LOADTRANSPARENT 0x0020 // ;Internal 4.0
  6107. #define LR_DEFAULTSIZE 0x0040 // ;Internal 4.0
  6108. #define LR_VGACOLOR 0x0080 // ;Internal 4.0
  6109. #define LR_LOADMAP3DCOLORS 0x1000 // ;Internal 4.0
  6110. #define LR_CREATEDIBSECTION 0x2000 // ;Internal 4.0
  6111. #define LR_COPYFROMRESOURCE 0x4000 // ;Internal 4.0
  6112. #define LR_SHARED 0x8000 // ;Internal 4.0
  6113. // ;Internal 4.0
  6114. #define DI_MASK 0x0001 // ;Internal 4.0
  6115. #define DI_IMAGE 0x0002 // ;Internal 4.0
  6116. #define DI_NORMAL 0x0003 // ;Internal 4.0
  6117. #define DI_COMPAT 0x0004 // ;Internal 4.0
  6118. #define DI_DEFAULTSIZE 0x0008 // ;Internal 4.0
  6119. // ;Internal 4.0
  6120. BOOL WINAPI DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int cx, // ;Internal 4.0
  6121. int cy, UINT istepIfAniCur, HBRUSH hbrFastDraw, UINT diFlags); // ;Internal 4.0
  6122. #endif /* WINVER >= 0x0400 */
  6123. #endif /* WINVER >= 0x030a */
  6124. BOOL WINAPI DrawIcon(HDC, int, int, HICON);
  6125. #ifndef NOICONS
  6126. /* Standard icon resource IDs */
  6127. #ifdef RC_INVOKED
  6128. #define IDI_APPLICATION 32512
  6129. #define IDI_ERROR 32513 /* ;win40: Name changed from IDI_HAND */
  6130. #define IDI_QUESTION 32514
  6131. #define IDI_WARNING 32515 /* ;win40: Name changed from IDI_EXCLAMATION */
  6132. #define IDI_INFORMATION 32516 /* ;win40: Name changed from IDI_ASTERISK */
  6133. #define IDI_WINLOGO 32517 /* ;Internal NT */
  6134. #else
  6135. #define IDI_APPLICATION MAKEINTRESOURCE(32512)
  6136. #define IDI_ERROR MAKEINTRESOURCE(32513) /* ;win40: Name changed from IDI_HAND */
  6137. #define IDI_QUESTION MAKEINTRESOURCE(32514)
  6138. #define IDI_WARNING MAKEINTRESOURCE(32515) /* ;win40: Name changed from IDI_EXCLAMATION */
  6139. #define IDI_INFORMATION MAKEINTRESOURCE(32516) /* ;win40: Name changed from IDI_ASTERISK */
  6140. #define IDI_WINLOGO MAKEINTRESOURCE(32517) /* ;Internal NT */
  6141. #endif /* RC_INVOKED */
  6142. #define IDI_HAND IDI_ERROR
  6143. #define IDI_EXCLAMATION IDI_WARNING
  6144. #define IDI_ASTERISK IDI_INFORMATION
  6145. #endif /* NOICONS */
  6146. /****** Caret support ********************************************************/
  6147. #ifdef tagWND /* ;Internal */
  6148. BOOL WINAPI CreateCaret(HWND, HBITMAP, int, int); /* ;Internal */
  6149. BOOL WINAPI DestroyCaret(void); /* ;Internal */
  6150. BOOL WINAPI ShowCaret(HWND); /* ;Internal */
  6151. BOOL WINAPI HideCaret(HWND); /* ;Internal */
  6152. BOOL WINAPI SetCaretPos(int, int); /* ;Internal */
  6153. BOOL WINAPI SetCaretBlinkTime(UINT); /* ;Internal */
  6154. BOOL WINAPI GetCaretPos(LPPOINT); /* ;Internal */
  6155. #else /* ;Internal */
  6156. void WINAPI CreateCaret(HWND, HBITMAP, int, int);
  6157. void WINAPI DestroyCaret(void);
  6158. void WINAPI ShowCaret(HWND);
  6159. void WINAPI HideCaret(HWND);
  6160. void WINAPI SetCaretPos(int, int);
  6161. void WINAPI SetCaretBlinkTime(UINT);
  6162. void WINAPI GetCaretPos(LPPOINT);
  6163. #endif /* ;Internal */
  6164. UINT WINAPI GetCaretBlinkTime(void);
  6165. /****** WM_SYSCOMMAND support ***********************************************/
  6166. #ifndef NOSYSCOMMANDS
  6167. /* System Menu Command Values */
  6168. #define SC_SIZE 0xF000
  6169. #define SC_MOVE 0xF010
  6170. #define SC_MINIMIZE 0xF020
  6171. #define SC_MAXIMIZE 0xF030
  6172. #define SC_NEXTWINDOW 0xF040
  6173. #define SC_PREVWINDOW 0xF050
  6174. #define SC_CLOSE 0xF060
  6175. #define SC_VSCROLL 0xF070
  6176. #define SC_HSCROLL 0xF080
  6177. #define SC_MOUSEMENU 0xF090
  6178. #define SC_KEYMENU 0xF100
  6179. #define SC_ARRANGE 0xF110
  6180. #define SC_RESTORE 0xF120
  6181. #define SC_TASKLIST 0xF130
  6182. #define SC_SCREENSAVE 0xF140
  6183. #define SC_HOTKEY 0xF150
  6184. #define SC_DEFAULT 0xF160 /* ;Internal 4.0 */
  6185. #define SC_MONITORPOWER 0xF170 /* ;Internal 4.0 */
  6186. #define SC_CONTEXTHELP 0xF180 /* ;Internal 4.0 */
  6187. #define SC_SEPARATOR 0xF00F /* ;Internal 4.0 */
  6188. /* Obsolete names */
  6189. #define SC_ICON SC_MINIMIZE
  6190. #define SC_ZOOM SC_MAXIMIZE
  6191. #endif /* NOSYSCOMMANDS */
  6192. /****** MDI Support *********************************************************/
  6193. #ifndef NOMDI
  6194. /* CreateWindow lpParams structure for creating MDI client */
  6195. typedef struct tagCLIENTCREATESTRUCT
  6196. {
  6197. #ifdef tagWND /* ;Internal */
  6198. HMENU_16 hWindowMenu; /* ;Internal */
  6199. #else /* ;Internal */
  6200. HMENU hWindowMenu;
  6201. #endif /* ;Internal */
  6202. UINT idFirstChild;
  6203. } CLIENTCREATESTRUCT;
  6204. typedef CLIENTCREATESTRUCT FAR* LPCLIENTCREATESTRUCT;
  6205. /* MDI client style bits */
  6206. #if (WINVER >= 0x030a)
  6207. #define MDIS_ALLCHILDSTYLES 0x0001
  6208. #endif /* WINVER >= 0x030a */
  6209. /* WM_MDICREATE message structure */
  6210. typedef struct tagMDICREATESTRUCT
  6211. {
  6212. LPCSTR szClass;
  6213. LPCSTR szTitle;
  6214. HINSTANCE hOwner;
  6215. int x;
  6216. int y;
  6217. int cx;
  6218. int cy;
  6219. DWORD style;
  6220. LPARAM lParam;
  6221. } MDICREATESTRUCT;
  6222. typedef MDICREATESTRUCT FAR* LPMDICREATESTRUCT;
  6223. #if (WINVER >= 0x030a)
  6224. /* wParam values for WM_MDITILE and WM_MDICASCADE messages. */
  6225. #define MDITILE_VERTICAL 0x0000
  6226. #define MDITILE_HORIZONTAL 0x0001
  6227. #define MDITILE_SKIPDISABLED 0x0002
  6228. #endif /* WINVER >= 0x030a */
  6229. #ifdef tagWND /* ;Internal */
  6230. LRESULT WINAPI DefFrameProc(HWND, HWND_16, UINT, WPARAM, LPARAM); /* ;Internal */
  6231. #else /* ;Internal */
  6232. LRESULT WINAPI DefFrameProc(HWND, HWND, UINT, WPARAM, LPARAM);
  6233. #endif /* ;Internal */
  6234. LRESULT WINAPI DefMDIChildProc(HWND, UINT, WPARAM, LPARAM);
  6235. #ifndef NOMSG
  6236. BOOL WINAPI TranslateMDISysAccel(HWND, LPMSG);
  6237. #endif
  6238. UINT WINAPI ArrangeIconicWindows(HWND);
  6239. BOOL WINAPI TileChildWindows(HWND, UINT);
  6240. BOOL WINAPI CascadeChildWindows(HWND, UINT);
  6241. /* ;Internal 4.0 */
  6242. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6243. #ifdef tagWND /* ;Internal 4.0 */
  6244. typedef const HWND_16 FAR *LPHWND; /* ;Internal 4.0 */
  6245. #else /* ;Internal 4.0 */
  6246. typedef const HWND FAR *LPHWND; /* ;Internal 4.0 */
  6247. #endif /* tagWND */ /* ;Internal 4.0 */
  6248. /* ;Internal 4.0 */
  6249. UINT WINAPI TileWindows (HWND, UINT, LPCRECT, UINT, LPHWND); /* ;Internal 4.0 */
  6250. UINT WINAPI CascadeWindows(HWND, UINT, LPCRECT, UINT, LPHWND); /* ;Internal 4.0 */
  6251. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6252. #endif /* NOMDI */
  6253. /****** Dialog and Control Management ***************************************/
  6254. #ifndef NOCTLMGR
  6255. /* Dialog window class */
  6256. #define WC_DIALOG (MAKEINTATOM(0x8002))
  6257. /* cbWndExtra bytes needed by dialog manager for dialog classes */
  6258. #define DLGWINDOWEXTRA 30
  6259. /* Dialog styles */
  6260. #define DS_ABSALIGN 0x0001L
  6261. #define DS_SYSMODAL 0x0002L
  6262. #define DS_LOCALEDIT 0x0020L
  6263. #define DS_SETFONT 0x0040L
  6264. #define DS_MODALFRAME 0x0080L
  6265. #define DS_NOIDLEMSG 0x0100L
  6266. #define DS_SETFOREGROUND 0x0200L // ;Internal NT
  6267. #define DS_VALID31 0x03e7L // ;Internal
  6268. #if (WINVER >= 0x0400) // ;Internal
  6269. #define DS_3DLOOK 0x0004L // ;Internal 4.0
  6270. #define DS_FIXEDSYS 0x0008L // ;Internal 4.0
  6271. #define DS_NOFAILCREATE 0x0010L // ;Internal 4.0
  6272. #define DS_CONTROL 0x0400L // ;Internal 4.0
  6273. #define DS_RECURSE DS_CONTROL // ;Internal BOGUS GOING AWAY
  6274. #define DS_CENTER 0x0800L // ;Internal 4.0
  6275. #define DS_CENTERMOUSE 0x1000L // ;Internal 4.0
  6276. #define DS_CONTEXTHELP 0x2000L // ;Internal 4.0
  6277. #define DS_COMMONDIALOG 0x4000L // ;Internal
  6278. #define DS_VALID40 0x7FFFL // ;Internal
  6279. #endif /* WINVER >= 0x0400 */ // ;Internal
  6280. /* Dialog messages */
  6281. #define DM_GETDEFID (WM_USER+0)
  6282. #define DM_SETDEFID (WM_USER+1)
  6283. #define DM_REPOSITION (WM_USER+2) /* ;Internal 4.0 */
  6284. /* ;Internal 4.0 */
  6285. #if WINVER >= 0x0400 /* ;Internal 4.0 */
  6286. #define PSM_PAGEINFO (WM_USER+100) /* ;Internal 4.0 */
  6287. #define PSM_SHEETINFO (WM_USER+101) /* ;Internal 4.0 */
  6288. /* ;Internal 4.0 */
  6289. #define PSI_SETACTIVE 0x0001L /* ;Internal 4.0 */
  6290. #define PSI_KILLACTIVE 0x0002L /* ;Internal 4.0 */
  6291. #define PSI_APPLY 0x0003L /* ;Internal 4.0 */
  6292. #define PSI_RESET 0x0004L /* ;Internal 4.0 */
  6293. #define PSI_HASHELP 0x0005L /* ;Internal 4.0 */
  6294. #define PSI_HELP 0x0006L /* ;Internal 4.0 */
  6295. /* ;Internal 4.0 */
  6296. #define PSI_CHANGED 0x0001L /* ;Internal 4.0 */
  6297. #define PSI_GUISTART 0x0002L /* ;Internal 4.0 */
  6298. #define PSI_REBOOT 0x0003L /* ;Internal 4.0 */
  6299. #define PSI_GETSIBLINGS 0x0004L /* ;Internal 4.0 */
  6300. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6301. /* Returned in HIWORD() of DM_GETDEFID result if msg is supported */
  6302. #define DC_HASDEFID 0x534B
  6303. #ifdef STRICT
  6304. #ifdef tagWND /* ;Internal */
  6305. typedef BOOL (CALLBACK* DLGPROC)(HWND_16, UINT, WPARAM, LPARAM);/* ;Internal */
  6306. #else /* ;Internal */
  6307. typedef BOOL (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
  6308. #endif /* ;Internal */
  6309. #else
  6310. typedef FARPROC DLGPROC;
  6311. #endif
  6312. /* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
  6313. #define DWL_MSGRESULT 0
  6314. #define DWL_DLGPROC 4
  6315. #define DWL_USER 8
  6316. #ifndef NOMSG
  6317. BOOL WINAPI IsDialogMessage(HWND, LPMSG);
  6318. #endif
  6319. #ifdef tagWND /* ;Internal */
  6320. LRESULT WINAPI DefDlgProc(HWND_16, UINT, WPARAM, LPARAM); /* ;Internal */
  6321. #else /* ;Internal */
  6322. LRESULT WINAPI DefDlgProc(HWND, UINT, WPARAM, LPARAM);
  6323. #endif /* ;Internal */
  6324. #ifdef tagWND /* ;Internal */
  6325. HWND_16 WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC); /* ;Internal */
  6326. HWND_16 WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC); /* ;Internal */
  6327. HWND_16 WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM); /* ;Internal */
  6328. HWND_16 WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM); /* ;Internal */
  6329. #else /* ;Internal */
  6330. HWND WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC);
  6331. HWND WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC);
  6332. HWND WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  6333. HWND WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM);
  6334. #endif /* ;Internal */
  6335. int WINAPI DialogBox(HINSTANCE, LPCSTR, HWND, DLGPROC);
  6336. int WINAPI DialogBoxIndirect(HINSTANCE, HGLOBAL, HWND, DLGPROC);
  6337. #ifdef tagWND /* ;Internal */
  6338. long WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM); /* ;Internal */
  6339. long WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM); /* ;Internal */
  6340. #else /* ;Internal */
  6341. int WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  6342. int WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM);
  6343. #endif /* ;Internal */
  6344. void WINAPI EndDialog(HWND, int);
  6345. BOOL WINAPI EndDialog32(HWND, long); /* ;Internal NT */
  6346. #ifdef tagWND /* ;Internal */
  6347. long WINAPI GetDlgCtrlID(HWND); /* ;Internal */
  6348. HWND_16 WINAPI GetDlgItem(HWND, int); /* ;Internal */
  6349. #else /* ;Internal */
  6350. int WINAPI GetDlgCtrlID(HWND);
  6351. HWND WINAPI GetDlgItem(HWND, int);
  6352. #endif /* ;Internal */
  6353. LRESULT WINAPI SendDlgItemMessage(HWND, int, UINT, WPARAM, LPARAM);
  6354. void WINAPI SetDlgItemInt(HWND, int, UINT, BOOL);
  6355. UINT WINAPI GetDlgItemInt(HWND, int, BOOL FAR *, BOOL);
  6356. void WINAPI SetDlgItemText(HWND, int, LPCSTR);
  6357. int WINAPI GetDlgItemText(HWND, int, LPSTR, int);
  6358. void WINAPI CheckDlgButton(HWND, int, UINT);
  6359. void WINAPI CheckRadioButton(HWND, int, int, int);
  6360. UINT WINAPI IsDlgButtonChecked(HWND, int);
  6361. #ifdef tagWND /* ;Internal */
  6362. HWND_16 WINAPI GetNextDlgGroupItem(HWND, HWND, BOOL); /* ;Internal */
  6363. HWND_16 WINAPI GetNextDlgTabItem(HWND, HWND, BOOL); /* ;Internal */
  6364. #else /* ;Internal */
  6365. HWND WINAPI GetNextDlgGroupItem(HWND, HWND, BOOL);
  6366. HWND WINAPI GetNextDlgTabItem(HWND, HWND, BOOL);
  6367. #endif /* ;Internal */
  6368. #ifdef tagWND // ;Internal
  6369. BOOL WINAPI MapDialogRect(HWND, LPRECT); // ;Internal
  6370. #else // ;Internal
  6371. void WINAPI MapDialogRect(HWND, LPRECT);
  6372. #endif // ;Internal
  6373. DWORD WINAPI GetDialogBaseUnits(void);
  6374. /* dialog codes */
  6375. #define DLGC_WANTARROWS 0x0001
  6376. #define DLGC_WANTTAB 0x0002
  6377. #define DLGC_WANTALLKEYS 0x0004
  6378. #define DLGC_WANTMESSAGE 0x0004
  6379. #define DLGC_HASSETSEL 0x0008
  6380. #define DLGC_DEFPUSHBUTTON 0x0010
  6381. #define DLGC_UNDEFPUSHBUTTON 0x0020
  6382. #define DLGC_RADIOBUTTON 0x0040
  6383. #define DLGC_WANTCHARS 0x0080
  6384. #define DLGC_STATIC 0x0100
  6385. #define DLGC_BUTTON 0x2000
  6386. /* WM_CTLCOLOR control IDs */
  6387. #define CTLCOLOR_MSGBOX 0
  6388. #define CTLCOLOR_EDIT 1
  6389. #define CTLCOLOR_LISTBOX 2
  6390. #define CTLCOLOR_BTN 3
  6391. #define CTLCOLOR_DLG 4
  6392. #define CTLCOLOR_SCROLLBAR 5
  6393. #define CTLCOLOR_STATIC 6
  6394. #define CTLCOLOR_MAX 7 // ;Internal
  6395. #endif /* NOCTLMGR */
  6396. /* Standard dialog button IDs */
  6397. #define IDOK 1
  6398. #define IDCANCEL 2
  6399. #define IDABORT 3
  6400. #define IDRETRY 4
  6401. #define IDIGNORE 5
  6402. #define IDYES 6
  6403. #define IDNO 7
  6404. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6405. #define IDCLOSE 8 /* ;Internal 4.0 */
  6406. #define IDHELP 9 /* ;Internal 4.0 */
  6407. #define IDUSERICON 10 /* ;Internal 4.0 */
  6408. #endif /* ;Internal 4.0 */
  6409. //***** Control Notification support ********************* ;Internal 4.0
  6410. // should this be marked internal? // ;Internal 4.0
  6411. typedef struct tagNMHDR
  6412. {
  6413. #ifdef tagWND
  6414. HWND_16 hwndFrom;
  6415. #else
  6416. HWND hwndFrom;
  6417. #endif
  6418. WORD _wDummy1;
  6419. UINT idFrom;
  6420. WORD _wDummy2;
  6421. UINT code;
  6422. WORD _wDummy3;
  6423. } NMHDR;
  6424. typedef NMHDR FAR * LPNMHDR;
  6425. typedef struct tagSTYLESTRUCT // ;Internal 4.0
  6426. { // ;Internal 4.0
  6427. /* Win4.0 fields */ // ;Internal 4.0
  6428. DWORD styleOld; // ;Internal 4.0
  6429. DWORD styleNew; // ;Internal 4.0
  6430. } STYLESTRUCT; // ;Internal 4.0
  6431. typedef STYLESTRUCT FAR * LPSTYLESTRUCT; // ;Internal 4.0
  6432. // ;Internal 4.0
  6433. /****** Owner draw control support ******************************************/
  6434. /* Owner draw control types */
  6435. #define ODT_MENU 1
  6436. #define ODT_LISTBOX 2
  6437. #define ODT_COMBOBOX 3
  6438. #define ODT_BUTTON 4
  6439. #define ODT_STATIC 5 /* ;Internal 4.0 */
  6440. /* Owner draw actions */
  6441. #define ODA_DRAWENTIRE 0x0001
  6442. #define ODA_SELECT 0x0002
  6443. #define ODA_FOCUS 0x0004
  6444. /* Owner draw state */
  6445. #define ODS_SELECTED 0x0001
  6446. #define ODS_GRAYED 0x0002
  6447. #define ODS_DISABLED 0x0004
  6448. #define ODS_CHECKED 0x0008
  6449. #define ODS_FOCUS 0x0010
  6450. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6451. #define ODS_DEFAULT 0x0020 /* ;Internal 4.0 */
  6452. #define ODS_COMBOBOXEDIT 0x1000 /* ;Internal 4.0 */
  6453. #define ODS_HOTTRACK 0x2000 /* ;Internal 4.0 */
  6454. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6455. /* LPARAM of WM_DRAWITEM is LPDRAWITEMSTRUCT */
  6456. typedef struct tagDRAWITEMSTRUCT
  6457. {
  6458. UINT CtlType;
  6459. UINT CtlID;
  6460. UINT itemID;
  6461. UINT itemAction;
  6462. UINT itemState;
  6463. #ifdef tagWND /* ;Internal */
  6464. HWND_16 hwndItem; /* ;Internal */
  6465. #else /* ;Internal */
  6466. HWND hwndItem;
  6467. #endif /* ;Internal */
  6468. HDC hDC;
  6469. RECT rcItem;
  6470. DWORD itemData;
  6471. } DRAWITEMSTRUCT;
  6472. typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
  6473. typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
  6474. /* LPARAM of WM_MEASUREITEM is LPMEASUREITEMSTRUCT */
  6475. typedef struct tagMEASUREITEMSTRUCT
  6476. {
  6477. UINT CtlType;
  6478. UINT CtlID;
  6479. UINT itemID;
  6480. UINT itemWidth;
  6481. UINT itemHeight;
  6482. DWORD itemData;
  6483. } MEASUREITEMSTRUCT;
  6484. typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
  6485. typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
  6486. /* LPARAM of WM_DELETEITEM is LPDELETEITEMSTRUCT */
  6487. typedef struct tagDELETEITEMSTRUCT
  6488. {
  6489. UINT CtlType;
  6490. UINT CtlID;
  6491. UINT itemID;
  6492. #ifdef tagWND /* ;Internal */
  6493. HWND_16 hwndItem; /* ;Internal */
  6494. #else /* ;Internal */
  6495. HWND hwndItem;
  6496. #endif /* ;Internal */
  6497. DWORD itemData;
  6498. } DELETEITEMSTRUCT;
  6499. typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
  6500. typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
  6501. /* LPARAM of WM_COMPAREITEM is LPCOMPAREITEMSTRUCT */
  6502. typedef struct tagCOMPAREITEMSTRUCT
  6503. {
  6504. UINT CtlType;
  6505. UINT CtlID;
  6506. #ifdef tagWND /* ;Internal */
  6507. HWND_16 hwndItem; /* ;Internal */
  6508. #else /* ;Internal */
  6509. HWND hwndItem;
  6510. #endif /* ;Internal */
  6511. UINT itemID1;
  6512. DWORD itemData1;
  6513. UINT itemID2;
  6514. DWORD itemData2;
  6515. } COMPAREITEMSTRUCT;
  6516. typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
  6517. typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
  6518. /****** Static control ******************************************************/
  6519. #ifndef NOCTLMGR
  6520. /* Static Control Styles */
  6521. #define SS_LEFT 0x00000000L
  6522. #define SS_CENTER 0x00000001L
  6523. #define SS_RIGHT 0x00000002L
  6524. #define SS_ICON 0x00000003L
  6525. #define SS_BLACKRECT 0x00000004L
  6526. #define SS_GRAYRECT 0x00000005L
  6527. #define SS_WHITERECT 0x00000006L
  6528. #define SS_BLACKFRAME 0x00000007L
  6529. #define SS_GRAYFRAME 0x00000008L
  6530. #define SS_WHITEFRAME 0x00000009L
  6531. #define SS_USERITEM 0x0000000AL // ;Internal
  6532. #define SS_SIMPLE 0x0000000BL
  6533. #define SS_LEFTNOWORDWRAP 0x0000000CL
  6534. #define SS_OWNERDRAW 0x0000000DL // ;Internal 4.0
  6535. #define SS_BITMAP 0x0000000EL // ;Internal 4.0
  6536. #define SS_ENHMETAFILE 0x0000000FL // ;Internal 4.0
  6537. #define SS_ETCHEDHORZ 0x00000010L // ;Internal 4.0
  6538. #define SS_ETCHEDVERT 0x00000011L // ;Internal 4.0
  6539. #define SS_ETCHEDFRAME 0x00000012L // ;Internal 4.0
  6540. #define SS_TYPEMASK 0x0000001FL // ;Internal 4.0
  6541. #define SS_NOPREFIX 0x00000080L
  6542. #define SS_NOTIFY 0x00000100L // ;Internal 4.0
  6543. #define SS_CENTERIMAGE 0x00000200L // ;Internal 4.0
  6544. #define SS_RIGHTJUST 0x00000400L // ;Internal 4.0
  6545. #define SS_REALSIZEIMAGE 0x00000800L // ;Internal 4.0
  6546. #define SS_SUNKEN 0x00001000L // ;Internal 4.0
  6547. #define SS_EDITCONTROL 0x00002000L // ;Internal
  6548. #if (WINVER >= 0x030a)
  6549. #ifndef NOWINMESSAGES
  6550. /* Static Control Mesages */
  6551. #define STM_FIRST_16 WM_USER // ;Internal
  6552. #define STM_SETICON (WM_USER+0)
  6553. #define STM_GETICON (WM_USER+1)
  6554. #if (WINVER >= 0x0400) // ;Internal 4.0
  6555. #define STM_SETIMAGE (WM_USER+2) // ;Internal 4.0
  6556. #define STM_GETIMAGE (WM_USER+3) // ;Internal 4.0
  6557. // ;Internal 4.0
  6558. #define STN_CLICKED 0 // ;Internal 4.0
  6559. #define STN_DBLCLK 1 // ;Internal 4.0
  6560. #define STN_ENABLE 2 // ;Internal 4.0
  6561. #define STN_DISABLE 3 // ;Internal 4.0
  6562. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  6563. #define STM_MSGMAX (WM_USER+4) // ;Internal 4.0
  6564. #endif /* NOWINMESSAGES */
  6565. #endif /* WINVER >= 0x030a */
  6566. #endif /* NOCTLMGR */
  6567. /****** Button control *****************************************************/
  6568. #ifndef NOCTLMGR
  6569. /* Button Control Styles */
  6570. #define BS_PUSHBUTTON 0x00000000L
  6571. #define BS_DEFPUSHBUTTON 0x00000001L
  6572. #define BS_CHECKBOX 0x00000002L
  6573. #define BS_AUTOCHECKBOX 0x00000003L
  6574. #define BS_RADIOBUTTON 0x00000004L
  6575. #define BS_3STATE 0x00000005L
  6576. #define BS_AUTO3STATE 0x00000006L
  6577. #define BS_GROUPBOX 0x00000007L
  6578. #define BS_USERBUTTON 0x00000008L
  6579. #define BS_AUTORADIOBUTTON 0x00000009L
  6580. #define BS_PUSHBOX 0x0000000AL // ;Internal
  6581. #define BS_OWNERDRAW 0x0000000BL
  6582. #define BS_TYPEMASK 0x0000000FL // ;Internal
  6583. #define BS_TEXT 0x00000000L // ;Internal 4.0
  6584. #define BS_RIGHTBUTTON 0x00000020L
  6585. #define BS_ICON 0x00000040L // ;Internal 4.0
  6586. #define BS_BITMAP 0x00000080L // ;Internal 4.0
  6587. #define BS_IMAGEMASK 0x000000C0L // ;Internal 4.0
  6588. // ;Internal 4.0
  6589. #define BS_LEFT 0x00000100L // ;Internal 4.0
  6590. #define BS_RIGHT 0x00000200L // ;Internal 4.0
  6591. #define BS_CENTER 0x00000300L // ;Internal 4.0
  6592. #define BS_HORZMASK 0x00000300L // ;Internal 4.0
  6593. #define BS_TOP 0x00000400L // ;Internal 4.0
  6594. #define BS_BOTTOM 0x00000800L // ;Internal 4.0
  6595. #define BS_VCENTER 0x00000C00L // ;Internal 4.0
  6596. #define BS_VERTMASK 0x00000C00L // ;Internal 4.0
  6597. #define BS_ALIGNMASK 0x00000F00L // ;Internal 4.0
  6598. // ;Internal 4.0
  6599. #define BS_PUSHLIKE 0x00001000L // ;Internal 4.0
  6600. #define BS_MULTILINE 0x00002000L // ;Internal 4.0
  6601. #define BS_NOTIFY 0x00004000L // ;Internal 4.0
  6602. #define BS_FLAT 0x00008000L // ;Internal 4.0
  6603. #define BS_LEFTTEXT BS_RIGHTBUTTON
  6604. #ifndef NOWINMESSAGES
  6605. /* Button Control Messages */
  6606. #define BM_FIRST_16 WM_USER // ;Internal
  6607. #define BM_GETCHECK (WM_USER+0)
  6608. #define BM_SETCHECK (WM_USER+1)
  6609. #define BM_GETSTATE (WM_USER+2)
  6610. #define BM_SETSTATE (WM_USER+3)
  6611. #define BM_SETSTYLE (WM_USER+4)
  6612. #define BM_CLICK (WM_USER+5)
  6613. #define BM_GETIMAGE (WM_USER+6) // ;Internal 4.0
  6614. #define BM_SETIMAGE (WM_USER+7) // ;Internal 4.0
  6615. #define BM_MSGMAX (WM_USER+8) // ;Internal 4.0
  6616. #define BST_UNCHECKED 0x0000
  6617. #define BST_CHECKED 0x0001
  6618. #define BST_INDETERMINATE 0x0002
  6619. #define BST_CHECKMASK 0x0003 // ;Internal
  6620. #define BST_PUSHED 0x0004
  6621. #define BST_FOCUS 0x0008
  6622. #define BST_INCLICK 0x0010 // ;Internal -- inside click code
  6623. #define BST_CAPTURED 0x0020 // ;Internal -- we have mouse capture
  6624. #define BST_MOUSE 0x0040 // ;Internal -- mouse initiated
  6625. #define BST_DONTCLICK 0x0080 // ;Internal -- Don't check on get focus.
  6626. #define BST_INBMCLICK 0x0100 // ;Internal -- processing BM_CLICK message
  6627. /* User Button Notification Codes */
  6628. #define BN_CLICKED 0
  6629. #define BN_PAINT 1
  6630. #define BN_PUSHED 2
  6631. #define BN_HILITE BN_PUSHED
  6632. #define BN_UNPUSHED 3
  6633. #define BN_UNHILITE BN_UNPUSHED
  6634. #define BN_DISABLE 4
  6635. #define BN_DBLCLK 5
  6636. #define BN_DOUBLECLICKED BN_DBLCLK
  6637. #define BN_SETFOCUS 6 /* ;Internal 4.0 */
  6638. #define BN_KILLFOCUS 7 /* ;Internal 4.0 */
  6639. #endif /* NOWINMESSAGES */
  6640. #endif /* NOCTLMGR */
  6641. /****** Edit control *******************************************************/
  6642. #ifndef NOCTLMGR
  6643. /* Edit control styles */
  6644. #ifndef NOWINSTYLES
  6645. #define ES_LEFT 0x0000L
  6646. #define ES_CENTER 0x0001L
  6647. #define ES_RIGHT 0x0002L
  6648. #define ES_MULTILINE 0x0004L
  6649. #define ES_UPPERCASE 0x0008L
  6650. #define ES_LOWERCASE 0x0010L
  6651. #define ES_PASSWORD 0x0020L
  6652. #define ES_AUTOVSCROLL 0x0040L
  6653. #define ES_AUTOHSCROLL 0x0080L
  6654. #define ES_NOHIDESEL 0x0100L
  6655. #define ES_COMBOBOX 0x0200L /* ;Internal */
  6656. #define ES_OEMCONVERT 0x0400L
  6657. #if (WINVER >= 0x030a)
  6658. #define ES_READONLY 0x0800L
  6659. #define ES_WANTRETURN 0x1000L
  6660. #endif /* WINVER >= 0x030a */
  6661. #if (WINVER >= 0x0400)
  6662. #define ES_NUMBER 0x2000L
  6663. #endif /* WINVER >= 0x0400 */
  6664. #endif /* NOWINSTYLES */
  6665. /* Edit control messages */
  6666. #ifndef NOWINMESSAGES
  6667. #define EM_FIRST_16 WM_USER // ;Internal
  6668. #define EM_GETSEL (WM_USER+0)
  6669. #define EM_SETSEL (WM_USER+1)
  6670. #define EM_GETRECT (WM_USER+2)
  6671. #define EM_SETRECT (WM_USER+3)
  6672. #define EM_SETRECTNP (WM_USER+4)
  6673. #define EM_SCROLL (WM_USER+5) // ;Internal
  6674. #define EM_LINESCROLL (WM_USER+6)
  6675. #define EM_SCROLLCARET (WM_USER+7)
  6676. #define EM_GETMODIFY (WM_USER+8)
  6677. #define EM_SETMODIFY (WM_USER+9)
  6678. #define EM_GETLINECOUNT (WM_USER+10)
  6679. #define EM_LINEINDEX (WM_USER+11)
  6680. #define EM_SETHANDLE (WM_USER+12)
  6681. #define EM_GETHANDLE (WM_USER+13)
  6682. #define EM_GETTHUMB (WM_USER+14) // ;Internal
  6683. #define EM_LINELENGTH (WM_USER+17)
  6684. #define EM_REPLACESEL (WM_USER+18)
  6685. #define EM_SETFONT (WM_USER+19) /* NOT IMPLEMENTED: use WM_SETFONT */
  6686. #define EM_GETLINE (WM_USER+20)
  6687. #define EM_SETLIMITTEXT (WM_USER+21)
  6688. #define EM_CANUNDO (WM_USER+22)
  6689. #define EM_UNDO (WM_USER+23)
  6690. #define EM_FMTLINES (WM_USER+24)
  6691. #define EM_LINEFROMCHAR (WM_USER+25)
  6692. #define EM_SETWORDBREAK (WM_USER+26) /* NOT IMPLEMENTED: use EM_SETWORDBREAK */
  6693. #define EM_SETTABSTOPS (WM_USER+27)
  6694. #define EM_SETPASSWORDCHAR (WM_USER+28)
  6695. #define EM_EMPTYUNDOBUFFER (WM_USER+29)
  6696. #if (WINVER >= 0x030a)
  6697. #define EM_GETFIRSTVISIBLELINE (WM_USER+30)
  6698. #define EM_SETREADONLY (WM_USER+31)
  6699. #define EM_SETWORDBREAKPROC (WM_USER+32)
  6700. #define EM_GETWORDBREAKPROC (WM_USER+33)
  6701. #define EM_GETPASSWORDCHAR (WM_USER+34)
  6702. #endif /* WINVER >= 0x030a */
  6703. /* ;Internal 4.0 */
  6704. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6705. #define EM_SETMARGINS (WM_USER+35) /* ;Internal 4.0 */
  6706. #define EM_GETMARGINS (WM_USER+36) /* ;Internal 4.0 */
  6707. #define EM_GETLIMITTEXT (WM_USER+37) /* ;Internal 4.0 */
  6708. #define EM_POSFROMCHAR (WM_USER+38) /* ;Internal 4.0 */
  6709. #define EM_CHARFROMPOS (WM_USER+39) /* ;Internal 4.0 */
  6710. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6711. #if (WINVER >= 0x040A) /* ;Internal 4.1 */
  6712. #define EM_SETIMESTATUS (WM_USER+40) /* ;Internal 4.1 */
  6713. #define EM_GETIMESTATUS (WM_USER+41) /* ;Internal 4.1 */
  6714. #endif /* WINVER >= 0x040A */ /* ;Internal 4.1 */
  6715. #define EM_LIMITTEXT EM_SETLIMITTEXT
  6716. #define EM_MSGMAX (WM_USER+42) // ;Internal 4.0
  6717. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6718. #define EM_RESERVED1 (WM_USER+0x40) // ;Internal
  6719. #define EM_RESERVED2 (WM_USER+0x41) // ;Internal
  6720. #define EM_RESERVED3 (WM_USER+0x42) // ;Internal
  6721. #define EM_RESERVED4 (WM_USER+0x43) // ;Internal
  6722. #define EM_RESERVED5 (WM_USER+0x44) // ;Internal
  6723. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6724. #endif /* NOWINMESSAGES */
  6725. #if (WINVER >= 0x030a)
  6726. typedef int (CALLBACK* EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch, int code);
  6727. /* EDITWORDBREAKPROC code values */
  6728. #define WB_LEFT 0
  6729. #define WB_RIGHT 1
  6730. #define WB_ISDELIMITER 2
  6731. #endif /* WINVER >= 0x030a */
  6732. /* Edit control notification codes */
  6733. #define EN_SETFOCUS 0x0100
  6734. #define EN_KILLFOCUS 0x0200
  6735. #define EN_CHANGE 0x0300
  6736. #define EN_UPDATE 0x0400
  6737. #define EN_ERRSPACE 0x0500
  6738. #define EN_MAXTEXT 0x0501
  6739. #define EN_HSCROLL 0x0601
  6740. #define EN_VSCROLL 0x0602
  6741. #if (WINVER >= 0x0400)
  6742. #define EN_ALIGN_LTR (0x700)
  6743. #define EN_ALIGN_RTL (0x701)
  6744. #endif
  6745. /* ;Internal 4.0 */
  6746. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6747. #define EC_LEFTMARGIN 0x0001 /* ;Internal 4.0 */
  6748. #define EC_RIGHTMARGIN 0x0002 /* ;Internal 4.0 */
  6749. #define EC_USEFONTINFO 0xffff /* ;Internal 4.0 */
  6750. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6751. #if (WINVER >= 0x040A) /* ;Internal 4.1 */
  6752. /* wParam of EM_GET/SETIMESTATUS */ /* ;Internal 4.1 */
  6753. #define EMSIS_COMPOSITIONSTRING 0x0001 /* ;Internal 4.1 */
  6754. #define EMSIS_GETLBBIT 0x8001 /* ;Internal 4.1 */
  6755. /* ;Internal 4.1 */
  6756. /* lParam for EMSIS_COMPOSITIONSTRING */ /* ;Internal 4.1 */
  6757. #define EIMES_GETCOMPSTRATONCE 0x0001 /* ;Internal 4.1 */
  6758. #define EIMES_CANCELCOMPSTRINFOCUS 0x0002 /* ;Internal 4.1 */
  6759. #define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004 /* ;Internal 4.1 */
  6760. #endif /* WINVER >= 0x040A */ /* ;Internal 4.1 */
  6761. #endif /* NOCTLMGR */
  6762. /****** Scroll bar control *************************************************/
  6763. /* Also see scrolling support */
  6764. #ifndef NOCTLMGR
  6765. #ifndef NOWINSTYLES
  6766. /* Scroll bar styles */
  6767. #define SBS_HORZ 0x0000L /* Type of scrollbar */
  6768. #define SBS_VERT 0x0001L /* Type of scrollbar */
  6769. #define SBS_TOPALIGN 0x0002L
  6770. #define SBS_LEFTALIGN 0x0002L
  6771. #define SBS_BOTTOMALIGN 0x0004L
  6772. #define SBS_RIGHTALIGN 0x0004L
  6773. #define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
  6774. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  6775. #define SBS_SIZEBOX 0x0008L /* Type of scrollbar */
  6776. #define SBS_SIZEGRIP 0x0010L /* Type of scrollbar */
  6777. #endif /* NOWINSTYLES */
  6778. #endif /* NOCTLMGR */
  6779. /****** Listbox control ****************************************************/
  6780. #ifndef NOCTLMGR
  6781. /* Listbox styles */
  6782. #ifndef NOWINSTYLES
  6783. #define LBS_NOTIFY 0x0001L
  6784. #define LBS_SORT 0x0002L
  6785. #define LBS_NOREDRAW 0x0004L
  6786. #define LBS_MULTIPLESEL 0x0008L
  6787. #define LBS_OWNERDRAWFIXED 0x0010L
  6788. #define LBS_OWNERDRAWVARIABLE 0x0020L
  6789. #define LBS_HASSTRINGS 0x0040L
  6790. #define LBS_USETABSTOPS 0x0080L
  6791. #define LBS_NOINTEGRALHEIGHT 0x0100L
  6792. #define LBS_MULTICOLUMN 0x0200L
  6793. #define LBS_WANTKEYBOARDINPUT 0x0400L
  6794. #define LBS_EXTENDEDSEL 0x0800L
  6795. #if (WINVER >= 0x030a)
  6796. #define LBS_DISABLENOSCROLL 0x1000L
  6797. #define LBS_NODATA 0x2000L
  6798. #if (WINVER >= 0x0400)
  6799. #define LBS_NOSEL 0x4000L
  6800. #endif /* WINVER >= 0x0400 */
  6801. #endif /* WINVER >= 0x030a */
  6802. #define LBS_COMBOBOX 0x8000L // ;Internal
  6803. #define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  6804. #endif /* NOWINSTYLES */
  6805. /* Listbox messages */
  6806. #ifndef NOWINMESSAGES
  6807. #define LB_FIRST_16 (WM_USER+1) // ;Internal
  6808. #define LB_ADDSTRING (WM_USER+1)
  6809. #define LB_INSERTSTRING (WM_USER+2)
  6810. #define LB_DELETESTRING (WM_USER+3)
  6811. #define LB_SELITEMRANGEEX (WM_USER+4) // ;Internal 4.0 NT
  6812. #define LB_RESETCONTENT (WM_USER+5)
  6813. #define LB_SETSEL (WM_USER+6)
  6814. #define LB_SETCURSEL (WM_USER+7)
  6815. #define LB_GETSEL (WM_USER+8)
  6816. #define LB_GETCURSEL (WM_USER+9)
  6817. #define LB_GETTEXT (WM_USER+10)
  6818. #define LB_GETTEXTLEN (WM_USER+11)
  6819. #define LB_GETCOUNT (WM_USER+12)
  6820. #define LB_SELECTSTRING (WM_USER+13)
  6821. #define LB_DIR (WM_USER+14)
  6822. #define LB_GETTOPINDEX (WM_USER+15)
  6823. #define LB_FINDSTRING (WM_USER+16)
  6824. #define LB_GETSELCOUNT (WM_USER+17)
  6825. #define LB_GETSELITEMS (WM_USER+18)
  6826. #define LB_SETTABSTOPS (WM_USER+19)
  6827. #define LB_GETHORIZONTALEXTENT (WM_USER+20)
  6828. #define LB_SETHORIZONTALEXTENT (WM_USER+21)
  6829. #define LB_SETCOLUMNWIDTH (WM_USER+22)
  6830. #define LB_ADDFILE (WM_USER+23) // ;Internal
  6831. #define LB_SETTOPINDEX (WM_USER+24)
  6832. #define LB_GETITEMRECT (WM_USER+25)
  6833. #define LB_GETITEMDATA (WM_USER+26)
  6834. #define LB_SETITEMDATA (WM_USER+27)
  6835. #define LB_SELITEMRANGE (WM_USER+28)
  6836. #define LB_SETANCHORINDEX (WM_USER+29)
  6837. #define LB_GETANCHORINDEX (WM_USER+30)
  6838. #define LB_SETCARETINDEX (WM_USER+31)
  6839. #define LB_GETCARETINDEX (WM_USER+32)
  6840. #if (WINVER >= 0x030a)
  6841. #define LB_SETITEMHEIGHT (WM_USER+33)
  6842. #define LB_GETITEMHEIGHT (WM_USER+34)
  6843. #define LB_FINDSTRINGEXACT (WM_USER+35)
  6844. #define LBCB_CARETON (WM_USER+36) // ;Internal
  6845. #define LBCB_CARETOFF (WM_USER+37) // ;Internal
  6846. // ;Internal NT
  6847. #define LB_SETLOCALE (WM_USER+38) // ;Internal NT
  6848. #define LB_GETLOCALE (WM_USER+39) // ;Internal NT
  6849. #define LB_SETCOUNT (WM_USER+40) // ;Internal NT
  6850. // ;Internal
  6851. #if (WINVER >= 0x0400) // ;Internal 4.0
  6852. #define LB_FIRST_40 (WM_USER+41) // ;Internal 4.0
  6853. #define LB_INITSTORAGE (WM_USER+41) // ;Internal 4.0
  6854. #define LB_ITEMFROMPOINT (WM_USER+42) // ;Internal 4.0
  6855. #define LB_INSERTSTRINGUPPER (WM_USER+43) // ;Internal 4.0
  6856. #define LB_INSERTSTRINGLOWER (WM_USER+44) // ;Internal 4.0
  6857. #define LB_ADDSTRINGUPPER (WM_USER+45) // ;Internal 4.0
  6858. #define LB_ADDSTRINGLOWER (WM_USER+46) // ;Internal 4.0
  6859. #endif /* WINVER >= 0x0400 */ // ;Internal 4.0
  6860. #endif /* WINVER >= 0x030a */
  6861. // ;Internal
  6862. #define LB_MSGMAX (WM_USER+47) // ;Internal
  6863. #endif /* NOWINMESSAGES */
  6864. /* Listbox notification codes */
  6865. #define LBN_ERRSPACE (-2)
  6866. #define LBN_SELCHANGE 1
  6867. #define LBN_DBLCLK 2
  6868. #define LBN_SELCANCEL 3
  6869. #define LBN_SETFOCUS 4
  6870. #define LBN_KILLFOCUS 5
  6871. /* Listbox message return values */
  6872. #define LB_OKAY 0
  6873. #define LB_ERR (-1)
  6874. #define LB_ERRSPACE (-2)
  6875. #define LB_CTLCODE 0L
  6876. /****** Dialog directory support ********************************************/
  6877. int WINAPI DlgDirList(HWND, LPSTR, int, int, UINT);
  6878. BOOL WINAPI DlgDirSelect(HWND, LPSTR, int);
  6879. int WINAPI DlgDirListComboBox(HWND, LPSTR, int, int, UINT);
  6880. BOOL WINAPI DlgDirSelectComboBox(HWND, LPSTR, int);
  6881. #if (WINVER >= 0x030a)
  6882. BOOL WINAPI DlgDirSelectEx(HWND, LPSTR, int, int);
  6883. BOOL WINAPI DlgDirSelectComboBoxEx(HWND, LPSTR, int, int);
  6884. #endif /* WINVER >= 0x030a */
  6885. /* DlgDirList, DlgDirListComboBox flags values */
  6886. #define DDL_READWRITE 0x0000
  6887. #define DDL_READONLY 0x0001
  6888. #define DDL_HIDDEN 0x0002
  6889. #define DDL_SYSTEM 0x0004
  6890. #define DDL_DIRECTORY 0x0010
  6891. #define DDL_ARCHIVE 0x0020
  6892. #define DDL_NOFILES 0x1000 /* ;Internal */
  6893. #define DDL_POSTMSGS 0x2000
  6894. #define DDL_DRIVES 0x4000
  6895. #define DDL_EXCLUSIVE 0x8000
  6896. #define DDL_VALID 0xf03f /* ;Internal */
  6897. #endif /* NOCTLMGR */
  6898. /****** Combo box control **************************************************/
  6899. #ifndef NOCTLMGR
  6900. /* Combo box styles */
  6901. #ifndef NOWINSTYLES
  6902. #define CBS_SIMPLE 0x0001L
  6903. #define CBS_DROPDOWN 0x0002L
  6904. #define CBS_DROPDOWNLIST 0x0003L
  6905. #define CBS_OWNERDRAWFIXED 0x0010L
  6906. #define CBS_OWNERDRAWVARIABLE 0x0020L
  6907. #define CBS_AUTOHSCROLL 0x0040L
  6908. #define CBS_OEMCONVERT 0x0080L
  6909. #define CBS_SORT 0x0100L
  6910. #define CBS_HASSTRINGS 0x0200L
  6911. #define CBS_NOINTEGRALHEIGHT 0x0400L
  6912. #if (WINVER >= 0x030a)
  6913. #define CBS_DISABLENOSCROLL 0x0800L
  6914. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6915. #define CBS_UPPERCASE 0x2000L /* ;Internal 4.0 */
  6916. #define CBS_LOWERCASE 0x4000L /* ;Internal 4.0 */
  6917. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6918. #endif /* WINVER >= 0x030a */
  6919. #endif /* NOWINSTYLES */
  6920. /* Combo box messages */
  6921. #ifndef NOWINMESSAGES
  6922. #define CB_FIRST_16 (WM_USER+0) // ;Internal
  6923. #define CB_GETEDITSEL (WM_USER+0)
  6924. #define CB_LIMITTEXT (WM_USER+1)
  6925. #define CB_SETEDITSEL (WM_USER+2)
  6926. #define CB_ADDSTRING (WM_USER+3)
  6927. #define CB_DELETESTRING (WM_USER+4)
  6928. #define CB_DIR (WM_USER+5)
  6929. #define CB_GETCOUNT (WM_USER+6)
  6930. #define CB_GETCURSEL (WM_USER+7)
  6931. #define CB_GETLBTEXT (WM_USER+8)
  6932. #define CB_GETLBTEXTLEN (WM_USER+9)
  6933. #define CB_INSERTSTRING (WM_USER+10)
  6934. #define CB_RESETCONTENT (WM_USER+11)
  6935. #define CB_FINDSTRING (WM_USER+12)
  6936. #define CB_SELECTSTRING (WM_USER+13)
  6937. #define CB_SETCURSEL (WM_USER+14)
  6938. #define CB_SHOWDROPDOWN (WM_USER+15)
  6939. #define CB_GETITEMDATA (WM_USER+16)
  6940. #define CB_SETITEMDATA (WM_USER+17)
  6941. #if (WINVER >= 0x030a)
  6942. #define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
  6943. #define CB_SETITEMHEIGHT (WM_USER+19)
  6944. #define CB_GETITEMHEIGHT (WM_USER+20)
  6945. #define CB_SETEXTENDEDUI (WM_USER+21)
  6946. #define CB_GETEXTENDEDUI (WM_USER+22)
  6947. #define CB_GETDROPPEDSTATE (WM_USER+23)
  6948. #define CB_FINDSTRINGEXACT (WM_USER+24)
  6949. /* ;Internal NT */
  6950. #define CB_SETLOCALE (WM_USER+25) /* ;Internal NT */
  6951. #define CB_GETLOCALE (WM_USER+26) /* ;Internal NT */
  6952. #if (WINVER >= 0x0400) /* ;Internal 4.0 */
  6953. #define CB_FIRST_40 (WM_USER+27) // ;Internal 4.0
  6954. #define CB_GETTOPINDEX (WM_USER+27) /* ;Internal 4.0 */
  6955. #define CB_SETTOPINDEX (WM_USER+28) /* ;Internal 4.0 */
  6956. #define CB_GETHORIZONTALEXTENT (WM_USER+29) /* ;Internal 4.0 */
  6957. #define CB_SETHORIZONTALEXTENT (WM_USER+30) /* ;Internal 4.0 */
  6958. #define CB_GETDROPPEDWIDTH (WM_USER+31) /* ;Internal 4.0 */
  6959. #define CB_SETDROPPEDWIDTH (WM_USER+32) /* ;Internal 4.0 */
  6960. #define CB_INITSTORAGE (WM_USER+33) /* ;Internal 4.0 */
  6961. #endif /* WINVER >= 0x0400 */ /* ;Internal 4.0 */
  6962. #endif /* WINVER >= 0x030a */
  6963. #define CB_MSGMAX (WM_USER+34) // ;Internal 4.0
  6964. #endif /* NOWINMESSAGES */
  6965. /* Combo box notification codes */
  6966. #define CBN_ERRSPACE (-1)
  6967. #define CBN_SELCHANGE 1
  6968. #define CBN_DBLCLK 2
  6969. #define CBN_SETFOCUS 3
  6970. #define CBN_KILLFOCUS 4
  6971. #define CBN_EDITCHANGE 5
  6972. #define CBN_EDITUPDATE 6
  6973. #define CBN_DROPDOWN 7
  6974. #if (WINVER >= 0x030a)
  6975. #define CBN_CLOSEUP 8
  6976. #define CBN_SELENDOK 9
  6977. #define CBN_SELENDCANCEL 10
  6978. #endif /* WINVER >= 0x030a */
  6979. /* Combo box message return values */
  6980. #define CB_OKAY 0
  6981. #define CB_ERR (-1)
  6982. #define CB_ERRSPACE (-2)
  6983. #endif /* NOCTLMGR */
  6984. /******* Windows hook support **********************************************/
  6985. #ifndef NOWH
  6986. DECLARE_HANDLE32(HHOOK);
  6987. #ifdef STRICT
  6988. typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
  6989. #else
  6990. typedef FARPROC HOOKPROC;
  6991. #endif
  6992. #ifdef STRICT
  6993. HHOOK WINAPI SetWindowsHook(int, HOOKPROC);
  6994. LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HHOOK FAR*);
  6995. #else
  6996. HOOKPROC WINAPI SetWindowsHook(int, HOOKPROC);
  6997. LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HOOKPROC FAR*);
  6998. #endif
  6999. BOOL WINAPI UnhookWindowsHook(int, HOOKPROC);
  7000. #if (WINVER >= 0x030a)
  7001. HHOOK WINAPI SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hInstance, HTASK hTask);
  7002. BOOL WINAPI UnhookWindowsHookEx(HHOOK hHook);
  7003. LRESULT WINAPI CallNextHookEx(HHOOK hHook, int code, WPARAM wParam, LPARAM lParam);
  7004. #endif /* WINVER >= 0x030a */
  7005. // ;Internal
  7006. #define WH_MIN (-1) // ;Internal
  7007. #define WH_MAX 12 // ;Internal
  7008. #define WH_MINHOOK WH_MIN // ;Internal
  7009. #define WH_MAXHOOK WH_MAX // ;Internal
  7010. #define WH_CHOOKS (WH_MAXHOOK - WH_MINHOOK+1) // ;Internal
  7011. /* Standard hook code */
  7012. #define HC_ACTION 0
  7013. /* Obsolete hook codes (NO LONGER SUPPORTED) */
  7014. #define HC_GETLPLPFN (-3)
  7015. #define HC_LPLPFNNEXT (-2)
  7016. #define HC_LPFNNEXT (-1)
  7017. #endif /* NOWH */
  7018. /****** Computer-based-training (CBT) support *******************************/
  7019. #ifndef NOWH
  7020. /* SetWindowsHook() code */
  7021. #define WH_CBT 5
  7022. #define HCBT_MOVESIZE 0
  7023. #define HCBT_MINMAX 1
  7024. #define HCBT_QS 2
  7025. #define HCBT_CREATEWND 3
  7026. #define HCBT_DESTROYWND 4
  7027. #define HCBT_ACTIVATE 5
  7028. #define HCBT_CLICKSKIPPED 6
  7029. #define HCBT_KEYSKIPPED 7
  7030. #define HCBT_SYSCOMMAND 8
  7031. #define HCBT_SETFOCUS 9
  7032. #define HCBT_SETWINDOWTEXT 10
  7033. #if (WINVER >= 0x030a)
  7034. /* HCBT_CREATEWND parameters pointed to by lParam */
  7035. typedef struct tagCBT_CREATEWND
  7036. {
  7037. LPCREATESTRUCT lpcs;
  7038. #ifdef tagWND /* ;Internal */
  7039. HWND_16 hwndInsertAfter; /* ;Internal */
  7040. #else /* ;Internal */
  7041. HWND hwndInsertAfter;
  7042. #endif /* ;Internal */
  7043. } CBT_CREATEWND;
  7044. typedef CBT_CREATEWND FAR* LPCBT_CREATEWND;
  7045. /* HCBT_ACTIVATE structure pointed to by lParam */
  7046. typedef struct tagCBTACTIVATESTRUCT
  7047. {
  7048. BOOL fMouse;
  7049. #ifdef tagWND /* ;Internal */
  7050. HWND_16 hWndActive; /* ;Internal */
  7051. #else /* ;Internal */
  7052. HWND hWndActive;
  7053. #endif /* ;Internal */
  7054. } CBTACTIVATESTRUCT;
  7055. #endif /* WINVER >= 0x030a */
  7056. #endif /* NOWH */
  7057. /****** Hardware hook support ***********************************************/
  7058. #ifndef NOWH
  7059. #if (WINVER >= 0x030a)
  7060. #define WH_HARDWARE 8
  7061. typedef struct tagHARDWAREHOOKSTRUCT
  7062. {
  7063. #ifdef tagWND /* ;Internal */
  7064. HWND_16 hWnd; /* ;Internal */
  7065. #else /* ;Internal */
  7066. HWND hWnd;
  7067. #endif /* ;Internal */
  7068. UINT wMessage;
  7069. WPARAM wParam;
  7070. LPARAM lParam;
  7071. } HARDWAREHOOKSTRUCT;
  7072. #endif /* WINVER >= 0x030a */
  7073. #endif /* NOWH */
  7074. /****** Shell support *******************************************************/
  7075. #ifndef NOWH
  7076. #if (WINVER >= 0x030a)
  7077. /* SetWindowsHook() Shell hook code */
  7078. #define WH_SHELL 10
  7079. #define HSHELL_WINDOWCREATED 1
  7080. #define HSHELL_WINDOWDESTROYED 2
  7081. #define HSHELL_ACTIVATESHELLWINDOW 3
  7082. #if (WINVER >= 0x0400)
  7083. #define HSHELL_WINDOWACTIVATED 4
  7084. #define HSHELL_GETMINRECT 5
  7085. #define HSHELL_REDRAW 6
  7086. #define HSHELL_TASKMAN 7
  7087. #define HSHELL_LANGUAGE 8
  7088. #endif /* WINVER >= 0x0400 */
  7089. #endif /* WINVER >= 0x030a */
  7090. #endif /* NOWH */
  7091. /****** Journalling support *************************************************/
  7092. #ifndef NOWH
  7093. #define WH_JOURNALRECORD 0
  7094. #define WH_JOURNALPLAYBACK 1
  7095. /* Journalling hook codes */
  7096. #define HC_GETNEXT 1
  7097. #define HC_SKIP 2
  7098. #define HC_NOREMOVE 3
  7099. #define HC_NOREM HC_NOREMOVE
  7100. #define HC_SYSMODALON 4
  7101. #define HC_SYSMODALOFF 5
  7102. /* Journalling message structure */
  7103. typedef struct tagEVENTMSG
  7104. {
  7105. UINT message;
  7106. UINT paramL;
  7107. UINT paramH;
  7108. DWORD time;
  7109. } EVENTMSG;
  7110. typedef EVENTMSG *PEVENTMSG;
  7111. typedef EVENTMSG *PEVENTMSGMSG; /* ;Internal */
  7112. typedef EVENTMSG NEAR* NPEVENTMSG;
  7113. typedef EVENTMSG FAR* LPEVENTMSG;
  7114. typedef EVENTMSG FAR* LPEVENTMSGMSG; /* ;Internal */
  7115. BOOL WINAPI EnableHardwareInput(BOOL);
  7116. #endif /* NOWH */
  7117. /****** Debugger support ****************************************************/
  7118. #if (WINVER >= 0x030a)
  7119. /* SetWindowsHook debug hook support */
  7120. #define WH_DEBUG 9
  7121. typedef struct tagDEBUGHOOKINFO
  7122. {
  7123. HMODULE hModuleHook;
  7124. LPARAM reserved;
  7125. LPARAM lParam;
  7126. WPARAM wParam;
  7127. int code;
  7128. } DEBUGHOOKINFO;
  7129. typedef DEBUGHOOKINFO FAR* LPDEBUGHOOKINFO;
  7130. #ifndef NOMSG
  7131. BOOL WINAPI QuerySendMessage(HANDLE h1, HANDLE h2, HANDLE h3, LPMSG lpmsg);
  7132. #endif /* NOMSG */
  7133. BOOL WINAPI LockInput(HANDLE h1, HWND hwndInput, BOOL fLock);
  7134. LONG WINAPI GetSystemDebugState(void);
  7135. /* Flags returned by GetSystemDebugState.
  7136. */
  7137. #define SDS_MENU 0x0001
  7138. #define SDS_SYSMODAL 0x0002
  7139. #define SDS_NOTASKQUEUE 0x0004
  7140. #define SDS_DIALOG 0x0008
  7141. #define SDS_TASKLOCKED 0x0010
  7142. #endif /* WINVER >= 0x030a */
  7143. /****** Help support ********************************************************/
  7144. #ifndef NOHELP
  7145. BOOL WINAPI WinHelp(HWND hwndMain, LPCSTR lpszHelp, UINT usCommand, DWORD ulData);
  7146. /* WinHelp() commands */
  7147. #define HELP_CONTEXT 0x0001
  7148. #define HELP_QUIT 0x0002
  7149. #define HELP_INDEX 0x0003
  7150. #define HELP_CONTENTS 0x0003
  7151. #define HELP_HELPONHELP 0x0004
  7152. #define HELP_SETINDEX 0x0005
  7153. #define HELP_SETCONTENTS 0x0005
  7154. #define HELP_CONTEXTPOPUP 0x0008
  7155. #define HELP_FORCEFILE 0x0009
  7156. #define HELP_KEY 0x0101
  7157. #define HELP_COMMAND 0x0102
  7158. #define HELP_PARTIALKEY 0x0105
  7159. #define HELP_MULTIKEY 0x0201
  7160. #define HELP_SETWINPOS 0x0203
  7161. #if (WINVER >= 0x0400)
  7162. #define HELP_CONTEXTMENU 0x000a
  7163. #define HELP_FINDER 0x000b
  7164. #define HELP_WM_HELP 0x000c
  7165. #define HELP_SETPOPUP_POS 0x000d
  7166. #define HELP_TCARD 0x8000
  7167. #define HELP_TCARD_DATA 0x0010
  7168. #define HELP_TCARD_NEXT 0x0011
  7169. #define HELP_TCARD_OTHER_CALLER 0x0011
  7170. #endif /* WINVER >= 0x0400 */
  7171. typedef struct tagMULTIKEYHELP
  7172. {
  7173. UINT mkSize;
  7174. BYTE mkKeylist;
  7175. BYTE szKeyphrase[1];
  7176. } MULTIKEYHELP;
  7177. typedef struct
  7178. {
  7179. int wStructSize;
  7180. int x;
  7181. int y;
  7182. int dx;
  7183. int dy;
  7184. int wMax;
  7185. char rgchMember[2];
  7186. } HELPWININFO;
  7187. typedef HELPWININFO NEAR* PHELPWININFO;
  7188. typedef HELPWININFO FAR* LPHELPWININFO;
  7189. #endif /* NOHELP */
  7190. #if (WINVER >= 0x0400)
  7191. #define HELPINFO_WINDOW 0x0001
  7192. #define HELPINFO_MENUITEM 0x0002
  7193. typedef struct tagHELPINFO
  7194. {
  7195. DWORD cbSize;
  7196. int iContextType;
  7197. int iCtrlId;
  7198. HANDLE hItemHandle;
  7199. DWORD dwContextId;
  7200. POINT MousePos;
  7201. }
  7202. HELPINFO, FAR* LPHELPINFO;
  7203. /* ;Internal 4.0 */
  7204. BOOL WINAPI SetWindowContextHelpId(HWND, DWORD); /* ;Internal 4.0 */
  7205. DWORD WINAPI GetWindowContextHelpId(HWND); /* ;Internal 4.0 */
  7206. BOOL WINAPI SetMenuContextHelpId(HMENU, DWORD); /* ;Internal 4.0 */
  7207. DWORD WINAPI GetMenuContextHelpId(HMENU); /* ;Internal 4.0 */
  7208. #endif /* WINVER >= 0x0400 */
  7209. /****** Message Box support *************************************************/
  7210. #ifndef NOMB
  7211. int WINAPI MessageBox(HWND, LPCSTR, LPCSTR, UINT);
  7212. #ifdef tagWND // ;Internal
  7213. BOOL WINAPI MessageBeep(UINT); // ;Internal
  7214. #else // ;Internal
  7215. void WINAPI MessageBeep(UINT);
  7216. #endif // ;Internal
  7217. #define MB_OK 0x0000
  7218. #define MB_OKCANCEL 0x0001
  7219. #define MB_ABORTRETRYIGNORE 0x0002
  7220. #define MB_YESNOCANCEL 0x0003
  7221. #define MB_YESNO 0x0004
  7222. #define MB_RETRYCANCEL 0x0005
  7223. #define MB_TYPEMASK 0x000F
  7224. #define MB_ICONERROR 0x0010 /* ;win40: Name changed from MB_ICONHAND */
  7225. #define MB_ICONQUESTION 0x0020
  7226. #define MB_ICONWARNING 0x0030 /* ;win40: Name changed from MB_ICONEXCLAMATION */
  7227. #define MB_ICONINFORMATION 0x0040 /* ;win40: Name changed from MB_ICONASTERISK */
  7228. #if (WINVER >= 0x400) /* ;Internal 4.0 */
  7229. #define MB_USERICON 0x0080 /* ;Internal 4.0 */
  7230. #endif /* ;Internal 4.0 */
  7231. #define MB_ICONMASK 0x00F0
  7232. #define MB_ICONHAND MB_ICONERROR
  7233. #define MB_ICONSTOP MB_ICONERROR
  7234. #define MB_ICONEXCLAMATION MB_ICONWARNING
  7235. #define MB_ICONASTERISK MB_ICONINFORMATION
  7236. #define MB_DEFBUTTON1 0x0000
  7237. #define MB_DEFBUTTON2 0x0100
  7238. #define MB_DEFBUTTON3 0x0200
  7239. #if (WINVER >= 0x0400)
  7240. #define MB_DEFBUTTON4 0x0300
  7241. #endif
  7242. #define MB_DEFMASK 0x0F00
  7243. #define MB_APPLMODAL 0x0000
  7244. #define MB_SYSTEMMODAL 0x1000
  7245. #define MB_TASKMODAL 0x2000
  7246. // ;Internal 4.0
  7247. #if (WINVER >= 0x0400) // ;Internal 4.0
  7248. #define MB_HELP 0x4000 // ;Internal 4.0
  7249. #define MB_RIGHT 0x00080000
  7250. #define MB_RTLREADING 0x00100000
  7251. #endif // ;Internal 4.0
  7252. #define MB_NOFOCUS 0x8000
  7253. // ;Internal 4.0
  7254. #define MB_TYPEMASK 0x000F // ;Internal 4.0
  7255. #define MB_ICONMASK 0x00F0 // ;Internal 4.0
  7256. #define MB_DEFMASK 0x0F00 // ;Internal 4.0
  7257. #define MB_MODEMASK 0x3000 // ;Internal 4.0
  7258. #define MB_MISCMASK 0xC000 // ;Internal 4.0
  7259. #define MB_VALID 0xb377 // ;Internal 4.0
  7260. // ;Internal 4.0
  7261. #define MB_SETFOREGROUND 0x00010000 // ;Internal NT
  7262. // #define MB_DEFAULT_DESKTOP_ONLY 0x00020000 // ;Internal NT
  7263. #if (WINVER >= 0x0400) // ;Internal NT
  7264. int WINAPI MessageBoxEx(HWND, LPCSTR, LPCSTR, DWORD, WORD); // ;Internal NT
  7265. #endif // WINVER >= 0x0400 // ;Internal NT
  7266. // ;Internal 4.0
  7267. #if (WINVER >= 0x400) // ;Internal 4.0
  7268. #define MB_TOPMOST 0x00040000 // ;Internal 4.0
  7269. #define MBEX_VALIDL 0xf3f7 // ;Internal 4.0
  7270. #define MBEX_VALIDH 1 // ;Internal 4.0
  7271. // ;Internal 4.0
  7272. typedef void (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo); // ;Internal 4.0
  7273. // ;Internal 4.0
  7274. typedef struct tagMSGBOXPARAMS // ;Internal 4.0
  7275. { // ;Internal 4.0
  7276. DWORD cbSize; // ;Internal 4.0
  7277. #ifdef tagWND // ;Internal 4.0
  7278. HWND_16 hwndOwner; // ;Internal 4.0
  7279. #else // ;Internal 4.0
  7280. HWND hwndOwner; // ;Internal 4.0
  7281. #endif // ;Internal 4.0
  7282. HINSTANCE hInstance; // ;Internal 4.0
  7283. LPCSTR lpszText; // ;Internal 4.0
  7284. LPCSTR lpszCaption; // ;Internal 4.0
  7285. DWORD dwStyle; // ;Internal 4.0
  7286. LPCSTR lpszIcon; // ;Internal 4.0
  7287. DWORD dwContextHelpId; // ;Internal 4.0
  7288. MSGBOXCALLBACK lpfnMsgBoxCallback; // ;Internal 4.0
  7289. DWORD dwLanguageId; // ;Internal 4.0
  7290. } MSGBOXPARAMS, FAR *LPMSGBOXPARAMS; // ;Internal 4.0
  7291. // ;Internal 4.0
  7292. int WINAPI MessageBoxIndirect(LPMSGBOXPARAMS); // ;Internal 4.0
  7293. #endif /* WINVER >=0x0400 */ // ;Internal 4.0
  7294. #endif /* NOMB */
  7295. /****** Sound support ******************************************************/
  7296. #ifndef NOSOUND
  7297. int WINAPI OpenSound(void);
  7298. void WINAPI CloseSound(void);
  7299. int WINAPI StartSound(void);
  7300. int WINAPI StopSound(void);
  7301. int WINAPI SetVoiceQueueSize(int, int);
  7302. int WINAPI SetVoiceNote(int, int, int, int);
  7303. int WINAPI SetVoiceAccent(int, int, int, int, int);
  7304. int WINAPI SetVoiceEnvelope(int, int, int);
  7305. int WINAPI SetVoiceSound(int, DWORD, int);
  7306. int WINAPI SetVoiceThreshold(int, int);
  7307. LPINT WINAPI GetThresholdEvent(void);
  7308. int WINAPI GetThresholdStatus(void);
  7309. int WINAPI SetSoundNoise(int, int);
  7310. /* SetSoundNoise() Sources */
  7311. #define S_PERIOD512 0
  7312. #define S_PERIOD1024 1
  7313. #define S_PERIOD2048 2
  7314. #define S_PERIODVOICE 3
  7315. #define S_WHITE512 4
  7316. #define S_WHITE1024 5
  7317. #define S_WHITE2048 6
  7318. #define S_WHITEVOICE 7
  7319. int WINAPI WaitSoundState(int);
  7320. /* WaitSoundState() constants */
  7321. #define S_QUEUEEMPTY 0
  7322. #define S_THRESHOLD 1
  7323. #define S_ALLTHRESHOLD 2
  7324. int WINAPI SyncAllVoices(void);
  7325. int WINAPI CountVoiceNotes(int);
  7326. /* Accent Modes */
  7327. #define S_NORMAL 0
  7328. #define S_LEGATO 1
  7329. #define S_STACCATO 2
  7330. /* Error return values */
  7331. #define S_SERDVNA (-1)
  7332. #define S_SEROFM (-2)
  7333. #define S_SERMACT (-3)
  7334. #define S_SERQFUL (-4)
  7335. #define S_SERBDNT (-5)
  7336. #define S_SERDLN (-6)
  7337. #define S_SERDCC (-7)
  7338. #define S_SERDTP (-8)
  7339. #define S_SERDVL (-9)
  7340. #define S_SERDMD (-10)
  7341. #define S_SERDSH (-11)
  7342. #define S_SERDPT (-12)
  7343. #define S_SERDFQ (-13)
  7344. #define S_SERDDR (-14)
  7345. #define S_SERDSR (-15)
  7346. #define S_SERDST (-16)
  7347. #endif /* NOSOUND */
  7348. /****** Comm support ******************************************************/
  7349. #ifndef NOCOMM
  7350. #define NOPARITY 0
  7351. #define ODDPARITY 1
  7352. #define EVENPARITY 2
  7353. #define MARKPARITY 3
  7354. #define SPACEPARITY 4
  7355. #define ONESTOPBIT 0
  7356. #define ONE5STOPBITS 1
  7357. #define TWOSTOPBITS 2
  7358. #define IGNORE 0
  7359. #define INFINITE 0xFFFF
  7360. /* Error Flags */
  7361. #define CE_RXOVER 0x0001
  7362. #define CE_OVERRUN 0x0002
  7363. #define CE_RXPARITY 0x0004
  7364. #define CE_FRAME 0x0008
  7365. #define CE_BREAK 0x0010
  7366. #define CE_CTSTO 0x0020
  7367. #define CE_DSRTO 0x0040
  7368. #define CE_RLSDTO 0x0080
  7369. #define CE_TXFULL 0x0100
  7370. #define CE_PTO 0x0200
  7371. #define CE_IOE 0x0400
  7372. #define CE_DNS 0x0800
  7373. #define CE_OOP 0x1000
  7374. #define CE_MODE 0x8000
  7375. #define IE_BADID (-1)
  7376. #define IE_OPEN (-2)
  7377. #define IE_NOPEN (-3)
  7378. #define IE_MEMORY (-4)
  7379. #define IE_DEFAULT (-5)
  7380. #define IE_HARDWARE (-10)
  7381. #define IE_BYTESIZE (-11)
  7382. #define IE_BAUDRATE (-12)
  7383. /* Events */
  7384. #define EV_RXCHAR 0x0001
  7385. #define EV_RXFLAG 0x0002
  7386. #define EV_TXEMPTY 0x0004
  7387. #define EV_CTS 0x0008
  7388. #define EV_DSR 0x0010
  7389. #define EV_RLSD 0x0020
  7390. #define EV_BREAK 0x0040
  7391. #define EV_ERR 0x0080
  7392. #define EV_RING 0x0100
  7393. #define EV_PERR 0x0200
  7394. #define EV_CTSS 0x0400
  7395. #define EV_DSRS 0x0800
  7396. #define EV_RLSDS 0x1000
  7397. #define EV_RingTe 0x2000
  7398. #define EV_RINGTE EV_RingTe
  7399. #define EV_VALID 0x3fff /* ;Internal */
  7400. /* Escape Functions */
  7401. #define SETXOFF 1
  7402. #define SETXON 2
  7403. #define SETRTS 3
  7404. #define CLRRTS 4
  7405. #define SETDTR 5
  7406. #define CLRDTR 6
  7407. #define RESETDEV 7
  7408. #define LPTx 0x80
  7409. #if (WINVER >= 0x030a)
  7410. /* new escape functions */
  7411. #define GETMAXLPT 8
  7412. #define GETMAXCOM 9
  7413. #define GETBASEIRQ 10
  7414. /* Comm Baud Rate indices */
  7415. #define CBR_110 0xFF10
  7416. #define CBR_300 0xFF11
  7417. #define CBR_600 0xFF12
  7418. #define CBR_1200 0xFF13
  7419. #define CBR_2400 0xFF14
  7420. #define CBR_4800 0xFF15
  7421. #define CBR_9600 0xFF16
  7422. #define CBR_14400 0xFF17
  7423. #define CBR_19200 0xFF18
  7424. #define CBR_38400 0xFF1B
  7425. #define CBR_56000 0xFF1F
  7426. #define CBR_128000 0xFF23
  7427. #define CBR_256000 0xFF27
  7428. /* notifications passed in low word of lParam on WM_COMMNOTIFY messages */
  7429. #define CN_RECEIVE 0x0001
  7430. #define CN_TRANSMIT 0x0002
  7431. #define CN_EVENT 0x0004
  7432. #endif /* WINVER >= 0x030a */
  7433. typedef struct tagDCB
  7434. {
  7435. BYTE Id;
  7436. UINT BaudRate;
  7437. BYTE ByteSize;
  7438. BYTE Parity;
  7439. BYTE StopBits;
  7440. UINT RlsTimeout;
  7441. UINT CtsTimeout;
  7442. UINT DsrTimeout;
  7443. UINT fBinary :1;
  7444. UINT fRtsDisable :1;
  7445. UINT fParity :1;
  7446. UINT fOutxCtsFlow :1;
  7447. UINT fOutxDsrFlow :1;
  7448. UINT fDummy :2;
  7449. UINT fDtrDisable :1;
  7450. UINT fOutX :1;
  7451. UINT fInX :1;
  7452. UINT fPeChar :1;
  7453. UINT fNull :1;
  7454. UINT fChEvt :1;
  7455. UINT fDtrflow :1;
  7456. UINT fRtsflow :1;
  7457. UINT fDummy2 :1;
  7458. char XonChar;
  7459. char XoffChar;
  7460. UINT XonLim;
  7461. UINT XoffLim;
  7462. char PeChar;
  7463. char EofChar;
  7464. char EvtChar;
  7465. UINT TxDelay;
  7466. } DCB;
  7467. typedef DCB FAR* LPDCB;
  7468. #if (defined(STRICT) | (WINVER >= 0x030a))
  7469. typedef struct tagCOMSTAT
  7470. {
  7471. BYTE status;
  7472. UINT cbInQue;
  7473. UINT cbOutQue;
  7474. } COMSTAT;
  7475. #define CSTF_CTSHOLD 0x01
  7476. #define CSTF_DSRHOLD 0x02
  7477. #define CSTF_RLSDHOLD 0x04
  7478. #define CSTF_XOFFHOLD 0x08
  7479. #define CSTF_XOFFSENT 0x10
  7480. #define CSTF_EOF 0x20
  7481. #define CSTF_TXIM 0x40
  7482. #else /* (STRICT | WINVER >= 0x030a) */
  7483. /* NOTE: This structure declaration is not ANSI compatible! */
  7484. typedef struct tagCOMSTAT
  7485. {
  7486. BYTE fCtsHold :1;
  7487. BYTE fDsrHold :1;
  7488. BYTE fRlsdHold :1;
  7489. BYTE fXoffHold :1;
  7490. BYTE fXoffSent :1;
  7491. BYTE fEof :1;
  7492. BYTE fTxim :1;
  7493. UINT cbInQue;
  7494. UINT cbOutQue;
  7495. } COMSTAT;
  7496. #endif /* !(STRICT | WINVER >= 0x030a */
  7497. int WINAPI BuildCommDCB(LPCSTR, DCB FAR*);
  7498. int WINAPI OpenComm(LPCSTR, UINT, UINT);
  7499. int WINAPI CloseComm(int);
  7500. int WINAPI ReadComm(int, void FAR*, int);
  7501. int WINAPI WriteComm(int, const void FAR*, int);
  7502. int WINAPI UngetCommChar(int, char);
  7503. int WINAPI FlushComm(int, int);
  7504. int WINAPI TransmitCommChar(int, char);
  7505. int WINAPI SetCommState(const DCB FAR*);
  7506. int WINAPI GetCommState(int, DCB FAR*);
  7507. int WINAPI GetCommError(int, COMSTAT FAR* );
  7508. int WINAPI SetCommBreak(int);
  7509. int WINAPI ClearCommBreak(int);
  7510. UINT FAR* WINAPI SetCommEventMask(int, UINT);
  7511. UINT WINAPI GetCommEventMask(int, int);
  7512. LONG WINAPI EscapeCommFunction(int, int);
  7513. #if (WINVER >= 0x030a)
  7514. BOOL WINAPI EnableCommNotification(int, HWND, int, int);
  7515. #endif /* WINVER >= 0x030a */
  7516. #endif /* NOCOMM */
  7517. /****** String formatting support *******************************************/
  7518. int WINAPI wvsprintf(LPSTR lpszOut, LPCSTR lpszFmt, const void FAR* lpParams);
  7519. int FAR CDECL wsprintf(LPSTR lpszOut, LPCSTR lpszFmt, ...);
  7520. /****** Driver support ******************************************************/
  7521. #if (WINVER >= 0x030a)
  7522. #ifndef NODRIVERS
  7523. DECLARE_HANDLE(HDRVR);
  7524. typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
  7525. /* Driver messages */
  7526. #define DRV_LOAD 0x0001
  7527. #define DRV_ENABLE 0x0002
  7528. #define DRV_OPEN 0x0003
  7529. #define DRV_CLOSE 0x0004
  7530. #define DRV_DISABLE 0x0005
  7531. #define DRV_FREE 0x0006
  7532. #define DRV_CONFIGURE 0x0007
  7533. #define DRV_QUERYCONFIGURE 0x0008
  7534. #define DRV_INSTALL 0x0009
  7535. #define DRV_REMOVE 0x000A
  7536. #define DRV_EXITSESSION 0x000B
  7537. #define DRV_EXITAPPLICATION 0x000C
  7538. #define DRV_POWER 0x000F
  7539. #define DRV_NOTIFYMSG 0x0010
  7540. /*#define DRV_QUERYENDSESSION 0x0010 */
  7541. /*#define DRV_EXITSESSIONCANCELLED 0x0011 */
  7542. #define DRV_RESERVED 0x0800
  7543. #define DRV_USER 0x4000
  7544. /* LPARAM of DRV_CONFIGURE message */
  7545. typedef struct tagDRVCONFIGINFO
  7546. {
  7547. DWORD dwDCISize;
  7548. LPCSTR lpszDCISectionName;
  7549. LPCSTR lpszDCIAliasName;
  7550. } DRVCONFIGINFO;
  7551. typedef DRVCONFIGINFO NEAR* PDRVCONFIGINFO;
  7552. typedef DRVCONFIGINFO FAR* LPDRVCONFIGINFO;
  7553. /* Supported return values for DRV_CONFIGURE message */
  7554. #define DRVCNF_CANCEL 0x0000
  7555. #define DRVCNF_OK 0x0001
  7556. #define DRVCNF_RESTART 0x0002
  7557. /* Supported lParam1 of DRV_EXITAPPLICATION notification */
  7558. #define DRVEA_NORMALEXIT 0x0001
  7559. #define DRVEA_ABNORMALEXIT 0x0002
  7560. LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID, UINT message, LPARAM lParam1, LPARAM lParam2);
  7561. HDRVR WINAPI OpenDriver(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
  7562. LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
  7563. LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
  7564. HINSTANCE WINAPI GetDriverModuleHandle(HDRVR hDriver);
  7565. HDRVR WINAPI GetNextDriver(HDRVR, DWORD);
  7566. /* GetNextDriver flags */
  7567. #define GND_FIRSTINSTANCEONLY 0x00000001
  7568. #define GND_FORWARD 0x00000000
  7569. #define GND_REVERSE 0x00000002
  7570. #define GND_VALID 0x00000003 /* ;Internal */
  7571. typedef struct tagDRIVERINFOSTRUCT
  7572. {
  7573. UINT length;
  7574. HDRVR hDriver;
  7575. HINSTANCE hModule;
  7576. char szAliasName[128];
  7577. } DRIVERINFOSTRUCT;
  7578. typedef DRIVERINFOSTRUCT FAR* LPDRIVERINFOSTRUCT;
  7579. BOOL WINAPI GetDriverInfo(HDRVR, DRIVERINFOSTRUCT FAR*);
  7580. #endif /* !NODRIVERS */
  7581. #endif /* WINVER >= 0x030a */
  7582. /****** Installable Message Thunk support ***********************************/
  7583. #if (WINVER > 0x030a)
  7584. #ifndef NOIMT
  7585. /* wReason codes */
  7586. #define IMT_REASON_ASYNC 0x00001
  7587. #define IMT_REASON_LS 0x00002
  7588. #define IMT_REASON_AFTER 0x00004
  7589. typedef struct tagIMTMSG
  7590. {
  7591. HWND hwnd;
  7592. UINT message;
  7593. DWORD wParam;
  7594. LPARAM lParam;
  7595. } IMTMSG, FAR* LPIMTMSG;
  7596. typedef struct tagIMTBUFFER
  7597. {
  7598. DWORD dwT1;
  7599. DWORD dwT2;
  7600. } IMTBUFFER, FAR* LPIMTBUFFER;
  7601. typedef BOOL (CALLBACK *IMTDISP)(WORD wReason, LPDWORD lpRetVal,
  7602. LPIMTMSG lpMsg, LPIMTBUFFER lpBuffer);
  7603. BOOL WINAPI InstallIMT(LPSTR lpszClassName, IMTDISP pfnDispatcher,
  7604. WORD msgLo, WORD msgHi);
  7605. BOOL WINAPI UnInstallIMT(LPSTR lpszClassName, IMTDISP pfnDispatcher,
  7606. WORD msgLo, WORD msgHi);
  7607. #endif /* !NOIMT */
  7608. #endif /* WINVER > 0x030a */
  7609. #endif /* NOUSER */
  7610. #if (WINVER >= 0x040A) // ;Internal 4.1
  7611. #define MWMO_WAITALL 0x0001 // ;Internal 4.1
  7612. #define MWMO_ALERTABLE 0x0002 // ;Internal 4.1
  7613. #endif /* WINVER >= 0x040A */ // ;Internal 4.1
  7614. DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwServiceType);
  7615. #define RSP_UNREGISTER_SERVICE 0x00000000
  7616. #define RSP_SIMPLE_SERVICE 0x00000001
  7617. VOID WINAPI RegisterNetworkCapabilities(DWORD dwBitsToSet, DWORD dwValues);
  7618. #define RNC_NETWORKS 0x00000001
  7619. // ;Internal
  7620. VOID API RegisterSystemThread(DWORD flags, DWORD reserved); // ;Internal
  7621. #define RST_DONTATTACHQUEUE 0x00000001 // ;Internal
  7622. #define RST_DONTJOURNALATTACH 0x00000002 // ;Internal
  7623. #define RST_ALWAYSFOREGROUNDABLE 0x00000004 // ;Internal
  7624. #define RST_FAULTTHREAD 0x00000008 // ;Internal
  7625. // ;Internal
  7626. DWORD API EndTask(HWND hwnd, DWORD idProcess, LPSTR lpszCaption, DWORD dwFlags); // ;Internal
  7627. // ;Internal
  7628. #define ET_ALLOWFORWAIT 0x00000001 // ;Internal
  7629. #define ET_TRYTOKILLNICELY 0x00000002 // ;Internal
  7630. #define ET_NOUI 0x00000004 // ;Internal
  7631. #define ET_NOWAIT 0x00000008 // ;Internal
  7632. // ;Internal
  7633. #define ET_VALID 0x0000000F // ;Internal
  7634. BOOL API IsValidLocale(DWORD Lcid, DWORD dwFlags); /* ;Internal */
  7635. #define LCID_INSTALLED 0x00000001 /* ;Internal */
  7636. /* ;Internal */
  7637. #ifndef NOWINDOWSX /* ;Internal */
  7638. #ifndef RC_INVOKED /* ;Internal */
  7639. #include <windowsx.h> /* ;Internal */
  7640. #ifndef STRICT /* ;Internal */
  7641. #undef SelectFont /* ;Internal */
  7642. #endif /* STRICT */ /* ;Internal */
  7643. #endif /* RC_INVOKED */ /* ;Internal */
  7644. #endif /* NOWINDOWSX */ /* ;Internal */
  7645. /* ;Internal */
  7646. #ifdef tagWND /* ;Internal */
  7647. #ifdef DEBUG /* ;Internal */
  7648. #undef HWND /* ;Internal */
  7649. #undef HWNDC /* ;Internal */
  7650. #undef HMENU /* ;Internal */
  7651. typedef struct tagWND BASED *HWND; /* ;Internal */
  7652. typedef HWND HWNDC; /* ;Internal */
  7653. typedef struct tagMENU FAR *HMENU; /* ;Internal */
  7654. #endif /* ;Internal */
  7655. #endif /* tagWND */ /* ;Internal */
  7656. #ifndef RC_INVOKED
  7657. #pragma pack() /* Revert to default packing */
  7658. #endif /* RC_INVOKED */
  7659. #ifdef __cplusplus
  7660. } /* End of extern "C" { */
  7661. #endif /* __cplusplus */
  7662. #endif /* _INC_WINDOWS */