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.

5243 lines
138 KiB

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