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.

11827 lines
265 KiB

  1. /****************************************************************************
  2. * *
  3. * winuser.h -- USER procedure declarations, constant definitions and macros *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. ****************************************************************************/
  8. #ifndef _WINUSER_
  9. #define _WINUSER_
  10. //
  11. // Define API decoration for direct importing of DLL references.
  12. //
  13. #if !defined(_USER32_)
  14. #define WINUSERAPI DECLSPEC_IMPORT
  15. #else
  16. #define WINUSERAPI
  17. #endif
  18. #ifdef _MAC
  19. #include <macwin32.h>
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif /* __cplusplus */
  24. #ifndef WINVER
  25. #define WINVER 0x0500 /* version 5.0 */
  26. #endif /* !WINVER */
  27. #include <stdarg.h>
  28. #ifndef NOUSER
  29. typedef HANDLE HDWP;
  30. typedef VOID MENUTEMPLATEA;
  31. typedef VOID MENUTEMPLATEW;
  32. #ifdef UNICODE
  33. typedef MENUTEMPLATEW MENUTEMPLATE;
  34. #else
  35. typedef MENUTEMPLATEA MENUTEMPLATE;
  36. #endif // UNICODE
  37. typedef PVOID LPMENUTEMPLATEA;
  38. typedef PVOID LPMENUTEMPLATEW;
  39. #ifdef UNICODE
  40. typedef LPMENUTEMPLATEW LPMENUTEMPLATE;
  41. #else
  42. typedef LPMENUTEMPLATEA LPMENUTEMPLATE;
  43. #endif // UNICODE
  44. typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
  45. #ifdef STRICT
  46. typedef INT_PTR (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
  47. typedef VOID (CALLBACK* TIMERPROC)(HWND, UINT, UINT_PTR, DWORD);
  48. typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
  49. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
  50. typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
  51. typedef VOID (CALLBACK* SENDASYNCPROC)(HWND, UINT, ULONG_PTR, LRESULT);
  52. typedef BOOL (CALLBACK* PROPENUMPROCA)(HWND, LPCSTR, HANDLE);
  53. typedef BOOL (CALLBACK* PROPENUMPROCW)(HWND, LPCWSTR, HANDLE);
  54. typedef BOOL (CALLBACK* PROPENUMPROCEXA)(HWND, LPSTR, HANDLE, ULONG_PTR);
  55. typedef BOOL (CALLBACK* PROPENUMPROCEXW)(HWND, LPWSTR, HANDLE, ULONG_PTR);
  56. typedef int (CALLBACK* EDITWORDBREAKPROCA)(LPSTR lpch, int ichCurrent, int cch, int code);
  57. typedef int (CALLBACK* EDITWORDBREAKPROCW)(LPWSTR lpch, int ichCurrent, int cch, int code);
  58. #if(WINVER >= 0x0400)
  59. typedef BOOL (CALLBACK* DRAWSTATEPROC)(HDC hdc, LPARAM lData, WPARAM wData, int cx, int cy);
  60. #endif /* WINVER >= 0x0400 */
  61. #else /* !STRICT */
  62. typedef FARPROC DLGPROC;
  63. typedef FARPROC TIMERPROC;
  64. typedef FARPROC GRAYSTRINGPROC;
  65. typedef FARPROC WNDENUMPROC;
  66. typedef FARPROC HOOKPROC;
  67. typedef FARPROC SENDASYNCPROC;
  68. typedef FARPROC EDITWORDBREAKPROCA;
  69. typedef FARPROC EDITWORDBREAKPROCW;
  70. typedef FARPROC PROPENUMPROCA;
  71. typedef FARPROC PROPENUMPROCW;
  72. typedef FARPROC PROPENUMPROCEXA;
  73. typedef FARPROC PROPENUMPROCEXW;
  74. #if(WINVER >= 0x0400)
  75. typedef FARPROC DRAWSTATEPROC;
  76. #endif /* WINVER >= 0x0400 */
  77. #endif /* !STRICT */
  78. #ifdef UNICODE
  79. typedef PROPENUMPROCW PROPENUMPROC;
  80. typedef PROPENUMPROCEXW PROPENUMPROCEX;
  81. typedef EDITWORDBREAKPROCW EDITWORDBREAKPROC;
  82. #else /* !UNICODE */
  83. typedef PROPENUMPROCA PROPENUMPROC;
  84. typedef PROPENUMPROCEXA PROPENUMPROCEX;
  85. typedef EDITWORDBREAKPROCA EDITWORDBREAKPROC;
  86. #endif /* UNICODE */
  87. #ifdef STRICT
  88. typedef BOOL (CALLBACK* NAMEENUMPROCA)(LPSTR, LPARAM);
  89. typedef BOOL (CALLBACK* NAMEENUMPROCW)(LPWSTR, LPARAM);
  90. typedef NAMEENUMPROCA WINSTAENUMPROCA;
  91. typedef NAMEENUMPROCA DESKTOPENUMPROCA;
  92. typedef NAMEENUMPROCW WINSTAENUMPROCW;
  93. typedef NAMEENUMPROCW DESKTOPENUMPROCW;
  94. #else /* !STRICT */
  95. typedef FARPROC NAMEENUMPROCA;
  96. typedef FARPROC NAMEENUMPROCW;
  97. typedef FARPROC WINSTAENUMPROCA;
  98. typedef FARPROC DESKTOPENUMPROCA;
  99. typedef FARPROC WINSTAENUMPROCW;
  100. typedef FARPROC DESKTOPENUMPROCW;
  101. #endif /* !STRICT */
  102. #ifdef UNICODE
  103. typedef WINSTAENUMPROCW WINSTAENUMPROC;
  104. typedef DESKTOPENUMPROCW DESKTOPENUMPROC;
  105. #else /* !UNICODE */
  106. typedef WINSTAENUMPROCA WINSTAENUMPROC;
  107. typedef DESKTOPENUMPROCA DESKTOPENUMPROC;
  108. #endif /* UNICODE */
  109. #define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0)
  110. #define MAKEINTRESOURCEA(i) (LPSTR)((ULONG_PTR)((WORD)(i)))
  111. #define MAKEINTRESOURCEW(i) (LPWSTR)((ULONG_PTR)((WORD)(i)))
  112. #ifdef UNICODE
  113. #define MAKEINTRESOURCE MAKEINTRESOURCEW
  114. #else
  115. #define MAKEINTRESOURCE MAKEINTRESOURCEA
  116. #endif // !UNICODE
  117. #ifndef NORESOURCE
  118. /*
  119. * Predefined Resource Types
  120. */
  121. #define RT_CURSOR MAKEINTRESOURCE(1)
  122. #define RT_BITMAP MAKEINTRESOURCE(2)
  123. #define RT_ICON MAKEINTRESOURCE(3)
  124. #define RT_MENU MAKEINTRESOURCE(4)
  125. #define RT_DIALOG MAKEINTRESOURCE(5)
  126. #define RT_STRING MAKEINTRESOURCE(6)
  127. #define RT_FONTDIR MAKEINTRESOURCE(7)
  128. #define RT_FONT MAKEINTRESOURCE(8)
  129. #define RT_ACCELERATOR MAKEINTRESOURCE(9)
  130. #define RT_RCDATA MAKEINTRESOURCE(10)
  131. #define RT_MESSAGETABLE MAKEINTRESOURCE(11)
  132. #define DIFFERENCE 11
  133. #define RT_GROUP_CURSOR MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR + DIFFERENCE)
  134. #define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)RT_ICON + DIFFERENCE)
  135. #define RT_VERSION MAKEINTRESOURCE(16)
  136. #define RT_DLGINCLUDE MAKEINTRESOURCE(17)
  137. #if(WINVER >= 0x0400)
  138. #define RT_PLUGPLAY MAKEINTRESOURCE(19)
  139. #define RT_VXD MAKEINTRESOURCE(20)
  140. #define RT_ANICURSOR MAKEINTRESOURCE(21)
  141. #define RT_ANIICON MAKEINTRESOURCE(22)
  142. #endif /* WINVER >= 0x0400 */
  143. #define RT_HTML MAKEINTRESOURCE(23)
  144. #ifdef RC_INVOKED
  145. #define RT_MANIFEST 24
  146. #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
  147. #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
  148. #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
  149. #define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID 1 /* inclusive */
  150. #define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID 16 /* inclusive */
  151. #else /* RC_INVOKED */
  152. #define RT_MANIFEST MAKEINTRESOURCE(24)
  153. #define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1)
  154. #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)
  155. #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)
  156. #define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1 /*inclusive*/)
  157. #define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16 /*inclusive*/)
  158. #endif /* RC_INVOKED */
  159. #endif /* !NORESOURCE */
  160. WINUSERAPI
  161. int
  162. WINAPI
  163. wvsprintfA(
  164. OUT LPSTR,
  165. IN LPCSTR,
  166. IN va_list arglist);
  167. WINUSERAPI
  168. int
  169. WINAPI
  170. wvsprintfW(
  171. OUT LPWSTR,
  172. IN LPCWSTR,
  173. IN va_list arglist);
  174. #ifdef UNICODE
  175. #define wvsprintf wvsprintfW
  176. #else
  177. #define wvsprintf wvsprintfA
  178. #endif // !UNICODE
  179. WINUSERAPI
  180. int
  181. WINAPIV
  182. wsprintfA(
  183. OUT LPSTR,
  184. IN LPCSTR,
  185. ...);
  186. WINUSERAPI
  187. int
  188. WINAPIV
  189. wsprintfW(
  190. OUT LPWSTR,
  191. IN LPCWSTR,
  192. ...);
  193. #ifdef UNICODE
  194. #define wsprintf wsprintfW
  195. #else
  196. #define wsprintf wsprintfA
  197. #endif // !UNICODE
  198. /*
  199. * SPI_SETDESKWALLPAPER defined constants
  200. */
  201. #define SETWALLPAPER_DEFAULT ((LPWSTR)-1)
  202. #ifndef NOSCROLL
  203. /*
  204. * Scroll Bar Constants
  205. */
  206. #define SB_HORZ 0
  207. #define SB_VERT 1
  208. #define SB_CTL 2
  209. #define SB_BOTH 3
  210. /*
  211. * Scroll Bar Commands
  212. */
  213. #define SB_LINEUP 0
  214. #define SB_LINELEFT 0
  215. #define SB_LINEDOWN 1
  216. #define SB_LINERIGHT 1
  217. #define SB_PAGEUP 2
  218. #define SB_PAGELEFT 2
  219. #define SB_PAGEDOWN 3
  220. #define SB_PAGERIGHT 3
  221. #define SB_THUMBPOSITION 4
  222. #define SB_THUMBTRACK 5
  223. #define SB_TOP 6
  224. #define SB_LEFT 6
  225. #define SB_BOTTOM 7
  226. #define SB_RIGHT 7
  227. #define SB_ENDSCROLL 8
  228. #endif /* !NOSCROLL */
  229. #ifndef NOSHOWWINDOW
  230. /*
  231. * ShowWindow() Commands
  232. */
  233. #define SW_HIDE 0
  234. #define SW_SHOWNORMAL 1
  235. #define SW_NORMAL 1
  236. #define SW_SHOWMINIMIZED 2
  237. #define SW_SHOWMAXIMIZED 3
  238. #define SW_MAXIMIZE 3
  239. #define SW_SHOWNOACTIVATE 4
  240. #define SW_SHOW 5
  241. #define SW_MINIMIZE 6
  242. #define SW_SHOWMINNOACTIVE 7
  243. #define SW_SHOWNA 8
  244. #define SW_RESTORE 9
  245. #define SW_SHOWDEFAULT 10
  246. #define SW_FORCEMINIMIZE 11
  247. #define SW_MAX 11
  248. /*
  249. * Old ShowWindow() Commands
  250. */
  251. #define HIDE_WINDOW 0
  252. #define SHOW_OPENWINDOW 1
  253. #define SHOW_ICONWINDOW 2
  254. #define SHOW_FULLSCREEN 3
  255. #define SHOW_OPENNOACTIVATE 4
  256. /*
  257. * Identifiers for the WM_SHOWWINDOW message
  258. */
  259. #define SW_PARENTCLOSING 1
  260. #define SW_OTHERZOOM 2
  261. #define SW_PARENTOPENING 3
  262. #define SW_OTHERUNZOOM 4
  263. #endif /* !NOSHOWWINDOW */
  264. #if(WINVER >= 0x0500)
  265. /*
  266. * AnimateWindow() Commands
  267. */
  268. #define AW_HOR_POSITIVE 0x00000001
  269. #define AW_HOR_NEGATIVE 0x00000002
  270. #define AW_VER_POSITIVE 0x00000004
  271. #define AW_VER_NEGATIVE 0x00000008
  272. #define AW_CENTER 0x00000010
  273. #define AW_HIDE 0x00010000
  274. #define AW_ACTIVATE 0x00020000
  275. #define AW_SLIDE 0x00040000
  276. #define AW_BLEND 0x00080000
  277. #endif /* WINVER >= 0x0500 */
  278. /*
  279. * WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags
  280. */
  281. #define KF_EXTENDED 0x0100
  282. #define KF_DLGMODE 0x0800
  283. #define KF_MENUMODE 0x1000
  284. #define KF_ALTDOWN 0x2000
  285. #define KF_REPEAT 0x4000
  286. #define KF_UP 0x8000
  287. #ifndef NOVIRTUALKEYCODES
  288. /*
  289. * Virtual Keys, Standard Set
  290. */
  291. #define VK_LBUTTON 0x01
  292. #define VK_RBUTTON 0x02
  293. #define VK_CANCEL 0x03
  294. #define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */
  295. #if(_WIN32_WINNT >= 0x0500)
  296. #define VK_XBUTTON1 0x05 /* NOT contiguous with L & RBUTTON */
  297. #define VK_XBUTTON2 0x06 /* NOT contiguous with L & RBUTTON */
  298. #endif /* _WIN32_WINNT >= 0x0500 */
  299. /*
  300. * 0x07 : unassigned
  301. */
  302. #define VK_BACK 0x08
  303. #define VK_TAB 0x09
  304. /*
  305. * 0x0A - 0x0B : reserved
  306. */
  307. #define VK_CLEAR 0x0C
  308. #define VK_RETURN 0x0D
  309. #define VK_SHIFT 0x10
  310. #define VK_CONTROL 0x11
  311. #define VK_MENU 0x12
  312. #define VK_PAUSE 0x13
  313. #define VK_CAPITAL 0x14
  314. #define VK_KANA 0x15
  315. #define VK_HANGEUL 0x15 /* old name - should be here for compatibility */
  316. #define VK_HANGUL 0x15
  317. #define VK_JUNJA 0x17
  318. #define VK_FINAL 0x18
  319. #define VK_HANJA 0x19
  320. #define VK_KANJI 0x19
  321. #define VK_ESCAPE 0x1B
  322. #define VK_CONVERT 0x1C
  323. #define VK_NONCONVERT 0x1D
  324. #define VK_ACCEPT 0x1E
  325. #define VK_MODECHANGE 0x1F
  326. #define VK_SPACE 0x20
  327. #define VK_PRIOR 0x21
  328. #define VK_NEXT 0x22
  329. #define VK_END 0x23
  330. #define VK_HOME 0x24
  331. #define VK_LEFT 0x25
  332. #define VK_UP 0x26
  333. #define VK_RIGHT 0x27
  334. #define VK_DOWN 0x28
  335. #define VK_SELECT 0x29
  336. #define VK_PRINT 0x2A
  337. #define VK_EXECUTE 0x2B
  338. #define VK_SNAPSHOT 0x2C
  339. #define VK_INSERT 0x2D
  340. #define VK_DELETE 0x2E
  341. #define VK_HELP 0x2F
  342. /*
  343. * VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
  344. * 0x40 : unassigned
  345. * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
  346. */
  347. #define VK_LWIN 0x5B
  348. #define VK_RWIN 0x5C
  349. #define VK_APPS 0x5D
  350. /*
  351. * 0x5E : reserved
  352. */
  353. #define VK_SLEEP 0x5F
  354. #define VK_NUMPAD0 0x60
  355. #define VK_NUMPAD1 0x61
  356. #define VK_NUMPAD2 0x62
  357. #define VK_NUMPAD3 0x63
  358. #define VK_NUMPAD4 0x64
  359. #define VK_NUMPAD5 0x65
  360. #define VK_NUMPAD6 0x66
  361. #define VK_NUMPAD7 0x67
  362. #define VK_NUMPAD8 0x68
  363. #define VK_NUMPAD9 0x69
  364. #define VK_MULTIPLY 0x6A
  365. #define VK_ADD 0x6B
  366. #define VK_SEPARATOR 0x6C
  367. #define VK_SUBTRACT 0x6D
  368. #define VK_DECIMAL 0x6E
  369. #define VK_DIVIDE 0x6F
  370. #define VK_F1 0x70
  371. #define VK_F2 0x71
  372. #define VK_F3 0x72
  373. #define VK_F4 0x73
  374. #define VK_F5 0x74
  375. #define VK_F6 0x75
  376. #define VK_F7 0x76
  377. #define VK_F8 0x77
  378. #define VK_F9 0x78
  379. #define VK_F10 0x79
  380. #define VK_F11 0x7A
  381. #define VK_F12 0x7B
  382. #define VK_F13 0x7C
  383. #define VK_F14 0x7D
  384. #define VK_F15 0x7E
  385. #define VK_F16 0x7F
  386. #define VK_F17 0x80
  387. #define VK_F18 0x81
  388. #define VK_F19 0x82
  389. #define VK_F20 0x83
  390. #define VK_F21 0x84
  391. #define VK_F22 0x85
  392. #define VK_F23 0x86
  393. #define VK_F24 0x87
  394. /*
  395. * 0x88 - 0x8F : unassigned
  396. */
  397. #define VK_NUMLOCK 0x90
  398. #define VK_SCROLL 0x91
  399. /*
  400. * NEC PC-9800 kbd definitions
  401. */
  402. #define VK_OEM_NEC_EQUAL 0x92 // '=' key on numpad
  403. /*
  404. * Fujitsu/OASYS kbd definitions
  405. */
  406. #define VK_OEM_FJ_JISHO 0x92 // 'Dictionary' key
  407. #define VK_OEM_FJ_MASSHOU 0x93 // 'Unregister word' key
  408. #define VK_OEM_FJ_TOUROKU 0x94 // 'Register word' key
  409. #define VK_OEM_FJ_LOYA 0x95 // 'Left OYAYUBI' key
  410. #define VK_OEM_FJ_ROYA 0x96 // 'Right OYAYUBI' key
  411. /*
  412. * 0x97 - 0x9F : unassigned
  413. */
  414. /*
  415. * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
  416. * Used only as parameters to GetAsyncKeyState() and GetKeyState().
  417. * No other API or message will distinguish left and right keys in this way.
  418. */
  419. #define VK_LSHIFT 0xA0
  420. #define VK_RSHIFT 0xA1
  421. #define VK_LCONTROL 0xA2
  422. #define VK_RCONTROL 0xA3
  423. #define VK_LMENU 0xA4
  424. #define VK_RMENU 0xA5
  425. #if(_WIN32_WINNT >= 0x0500)
  426. #define VK_BROWSER_BACK 0xA6
  427. #define VK_BROWSER_FORWARD 0xA7
  428. #define VK_BROWSER_REFRESH 0xA8
  429. #define VK_BROWSER_STOP 0xA9
  430. #define VK_BROWSER_SEARCH 0xAA
  431. #define VK_BROWSER_FAVORITES 0xAB
  432. #define VK_BROWSER_HOME 0xAC
  433. #define VK_VOLUME_MUTE 0xAD
  434. #define VK_VOLUME_DOWN 0xAE
  435. #define VK_VOLUME_UP 0xAF
  436. #define VK_MEDIA_NEXT_TRACK 0xB0
  437. #define VK_MEDIA_PREV_TRACK 0xB1
  438. #define VK_MEDIA_STOP 0xB2
  439. #define VK_MEDIA_PLAY_PAUSE 0xB3
  440. #define VK_LAUNCH_MAIL 0xB4
  441. #define VK_LAUNCH_MEDIA_SELECT 0xB5
  442. #define VK_LAUNCH_APP1 0xB6
  443. #define VK_LAUNCH_APP2 0xB7
  444. #endif /* _WIN32_WINNT >= 0x0500 */
  445. /*
  446. * 0xB8 - 0xB9 : reserved
  447. */
  448. #define VK_OEM_1 0xBA // ';:' for US
  449. #define VK_OEM_PLUS 0xBB // '+' any country
  450. #define VK_OEM_COMMA 0xBC // ',' any country
  451. #define VK_OEM_MINUS 0xBD // '-' any country
  452. #define VK_OEM_PERIOD 0xBE // '.' any country
  453. #define VK_OEM_2 0xBF // '/?' for US
  454. #define VK_OEM_3 0xC0 // '`~' for US
  455. /*
  456. * 0xC1 - 0xD7 : reserved
  457. */
  458. /*
  459. * 0xD8 - 0xDA : unassigned
  460. */
  461. #define VK_OEM_4 0xDB // '[{' for US
  462. #define VK_OEM_5 0xDC // '\|' for US
  463. #define VK_OEM_6 0xDD // ']}' for US
  464. #define VK_OEM_7 0xDE // ''"' for US
  465. #define VK_OEM_8 0xDF
  466. /*
  467. * 0xE0 : reserved
  468. */
  469. /*
  470. * Various extended or enhanced keyboards
  471. */
  472. #define VK_OEM_AX 0xE1 // 'AX' key on Japanese AX kbd
  473. #define VK_OEM_102 0xE2 // "<>" or "\|" on RT 102-key kbd.
  474. #define VK_ICO_HELP 0xE3 // Help key on ICO
  475. #define VK_ICO_00 0xE4 // 00 key on ICO
  476. #if(WINVER >= 0x0400)
  477. #define VK_PROCESSKEY 0xE5
  478. #endif /* WINVER >= 0x0400 */
  479. #define VK_ICO_CLEAR 0xE6
  480. #if(_WIN32_WINNT >= 0x0500)
  481. #define VK_PACKET 0xE7
  482. #endif /* _WIN32_WINNT >= 0x0500 */
  483. /*
  484. * 0xE8 : unassigned
  485. */
  486. /*
  487. * Nokia/Ericsson definitions
  488. */
  489. #define VK_OEM_RESET 0xE9
  490. #define VK_OEM_JUMP 0xEA
  491. #define VK_OEM_PA1 0xEB
  492. #define VK_OEM_PA2 0xEC
  493. #define VK_OEM_PA3 0xED
  494. #define VK_OEM_WSCTRL 0xEE
  495. #define VK_OEM_CUSEL 0xEF
  496. #define VK_OEM_ATTN 0xF0
  497. #define VK_OEM_FINISH 0xF1
  498. #define VK_OEM_COPY 0xF2
  499. #define VK_OEM_AUTO 0xF3
  500. #define VK_OEM_ENLW 0xF4
  501. #define VK_OEM_BACKTAB 0xF5
  502. #define VK_ATTN 0xF6
  503. #define VK_CRSEL 0xF7
  504. #define VK_EXSEL 0xF8
  505. #define VK_EREOF 0xF9
  506. #define VK_PLAY 0xFA
  507. #define VK_ZOOM 0xFB
  508. #define VK_NONAME 0xFC
  509. #define VK_PA1 0xFD
  510. #define VK_OEM_CLEAR 0xFE
  511. /*
  512. * 0xFF : reserved
  513. */
  514. #endif /* !NOVIRTUALKEYCODES */
  515. #ifndef NOWH
  516. /*
  517. * SetWindowsHook() codes
  518. */
  519. #define WH_MIN (-1)
  520. #define WH_MSGFILTER (-1)
  521. #define WH_JOURNALRECORD 0
  522. #define WH_JOURNALPLAYBACK 1
  523. #define WH_KEYBOARD 2
  524. #define WH_GETMESSAGE 3
  525. #define WH_CALLWNDPROC 4
  526. #define WH_CBT 5
  527. #define WH_SYSMSGFILTER 6
  528. #define WH_MOUSE 7
  529. #if defined(_WIN32_WINDOWS)
  530. #define WH_HARDWARE 8
  531. #endif
  532. #define WH_DEBUG 9
  533. #define WH_SHELL 10
  534. #define WH_FOREGROUNDIDLE 11
  535. #if(WINVER >= 0x0400)
  536. #define WH_CALLWNDPROCRET 12
  537. #endif /* WINVER >= 0x0400 */
  538. #if (_WIN32_WINNT >= 0x0400)
  539. #define WH_KEYBOARD_LL 13
  540. #define WH_MOUSE_LL 14
  541. #endif // (_WIN32_WINNT >= 0x0400)
  542. #if(WINVER >= 0x0400)
  543. #if (_WIN32_WINNT >= 0x0400)
  544. #define WH_MAX 14
  545. #else
  546. #define WH_MAX 12
  547. #endif // (_WIN32_WINNT >= 0x0400)
  548. #else
  549. #define WH_MAX 11
  550. #endif
  551. #define WH_MINHOOK WH_MIN
  552. #define WH_MAXHOOK WH_MAX
  553. /*
  554. * Hook Codes
  555. */
  556. #define HC_ACTION 0
  557. #define HC_GETNEXT 1
  558. #define HC_SKIP 2
  559. #define HC_NOREMOVE 3
  560. #define HC_NOREM HC_NOREMOVE
  561. #define HC_SYSMODALON 4
  562. #define HC_SYSMODALOFF 5
  563. /*
  564. * CBT Hook Codes
  565. */
  566. #define HCBT_MOVESIZE 0
  567. #define HCBT_MINMAX 1
  568. #define HCBT_QS 2
  569. #define HCBT_CREATEWND 3
  570. #define HCBT_DESTROYWND 4
  571. #define HCBT_ACTIVATE 5
  572. #define HCBT_CLICKSKIPPED 6
  573. #define HCBT_KEYSKIPPED 7
  574. #define HCBT_SYSCOMMAND 8
  575. #define HCBT_SETFOCUS 9
  576. /*
  577. * HCBT_CREATEWND parameters pointed to by lParam
  578. */
  579. typedef struct tagCBT_CREATEWNDA
  580. {
  581. struct tagCREATESTRUCTA *lpcs;
  582. HWND hwndInsertAfter;
  583. } CBT_CREATEWNDA, *LPCBT_CREATEWNDA;
  584. /*
  585. * HCBT_CREATEWND parameters pointed to by lParam
  586. */
  587. typedef struct tagCBT_CREATEWNDW
  588. {
  589. struct tagCREATESTRUCTW *lpcs;
  590. HWND hwndInsertAfter;
  591. } CBT_CREATEWNDW, *LPCBT_CREATEWNDW;
  592. #ifdef UNICODE
  593. typedef CBT_CREATEWNDW CBT_CREATEWND;
  594. typedef LPCBT_CREATEWNDW LPCBT_CREATEWND;
  595. #else
  596. typedef CBT_CREATEWNDA CBT_CREATEWND;
  597. typedef LPCBT_CREATEWNDA LPCBT_CREATEWND;
  598. #endif // UNICODE
  599. /*
  600. * HCBT_ACTIVATE structure pointed to by lParam
  601. */
  602. typedef struct tagCBTACTIVATESTRUCT
  603. {
  604. BOOL fMouse;
  605. HWND hWndActive;
  606. } CBTACTIVATESTRUCT, *LPCBTACTIVATESTRUCT;
  607. #if(_WIN32_WINNT >= 0x0501)
  608. /*
  609. * WTSSESSION_NOTIFICATION struct pointed by lParam, for WM_WTSSESSION_CHANGE
  610. */
  611. typedef struct tagWTSSESSION_NOTIFICATION
  612. {
  613. DWORD cbSize;
  614. DWORD dwSessionId;
  615. } WTSSESSION_NOTIFICATION, *PWTSSESSION_NOTIFICATION;
  616. /*
  617. * codes passed in WPARAM for WM_WTSSESSION_CHANGE
  618. */
  619. #define WTS_CONSOLE_CONNECT 0x1
  620. #define WTS_CONSOLE_DISCONNECT 0x2
  621. #define WTS_REMOTE_CONNECT 0x3
  622. #define WTS_REMOTE_DISCONNECT 0x4
  623. #define WTS_SESSION_LOGON 0x5
  624. #define WTS_SESSION_LOGOFF 0x6
  625. #define WTS_SESSION_LOCK 0x7
  626. #define WTS_SESSION_UNLOCK 0x8
  627. #endif /* _WIN32_WINNT >= 0x0501 */
  628. /*
  629. * WH_MSGFILTER Filter Proc Codes
  630. */
  631. #define MSGF_DIALOGBOX 0
  632. #define MSGF_MESSAGEBOX 1
  633. #define MSGF_MENU 2
  634. #define MSGF_SCROLLBAR 5
  635. #define MSGF_NEXTWINDOW 6
  636. #define MSGF_MAX 8 // unused
  637. #define MSGF_USER 4096
  638. /*
  639. * Shell support
  640. */
  641. #define HSHELL_WINDOWCREATED 1
  642. #define HSHELL_WINDOWDESTROYED 2
  643. #define HSHELL_ACTIVATESHELLWINDOW 3
  644. #if(WINVER >= 0x0400)
  645. #define HSHELL_WINDOWACTIVATED 4
  646. #define HSHELL_GETMINRECT 5
  647. #define HSHELL_REDRAW 6
  648. #define HSHELL_TASKMAN 7
  649. #define HSHELL_LANGUAGE 8
  650. #define HSHELL_SYSMENU 9
  651. #define HSHELL_ENDTASK 10
  652. #endif /* WINVER >= 0x0400 */
  653. #if(_WIN32_WINNT >= 0x0500)
  654. #define HSHELL_ACCESSIBILITYSTATE 11
  655. #define HSHELL_APPCOMMAND 12
  656. #endif /* _WIN32_WINNT >= 0x0500 */
  657. #if(_WIN32_WINNT >= 0x0501)
  658. #define HSHELL_WINDOWREPLACED 13
  659. #define HSHELL_WINDOWREPLACING 14
  660. #endif /* _WIN32_WINNT >= 0x0501 */
  661. #define HSHELL_HIGHBIT 0x8000
  662. #define HSHELL_FLASH (HSHELL_REDRAW|HSHELL_HIGHBIT)
  663. #define HSHELL_RUDEAPPACTIVATED (HSHELL_WINDOWACTIVATED|HSHELL_HIGHBIT)
  664. #if(_WIN32_WINNT >= 0x0500)
  665. /* wparam for HSHELL_ACCESSIBILITYSTATE */
  666. #define ACCESS_STICKYKEYS 0x0001
  667. #define ACCESS_FILTERKEYS 0x0002
  668. #define ACCESS_MOUSEKEYS 0x0003
  669. /* cmd for HSHELL_APPCOMMAND and WM_APPCOMMAND */
  670. #define APPCOMMAND_BROWSER_BACKWARD 1
  671. #define APPCOMMAND_BROWSER_FORWARD 2
  672. #define APPCOMMAND_BROWSER_REFRESH 3
  673. #define APPCOMMAND_BROWSER_STOP 4
  674. #define APPCOMMAND_BROWSER_SEARCH 5
  675. #define APPCOMMAND_BROWSER_FAVORITES 6
  676. #define APPCOMMAND_BROWSER_HOME 7
  677. #define APPCOMMAND_VOLUME_MUTE 8
  678. #define APPCOMMAND_VOLUME_DOWN 9
  679. #define APPCOMMAND_VOLUME_UP 10
  680. #define APPCOMMAND_MEDIA_NEXTTRACK 11
  681. #define APPCOMMAND_MEDIA_PREVIOUSTRACK 12
  682. #define APPCOMMAND_MEDIA_STOP 13
  683. #define APPCOMMAND_MEDIA_PLAY_PAUSE 14
  684. #define APPCOMMAND_LAUNCH_MAIL 15
  685. #define APPCOMMAND_LAUNCH_MEDIA_SELECT 16
  686. #define APPCOMMAND_LAUNCH_APP1 17
  687. #define APPCOMMAND_LAUNCH_APP2 18
  688. #define APPCOMMAND_BASS_DOWN 19
  689. #define APPCOMMAND_BASS_BOOST 20
  690. #define APPCOMMAND_BASS_UP 21
  691. #define APPCOMMAND_TREBLE_DOWN 22
  692. #define APPCOMMAND_TREBLE_UP 23
  693. #if(_WIN32_WINNT >= 0x0501)
  694. #define APPCOMMAND_MICROPHONE_VOLUME_MUTE 24
  695. #define APPCOMMAND_MICROPHONE_VOLUME_DOWN 25
  696. #define APPCOMMAND_MICROPHONE_VOLUME_UP 26
  697. #define APPCOMMAND_HELP 27
  698. #define APPCOMMAND_FIND 28
  699. #define APPCOMMAND_NEW 29
  700. #define APPCOMMAND_OPEN 30
  701. #define APPCOMMAND_CLOSE 31
  702. #define APPCOMMAND_SAVE 32
  703. #define APPCOMMAND_PRINT 33
  704. #define APPCOMMAND_UNDO 34
  705. #define APPCOMMAND_REDO 35
  706. #define APPCOMMAND_COPY 36
  707. #define APPCOMMAND_CUT 37
  708. #define APPCOMMAND_PASTE 38
  709. #define APPCOMMAND_REPLY_TO_MAIL 39
  710. #define APPCOMMAND_FORWARD_MAIL 40
  711. #define APPCOMMAND_SEND_MAIL 41
  712. #define APPCOMMAND_SPELL_CHECK 42
  713. #define APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE 43
  714. #define APPCOMMAND_MIC_ON_OFF_TOGGLE 44
  715. #define APPCOMMAND_CORRECTION_LIST 45
  716. #define APPCOMMAND_MEDIA_PLAY 46
  717. #define APPCOMMAND_MEDIA_PAUSE 47
  718. #define APPCOMMAND_MEDIA_RECORD 48
  719. #define APPCOMMAND_MEDIA_FAST_FORWARD 49
  720. #define APPCOMMAND_MEDIA_REWIND 50
  721. #define APPCOMMAND_MEDIA_CHANNEL_UP 51
  722. #define APPCOMMAND_MEDIA_CHANNEL_DOWN 52
  723. #endif /* _WIN32_WINNT >= 0x0501 */
  724. #define FAPPCOMMAND_MOUSE 0x8000
  725. #define FAPPCOMMAND_KEY 0
  726. #define FAPPCOMMAND_OEM 0x1000
  727. #define FAPPCOMMAND_MASK 0xF000
  728. #define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
  729. #define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
  730. #define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
  731. #define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
  732. #define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
  733. #endif /* _WIN32_WINNT >= 0x0500 */
  734. typedef struct
  735. {
  736. HWND hwnd;
  737. RECT rc;
  738. } SHELLHOOKINFO, *LPSHELLHOOKINFO;
  739. /*
  740. * Message Structure used in Journaling
  741. */
  742. typedef struct tagEVENTMSG {
  743. UINT message;
  744. UINT paramL;
  745. UINT paramH;
  746. DWORD time;
  747. HWND hwnd;
  748. } EVENTMSG, *PEVENTMSGMSG, NEAR *NPEVENTMSGMSG, FAR *LPEVENTMSGMSG;
  749. typedef struct tagEVENTMSG *PEVENTMSG, NEAR *NPEVENTMSG, FAR *LPEVENTMSG;
  750. /*
  751. * Message structure used by WH_CALLWNDPROC
  752. */
  753. typedef struct tagCWPSTRUCT {
  754. LPARAM lParam;
  755. WPARAM wParam;
  756. UINT message;
  757. HWND hwnd;
  758. } CWPSTRUCT, *PCWPSTRUCT, NEAR *NPCWPSTRUCT, FAR *LPCWPSTRUCT;
  759. #if(WINVER >= 0x0400)
  760. /*
  761. * Message structure used by WH_CALLWNDPROCRET
  762. */
  763. typedef struct tagCWPRETSTRUCT {
  764. LRESULT lResult;
  765. LPARAM lParam;
  766. WPARAM wParam;
  767. UINT message;
  768. HWND hwnd;
  769. } CWPRETSTRUCT, *PCWPRETSTRUCT, NEAR *NPCWPRETSTRUCT, FAR *LPCWPRETSTRUCT;
  770. #endif /* WINVER >= 0x0400 */
  771. #if (_WIN32_WINNT >= 0x0400)
  772. /*
  773. * Low level hook flags
  774. */
  775. #define LLKHF_EXTENDED (KF_EXTENDED >> 8)
  776. #define LLKHF_INJECTED 0x00000010
  777. #define LLKHF_ALTDOWN (KF_ALTDOWN >> 8)
  778. #define LLKHF_UP (KF_UP >> 8)
  779. #define LLMHF_INJECTED 0x00000001
  780. /*
  781. * Structure used by WH_KEYBOARD_LL
  782. */
  783. typedef struct tagKBDLLHOOKSTRUCT {
  784. DWORD vkCode;
  785. DWORD scanCode;
  786. DWORD flags;
  787. DWORD time;
  788. ULONG_PTR dwExtraInfo;
  789. } KBDLLHOOKSTRUCT, FAR *LPKBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;
  790. /*
  791. * Structure used by WH_MOUSE_LL
  792. */
  793. typedef struct tagMSLLHOOKSTRUCT {
  794. POINT pt;
  795. DWORD mouseData;
  796. DWORD flags;
  797. DWORD time;
  798. ULONG_PTR dwExtraInfo;
  799. } MSLLHOOKSTRUCT, FAR *LPMSLLHOOKSTRUCT, *PMSLLHOOKSTRUCT;
  800. #endif // (_WIN32_WINNT >= 0x0400)
  801. /*
  802. * Structure used by WH_DEBUG
  803. */
  804. typedef struct tagDEBUGHOOKINFO
  805. {
  806. DWORD idThread;
  807. DWORD idThreadInstaller;
  808. LPARAM lParam;
  809. WPARAM wParam;
  810. int code;
  811. } DEBUGHOOKINFO, *PDEBUGHOOKINFO, NEAR *NPDEBUGHOOKINFO, FAR* LPDEBUGHOOKINFO;
  812. /*
  813. * Structure used by WH_MOUSE
  814. */
  815. typedef struct tagMOUSEHOOKSTRUCT {
  816. POINT pt;
  817. HWND hwnd;
  818. UINT wHitTestCode;
  819. ULONG_PTR dwExtraInfo;
  820. } MOUSEHOOKSTRUCT, FAR *LPMOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT;
  821. #if(_WIN32_WINNT >= 0x0500)
  822. #ifdef __cplusplus
  823. typedef struct tagMOUSEHOOKSTRUCTEX : public tagMOUSEHOOKSTRUCT
  824. {
  825. DWORD mouseData;
  826. } MOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX;
  827. #else // ndef __cplusplus
  828. typedef struct tagMOUSEHOOKSTRUCTEX
  829. {
  830. MOUSEHOOKSTRUCT;
  831. DWORD mouseData;
  832. } MOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX;
  833. #endif
  834. #endif /* _WIN32_WINNT >= 0x0500 */
  835. #if(WINVER >= 0x0400)
  836. /*
  837. * Structure used by WH_HARDWARE
  838. */
  839. typedef struct tagHARDWAREHOOKSTRUCT {
  840. HWND hwnd;
  841. UINT message;
  842. WPARAM wParam;
  843. LPARAM lParam;
  844. } HARDWAREHOOKSTRUCT, FAR *LPHARDWAREHOOKSTRUCT, *PHARDWAREHOOKSTRUCT;
  845. #endif /* WINVER >= 0x0400 */
  846. #endif /* !NOWH */
  847. /*
  848. * Keyboard Layout API
  849. */
  850. #define HKL_PREV 0
  851. #define HKL_NEXT 1
  852. #define KLF_ACTIVATE 0x00000001
  853. #define KLF_SUBSTITUTE_OK 0x00000002
  854. #define KLF_REORDER 0x00000008
  855. #if(WINVER >= 0x0400)
  856. #define KLF_REPLACELANG 0x00000010
  857. #define KLF_NOTELLSHELL 0x00000080
  858. #endif /* WINVER >= 0x0400 */
  859. #define KLF_SETFORPROCESS 0x00000100
  860. #if(_WIN32_WINNT >= 0x0500)
  861. #define KLF_SHIFTLOCK 0x00010000
  862. #define KLF_RESET 0x40000000
  863. #endif /* _WIN32_WINNT >= 0x0500 */
  864. #if(WINVER >= 0x0500)
  865. /*
  866. * Bits in wParam of WM_INPUTLANGCHANGEREQUEST message
  867. */
  868. #define INPUTLANGCHANGE_SYSCHARSET 0x0001
  869. #define INPUTLANGCHANGE_FORWARD 0x0002
  870. #define INPUTLANGCHANGE_BACKWARD 0x0004
  871. #endif /* WINVER >= 0x0500 */
  872. /*
  873. * Size of KeyboardLayoutName (number of characters), including nul terminator
  874. */
  875. #define KL_NAMELENGTH 9
  876. WINUSERAPI
  877. HKL
  878. WINAPI
  879. LoadKeyboardLayoutA(
  880. IN LPCSTR pwszKLID,
  881. IN UINT Flags);
  882. WINUSERAPI
  883. HKL
  884. WINAPI
  885. LoadKeyboardLayoutW(
  886. IN LPCWSTR pwszKLID,
  887. IN UINT Flags);
  888. #ifdef UNICODE
  889. #define LoadKeyboardLayout LoadKeyboardLayoutW
  890. #else
  891. #define LoadKeyboardLayout LoadKeyboardLayoutA
  892. #endif // !UNICODE
  893. #if(WINVER >= 0x0400)
  894. WINUSERAPI
  895. HKL
  896. WINAPI
  897. ActivateKeyboardLayout(
  898. IN HKL hkl,
  899. IN UINT Flags);
  900. #else
  901. WINUSERAPI
  902. BOOL
  903. WINAPI
  904. ActivateKeyboardLayout(
  905. IN HKL hkl,
  906. IN UINT Flags);
  907. #endif /* WINVER >= 0x0400 */
  908. #if(WINVER >= 0x0400)
  909. WINUSERAPI
  910. int
  911. WINAPI
  912. ToUnicodeEx(
  913. IN UINT wVirtKey,
  914. IN UINT wScanCode,
  915. IN CONST BYTE *lpKeyState,
  916. OUT LPWSTR pwszBuff,
  917. IN int cchBuff,
  918. IN UINT wFlags,
  919. IN HKL dwhkl);
  920. #endif /* WINVER >= 0x0400 */
  921. WINUSERAPI
  922. BOOL
  923. WINAPI
  924. UnloadKeyboardLayout(
  925. IN HKL hkl);
  926. WINUSERAPI
  927. BOOL
  928. WINAPI
  929. GetKeyboardLayoutNameA(
  930. OUT LPSTR pwszKLID);
  931. WINUSERAPI
  932. BOOL
  933. WINAPI
  934. GetKeyboardLayoutNameW(
  935. OUT LPWSTR pwszKLID);
  936. #ifdef UNICODE
  937. #define GetKeyboardLayoutName GetKeyboardLayoutNameW
  938. #else
  939. #define GetKeyboardLayoutName GetKeyboardLayoutNameA
  940. #endif // !UNICODE
  941. #if(WINVER >= 0x0400)
  942. WINUSERAPI
  943. int
  944. WINAPI
  945. GetKeyboardLayoutList(
  946. IN int nBuff,
  947. OUT HKL FAR *lpList);
  948. WINUSERAPI
  949. HKL
  950. WINAPI
  951. GetKeyboardLayout(
  952. IN DWORD idThread
  953. );
  954. #endif /* WINVER >= 0x0400 */
  955. #if(WINVER >= 0x0500)
  956. typedef struct tagMOUSEMOVEPOINT {
  957. int x;
  958. int y;
  959. DWORD time;
  960. ULONG_PTR dwExtraInfo;
  961. } MOUSEMOVEPOINT, *PMOUSEMOVEPOINT, FAR* LPMOUSEMOVEPOINT;
  962. /*
  963. * Values for resolution parameter of GetMouseMovePointsEx
  964. */
  965. #define GMMP_USE_DISPLAY_POINTS 1
  966. #define GMMP_USE_HIGH_RESOLUTION_POINTS 2
  967. WINUSERAPI
  968. int
  969. WINAPI
  970. GetMouseMovePointsEx(
  971. IN UINT cbSize,
  972. IN LPMOUSEMOVEPOINT lppt,
  973. IN LPMOUSEMOVEPOINT lpptBuf,
  974. IN int nBufPoints,
  975. IN DWORD resolution
  976. );
  977. #endif /* WINVER >= 0x0500 */
  978. #ifndef NODESKTOP
  979. /*
  980. * Desktop-specific access flags
  981. */
  982. #define DESKTOP_READOBJECTS 0x0001L
  983. #define DESKTOP_CREATEWINDOW 0x0002L
  984. #define DESKTOP_CREATEMENU 0x0004L
  985. #define DESKTOP_HOOKCONTROL 0x0008L
  986. #define DESKTOP_JOURNALRECORD 0x0010L
  987. #define DESKTOP_JOURNALPLAYBACK 0x0020L
  988. #define DESKTOP_ENUMERATE 0x0040L
  989. #define DESKTOP_WRITEOBJECTS 0x0080L
  990. #define DESKTOP_SWITCHDESKTOP 0x0100L
  991. /*
  992. * Desktop-specific control flags
  993. */
  994. #define DF_ALLOWOTHERACCOUNTHOOK 0x0001L
  995. #ifdef _WINGDI_
  996. #ifndef NOGDI
  997. WINUSERAPI
  998. HDESK
  999. WINAPI
  1000. CreateDesktopA(
  1001. IN LPCSTR lpszDesktop,
  1002. IN LPCSTR lpszDevice,
  1003. IN LPDEVMODEA pDevmode,
  1004. IN DWORD dwFlags,
  1005. IN ACCESS_MASK dwDesiredAccess,
  1006. IN LPSECURITY_ATTRIBUTES lpsa);
  1007. WINUSERAPI
  1008. HDESK
  1009. WINAPI
  1010. CreateDesktopW(
  1011. IN LPCWSTR lpszDesktop,
  1012. IN LPCWSTR lpszDevice,
  1013. IN LPDEVMODEW pDevmode,
  1014. IN DWORD dwFlags,
  1015. IN ACCESS_MASK dwDesiredAccess,
  1016. IN LPSECURITY_ATTRIBUTES lpsa);
  1017. #ifdef UNICODE
  1018. #define CreateDesktop CreateDesktopW
  1019. #else
  1020. #define CreateDesktop CreateDesktopA
  1021. #endif // !UNICODE
  1022. #endif /* NOGDI */
  1023. #endif /* _WINGDI_ */
  1024. WINUSERAPI
  1025. HDESK
  1026. WINAPI
  1027. OpenDesktopA(
  1028. IN LPCSTR lpszDesktop,
  1029. IN DWORD dwFlags,
  1030. IN BOOL fInherit,
  1031. IN ACCESS_MASK dwDesiredAccess);
  1032. WINUSERAPI
  1033. HDESK
  1034. WINAPI
  1035. OpenDesktopW(
  1036. IN LPCWSTR lpszDesktop,
  1037. IN DWORD dwFlags,
  1038. IN BOOL fInherit,
  1039. IN ACCESS_MASK dwDesiredAccess);
  1040. #ifdef UNICODE
  1041. #define OpenDesktop OpenDesktopW
  1042. #else
  1043. #define OpenDesktop OpenDesktopA
  1044. #endif // !UNICODE
  1045. WINUSERAPI
  1046. HDESK
  1047. WINAPI
  1048. OpenInputDesktop(
  1049. IN DWORD dwFlags,
  1050. IN BOOL fInherit,
  1051. IN ACCESS_MASK dwDesiredAccess);
  1052. WINUSERAPI
  1053. BOOL
  1054. WINAPI
  1055. EnumDesktopsA(
  1056. IN HWINSTA hwinsta,
  1057. IN DESKTOPENUMPROCA lpEnumFunc,
  1058. IN LPARAM lParam);
  1059. WINUSERAPI
  1060. BOOL
  1061. WINAPI
  1062. EnumDesktopsW(
  1063. IN HWINSTA hwinsta,
  1064. IN DESKTOPENUMPROCW lpEnumFunc,
  1065. IN LPARAM lParam);
  1066. #ifdef UNICODE
  1067. #define EnumDesktops EnumDesktopsW
  1068. #else
  1069. #define EnumDesktops EnumDesktopsA
  1070. #endif // !UNICODE
  1071. WINUSERAPI
  1072. BOOL
  1073. WINAPI
  1074. EnumDesktopWindows(
  1075. IN HDESK hDesktop,
  1076. IN WNDENUMPROC lpfn,
  1077. IN LPARAM lParam);
  1078. WINUSERAPI
  1079. BOOL
  1080. WINAPI
  1081. SwitchDesktop(
  1082. IN HDESK hDesktop);
  1083. WINUSERAPI
  1084. BOOL
  1085. WINAPI
  1086. SetThreadDesktop(
  1087. IN HDESK hDesktop);
  1088. WINUSERAPI
  1089. BOOL
  1090. WINAPI
  1091. CloseDesktop(
  1092. IN HDESK hDesktop);
  1093. WINUSERAPI
  1094. HDESK
  1095. WINAPI
  1096. GetThreadDesktop(
  1097. IN DWORD dwThreadId);
  1098. #endif /* !NODESKTOP */
  1099. #ifndef NOWINDOWSTATION
  1100. /*
  1101. * Windowstation-specific access flags
  1102. */
  1103. #define WINSTA_ENUMDESKTOPS 0x0001L
  1104. #define WINSTA_READATTRIBUTES 0x0002L
  1105. #define WINSTA_ACCESSCLIPBOARD 0x0004L
  1106. #define WINSTA_CREATEDESKTOP 0x0008L
  1107. #define WINSTA_WRITEATTRIBUTES 0x0010L
  1108. #define WINSTA_ACCESSGLOBALATOMS 0x0020L
  1109. #define WINSTA_EXITWINDOWS 0x0040L
  1110. #define WINSTA_ENUMERATE 0x0100L
  1111. #define WINSTA_READSCREEN 0x0200L
  1112. /*
  1113. * Windowstation-specific attribute flags
  1114. */
  1115. #define WSF_VISIBLE 0x0001L
  1116. WINUSERAPI
  1117. HWINSTA
  1118. WINAPI
  1119. CreateWindowStationA(
  1120. IN LPCSTR lpwinsta,
  1121. IN DWORD dwReserved,
  1122. IN ACCESS_MASK dwDesiredAccess,
  1123. IN LPSECURITY_ATTRIBUTES lpsa);
  1124. WINUSERAPI
  1125. HWINSTA
  1126. WINAPI
  1127. CreateWindowStationW(
  1128. IN LPCWSTR lpwinsta,
  1129. IN DWORD dwReserved,
  1130. IN ACCESS_MASK dwDesiredAccess,
  1131. IN LPSECURITY_ATTRIBUTES lpsa);
  1132. #ifdef UNICODE
  1133. #define CreateWindowStation CreateWindowStationW
  1134. #else
  1135. #define CreateWindowStation CreateWindowStationA
  1136. #endif // !UNICODE
  1137. WINUSERAPI
  1138. HWINSTA
  1139. WINAPI
  1140. OpenWindowStationA(
  1141. IN LPCSTR lpszWinSta,
  1142. IN BOOL fInherit,
  1143. IN ACCESS_MASK dwDesiredAccess);
  1144. WINUSERAPI
  1145. HWINSTA
  1146. WINAPI
  1147. OpenWindowStationW(
  1148. IN LPCWSTR lpszWinSta,
  1149. IN BOOL fInherit,
  1150. IN ACCESS_MASK dwDesiredAccess);
  1151. #ifdef UNICODE
  1152. #define OpenWindowStation OpenWindowStationW
  1153. #else
  1154. #define OpenWindowStation OpenWindowStationA
  1155. #endif // !UNICODE
  1156. WINUSERAPI
  1157. BOOL
  1158. WINAPI
  1159. EnumWindowStationsA(
  1160. IN WINSTAENUMPROCA lpEnumFunc,
  1161. IN LPARAM lParam);
  1162. WINUSERAPI
  1163. BOOL
  1164. WINAPI
  1165. EnumWindowStationsW(
  1166. IN WINSTAENUMPROCW lpEnumFunc,
  1167. IN LPARAM lParam);
  1168. #ifdef UNICODE
  1169. #define EnumWindowStations EnumWindowStationsW
  1170. #else
  1171. #define EnumWindowStations EnumWindowStationsA
  1172. #endif // !UNICODE
  1173. WINUSERAPI
  1174. BOOL
  1175. WINAPI
  1176. CloseWindowStation(
  1177. IN HWINSTA hWinSta);
  1178. WINUSERAPI
  1179. BOOL
  1180. WINAPI
  1181. SetProcessWindowStation(
  1182. IN HWINSTA hWinSta);
  1183. WINUSERAPI
  1184. HWINSTA
  1185. WINAPI
  1186. GetProcessWindowStation(
  1187. VOID);
  1188. #endif /* !NOWINDOWSTATION */
  1189. #ifndef NOSECURITY
  1190. WINUSERAPI
  1191. BOOL
  1192. WINAPI
  1193. SetUserObjectSecurity(
  1194. IN HANDLE hObj,
  1195. IN PSECURITY_INFORMATION pSIRequested,
  1196. IN PSECURITY_DESCRIPTOR pSID);
  1197. WINUSERAPI
  1198. BOOL
  1199. WINAPI
  1200. GetUserObjectSecurity(
  1201. IN HANDLE hObj,
  1202. IN PSECURITY_INFORMATION pSIRequested,
  1203. IN OUT PSECURITY_DESCRIPTOR pSID,
  1204. IN DWORD nLength,
  1205. OUT LPDWORD lpnLengthNeeded);
  1206. #define UOI_FLAGS 1
  1207. #define UOI_NAME 2
  1208. #define UOI_TYPE 3
  1209. #define UOI_USER_SID 4
  1210. typedef struct tagUSEROBJECTFLAGS {
  1211. BOOL fInherit;
  1212. BOOL fReserved;
  1213. DWORD dwFlags;
  1214. } USEROBJECTFLAGS, *PUSEROBJECTFLAGS;
  1215. WINUSERAPI
  1216. BOOL
  1217. WINAPI
  1218. GetUserObjectInformationA(
  1219. IN HANDLE hObj,
  1220. IN int nIndex,
  1221. OUT PVOID pvInfo,
  1222. IN DWORD nLength,
  1223. OUT LPDWORD lpnLengthNeeded);
  1224. WINUSERAPI
  1225. BOOL
  1226. WINAPI
  1227. GetUserObjectInformationW(
  1228. IN HANDLE hObj,
  1229. IN int nIndex,
  1230. OUT PVOID pvInfo,
  1231. IN DWORD nLength,
  1232. OUT LPDWORD lpnLengthNeeded);
  1233. #ifdef UNICODE
  1234. #define GetUserObjectInformation GetUserObjectInformationW
  1235. #else
  1236. #define GetUserObjectInformation GetUserObjectInformationA
  1237. #endif // !UNICODE
  1238. WINUSERAPI
  1239. BOOL
  1240. WINAPI
  1241. SetUserObjectInformationA(
  1242. IN HANDLE hObj,
  1243. IN int nIndex,
  1244. IN PVOID pvInfo,
  1245. IN DWORD nLength);
  1246. WINUSERAPI
  1247. BOOL
  1248. WINAPI
  1249. SetUserObjectInformationW(
  1250. IN HANDLE hObj,
  1251. IN int nIndex,
  1252. IN PVOID pvInfo,
  1253. IN DWORD nLength);
  1254. #ifdef UNICODE
  1255. #define SetUserObjectInformation SetUserObjectInformationW
  1256. #else
  1257. #define SetUserObjectInformation SetUserObjectInformationA
  1258. #endif // !UNICODE
  1259. #endif /* !NOSECURITY */
  1260. #if(WINVER >= 0x0400)
  1261. typedef struct tagWNDCLASSEXA {
  1262. UINT cbSize;
  1263. /* Win 3.x */
  1264. UINT style;
  1265. WNDPROC lpfnWndProc;
  1266. int cbClsExtra;
  1267. int cbWndExtra;
  1268. HINSTANCE hInstance;
  1269. HICON hIcon;
  1270. HCURSOR hCursor;
  1271. HBRUSH hbrBackground;
  1272. LPCSTR lpszMenuName;
  1273. LPCSTR lpszClassName;
  1274. /* Win 4.0 */
  1275. HICON hIconSm;
  1276. } WNDCLASSEXA, *PWNDCLASSEXA, NEAR *NPWNDCLASSEXA, FAR *LPWNDCLASSEXA;
  1277. typedef struct tagWNDCLASSEXW {
  1278. UINT cbSize;
  1279. /* Win 3.x */
  1280. UINT style;
  1281. WNDPROC lpfnWndProc;
  1282. int cbClsExtra;
  1283. int cbWndExtra;
  1284. HINSTANCE hInstance;
  1285. HICON hIcon;
  1286. HCURSOR hCursor;
  1287. HBRUSH hbrBackground;
  1288. LPCWSTR lpszMenuName;
  1289. LPCWSTR lpszClassName;
  1290. /* Win 4.0 */
  1291. HICON hIconSm;
  1292. } WNDCLASSEXW, *PWNDCLASSEXW, NEAR *NPWNDCLASSEXW, FAR *LPWNDCLASSEXW;
  1293. #ifdef UNICODE
  1294. typedef WNDCLASSEXW WNDCLASSEX;
  1295. typedef PWNDCLASSEXW PWNDCLASSEX;
  1296. typedef NPWNDCLASSEXW NPWNDCLASSEX;
  1297. typedef LPWNDCLASSEXW LPWNDCLASSEX;
  1298. #else
  1299. typedef WNDCLASSEXA WNDCLASSEX;
  1300. typedef PWNDCLASSEXA PWNDCLASSEX;
  1301. typedef NPWNDCLASSEXA NPWNDCLASSEX;
  1302. typedef LPWNDCLASSEXA LPWNDCLASSEX;
  1303. #endif // UNICODE
  1304. #endif /* WINVER >= 0x0400 */
  1305. typedef struct tagWNDCLASSA {
  1306. UINT style;
  1307. WNDPROC lpfnWndProc;
  1308. int cbClsExtra;
  1309. int cbWndExtra;
  1310. HINSTANCE hInstance;
  1311. HICON hIcon;
  1312. HCURSOR hCursor;
  1313. HBRUSH hbrBackground;
  1314. LPCSTR lpszMenuName;
  1315. LPCSTR lpszClassName;
  1316. } WNDCLASSA, *PWNDCLASSA, NEAR *NPWNDCLASSA, FAR *LPWNDCLASSA;
  1317. typedef struct tagWNDCLASSW {
  1318. UINT style;
  1319. WNDPROC lpfnWndProc;
  1320. int cbClsExtra;
  1321. int cbWndExtra;
  1322. HINSTANCE hInstance;
  1323. HICON hIcon;
  1324. HCURSOR hCursor;
  1325. HBRUSH hbrBackground;
  1326. LPCWSTR lpszMenuName;
  1327. LPCWSTR lpszClassName;
  1328. } WNDCLASSW, *PWNDCLASSW, NEAR *NPWNDCLASSW, FAR *LPWNDCLASSW;
  1329. #ifdef UNICODE
  1330. typedef WNDCLASSW WNDCLASS;
  1331. typedef PWNDCLASSW PWNDCLASS;
  1332. typedef NPWNDCLASSW NPWNDCLASS;
  1333. typedef LPWNDCLASSW LPWNDCLASS;
  1334. #else
  1335. typedef WNDCLASSA WNDCLASS;
  1336. typedef PWNDCLASSA PWNDCLASS;
  1337. typedef NPWNDCLASSA NPWNDCLASS;
  1338. typedef LPWNDCLASSA LPWNDCLASS;
  1339. #endif // UNICODE
  1340. WINUSERAPI
  1341. BOOL
  1342. IsHungAppWindow(
  1343. IN HWND hwnd);
  1344. #if(WINVER >= 0x0501)
  1345. WINUSERAPI
  1346. VOID
  1347. DisableProcessWindowsGhosting(
  1348. VOID);
  1349. #endif /* WINVER >= 0x0501 */
  1350. #ifndef NOMSG
  1351. /*
  1352. * Message structure
  1353. */
  1354. typedef struct tagMSG {
  1355. HWND hwnd;
  1356. UINT message;
  1357. WPARAM wParam;
  1358. LPARAM lParam;
  1359. DWORD time;
  1360. POINT pt;
  1361. #ifdef _MAC
  1362. DWORD lPrivate;
  1363. #endif
  1364. } MSG, *PMSG, NEAR *NPMSG, FAR *LPMSG;
  1365. #define POINTSTOPOINT(pt, pts) \
  1366. { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); \
  1367. (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }
  1368. #define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y)))
  1369. #define MAKEWPARAM(l, h) ((WPARAM)(DWORD)MAKELONG(l, h))
  1370. #define MAKELPARAM(l, h) ((LPARAM)(DWORD)MAKELONG(l, h))
  1371. #define MAKELRESULT(l, h) ((LRESULT)(DWORD)MAKELONG(l, h))
  1372. #endif /* !NOMSG */
  1373. #ifndef NOWINOFFSETS
  1374. /*
  1375. * Window field offsets for GetWindowLong()
  1376. */
  1377. #define GWL_WNDPROC (-4)
  1378. #define GWL_HINSTANCE (-6)
  1379. #define GWL_HWNDPARENT (-8)
  1380. #define GWL_STYLE (-16)
  1381. #define GWL_EXSTYLE (-20)
  1382. #define GWL_USERDATA (-21)
  1383. #define GWL_ID (-12)
  1384. #ifdef _WIN64
  1385. #undef GWL_WNDPROC
  1386. #undef GWL_HINSTANCE
  1387. #undef GWL_HWNDPARENT
  1388. #undef GWL_USERDATA
  1389. #endif /* _WIN64 */
  1390. #define GWLP_WNDPROC (-4)
  1391. #define GWLP_HINSTANCE (-6)
  1392. #define GWLP_HWNDPARENT (-8)
  1393. #define GWLP_USERDATA (-21)
  1394. #define GWLP_ID (-12)
  1395. /*
  1396. * Class field offsets for GetClassLong()
  1397. */
  1398. #define GCL_MENUNAME (-8)
  1399. #define GCL_HBRBACKGROUND (-10)
  1400. #define GCL_HCURSOR (-12)
  1401. #define GCL_HICON (-14)
  1402. #define GCL_HMODULE (-16)
  1403. #define GCL_CBWNDEXTRA (-18)
  1404. #define GCL_CBCLSEXTRA (-20)
  1405. #define GCL_WNDPROC (-24)
  1406. #define GCL_STYLE (-26)
  1407. #define GCW_ATOM (-32)
  1408. #if(WINVER >= 0x0400)
  1409. #define GCL_HICONSM (-34)
  1410. #endif /* WINVER >= 0x0400 */
  1411. #ifdef _WIN64
  1412. #undef GCL_MENUNAME
  1413. #undef GCL_HBRBACKGROUND
  1414. #undef GCL_HCURSOR
  1415. #undef GCL_HICON
  1416. #undef GCL_HMODULE
  1417. #undef GCL_WNDPROC
  1418. #undef GCL_HICONSM
  1419. #endif /* _WIN64 */
  1420. #define GCLP_MENUNAME (-8)
  1421. #define GCLP_HBRBACKGROUND (-10)
  1422. #define GCLP_HCURSOR (-12)
  1423. #define GCLP_HICON (-14)
  1424. #define GCLP_HMODULE (-16)
  1425. #define GCLP_WNDPROC (-24)
  1426. #define GCLP_HICONSM (-34)
  1427. #endif /* !NOWINOFFSETS */
  1428. #ifndef NOWINMESSAGES
  1429. /*
  1430. * Window Messages
  1431. */
  1432. #define WM_NULL 0x0000
  1433. #define WM_CREATE 0x0001
  1434. #define WM_DESTROY 0x0002
  1435. #define WM_MOVE 0x0003
  1436. #define WM_SIZE 0x0005
  1437. #define WM_ACTIVATE 0x0006
  1438. /*
  1439. * WM_ACTIVATE state values
  1440. */
  1441. #define WA_INACTIVE 0
  1442. #define WA_ACTIVE 1
  1443. #define WA_CLICKACTIVE 2
  1444. #define WM_SETFOCUS 0x0007
  1445. #define WM_KILLFOCUS 0x0008
  1446. #define WM_ENABLE 0x000A
  1447. #define WM_SETREDRAW 0x000B
  1448. #define WM_SETTEXT 0x000C
  1449. #define WM_GETTEXT 0x000D
  1450. #define WM_GETTEXTLENGTH 0x000E
  1451. #define WM_PAINT 0x000F
  1452. #define WM_CLOSE 0x0010
  1453. #ifndef _WIN32_WCE
  1454. #define WM_QUERYENDSESSION 0x0011
  1455. #define WM_QUERYOPEN 0x0013
  1456. #define WM_ENDSESSION 0x0016
  1457. #endif
  1458. #define WM_QUIT 0x0012
  1459. #define WM_ERASEBKGND 0x0014
  1460. #define WM_SYSCOLORCHANGE 0x0015
  1461. #define WM_SHOWWINDOW 0x0018
  1462. #define WM_WININICHANGE 0x001A
  1463. #if(WINVER >= 0x0400)
  1464. #define WM_SETTINGCHANGE WM_WININICHANGE
  1465. #endif /* WINVER >= 0x0400 */
  1466. #define WM_DEVMODECHANGE 0x001B
  1467. #define WM_ACTIVATEAPP 0x001C
  1468. #define WM_FONTCHANGE 0x001D
  1469. #define WM_TIMECHANGE 0x001E
  1470. #define WM_CANCELMODE 0x001F
  1471. #define WM_SETCURSOR 0x0020
  1472. #define WM_MOUSEACTIVATE 0x0021
  1473. #define WM_CHILDACTIVATE 0x0022
  1474. #define WM_QUEUESYNC 0x0023
  1475. #define WM_GETMINMAXINFO 0x0024
  1476. /*
  1477. * Struct pointed to by WM_GETMINMAXINFO lParam
  1478. */
  1479. typedef struct tagMINMAXINFO {
  1480. POINT ptReserved;
  1481. POINT ptMaxSize;
  1482. POINT ptMaxPosition;
  1483. POINT ptMinTrackSize;
  1484. POINT ptMaxTrackSize;
  1485. } MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
  1486. #define WM_PAINTICON 0x0026
  1487. #define WM_ICONERASEBKGND 0x0027
  1488. #define WM_NEXTDLGCTL 0x0028
  1489. #define WM_SPOOLERSTATUS 0x002A
  1490. #define WM_DRAWITEM 0x002B
  1491. #define WM_MEASUREITEM 0x002C
  1492. #define WM_DELETEITEM 0x002D
  1493. #define WM_VKEYTOITEM 0x002E
  1494. #define WM_CHARTOITEM 0x002F
  1495. #define WM_SETFONT 0x0030
  1496. #define WM_GETFONT 0x0031
  1497. #define WM_SETHOTKEY 0x0032
  1498. #define WM_GETHOTKEY 0x0033
  1499. #define WM_QUERYDRAGICON 0x0037
  1500. #define WM_COMPAREITEM 0x0039
  1501. #if(WINVER >= 0x0500)
  1502. #ifndef _WIN32_WCE
  1503. #define WM_GETOBJECT 0x003D
  1504. #endif
  1505. #endif /* WINVER >= 0x0500 */
  1506. #define WM_COMPACTING 0x0041
  1507. #define WM_COMMNOTIFY 0x0044 /* no longer suported */
  1508. #define WM_WINDOWPOSCHANGING 0x0046
  1509. #define WM_WINDOWPOSCHANGED 0x0047
  1510. #define WM_POWER 0x0048
  1511. /*
  1512. * wParam for WM_POWER window message and DRV_POWER driver notification
  1513. */
  1514. #define PWR_OK 1
  1515. #define PWR_FAIL (-1)
  1516. #define PWR_SUSPENDREQUEST 1
  1517. #define PWR_SUSPENDRESUME 2
  1518. #define PWR_CRITICALRESUME 3
  1519. #define WM_COPYDATA 0x004A
  1520. #define WM_CANCELJOURNAL 0x004B
  1521. /*
  1522. * lParam of WM_COPYDATA message points to...
  1523. */
  1524. typedef struct tagCOPYDATASTRUCT {
  1525. ULONG_PTR dwData;
  1526. DWORD cbData;
  1527. PVOID lpData;
  1528. } COPYDATASTRUCT, *PCOPYDATASTRUCT;
  1529. #if(WINVER >= 0x0400)
  1530. typedef struct tagMDINEXTMENU
  1531. {
  1532. HMENU hmenuIn;
  1533. HMENU hmenuNext;
  1534. HWND hwndNext;
  1535. } MDINEXTMENU, * PMDINEXTMENU, FAR * LPMDINEXTMENU;
  1536. #endif /* WINVER >= 0x0400 */
  1537. #if(WINVER >= 0x0400)
  1538. #define WM_NOTIFY 0x004E
  1539. #define WM_INPUTLANGCHANGEREQUEST 0x0050
  1540. #define WM_INPUTLANGCHANGE 0x0051
  1541. #define WM_TCARD 0x0052
  1542. #define WM_HELP 0x0053
  1543. #define WM_USERCHANGED 0x0054
  1544. #define WM_NOTIFYFORMAT 0x0055
  1545. #define NFR_ANSI 1
  1546. #define NFR_UNICODE 2
  1547. #define NF_QUERY 3
  1548. #define NF_REQUERY 4
  1549. #define WM_CONTEXTMENU 0x007B
  1550. #define WM_STYLECHANGING 0x007C
  1551. #define WM_STYLECHANGED 0x007D
  1552. #define WM_DISPLAYCHANGE 0x007E
  1553. #define WM_GETICON 0x007F
  1554. #define WM_SETICON 0x0080
  1555. #endif /* WINVER >= 0x0400 */
  1556. #define WM_NCCREATE 0x0081
  1557. #define WM_NCDESTROY 0x0082
  1558. #define WM_NCCALCSIZE 0x0083
  1559. #define WM_NCHITTEST 0x0084
  1560. #define WM_NCPAINT 0x0085
  1561. #define WM_NCACTIVATE 0x0086
  1562. #define WM_GETDLGCODE 0x0087
  1563. #ifndef _WIN32_WCE
  1564. #define WM_SYNCPAINT 0x0088
  1565. #endif
  1566. #define WM_NCMOUSEMOVE 0x00A0
  1567. #define WM_NCLBUTTONDOWN 0x00A1
  1568. #define WM_NCLBUTTONUP 0x00A2
  1569. #define WM_NCLBUTTONDBLCLK 0x00A3
  1570. #define WM_NCRBUTTONDOWN 0x00A4
  1571. #define WM_NCRBUTTONUP 0x00A5
  1572. #define WM_NCRBUTTONDBLCLK 0x00A6
  1573. #define WM_NCMBUTTONDOWN 0x00A7
  1574. #define WM_NCMBUTTONUP 0x00A8
  1575. #define WM_NCMBUTTONDBLCLK 0x00A9
  1576. #if(_WIN32_WINNT >= 0x0500)
  1577. #define WM_NCXBUTTONDOWN 0x00AB
  1578. #define WM_NCXBUTTONUP 0x00AC
  1579. #define WM_NCXBUTTONDBLCLK 0x00AD
  1580. #endif /* _WIN32_WINNT >= 0x0500 */
  1581. #if(_WIN32_WINNT >= 0x0501)
  1582. #define WM_INPUT 0x00FF
  1583. #endif /* _WIN32_WINNT >= 0x0501 */
  1584. #define WM_KEYFIRST 0x0100
  1585. #define WM_KEYDOWN 0x0100
  1586. #define WM_KEYUP 0x0101
  1587. #define WM_CHAR 0x0102
  1588. #define WM_DEADCHAR 0x0103
  1589. #define WM_SYSKEYDOWN 0x0104
  1590. #define WM_SYSKEYUP 0x0105
  1591. #define WM_SYSCHAR 0x0106
  1592. #define WM_SYSDEADCHAR 0x0107
  1593. #if(_WIN32_WINNT >= 0x0501)
  1594. #define WM_UNICHAR 0x0109
  1595. #define WM_KEYLAST 0x0109
  1596. #define UNICODE_NOCHAR 0xFFFF
  1597. #else
  1598. #define WM_KEYLAST 0x0108
  1599. #endif /* _WIN32_WINNT >= 0x0501 */
  1600. #if(WINVER >= 0x0400)
  1601. #define WM_IME_STARTCOMPOSITION 0x010D
  1602. #define WM_IME_ENDCOMPOSITION 0x010E
  1603. #define WM_IME_COMPOSITION 0x010F
  1604. #define WM_IME_KEYLAST 0x010F
  1605. #endif /* WINVER >= 0x0400 */
  1606. #define WM_INITDIALOG 0x0110
  1607. #define WM_COMMAND 0x0111
  1608. #define WM_SYSCOMMAND 0x0112
  1609. #define WM_TIMER 0x0113
  1610. #define WM_HSCROLL 0x0114
  1611. #define WM_VSCROLL 0x0115
  1612. #define WM_INITMENU 0x0116
  1613. #define WM_INITMENUPOPUP 0x0117
  1614. #define WM_MENUSELECT 0x011F
  1615. #define WM_MENUCHAR 0x0120
  1616. #define WM_ENTERIDLE 0x0121
  1617. #if(WINVER >= 0x0500)
  1618. #ifndef _WIN32_WCE
  1619. #define WM_MENURBUTTONUP 0x0122
  1620. #define WM_MENUDRAG 0x0123
  1621. #define WM_MENUGETOBJECT 0x0124
  1622. #define WM_UNINITMENUPOPUP 0x0125
  1623. #define WM_MENUCOMMAND 0x0126
  1624. #ifndef _WIN32_WCE
  1625. #if(_WIN32_WINNT >= 0x0500)
  1626. #define WM_CHANGEUISTATE 0x0127
  1627. #define WM_UPDATEUISTATE 0x0128
  1628. #define WM_QUERYUISTATE 0x0129
  1629. /*
  1630. * LOWORD(wParam) values in WM_*UISTATE*
  1631. */
  1632. #define UIS_SET 1
  1633. #define UIS_CLEAR 2
  1634. #define UIS_INITIALIZE 3
  1635. /*
  1636. * HIWORD(wParam) values in WM_*UISTATE*
  1637. */
  1638. #define UISF_HIDEFOCUS 0x1
  1639. #define UISF_HIDEACCEL 0x2
  1640. #if(_WIN32_WINNT >= 0x0501)
  1641. #define UISF_ACTIVE 0x4
  1642. #endif /* _WIN32_WINNT >= 0x0501 */
  1643. #endif /* _WIN32_WINNT >= 0x0500 */
  1644. #endif
  1645. #endif
  1646. #endif /* WINVER >= 0x0500 */
  1647. #define WM_CTLCOLORMSGBOX 0x0132
  1648. #define WM_CTLCOLOREDIT 0x0133
  1649. #define WM_CTLCOLORLISTBOX 0x0134
  1650. #define WM_CTLCOLORBTN 0x0135
  1651. #define WM_CTLCOLORDLG 0x0136
  1652. #define WM_CTLCOLORSCROLLBAR 0x0137
  1653. #define WM_CTLCOLORSTATIC 0x0138
  1654. #define MN_GETHMENU 0x01E1
  1655. #define WM_MOUSEFIRST 0x0200
  1656. #define WM_MOUSEMOVE 0x0200
  1657. #define WM_LBUTTONDOWN 0x0201
  1658. #define WM_LBUTTONUP 0x0202
  1659. #define WM_LBUTTONDBLCLK 0x0203
  1660. #define WM_RBUTTONDOWN 0x0204
  1661. #define WM_RBUTTONUP 0x0205
  1662. #define WM_RBUTTONDBLCLK 0x0206
  1663. #define WM_MBUTTONDOWN 0x0207
  1664. #define WM_MBUTTONUP 0x0208
  1665. #define WM_MBUTTONDBLCLK 0x0209
  1666. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  1667. #define WM_MOUSEWHEEL 0x020A
  1668. #endif
  1669. #if (_WIN32_WINNT >= 0x0500)
  1670. #define WM_XBUTTONDOWN 0x020B
  1671. #define WM_XBUTTONUP 0x020C
  1672. #define WM_XBUTTONDBLCLK 0x020D
  1673. #endif
  1674. #if (_WIN32_WINNT >= 0x0500)
  1675. #define WM_MOUSELAST 0x020D
  1676. #elif (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  1677. #define WM_MOUSELAST 0x020A
  1678. #else
  1679. #define WM_MOUSELAST 0x0209
  1680. #endif /* (_WIN32_WINNT >= 0x0500) */
  1681. #if(_WIN32_WINNT >= 0x0400)
  1682. /* Value for rolling one detent */
  1683. #define WHEEL_DELTA 120
  1684. #define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
  1685. /* Setting to scroll one page for SPI_GET/SETWHEELSCROLLLINES */
  1686. #define WHEEL_PAGESCROLL (UINT_MAX)
  1687. #endif /* _WIN32_WINNT >= 0x0400 */
  1688. #if(_WIN32_WINNT >= 0x0500)
  1689. #define GET_KEYSTATE_WPARAM(wParam) (LOWORD(wParam))
  1690. #define GET_NCHITTEST_WPARAM(wParam) ((short)LOWORD(wParam))
  1691. #define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
  1692. /* XButton values are WORD flags */
  1693. #define XBUTTON1 0x0001
  1694. #define XBUTTON2 0x0002
  1695. /* Were there to be an XBUTTON3, its value would be 0x0004 */
  1696. #endif /* _WIN32_WINNT >= 0x0500 */
  1697. #define WM_PARENTNOTIFY 0x0210
  1698. #define WM_ENTERMENULOOP 0x0211
  1699. #define WM_EXITMENULOOP 0x0212
  1700. #if(WINVER >= 0x0400)
  1701. #define WM_NEXTMENU 0x0213
  1702. #define WM_SIZING 0x0214
  1703. #define WM_CAPTURECHANGED 0x0215
  1704. #define WM_MOVING 0x0216
  1705. #endif /* WINVER >= 0x0400 */
  1706. #if(WINVER >= 0x0400)
  1707. #define WM_POWERBROADCAST 0x0218
  1708. #ifndef _WIN32_WCE
  1709. #define PBT_APMQUERYSUSPEND 0x0000
  1710. #define PBT_APMQUERYSTANDBY 0x0001
  1711. #define PBT_APMQUERYSUSPENDFAILED 0x0002
  1712. #define PBT_APMQUERYSTANDBYFAILED 0x0003
  1713. #define PBT_APMSUSPEND 0x0004
  1714. #define PBT_APMSTANDBY 0x0005
  1715. #define PBT_APMRESUMECRITICAL 0x0006
  1716. #define PBT_APMRESUMESUSPEND 0x0007
  1717. #define PBT_APMRESUMESTANDBY 0x0008
  1718. #define PBTF_APMRESUMEFROMFAILURE 0x00000001
  1719. #define PBT_APMBATTERYLOW 0x0009
  1720. #define PBT_APMPOWERSTATUSCHANGE 0x000A
  1721. #define PBT_APMOEMEVENT 0x000B
  1722. #define PBT_APMRESUMEAUTOMATIC 0x0012
  1723. #endif
  1724. #endif /* WINVER >= 0x0400 */
  1725. #if(WINVER >= 0x0400)
  1726. #define WM_DEVICECHANGE 0x0219
  1727. #endif /* WINVER >= 0x0400 */
  1728. #define WM_MDICREATE 0x0220
  1729. #define WM_MDIDESTROY 0x0221
  1730. #define WM_MDIACTIVATE 0x0222
  1731. #define WM_MDIRESTORE 0x0223
  1732. #define WM_MDINEXT 0x0224
  1733. #define WM_MDIMAXIMIZE 0x0225
  1734. #define WM_MDITILE 0x0226
  1735. #define WM_MDICASCADE 0x0227
  1736. #define WM_MDIICONARRANGE 0x0228
  1737. #define WM_MDIGETACTIVE 0x0229
  1738. #define WM_MDISETMENU 0x0230
  1739. #define WM_ENTERSIZEMOVE 0x0231
  1740. #define WM_EXITSIZEMOVE 0x0232
  1741. #define WM_DROPFILES 0x0233
  1742. #define WM_MDIREFRESHMENU 0x0234
  1743. #if(WINVER >= 0x0400)
  1744. #define WM_IME_SETCONTEXT 0x0281
  1745. #define WM_IME_NOTIFY 0x0282
  1746. #define WM_IME_CONTROL 0x0283
  1747. #define WM_IME_COMPOSITIONFULL 0x0284
  1748. #define WM_IME_SELECT 0x0285
  1749. #define WM_IME_CHAR 0x0286
  1750. #endif /* WINVER >= 0x0400 */
  1751. #if(WINVER >= 0x0500)
  1752. #define WM_IME_REQUEST 0x0288
  1753. #endif /* WINVER >= 0x0500 */
  1754. #if(WINVER >= 0x0400)
  1755. #define WM_IME_KEYDOWN 0x0290
  1756. #define WM_IME_KEYUP 0x0291
  1757. #endif /* WINVER >= 0x0400 */
  1758. #if((_WIN32_WINNT >= 0x0400) || (WINVER >= 0x0500))
  1759. #define WM_MOUSEHOVER 0x02A1
  1760. #define WM_MOUSELEAVE 0x02A3
  1761. #endif
  1762. #if(WINVER >= 0x0500)
  1763. #define WM_NCMOUSEHOVER 0x02A0
  1764. #define WM_NCMOUSELEAVE 0x02A2
  1765. #endif /* WINVER >= 0x0500 */
  1766. #if(_WIN32_WINNT >= 0x0501)
  1767. #define WM_WTSSESSION_CHANGE 0x02B1
  1768. #define WM_TABLET_FIRST 0x02c0
  1769. #define WM_TABLET_LAST 0x02df
  1770. #endif /* _WIN32_WINNT >= 0x0501 */
  1771. #define WM_CUT 0x0300
  1772. #define WM_COPY 0x0301
  1773. #define WM_PASTE 0x0302
  1774. #define WM_CLEAR 0x0303
  1775. #define WM_UNDO 0x0304
  1776. #define WM_RENDERFORMAT 0x0305
  1777. #define WM_RENDERALLFORMATS 0x0306
  1778. #define WM_DESTROYCLIPBOARD 0x0307
  1779. #define WM_DRAWCLIPBOARD 0x0308
  1780. #define WM_PAINTCLIPBOARD 0x0309
  1781. #define WM_VSCROLLCLIPBOARD 0x030A
  1782. #define WM_SIZECLIPBOARD 0x030B
  1783. #define WM_ASKCBFORMATNAME 0x030C
  1784. #define WM_CHANGECBCHAIN 0x030D
  1785. #define WM_HSCROLLCLIPBOARD 0x030E
  1786. #define WM_QUERYNEWPALETTE 0x030F
  1787. #define WM_PALETTEISCHANGING 0x0310
  1788. #define WM_PALETTECHANGED 0x0311
  1789. #define WM_HOTKEY 0x0312
  1790. #if(WINVER >= 0x0400)
  1791. #define WM_PRINT 0x0317
  1792. #define WM_PRINTCLIENT 0x0318
  1793. #endif /* WINVER >= 0x0400 */
  1794. #if(_WIN32_WINNT >= 0x0500)
  1795. #define WM_APPCOMMAND 0x0319
  1796. #endif /* _WIN32_WINNT >= 0x0500 */
  1797. #if(_WIN32_WINNT >= 0x0501)
  1798. #define WM_THEMECHANGED 0x031A
  1799. #endif /* _WIN32_WINNT >= 0x0501 */
  1800. #if(WINVER >= 0x0400)
  1801. #define WM_HANDHELDFIRST 0x0358
  1802. #define WM_HANDHELDLAST 0x035F
  1803. #define WM_AFXFIRST 0x0360
  1804. #define WM_AFXLAST 0x037F
  1805. #endif /* WINVER >= 0x0400 */
  1806. #define WM_PENWINFIRST 0x0380
  1807. #define WM_PENWINLAST 0x038F
  1808. #if(WINVER >= 0x0400)
  1809. #define WM_APP 0x8000
  1810. #endif /* WINVER >= 0x0400 */
  1811. /*
  1812. * NOTE: All Message Numbers below 0x0400 are RESERVED.
  1813. *
  1814. * Private Window Messages Start Here:
  1815. */
  1816. #define WM_USER 0x0400
  1817. #if(WINVER >= 0x0400)
  1818. /* wParam for WM_SIZING message */
  1819. #define WMSZ_LEFT 1
  1820. #define WMSZ_RIGHT 2
  1821. #define WMSZ_TOP 3
  1822. #define WMSZ_TOPLEFT 4
  1823. #define WMSZ_TOPRIGHT 5
  1824. #define WMSZ_BOTTOM 6
  1825. #define WMSZ_BOTTOMLEFT 7
  1826. #define WMSZ_BOTTOMRIGHT 8
  1827. #endif /* WINVER >= 0x0400 */
  1828. #ifndef NONCMESSAGES
  1829. /*
  1830. * WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes
  1831. */
  1832. #define HTERROR (-2)
  1833. #define HTTRANSPARENT (-1)
  1834. #define HTNOWHERE 0
  1835. #define HTCLIENT 1
  1836. #define HTCAPTION 2
  1837. #define HTSYSMENU 3
  1838. #define HTGROWBOX 4
  1839. #define HTSIZE HTGROWBOX
  1840. #define HTMENU 5
  1841. #define HTHSCROLL 6
  1842. #define HTVSCROLL 7
  1843. #define HTMINBUTTON 8
  1844. #define HTMAXBUTTON 9
  1845. #define HTLEFT 10
  1846. #define HTRIGHT 11
  1847. #define HTTOP 12
  1848. #define HTTOPLEFT 13
  1849. #define HTTOPRIGHT 14
  1850. #define HTBOTTOM 15
  1851. #define HTBOTTOMLEFT 16
  1852. #define HTBOTTOMRIGHT 17
  1853. #define HTBORDER 18
  1854. #define HTREDUCE HTMINBUTTON
  1855. #define HTZOOM HTMAXBUTTON
  1856. #define HTSIZEFIRST HTLEFT
  1857. #define HTSIZELAST HTBOTTOMRIGHT
  1858. #if(WINVER >= 0x0400)
  1859. #define HTOBJECT 19
  1860. #define HTCLOSE 20
  1861. #define HTHELP 21
  1862. #endif /* WINVER >= 0x0400 */
  1863. /*
  1864. * SendMessageTimeout values
  1865. */
  1866. #define SMTO_NORMAL 0x0000
  1867. #define SMTO_BLOCK 0x0001
  1868. #define SMTO_ABORTIFHUNG 0x0002
  1869. #if(WINVER >= 0x0500)
  1870. #define SMTO_NOTIMEOUTIFNOTHUNG 0x0008
  1871. #endif /* WINVER >= 0x0500 */
  1872. #endif /* !NONCMESSAGES */
  1873. /*
  1874. * WM_MOUSEACTIVATE Return Codes
  1875. */
  1876. #define MA_ACTIVATE 1
  1877. #define MA_ACTIVATEANDEAT 2
  1878. #define MA_NOACTIVATE 3
  1879. #define MA_NOACTIVATEANDEAT 4
  1880. /*
  1881. * WM_SETICON / WM_GETICON Type Codes
  1882. */
  1883. #define ICON_SMALL 0
  1884. #define ICON_BIG 1
  1885. #if(_WIN32_WINNT >= 0x0501)
  1886. #define ICON_SMALL2 2
  1887. #endif /* _WIN32_WINNT >= 0x0501 */
  1888. WINUSERAPI
  1889. UINT
  1890. WINAPI
  1891. RegisterWindowMessageA(
  1892. IN LPCSTR lpString);
  1893. WINUSERAPI
  1894. UINT
  1895. WINAPI
  1896. RegisterWindowMessageW(
  1897. IN LPCWSTR lpString);
  1898. #ifdef UNICODE
  1899. #define RegisterWindowMessage RegisterWindowMessageW
  1900. #else
  1901. #define RegisterWindowMessage RegisterWindowMessageA
  1902. #endif // !UNICODE
  1903. /*
  1904. * WM_SIZE message wParam values
  1905. */
  1906. #define SIZE_RESTORED 0
  1907. #define SIZE_MINIMIZED 1
  1908. #define SIZE_MAXIMIZED 2
  1909. #define SIZE_MAXSHOW 3
  1910. #define SIZE_MAXHIDE 4
  1911. /*
  1912. * Obsolete constant names
  1913. */
  1914. #define SIZENORMAL SIZE_RESTORED
  1915. #define SIZEICONIC SIZE_MINIMIZED
  1916. #define SIZEFULLSCREEN SIZE_MAXIMIZED
  1917. #define SIZEZOOMSHOW SIZE_MAXSHOW
  1918. #define SIZEZOOMHIDE SIZE_MAXHIDE
  1919. /*
  1920. * WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam
  1921. */
  1922. typedef struct tagWINDOWPOS {
  1923. HWND hwnd;
  1924. HWND hwndInsertAfter;
  1925. int x;
  1926. int y;
  1927. int cx;
  1928. int cy;
  1929. UINT flags;
  1930. } WINDOWPOS, *LPWINDOWPOS, *PWINDOWPOS;
  1931. /*
  1932. * WM_NCCALCSIZE parameter structure
  1933. */
  1934. typedef struct tagNCCALCSIZE_PARAMS {
  1935. RECT rgrc[3];
  1936. PWINDOWPOS lppos;
  1937. } NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS;
  1938. /*
  1939. * WM_NCCALCSIZE "window valid rect" return values
  1940. */
  1941. #define WVR_ALIGNTOP 0x0010
  1942. #define WVR_ALIGNLEFT 0x0020
  1943. #define WVR_ALIGNBOTTOM 0x0040
  1944. #define WVR_ALIGNRIGHT 0x0080
  1945. #define WVR_HREDRAW 0x0100
  1946. #define WVR_VREDRAW 0x0200
  1947. #define WVR_REDRAW (WVR_HREDRAW | \
  1948. WVR_VREDRAW)
  1949. #define WVR_VALIDRECTS 0x0400
  1950. #ifndef NOKEYSTATES
  1951. /*
  1952. * Key State Masks for Mouse Messages
  1953. */
  1954. #define MK_LBUTTON 0x0001
  1955. #define MK_RBUTTON 0x0002
  1956. #define MK_SHIFT 0x0004
  1957. #define MK_CONTROL 0x0008
  1958. #define MK_MBUTTON 0x0010
  1959. #if(_WIN32_WINNT >= 0x0500)
  1960. #define MK_XBUTTON1 0x0020
  1961. #define MK_XBUTTON2 0x0040
  1962. #endif /* _WIN32_WINNT >= 0x0500 */
  1963. #endif /* !NOKEYSTATES */
  1964. #if(_WIN32_WINNT >= 0x0400)
  1965. #ifndef NOTRACKMOUSEEVENT
  1966. #define TME_HOVER 0x00000001
  1967. #define TME_LEAVE 0x00000002
  1968. #if(WINVER >= 0x0500)
  1969. #define TME_NONCLIENT 0x00000010
  1970. #endif /* WINVER >= 0x0500 */
  1971. #define TME_QUERY 0x40000000
  1972. #define TME_CANCEL 0x80000000
  1973. #define HOVER_DEFAULT 0xFFFFFFFF
  1974. #endif /* _WIN32_WINNT >= 0x0400 */
  1975. #if(_WIN32_WINNT >= 0x0400)
  1976. typedef struct tagTRACKMOUSEEVENT {
  1977. DWORD cbSize;
  1978. DWORD dwFlags;
  1979. HWND hwndTrack;
  1980. DWORD dwHoverTime;
  1981. } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  1982. WINUSERAPI
  1983. BOOL
  1984. WINAPI
  1985. TrackMouseEvent(
  1986. IN OUT LPTRACKMOUSEEVENT lpEventTrack);
  1987. #endif /* _WIN32_WINNT >= 0x0400 */
  1988. #if(_WIN32_WINNT >= 0x0400)
  1989. #endif /* !NOTRACKMOUSEEVENT */
  1990. #endif /* _WIN32_WINNT >= 0x0400 */
  1991. #endif /* !NOWINMESSAGES */
  1992. #ifndef NOWINSTYLES
  1993. /*
  1994. * Window Styles
  1995. */
  1996. #define WS_OVERLAPPED 0x00000000L
  1997. #define WS_POPUP 0x80000000L
  1998. #define WS_CHILD 0x40000000L
  1999. #define WS_MINIMIZE 0x20000000L
  2000. #define WS_VISIBLE 0x10000000L
  2001. #define WS_DISABLED 0x08000000L
  2002. #define WS_CLIPSIBLINGS 0x04000000L
  2003. #define WS_CLIPCHILDREN 0x02000000L
  2004. #define WS_MAXIMIZE 0x01000000L
  2005. #define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */
  2006. #define WS_BORDER 0x00800000L
  2007. #define WS_DLGFRAME 0x00400000L
  2008. #define WS_VSCROLL 0x00200000L
  2009. #define WS_HSCROLL 0x00100000L
  2010. #define WS_SYSMENU 0x00080000L
  2011. #define WS_THICKFRAME 0x00040000L
  2012. #define WS_GROUP 0x00020000L
  2013. #define WS_TABSTOP 0x00010000L
  2014. #define WS_MINIMIZEBOX 0x00020000L
  2015. #define WS_MAXIMIZEBOX 0x00010000L
  2016. #define WS_TILED WS_OVERLAPPED
  2017. #define WS_ICONIC WS_MINIMIZE
  2018. #define WS_SIZEBOX WS_THICKFRAME
  2019. #define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
  2020. /*
  2021. * Common Window Styles
  2022. */
  2023. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | \
  2024. WS_CAPTION | \
  2025. WS_SYSMENU | \
  2026. WS_THICKFRAME | \
  2027. WS_MINIMIZEBOX | \
  2028. WS_MAXIMIZEBOX)
  2029. #define WS_POPUPWINDOW (WS_POPUP | \
  2030. WS_BORDER | \
  2031. WS_SYSMENU)
  2032. #define WS_CHILDWINDOW (WS_CHILD)
  2033. /*
  2034. * Extended Window Styles
  2035. */
  2036. #define WS_EX_DLGMODALFRAME 0x00000001L
  2037. #define WS_EX_NOPARENTNOTIFY 0x00000004L
  2038. #define WS_EX_TOPMOST 0x00000008L
  2039. #define WS_EX_ACCEPTFILES 0x00000010L
  2040. #define WS_EX_TRANSPARENT 0x00000020L
  2041. #if(WINVER >= 0x0400)
  2042. #define WS_EX_MDICHILD 0x00000040L
  2043. #define WS_EX_TOOLWINDOW 0x00000080L
  2044. #define WS_EX_WINDOWEDGE 0x00000100L
  2045. #define WS_EX_CLIENTEDGE 0x00000200L
  2046. #define WS_EX_CONTEXTHELP 0x00000400L
  2047. #endif /* WINVER >= 0x0400 */
  2048. #if(WINVER >= 0x0400)
  2049. #define WS_EX_RIGHT 0x00001000L
  2050. #define WS_EX_LEFT 0x00000000L
  2051. #define WS_EX_RTLREADING 0x00002000L
  2052. #define WS_EX_LTRREADING 0x00000000L
  2053. #define WS_EX_LEFTSCROLLBAR 0x00004000L
  2054. #define WS_EX_RIGHTSCROLLBAR 0x00000000L
  2055. #define WS_EX_CONTROLPARENT 0x00010000L
  2056. #define WS_EX_STATICEDGE 0x00020000L
  2057. #define WS_EX_APPWINDOW 0x00040000L
  2058. #define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
  2059. #define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
  2060. #endif /* WINVER >= 0x0400 */
  2061. #if(_WIN32_WINNT >= 0x0500)
  2062. #define WS_EX_LAYERED 0x00080000
  2063. #endif /* _WIN32_WINNT >= 0x0500 */
  2064. #if(WINVER >= 0x0500)
  2065. #define WS_EX_NOINHERITLAYOUT 0x00100000L // Disable inheritence of mirroring by children
  2066. #define WS_EX_LAYOUTRTL 0x00400000L // Right to left mirroring
  2067. #endif /* WINVER >= 0x0500 */
  2068. #if(_WIN32_WINNT >= 0x0501)
  2069. #define WS_EX_COMPOSITED 0x02000000L
  2070. #endif /* _WIN32_WINNT >= 0x0501 */
  2071. #if(_WIN32_WINNT >= 0x0500)
  2072. #define WS_EX_NOACTIVATE 0x08000000L
  2073. #endif /* _WIN32_WINNT >= 0x0500 */
  2074. /*
  2075. * Class styles
  2076. */
  2077. #define CS_VREDRAW 0x0001
  2078. #define CS_HREDRAW 0x0002
  2079. #define CS_DBLCLKS 0x0008
  2080. #define CS_OWNDC 0x0020
  2081. #define CS_CLASSDC 0x0040
  2082. #define CS_PARENTDC 0x0080
  2083. #define CS_NOCLOSE 0x0200
  2084. #define CS_SAVEBITS 0x0800
  2085. #define CS_BYTEALIGNCLIENT 0x1000
  2086. #define CS_BYTEALIGNWINDOW 0x2000
  2087. #define CS_GLOBALCLASS 0x4000
  2088. #define CS_IME 0x00010000
  2089. #if(_WIN32_WINNT >= 0x0501)
  2090. #define CS_DROPSHADOW 0x00020000
  2091. #endif /* _WIN32_WINNT >= 0x0501 */
  2092. #endif /* !NOWINSTYLES */
  2093. #if(WINVER >= 0x0400)
  2094. /* WM_PRINT flags */
  2095. #define PRF_CHECKVISIBLE 0x00000001L
  2096. #define PRF_NONCLIENT 0x00000002L
  2097. #define PRF_CLIENT 0x00000004L
  2098. #define PRF_ERASEBKGND 0x00000008L
  2099. #define PRF_CHILDREN 0x00000010L
  2100. #define PRF_OWNED 0x00000020L
  2101. /* 3D border styles */
  2102. #define BDR_RAISEDOUTER 0x0001
  2103. #define BDR_SUNKENOUTER 0x0002
  2104. #define BDR_RAISEDINNER 0x0004
  2105. #define BDR_SUNKENINNER 0x0008
  2106. #define BDR_OUTER (BDR_RAISEDOUTER | BDR_SUNKENOUTER)
  2107. #define BDR_INNER (BDR_RAISEDINNER | BDR_SUNKENINNER)
  2108. #define BDR_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
  2109. #define BDR_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
  2110. #define EDGE_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
  2111. #define EDGE_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
  2112. #define EDGE_ETCHED (BDR_SUNKENOUTER | BDR_RAISEDINNER)
  2113. #define EDGE_BUMP (BDR_RAISEDOUTER | BDR_SUNKENINNER)
  2114. /* Border flags */
  2115. #define BF_LEFT 0x0001
  2116. #define BF_TOP 0x0002
  2117. #define BF_RIGHT 0x0004
  2118. #define BF_BOTTOM 0x0008
  2119. #define BF_TOPLEFT (BF_TOP | BF_LEFT)
  2120. #define BF_TOPRIGHT (BF_TOP | BF_RIGHT)
  2121. #define BF_BOTTOMLEFT (BF_BOTTOM | BF_LEFT)
  2122. #define BF_BOTTOMRIGHT (BF_BOTTOM | BF_RIGHT)
  2123. #define BF_RECT (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
  2124. #define BF_DIAGONAL 0x0010
  2125. // For diagonal lines, the BF_RECT flags specify the end point of the
  2126. // vector bounded by the rectangle parameter.
  2127. #define BF_DIAGONAL_ENDTOPRIGHT (BF_DIAGONAL | BF_TOP | BF_RIGHT)
  2128. #define BF_DIAGONAL_ENDTOPLEFT (BF_DIAGONAL | BF_TOP | BF_LEFT)
  2129. #define BF_DIAGONAL_ENDBOTTOMLEFT (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
  2130. #define BF_DIAGONAL_ENDBOTTOMRIGHT (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
  2131. #define BF_MIDDLE 0x0800 /* Fill in the middle */
  2132. #define BF_SOFT 0x1000 /* For softer buttons */
  2133. #define BF_ADJUST 0x2000 /* Calculate the space left over */
  2134. #define BF_FLAT 0x4000 /* For flat rather than 3D borders */
  2135. #define BF_MONO 0x8000 /* For monochrome borders */
  2136. WINUSERAPI
  2137. BOOL
  2138. WINAPI
  2139. DrawEdge(
  2140. IN HDC hdc,
  2141. IN OUT LPRECT qrc,
  2142. IN UINT edge,
  2143. IN UINT grfFlags);
  2144. /* flags for DrawFrameControl */
  2145. #define DFC_CAPTION 1
  2146. #define DFC_MENU 2
  2147. #define DFC_SCROLL 3
  2148. #define DFC_BUTTON 4
  2149. #if(WINVER >= 0x0500)
  2150. #define DFC_POPUPMENU 5
  2151. #endif /* WINVER >= 0x0500 */
  2152. #define DFCS_CAPTIONCLOSE 0x0000
  2153. #define DFCS_CAPTIONMIN 0x0001
  2154. #define DFCS_CAPTIONMAX 0x0002
  2155. #define DFCS_CAPTIONRESTORE 0x0003
  2156. #define DFCS_CAPTIONHELP 0x0004
  2157. #define DFCS_MENUARROW 0x0000
  2158. #define DFCS_MENUCHECK 0x0001
  2159. #define DFCS_MENUBULLET 0x0002
  2160. #define DFCS_MENUARROWRIGHT 0x0004
  2161. #define DFCS_SCROLLUP 0x0000
  2162. #define DFCS_SCROLLDOWN 0x0001
  2163. #define DFCS_SCROLLLEFT 0x0002
  2164. #define DFCS_SCROLLRIGHT 0x0003
  2165. #define DFCS_SCROLLCOMBOBOX 0x0005
  2166. #define DFCS_SCROLLSIZEGRIP 0x0008
  2167. #define DFCS_SCROLLSIZEGRIPRIGHT 0x0010
  2168. #define DFCS_BUTTONCHECK 0x0000
  2169. #define DFCS_BUTTONRADIOIMAGE 0x0001
  2170. #define DFCS_BUTTONRADIOMASK 0x0002
  2171. #define DFCS_BUTTONRADIO 0x0004
  2172. #define DFCS_BUTTON3STATE 0x0008
  2173. #define DFCS_BUTTONPUSH 0x0010
  2174. #define DFCS_INACTIVE 0x0100
  2175. #define DFCS_PUSHED 0x0200
  2176. #define DFCS_CHECKED 0x0400
  2177. #if(WINVER >= 0x0500)
  2178. #define DFCS_TRANSPARENT 0x0800
  2179. #define DFCS_HOT 0x1000
  2180. #endif /* WINVER >= 0x0500 */
  2181. #define DFCS_ADJUSTRECT 0x2000
  2182. #define DFCS_FLAT 0x4000
  2183. #define DFCS_MONO 0x8000
  2184. WINUSERAPI
  2185. BOOL
  2186. WINAPI
  2187. DrawFrameControl(
  2188. IN HDC,
  2189. IN OUT LPRECT,
  2190. IN UINT,
  2191. IN UINT);
  2192. /* flags for DrawCaption */
  2193. #define DC_ACTIVE 0x0001
  2194. #define DC_SMALLCAP 0x0002
  2195. #define DC_ICON 0x0004
  2196. #define DC_TEXT 0x0008
  2197. #define DC_INBUTTON 0x0010
  2198. #if(WINVER >= 0x0500)
  2199. #define DC_GRADIENT 0x0020
  2200. #endif /* WINVER >= 0x0500 */
  2201. #if(_WIN32_WINNT >= 0x0501)
  2202. #define DC_BUTTONS 0x1000
  2203. #endif /* _WIN32_WINNT >= 0x0501 */
  2204. WINUSERAPI
  2205. BOOL
  2206. WINAPI
  2207. DrawCaption(IN HWND, IN HDC, IN CONST RECT *, IN UINT);
  2208. #define IDANI_OPEN 1
  2209. #define IDANI_CAPTION 3
  2210. WINUSERAPI
  2211. BOOL
  2212. WINAPI
  2213. DrawAnimatedRects(
  2214. IN HWND hwnd,
  2215. IN int idAni,
  2216. IN CONST RECT * lprcFrom,
  2217. IN CONST RECT * lprcTo);
  2218. #endif /* WINVER >= 0x0400 */
  2219. #ifndef NOCLIPBOARD
  2220. /*
  2221. * Predefined Clipboard Formats
  2222. */
  2223. #define CF_TEXT 1
  2224. #define CF_BITMAP 2
  2225. #define CF_METAFILEPICT 3
  2226. #define CF_SYLK 4
  2227. #define CF_DIF 5
  2228. #define CF_TIFF 6
  2229. #define CF_OEMTEXT 7
  2230. #define CF_DIB 8
  2231. #define CF_PALETTE 9
  2232. #define CF_PENDATA 10
  2233. #define CF_RIFF 11
  2234. #define CF_WAVE 12
  2235. #define CF_UNICODETEXT 13
  2236. #define CF_ENHMETAFILE 14
  2237. #if(WINVER >= 0x0400)
  2238. #define CF_HDROP 15
  2239. #define CF_LOCALE 16
  2240. #endif /* WINVER >= 0x0400 */
  2241. #if(WINVER >= 0x0500)
  2242. #define CF_DIBV5 17
  2243. #endif /* WINVER >= 0x0500 */
  2244. #if(WINVER >= 0x0500)
  2245. #define CF_MAX 18
  2246. #elif(WINVER >= 0x0400)
  2247. #define CF_MAX 17
  2248. #else
  2249. #define CF_MAX 15
  2250. #endif
  2251. #define CF_OWNERDISPLAY 0x0080
  2252. #define CF_DSPTEXT 0x0081
  2253. #define CF_DSPBITMAP 0x0082
  2254. #define CF_DSPMETAFILEPICT 0x0083
  2255. #define CF_DSPENHMETAFILE 0x008E
  2256. /*
  2257. * "Private" formats don't get GlobalFree()'d
  2258. */
  2259. #define CF_PRIVATEFIRST 0x0200
  2260. #define CF_PRIVATELAST 0x02FF
  2261. /*
  2262. * "GDIOBJ" formats do get DeleteObject()'d
  2263. */
  2264. #define CF_GDIOBJFIRST 0x0300
  2265. #define CF_GDIOBJLAST 0x03FF
  2266. #endif /* !NOCLIPBOARD */
  2267. /*
  2268. * Defines for the fVirt field of the Accelerator table structure.
  2269. */
  2270. #define FVIRTKEY TRUE /* Assumed to be == TRUE */
  2271. #define FNOINVERT 0x02
  2272. #define FSHIFT 0x04
  2273. #define FCONTROL 0x08
  2274. #define FALT 0x10
  2275. typedef struct tagACCEL {
  2276. #ifndef _MAC
  2277. BYTE fVirt; /* Also called the flags field */
  2278. WORD key;
  2279. WORD cmd;
  2280. #else
  2281. WORD fVirt; /* Also called the flags field */
  2282. WORD key;
  2283. DWORD cmd;
  2284. #endif
  2285. } ACCEL, *LPACCEL;
  2286. typedef struct tagPAINTSTRUCT {
  2287. HDC hdc;
  2288. BOOL fErase;
  2289. RECT rcPaint;
  2290. BOOL fRestore;
  2291. BOOL fIncUpdate;
  2292. BYTE rgbReserved[32];
  2293. } PAINTSTRUCT, *PPAINTSTRUCT, *NPPAINTSTRUCT, *LPPAINTSTRUCT;
  2294. typedef struct tagCREATESTRUCTA {
  2295. LPVOID lpCreateParams;
  2296. HINSTANCE hInstance;
  2297. HMENU hMenu;
  2298. HWND hwndParent;
  2299. int cy;
  2300. int cx;
  2301. int y;
  2302. int x;
  2303. LONG style;
  2304. LPCSTR lpszName;
  2305. LPCSTR lpszClass;
  2306. DWORD dwExStyle;
  2307. } CREATESTRUCTA, *LPCREATESTRUCTA;
  2308. typedef struct tagCREATESTRUCTW {
  2309. LPVOID lpCreateParams;
  2310. HINSTANCE hInstance;
  2311. HMENU hMenu;
  2312. HWND hwndParent;
  2313. int cy;
  2314. int cx;
  2315. int y;
  2316. int x;
  2317. LONG style;
  2318. LPCWSTR lpszName;
  2319. LPCWSTR lpszClass;
  2320. DWORD dwExStyle;
  2321. } CREATESTRUCTW, *LPCREATESTRUCTW;
  2322. #ifdef UNICODE
  2323. typedef CREATESTRUCTW CREATESTRUCT;
  2324. typedef LPCREATESTRUCTW LPCREATESTRUCT;
  2325. #else
  2326. typedef CREATESTRUCTA CREATESTRUCT;
  2327. typedef LPCREATESTRUCTA LPCREATESTRUCT;
  2328. #endif // UNICODE
  2329. typedef struct tagWINDOWPLACEMENT {
  2330. UINT length;
  2331. UINT flags;
  2332. UINT showCmd;
  2333. POINT ptMinPosition;
  2334. POINT ptMaxPosition;
  2335. RECT rcNormalPosition;
  2336. #ifdef _MAC
  2337. RECT rcDevice;
  2338. #endif
  2339. } WINDOWPLACEMENT;
  2340. typedef WINDOWPLACEMENT *PWINDOWPLACEMENT, *LPWINDOWPLACEMENT;
  2341. #define WPF_SETMINPOSITION 0x0001
  2342. #define WPF_RESTORETOMAXIMIZED 0x0002
  2343. #if(_WIN32_WINNT >= 0x0500)
  2344. #define WPF_ASYNCWINDOWPLACEMENT 0x0004
  2345. #endif /* _WIN32_WINNT >= 0x0500 */
  2346. #if(WINVER >= 0x0400)
  2347. typedef struct tagNMHDR
  2348. {
  2349. HWND hwndFrom;
  2350. UINT_PTR idFrom;
  2351. UINT code; // NM_ code
  2352. } NMHDR;
  2353. typedef NMHDR FAR * LPNMHDR;
  2354. typedef struct tagSTYLESTRUCT
  2355. {
  2356. DWORD styleOld;
  2357. DWORD styleNew;
  2358. } STYLESTRUCT, * LPSTYLESTRUCT;
  2359. #endif /* WINVER >= 0x0400 */
  2360. /*
  2361. * Owner draw control types
  2362. */
  2363. #define ODT_MENU 1
  2364. #define ODT_LISTBOX 2
  2365. #define ODT_COMBOBOX 3
  2366. #define ODT_BUTTON 4
  2367. #if(WINVER >= 0x0400)
  2368. #define ODT_STATIC 5
  2369. #endif /* WINVER >= 0x0400 */
  2370. /*
  2371. * Owner draw actions
  2372. */
  2373. #define ODA_DRAWENTIRE 0x0001
  2374. #define ODA_SELECT 0x0002
  2375. #define ODA_FOCUS 0x0004
  2376. /*
  2377. * Owner draw state
  2378. */
  2379. #define ODS_SELECTED 0x0001
  2380. #define ODS_GRAYED 0x0002
  2381. #define ODS_DISABLED 0x0004
  2382. #define ODS_CHECKED 0x0008
  2383. #define ODS_FOCUS 0x0010
  2384. #if(WINVER >= 0x0400)
  2385. #define ODS_DEFAULT 0x0020
  2386. #define ODS_COMBOBOXEDIT 0x1000
  2387. #endif /* WINVER >= 0x0400 */
  2388. #if(WINVER >= 0x0500)
  2389. #define ODS_HOTLIGHT 0x0040
  2390. #define ODS_INACTIVE 0x0080
  2391. #if(_WIN32_WINNT >= 0x0500)
  2392. #define ODS_NOACCEL 0x0100
  2393. #define ODS_NOFOCUSRECT 0x0200
  2394. #endif /* _WIN32_WINNT >= 0x0500 */
  2395. #endif /* WINVER >= 0x0500 */
  2396. /*
  2397. * MEASUREITEMSTRUCT for ownerdraw
  2398. */
  2399. typedef struct tagMEASUREITEMSTRUCT {
  2400. UINT CtlType;
  2401. UINT CtlID;
  2402. UINT itemID;
  2403. UINT itemWidth;
  2404. UINT itemHeight;
  2405. ULONG_PTR itemData;
  2406. } MEASUREITEMSTRUCT, NEAR *PMEASUREITEMSTRUCT, FAR *LPMEASUREITEMSTRUCT;
  2407. /*
  2408. * DRAWITEMSTRUCT for ownerdraw
  2409. */
  2410. typedef struct tagDRAWITEMSTRUCT {
  2411. UINT CtlType;
  2412. UINT CtlID;
  2413. UINT itemID;
  2414. UINT itemAction;
  2415. UINT itemState;
  2416. HWND hwndItem;
  2417. HDC hDC;
  2418. RECT rcItem;
  2419. ULONG_PTR itemData;
  2420. } DRAWITEMSTRUCT, NEAR *PDRAWITEMSTRUCT, FAR *LPDRAWITEMSTRUCT;
  2421. /*
  2422. * DELETEITEMSTRUCT for ownerdraw
  2423. */
  2424. typedef struct tagDELETEITEMSTRUCT {
  2425. UINT CtlType;
  2426. UINT CtlID;
  2427. UINT itemID;
  2428. HWND hwndItem;
  2429. ULONG_PTR itemData;
  2430. } DELETEITEMSTRUCT, NEAR *PDELETEITEMSTRUCT, FAR *LPDELETEITEMSTRUCT;
  2431. /*
  2432. * COMPAREITEMSTUCT for ownerdraw sorting
  2433. */
  2434. typedef struct tagCOMPAREITEMSTRUCT {
  2435. UINT CtlType;
  2436. UINT CtlID;
  2437. HWND hwndItem;
  2438. UINT itemID1;
  2439. ULONG_PTR itemData1;
  2440. UINT itemID2;
  2441. ULONG_PTR itemData2;
  2442. DWORD dwLocaleId;
  2443. } COMPAREITEMSTRUCT, NEAR *PCOMPAREITEMSTRUCT, FAR *LPCOMPAREITEMSTRUCT;
  2444. #ifndef NOMSG
  2445. /*
  2446. * Message Function Templates
  2447. */
  2448. WINUSERAPI
  2449. BOOL
  2450. WINAPI
  2451. GetMessageA(
  2452. OUT LPMSG lpMsg,
  2453. IN HWND hWnd,
  2454. IN UINT wMsgFilterMin,
  2455. IN UINT wMsgFilterMax);
  2456. WINUSERAPI
  2457. BOOL
  2458. WINAPI
  2459. GetMessageW(
  2460. OUT LPMSG lpMsg,
  2461. IN HWND hWnd,
  2462. IN UINT wMsgFilterMin,
  2463. IN UINT wMsgFilterMax);
  2464. #ifdef UNICODE
  2465. #define GetMessage GetMessageW
  2466. #else
  2467. #define GetMessage GetMessageA
  2468. #endif // !UNICODE
  2469. WINUSERAPI
  2470. BOOL
  2471. WINAPI
  2472. TranslateMessage(
  2473. IN CONST MSG *lpMsg);
  2474. WINUSERAPI
  2475. LRESULT
  2476. WINAPI
  2477. DispatchMessageA(
  2478. IN CONST MSG *lpMsg);
  2479. WINUSERAPI
  2480. LRESULT
  2481. WINAPI
  2482. DispatchMessageW(
  2483. IN CONST MSG *lpMsg);
  2484. #ifdef UNICODE
  2485. #define DispatchMessage DispatchMessageW
  2486. #else
  2487. #define DispatchMessage DispatchMessageA
  2488. #endif // !UNICODE
  2489. WINUSERAPI
  2490. BOOL
  2491. WINAPI
  2492. SetMessageQueue(
  2493. IN int cMessagesMax);
  2494. WINUSERAPI
  2495. BOOL
  2496. WINAPI
  2497. PeekMessageA(
  2498. OUT LPMSG lpMsg,
  2499. IN HWND hWnd,
  2500. IN UINT wMsgFilterMin,
  2501. IN UINT wMsgFilterMax,
  2502. IN UINT wRemoveMsg);
  2503. WINUSERAPI
  2504. BOOL
  2505. WINAPI
  2506. PeekMessageW(
  2507. OUT LPMSG lpMsg,
  2508. IN HWND hWnd,
  2509. IN UINT wMsgFilterMin,
  2510. IN UINT wMsgFilterMax,
  2511. IN UINT wRemoveMsg);
  2512. #ifdef UNICODE
  2513. #define PeekMessage PeekMessageW
  2514. #else
  2515. #define PeekMessage PeekMessageA
  2516. #endif // !UNICODE
  2517. /*
  2518. * PeekMessage() Options
  2519. */
  2520. #define PM_NOREMOVE 0x0000
  2521. #define PM_REMOVE 0x0001
  2522. #define PM_NOYIELD 0x0002
  2523. #if(WINVER >= 0x0500)
  2524. #define PM_QS_INPUT (QS_INPUT << 16)
  2525. #define PM_QS_POSTMESSAGE ((QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16)
  2526. #define PM_QS_PAINT (QS_PAINT << 16)
  2527. #define PM_QS_SENDMESSAGE (QS_SENDMESSAGE << 16)
  2528. #endif /* WINVER >= 0x0500 */
  2529. #endif /* !NOMSG */
  2530. WINUSERAPI
  2531. BOOL
  2532. WINAPI
  2533. RegisterHotKey(
  2534. IN HWND hWnd,
  2535. IN int id,
  2536. IN UINT fsModifiers,
  2537. IN UINT vk);
  2538. WINUSERAPI
  2539. BOOL
  2540. WINAPI
  2541. UnregisterHotKey(
  2542. IN HWND hWnd,
  2543. IN int id);
  2544. #define MOD_ALT 0x0001
  2545. #define MOD_CONTROL 0x0002
  2546. #define MOD_SHIFT 0x0004
  2547. #define MOD_WIN 0x0008
  2548. #define IDHOT_SNAPWINDOW (-1) /* SHIFT-PRINTSCRN */
  2549. #define IDHOT_SNAPDESKTOP (-2) /* PRINTSCRN */
  2550. #ifdef WIN_INTERNAL
  2551. #ifndef LSTRING
  2552. #define NOLSTRING
  2553. #endif /* LSTRING */
  2554. #ifndef LFILEIO
  2555. #define NOLFILEIO
  2556. #endif /* LFILEIO */
  2557. #endif /* WIN_INTERNAL */
  2558. #if(WINVER >= 0x0400)
  2559. #define ENDSESSION_LOGOFF 0x80000000
  2560. #endif /* WINVER >= 0x0400 */
  2561. #define EWX_LOGOFF 0
  2562. #define EWX_SHUTDOWN 0x00000001
  2563. #define EWX_REBOOT 0x00000002
  2564. #define EWX_FORCE 0x00000004
  2565. #define EWX_POWEROFF 0x00000008
  2566. #if(_WIN32_WINNT >= 0x0500)
  2567. #define EWX_FORCEIFHUNG 0x00000010
  2568. #endif /* _WIN32_WINNT >= 0x0500 */
  2569. #define ExitWindows(dwReserved, Code) ExitWindowsEx(EWX_LOGOFF, 0xFFFFFFFF)
  2570. WINUSERAPI
  2571. BOOL
  2572. WINAPI
  2573. ExitWindowsEx(
  2574. IN UINT uFlags,
  2575. IN DWORD dwReserved);
  2576. WINUSERAPI
  2577. BOOL
  2578. WINAPI
  2579. SwapMouseButton(
  2580. IN BOOL fSwap);
  2581. WINUSERAPI
  2582. DWORD
  2583. WINAPI
  2584. GetMessagePos(
  2585. VOID);
  2586. WINUSERAPI
  2587. LONG
  2588. WINAPI
  2589. GetMessageTime(
  2590. VOID);
  2591. WINUSERAPI
  2592. LPARAM
  2593. WINAPI
  2594. GetMessageExtraInfo(
  2595. VOID);
  2596. #if(WINVER >= 0x0400)
  2597. WINUSERAPI
  2598. LPARAM
  2599. WINAPI
  2600. SetMessageExtraInfo(
  2601. IN LPARAM lParam);
  2602. #endif /* WINVER >= 0x0400 */
  2603. WINUSERAPI
  2604. LRESULT
  2605. WINAPI
  2606. SendMessageA(
  2607. IN HWND hWnd,
  2608. IN UINT Msg,
  2609. IN WPARAM wParam,
  2610. IN LPARAM lParam);
  2611. WINUSERAPI
  2612. LRESULT
  2613. WINAPI
  2614. SendMessageW(
  2615. IN HWND hWnd,
  2616. IN UINT Msg,
  2617. IN WPARAM wParam,
  2618. IN LPARAM lParam);
  2619. #ifdef UNICODE
  2620. #define SendMessage SendMessageW
  2621. #else
  2622. #define SendMessage SendMessageA
  2623. #endif // !UNICODE
  2624. WINUSERAPI
  2625. LRESULT
  2626. WINAPI
  2627. SendMessageTimeoutA(
  2628. IN HWND hWnd,
  2629. IN UINT Msg,
  2630. IN WPARAM wParam,
  2631. IN LPARAM lParam,
  2632. IN UINT fuFlags,
  2633. IN UINT uTimeout,
  2634. OUT PDWORD_PTR lpdwResult);
  2635. WINUSERAPI
  2636. LRESULT
  2637. WINAPI
  2638. SendMessageTimeoutW(
  2639. IN HWND hWnd,
  2640. IN UINT Msg,
  2641. IN WPARAM wParam,
  2642. IN LPARAM lParam,
  2643. IN UINT fuFlags,
  2644. IN UINT uTimeout,
  2645. OUT PDWORD_PTR lpdwResult);
  2646. #ifdef UNICODE
  2647. #define SendMessageTimeout SendMessageTimeoutW
  2648. #else
  2649. #define SendMessageTimeout SendMessageTimeoutA
  2650. #endif // !UNICODE
  2651. WINUSERAPI
  2652. BOOL
  2653. WINAPI
  2654. SendNotifyMessageA(
  2655. IN HWND hWnd,
  2656. IN UINT Msg,
  2657. IN WPARAM wParam,
  2658. IN LPARAM lParam);
  2659. WINUSERAPI
  2660. BOOL
  2661. WINAPI
  2662. SendNotifyMessageW(
  2663. IN HWND hWnd,
  2664. IN UINT Msg,
  2665. IN WPARAM wParam,
  2666. IN LPARAM lParam);
  2667. #ifdef UNICODE
  2668. #define SendNotifyMessage SendNotifyMessageW
  2669. #else
  2670. #define SendNotifyMessage SendNotifyMessageA
  2671. #endif // !UNICODE
  2672. WINUSERAPI
  2673. BOOL
  2674. WINAPI
  2675. SendMessageCallbackA(
  2676. IN HWND hWnd,
  2677. IN UINT Msg,
  2678. IN WPARAM wParam,
  2679. IN LPARAM lParam,
  2680. IN SENDASYNCPROC lpResultCallBack,
  2681. IN ULONG_PTR dwData);
  2682. WINUSERAPI
  2683. BOOL
  2684. WINAPI
  2685. SendMessageCallbackW(
  2686. IN HWND hWnd,
  2687. IN UINT Msg,
  2688. IN WPARAM wParam,
  2689. IN LPARAM lParam,
  2690. IN SENDASYNCPROC lpResultCallBack,
  2691. IN ULONG_PTR dwData);
  2692. #ifdef UNICODE
  2693. #define SendMessageCallback SendMessageCallbackW
  2694. #else
  2695. #define SendMessageCallback SendMessageCallbackA
  2696. #endif // !UNICODE
  2697. #if(_WIN32_WINNT >= 0x0501)
  2698. typedef struct {
  2699. UINT cbSize;
  2700. HDESK hdesk;
  2701. HWND hwnd;
  2702. LUID luid;
  2703. } BSMINFO, *PBSMINFO;
  2704. WINUSERAPI
  2705. long
  2706. WINAPI
  2707. BroadcastSystemMessageExA(
  2708. IN DWORD,
  2709. IN LPDWORD,
  2710. IN UINT,
  2711. IN WPARAM,
  2712. IN LPARAM,
  2713. OUT PBSMINFO);
  2714. WINUSERAPI
  2715. long
  2716. WINAPI
  2717. BroadcastSystemMessageExW(
  2718. IN DWORD,
  2719. IN LPDWORD,
  2720. IN UINT,
  2721. IN WPARAM,
  2722. IN LPARAM,
  2723. OUT PBSMINFO);
  2724. #ifdef UNICODE
  2725. #define BroadcastSystemMessageEx BroadcastSystemMessageExW
  2726. #else
  2727. #define BroadcastSystemMessageEx BroadcastSystemMessageExA
  2728. #endif // !UNICODE
  2729. #endif /* _WIN32_WINNT >= 0x0501 */
  2730. #if(WINVER >= 0x0400)
  2731. #if defined(_WIN32_WINNT)
  2732. WINUSERAPI
  2733. long
  2734. WINAPI
  2735. BroadcastSystemMessageA(
  2736. IN DWORD,
  2737. IN LPDWORD,
  2738. IN UINT,
  2739. IN WPARAM,
  2740. IN LPARAM);
  2741. WINUSERAPI
  2742. long
  2743. WINAPI
  2744. BroadcastSystemMessageW(
  2745. IN DWORD,
  2746. IN LPDWORD,
  2747. IN UINT,
  2748. IN WPARAM,
  2749. IN LPARAM);
  2750. #ifdef UNICODE
  2751. #define BroadcastSystemMessage BroadcastSystemMessageW
  2752. #else
  2753. #define BroadcastSystemMessage BroadcastSystemMessageA
  2754. #endif // !UNICODE
  2755. #elif defined(_WIN32_WINDOWS)
  2756. // The Win95 version isn't A/W decorated
  2757. WINUSERAPI
  2758. long
  2759. WINAPI
  2760. BroadcastSystemMessage(
  2761. IN DWORD,
  2762. IN LPDWORD,
  2763. IN UINT,
  2764. IN WPARAM,
  2765. IN LPARAM);
  2766. #endif
  2767. //Broadcast Special Message Recipient list
  2768. #define BSM_ALLCOMPONENTS 0x00000000
  2769. #define BSM_VXDS 0x00000001
  2770. #define BSM_NETDRIVER 0x00000002
  2771. #define BSM_INSTALLABLEDRIVERS 0x00000004
  2772. #define BSM_APPLICATIONS 0x00000008
  2773. #define BSM_ALLDESKTOPS 0x00000010
  2774. //Broadcast Special Message Flags
  2775. #define BSF_QUERY 0x00000001
  2776. #define BSF_IGNORECURRENTTASK 0x00000002
  2777. #define BSF_FLUSHDISK 0x00000004
  2778. #define BSF_NOHANG 0x00000008
  2779. #define BSF_POSTMESSAGE 0x00000010
  2780. #define BSF_FORCEIFHUNG 0x00000020
  2781. #define BSF_NOTIMEOUTIFNOTHUNG 0x00000040
  2782. #if(_WIN32_WINNT >= 0x0500)
  2783. #define BSF_ALLOWSFW 0x00000080
  2784. #define BSF_SENDNOTIFYMESSAGE 0x00000100
  2785. #endif /* _WIN32_WINNT >= 0x0500 */
  2786. #if(_WIN32_WINNT >= 0x0501)
  2787. #define BSF_RETURNHDESK 0x00000200
  2788. #define BSF_LUID 0x00000400
  2789. #endif /* _WIN32_WINNT >= 0x0501 */
  2790. #define BROADCAST_QUERY_DENY 0x424D5144 // Return this value to deny a query.
  2791. #endif /* WINVER >= 0x0400 */
  2792. // RegisterDeviceNotification
  2793. #if(WINVER >= 0x0500)
  2794. typedef PVOID HDEVNOTIFY;
  2795. typedef HDEVNOTIFY *PHDEVNOTIFY;
  2796. #define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000
  2797. #define DEVICE_NOTIFY_SERVICE_HANDLE 0x00000001
  2798. #if(_WIN32_WINNT >= 0x0501)
  2799. #define DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 0x00000004
  2800. #endif /* _WIN32_WINNT >= 0x0501 */
  2801. WINUSERAPI
  2802. HDEVNOTIFY
  2803. WINAPI
  2804. RegisterDeviceNotificationA(
  2805. IN HANDLE hRecipient,
  2806. IN LPVOID NotificationFilter,
  2807. IN DWORD Flags
  2808. );
  2809. WINUSERAPI
  2810. HDEVNOTIFY
  2811. WINAPI
  2812. RegisterDeviceNotificationW(
  2813. IN HANDLE hRecipient,
  2814. IN LPVOID NotificationFilter,
  2815. IN DWORD Flags
  2816. );
  2817. #ifdef UNICODE
  2818. #define RegisterDeviceNotification RegisterDeviceNotificationW
  2819. #else
  2820. #define RegisterDeviceNotification RegisterDeviceNotificationA
  2821. #endif // !UNICODE
  2822. WINUSERAPI
  2823. BOOL
  2824. WINAPI
  2825. UnregisterDeviceNotification(
  2826. IN HDEVNOTIFY Handle
  2827. );
  2828. #endif /* WINVER >= 0x0500 */
  2829. WINUSERAPI
  2830. BOOL
  2831. WINAPI
  2832. PostMessageA(
  2833. IN HWND hWnd,
  2834. IN UINT Msg,
  2835. IN WPARAM wParam,
  2836. IN LPARAM lParam);
  2837. WINUSERAPI
  2838. BOOL
  2839. WINAPI
  2840. PostMessageW(
  2841. IN HWND hWnd,
  2842. IN UINT Msg,
  2843. IN WPARAM wParam,
  2844. IN LPARAM lParam);
  2845. #ifdef UNICODE
  2846. #define PostMessage PostMessageW
  2847. #else
  2848. #define PostMessage PostMessageA
  2849. #endif // !UNICODE
  2850. WINUSERAPI
  2851. BOOL
  2852. WINAPI
  2853. PostThreadMessageA(
  2854. IN DWORD idThread,
  2855. IN UINT Msg,
  2856. IN WPARAM wParam,
  2857. IN LPARAM lParam);
  2858. WINUSERAPI
  2859. BOOL
  2860. WINAPI
  2861. PostThreadMessageW(
  2862. IN DWORD idThread,
  2863. IN UINT Msg,
  2864. IN WPARAM wParam,
  2865. IN LPARAM lParam);
  2866. #ifdef UNICODE
  2867. #define PostThreadMessage PostThreadMessageW
  2868. #else
  2869. #define PostThreadMessage PostThreadMessageA
  2870. #endif // !UNICODE
  2871. #define PostAppMessageA(idThread, wMsg, wParam, lParam)\
  2872. PostThreadMessageA((DWORD)idThread, wMsg, wParam, lParam)
  2873. #define PostAppMessageW(idThread, wMsg, wParam, lParam)\
  2874. PostThreadMessageW((DWORD)idThread, wMsg, wParam, lParam)
  2875. #ifdef UNICODE
  2876. #define PostAppMessage PostAppMessageW
  2877. #else
  2878. #define PostAppMessage PostAppMessageA
  2879. #endif // !UNICODE
  2880. /*
  2881. * Special HWND value for use with PostMessage() and SendMessage()
  2882. */
  2883. #define HWND_BROADCAST ((HWND)0xffff)
  2884. #if(WINVER >= 0x0500)
  2885. #define HWND_MESSAGE ((HWND)-3)
  2886. #endif /* WINVER >= 0x0500 */
  2887. WINUSERAPI
  2888. BOOL
  2889. WINAPI
  2890. AttachThreadInput(
  2891. IN DWORD idAttach,
  2892. IN DWORD idAttachTo,
  2893. IN BOOL fAttach);
  2894. WINUSERAPI
  2895. BOOL
  2896. WINAPI
  2897. ReplyMessage(
  2898. IN LRESULT lResult);
  2899. WINUSERAPI
  2900. BOOL
  2901. WINAPI
  2902. WaitMessage(
  2903. VOID);
  2904. WINUSERAPI
  2905. DWORD
  2906. WINAPI
  2907. WaitForInputIdle(
  2908. IN HANDLE hProcess,
  2909. IN DWORD dwMilliseconds);
  2910. WINUSERAPI
  2911. #ifndef _MAC
  2912. LRESULT
  2913. WINAPI
  2914. #else
  2915. LRESULT
  2916. CALLBACK
  2917. #endif
  2918. DefWindowProcA(
  2919. IN HWND hWnd,
  2920. IN UINT Msg,
  2921. IN WPARAM wParam,
  2922. IN LPARAM lParam);
  2923. WINUSERAPI
  2924. #ifndef _MAC
  2925. LRESULT
  2926. WINAPI
  2927. #else
  2928. LRESULT
  2929. CALLBACK
  2930. #endif
  2931. DefWindowProcW(
  2932. IN HWND hWnd,
  2933. IN UINT Msg,
  2934. IN WPARAM wParam,
  2935. IN LPARAM lParam);
  2936. #ifdef UNICODE
  2937. #define DefWindowProc DefWindowProcW
  2938. #else
  2939. #define DefWindowProc DefWindowProcA
  2940. #endif // !UNICODE
  2941. WINUSERAPI
  2942. VOID
  2943. WINAPI
  2944. PostQuitMessage(
  2945. IN int nExitCode);
  2946. #ifdef STRICT
  2947. WINUSERAPI
  2948. LRESULT
  2949. WINAPI
  2950. CallWindowProcA(
  2951. IN WNDPROC lpPrevWndFunc,
  2952. IN HWND hWnd,
  2953. IN UINT Msg,
  2954. IN WPARAM wParam,
  2955. IN LPARAM lParam);
  2956. WINUSERAPI
  2957. LRESULT
  2958. WINAPI
  2959. CallWindowProcW(
  2960. IN WNDPROC lpPrevWndFunc,
  2961. IN HWND hWnd,
  2962. IN UINT Msg,
  2963. IN WPARAM wParam,
  2964. IN LPARAM lParam);
  2965. #ifdef UNICODE
  2966. #define CallWindowProc CallWindowProcW
  2967. #else
  2968. #define CallWindowProc CallWindowProcA
  2969. #endif // !UNICODE
  2970. #else /* !STRICT */
  2971. WINUSERAPI
  2972. LRESULT
  2973. WINAPI
  2974. CallWindowProcA(
  2975. IN FARPROC lpPrevWndFunc,
  2976. IN HWND hWnd,
  2977. IN UINT Msg,
  2978. IN WPARAM wParam,
  2979. IN LPARAM lParam);
  2980. WINUSERAPI
  2981. LRESULT
  2982. WINAPI
  2983. CallWindowProcW(
  2984. IN FARPROC lpPrevWndFunc,
  2985. IN HWND hWnd,
  2986. IN UINT Msg,
  2987. IN WPARAM wParam,
  2988. IN LPARAM lParam);
  2989. #ifdef UNICODE
  2990. #define CallWindowProc CallWindowProcW
  2991. #else
  2992. #define CallWindowProc CallWindowProcA
  2993. #endif // !UNICODE
  2994. #endif /* !STRICT */
  2995. WINUSERAPI
  2996. BOOL
  2997. WINAPI
  2998. InSendMessage(
  2999. VOID);
  3000. #if(WINVER >= 0x0500)
  3001. WINUSERAPI
  3002. DWORD
  3003. WINAPI
  3004. InSendMessageEx(
  3005. IN LPVOID lpReserved);
  3006. /*
  3007. * InSendMessageEx return value
  3008. */
  3009. #define ISMEX_NOSEND 0x00000000
  3010. #define ISMEX_SEND 0x00000001
  3011. #define ISMEX_NOTIFY 0x00000002
  3012. #define ISMEX_CALLBACK 0x00000004
  3013. #define ISMEX_REPLIED 0x00000008
  3014. #endif /* WINVER >= 0x0500 */
  3015. WINUSERAPI
  3016. UINT
  3017. WINAPI
  3018. GetDoubleClickTime(
  3019. VOID);
  3020. WINUSERAPI
  3021. BOOL
  3022. WINAPI
  3023. SetDoubleClickTime(
  3024. IN UINT);
  3025. WINUSERAPI
  3026. ATOM
  3027. WINAPI
  3028. RegisterClassA(
  3029. IN CONST WNDCLASSA *lpWndClass);
  3030. WINUSERAPI
  3031. ATOM
  3032. WINAPI
  3033. RegisterClassW(
  3034. IN CONST WNDCLASSW *lpWndClass);
  3035. #ifdef UNICODE
  3036. #define RegisterClass RegisterClassW
  3037. #else
  3038. #define RegisterClass RegisterClassA
  3039. #endif // !UNICODE
  3040. WINUSERAPI
  3041. BOOL
  3042. WINAPI
  3043. UnregisterClassA(
  3044. IN LPCSTR lpClassName,
  3045. IN HINSTANCE hInstance);
  3046. WINUSERAPI
  3047. BOOL
  3048. WINAPI
  3049. UnregisterClassW(
  3050. IN LPCWSTR lpClassName,
  3051. IN HINSTANCE hInstance);
  3052. #ifdef UNICODE
  3053. #define UnregisterClass UnregisterClassW
  3054. #else
  3055. #define UnregisterClass UnregisterClassA
  3056. #endif // !UNICODE
  3057. WINUSERAPI
  3058. BOOL
  3059. WINAPI
  3060. GetClassInfoA(
  3061. IN HINSTANCE hInstance,
  3062. IN LPCSTR lpClassName,
  3063. OUT LPWNDCLASSA lpWndClass);
  3064. WINUSERAPI
  3065. BOOL
  3066. WINAPI
  3067. GetClassInfoW(
  3068. IN HINSTANCE hInstance,
  3069. IN LPCWSTR lpClassName,
  3070. OUT LPWNDCLASSW lpWndClass);
  3071. #ifdef UNICODE
  3072. #define GetClassInfo GetClassInfoW
  3073. #else
  3074. #define GetClassInfo GetClassInfoA
  3075. #endif // !UNICODE
  3076. #if(WINVER >= 0x0400)
  3077. WINUSERAPI
  3078. ATOM
  3079. WINAPI
  3080. RegisterClassExA(
  3081. IN CONST WNDCLASSEXA *);
  3082. WINUSERAPI
  3083. ATOM
  3084. WINAPI
  3085. RegisterClassExW(
  3086. IN CONST WNDCLASSEXW *);
  3087. #ifdef UNICODE
  3088. #define RegisterClassEx RegisterClassExW
  3089. #else
  3090. #define RegisterClassEx RegisterClassExA
  3091. #endif // !UNICODE
  3092. WINUSERAPI
  3093. BOOL
  3094. WINAPI
  3095. GetClassInfoExA(
  3096. IN HINSTANCE,
  3097. IN LPCSTR,
  3098. OUT LPWNDCLASSEXA);
  3099. WINUSERAPI
  3100. BOOL
  3101. WINAPI
  3102. GetClassInfoExW(
  3103. IN HINSTANCE,
  3104. IN LPCWSTR,
  3105. OUT LPWNDCLASSEXW);
  3106. #ifdef UNICODE
  3107. #define GetClassInfoEx GetClassInfoExW
  3108. #else
  3109. #define GetClassInfoEx GetClassInfoExA
  3110. #endif // !UNICODE
  3111. #endif /* WINVER >= 0x0400 */
  3112. #define CW_USEDEFAULT ((int)0x80000000)
  3113. /*
  3114. * Special value for CreateWindow, et al.
  3115. */
  3116. #define HWND_DESKTOP ((HWND)0)
  3117. #if(_WIN32_WINNT >= 0x0501)
  3118. typedef BOOLEAN (WINAPI * PREGISTERCLASSNAMEW)(LPCWSTR);
  3119. #endif /* _WIN32_WINNT >= 0x0501 */
  3120. WINUSERAPI
  3121. HWND
  3122. WINAPI
  3123. CreateWindowExA(
  3124. IN DWORD dwExStyle,
  3125. IN LPCSTR lpClassName,
  3126. IN LPCSTR lpWindowName,
  3127. IN DWORD dwStyle,
  3128. IN int X,
  3129. IN int Y,
  3130. IN int nWidth,
  3131. IN int nHeight,
  3132. IN HWND hWndParent,
  3133. IN HMENU hMenu,
  3134. IN HINSTANCE hInstance,
  3135. IN LPVOID lpParam);
  3136. WINUSERAPI
  3137. HWND
  3138. WINAPI
  3139. CreateWindowExW(
  3140. IN DWORD dwExStyle,
  3141. IN LPCWSTR lpClassName,
  3142. IN LPCWSTR lpWindowName,
  3143. IN DWORD dwStyle,
  3144. IN int X,
  3145. IN int Y,
  3146. IN int nWidth,
  3147. IN int nHeight,
  3148. IN HWND hWndParent,
  3149. IN HMENU hMenu,
  3150. IN HINSTANCE hInstance,
  3151. IN LPVOID lpParam);
  3152. #ifdef UNICODE
  3153. #define CreateWindowEx CreateWindowExW
  3154. #else
  3155. #define CreateWindowEx CreateWindowExA
  3156. #endif // !UNICODE
  3157. #define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\
  3158. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\
  3159. CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\
  3160. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
  3161. #define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y,\
  3162. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\
  3163. CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y,\
  3164. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
  3165. #ifdef UNICODE
  3166. #define CreateWindow CreateWindowW
  3167. #else
  3168. #define CreateWindow CreateWindowA
  3169. #endif // !UNICODE
  3170. WINUSERAPI
  3171. BOOL
  3172. WINAPI
  3173. IsWindow(
  3174. IN HWND hWnd);
  3175. WINUSERAPI
  3176. BOOL
  3177. WINAPI
  3178. IsMenu(
  3179. IN HMENU hMenu);
  3180. WINUSERAPI
  3181. BOOL
  3182. WINAPI
  3183. IsChild(
  3184. IN HWND hWndParent,
  3185. IN HWND hWnd);
  3186. WINUSERAPI
  3187. BOOL
  3188. WINAPI
  3189. DestroyWindow(
  3190. IN HWND hWnd);
  3191. WINUSERAPI
  3192. BOOL
  3193. WINAPI
  3194. ShowWindow(
  3195. IN HWND hWnd,
  3196. IN int nCmdShow);
  3197. #if(WINVER >= 0x0500)
  3198. WINUSERAPI
  3199. BOOL
  3200. WINAPI
  3201. AnimateWindow(
  3202. IN HWND hWnd,
  3203. IN DWORD dwTime,
  3204. IN DWORD dwFlags);
  3205. #endif /* WINVER >= 0x0500 */
  3206. #if(_WIN32_WINNT >= 0x0500)
  3207. #if defined(_WINGDI_) && !defined (NOGDI)
  3208. WINUSERAPI
  3209. BOOL
  3210. WINAPI
  3211. UpdateLayeredWindow(
  3212. HWND hWnd,
  3213. HDC hdcDst,
  3214. POINT *pptDst,
  3215. SIZE *psize,
  3216. HDC hdcSrc,
  3217. POINT *pptSrc,
  3218. COLORREF crKey,
  3219. BLENDFUNCTION *pblend,
  3220. DWORD dwFlags);
  3221. #endif
  3222. #if(_WIN32_WINNT >= 0x0501)
  3223. WINUSERAPI
  3224. BOOL
  3225. WINAPI
  3226. GetLayeredWindowAttributes(
  3227. HWND hwnd,
  3228. COLORREF *pcrKey,
  3229. BYTE *pbAlpha,
  3230. DWORD *pdwFlags);
  3231. #define PW_CLIENTONLY 0x00000001
  3232. WINUSERAPI
  3233. BOOL
  3234. WINAPI
  3235. PrintWindow(
  3236. IN HWND hwnd,
  3237. IN HDC hdcBlt,
  3238. IN UINT nFlags);
  3239. #endif /* _WIN32_WINNT >= 0x0501 */
  3240. WINUSERAPI
  3241. BOOL
  3242. WINAPI
  3243. SetLayeredWindowAttributes(
  3244. HWND hwnd,
  3245. COLORREF crKey,
  3246. BYTE bAlpha,
  3247. DWORD dwFlags);
  3248. #define LWA_COLORKEY 0x00000001
  3249. #define LWA_ALPHA 0x00000002
  3250. #define ULW_COLORKEY 0x00000001
  3251. #define ULW_ALPHA 0x00000002
  3252. #define ULW_OPAQUE 0x00000004
  3253. #endif /* _WIN32_WINNT >= 0x0500 */
  3254. #if(WINVER >= 0x0400)
  3255. WINUSERAPI
  3256. BOOL
  3257. WINAPI
  3258. ShowWindowAsync(
  3259. IN HWND hWnd,
  3260. IN int nCmdShow);
  3261. #endif /* WINVER >= 0x0400 */
  3262. WINUSERAPI
  3263. BOOL
  3264. WINAPI
  3265. FlashWindow(
  3266. IN HWND hWnd,
  3267. IN BOOL bInvert);
  3268. #if(WINVER >= 0x0500)
  3269. typedef struct {
  3270. UINT cbSize;
  3271. HWND hwnd;
  3272. DWORD dwFlags;
  3273. UINT uCount;
  3274. DWORD dwTimeout;
  3275. } FLASHWINFO, *PFLASHWINFO;
  3276. WINUSERAPI
  3277. BOOL
  3278. WINAPI
  3279. FlashWindowEx(
  3280. PFLASHWINFO pfwi);
  3281. #define FLASHW_STOP 0
  3282. #define FLASHW_CAPTION 0x00000001
  3283. #define FLASHW_TRAY 0x00000002
  3284. #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY)
  3285. #define FLASHW_TIMER 0x00000004
  3286. #define FLASHW_TIMERNOFG 0x0000000C
  3287. #endif /* WINVER >= 0x0500 */
  3288. WINUSERAPI
  3289. BOOL
  3290. WINAPI
  3291. ShowOwnedPopups(
  3292. IN HWND hWnd,
  3293. IN BOOL fShow);
  3294. WINUSERAPI
  3295. BOOL
  3296. WINAPI
  3297. OpenIcon(
  3298. IN HWND hWnd);
  3299. WINUSERAPI
  3300. BOOL
  3301. WINAPI
  3302. CloseWindow(
  3303. IN HWND hWnd);
  3304. WINUSERAPI
  3305. BOOL
  3306. WINAPI
  3307. MoveWindow(
  3308. IN HWND hWnd,
  3309. IN int X,
  3310. IN int Y,
  3311. IN int nWidth,
  3312. IN int nHeight,
  3313. IN BOOL bRepaint);
  3314. WINUSERAPI
  3315. BOOL
  3316. WINAPI
  3317. SetWindowPos(
  3318. IN HWND hWnd,
  3319. IN HWND hWndInsertAfter,
  3320. IN int X,
  3321. IN int Y,
  3322. IN int cx,
  3323. IN int cy,
  3324. IN UINT uFlags);
  3325. WINUSERAPI
  3326. BOOL
  3327. WINAPI
  3328. GetWindowPlacement(
  3329. IN HWND hWnd,
  3330. OUT WINDOWPLACEMENT *lpwndpl);
  3331. WINUSERAPI
  3332. BOOL
  3333. WINAPI
  3334. SetWindowPlacement(
  3335. IN HWND hWnd,
  3336. IN CONST WINDOWPLACEMENT *lpwndpl);
  3337. #ifndef NODEFERWINDOWPOS
  3338. WINUSERAPI
  3339. HDWP
  3340. WINAPI
  3341. BeginDeferWindowPos(
  3342. IN int nNumWindows);
  3343. WINUSERAPI
  3344. HDWP
  3345. WINAPI
  3346. DeferWindowPos(
  3347. IN HDWP hWinPosInfo,
  3348. IN HWND hWnd,
  3349. IN HWND hWndInsertAfter,
  3350. IN int x,
  3351. IN int y,
  3352. IN int cx,
  3353. IN int cy,
  3354. IN UINT uFlags);
  3355. WINUSERAPI
  3356. BOOL
  3357. WINAPI
  3358. EndDeferWindowPos(
  3359. IN HDWP hWinPosInfo);
  3360. #endif /* !NODEFERWINDOWPOS */
  3361. WINUSERAPI
  3362. BOOL
  3363. WINAPI
  3364. IsWindowVisible(
  3365. IN HWND hWnd);
  3366. WINUSERAPI
  3367. BOOL
  3368. WINAPI
  3369. IsIconic(
  3370. IN HWND hWnd);
  3371. WINUSERAPI
  3372. BOOL
  3373. WINAPI
  3374. AnyPopup(
  3375. VOID);
  3376. WINUSERAPI
  3377. BOOL
  3378. WINAPI
  3379. BringWindowToTop(
  3380. IN HWND hWnd);
  3381. WINUSERAPI
  3382. BOOL
  3383. WINAPI
  3384. IsZoomed(
  3385. IN HWND hWnd);
  3386. /*
  3387. * SetWindowPos Flags
  3388. */
  3389. #define SWP_NOSIZE 0x0001
  3390. #define SWP_NOMOVE 0x0002
  3391. #define SWP_NOZORDER 0x0004
  3392. #define SWP_NOREDRAW 0x0008
  3393. #define SWP_NOACTIVATE 0x0010
  3394. #define SWP_FRAMECHANGED 0x0020 /* The frame changed: send WM_NCCALCSIZE */
  3395. #define SWP_SHOWWINDOW 0x0040
  3396. #define SWP_HIDEWINDOW 0x0080
  3397. #define SWP_NOCOPYBITS 0x0100
  3398. #define SWP_NOOWNERZORDER 0x0200 /* Don't do owner Z ordering */
  3399. #define SWP_NOSENDCHANGING 0x0400 /* Don't send WM_WINDOWPOSCHANGING */
  3400. #define SWP_DRAWFRAME SWP_FRAMECHANGED
  3401. #define SWP_NOREPOSITION SWP_NOOWNERZORDER
  3402. #if(WINVER >= 0x0400)
  3403. #define SWP_DEFERERASE 0x2000
  3404. #define SWP_ASYNCWINDOWPOS 0x4000
  3405. #endif /* WINVER >= 0x0400 */
  3406. #define HWND_TOP ((HWND)0)
  3407. #define HWND_BOTTOM ((HWND)1)
  3408. #define HWND_TOPMOST ((HWND)-1)
  3409. #define HWND_NOTOPMOST ((HWND)-2)
  3410. #ifndef NOCTLMGR
  3411. /*
  3412. * WARNING:
  3413. * The following structures must NOT be DWORD padded because they are
  3414. * followed by strings, etc that do not have to be DWORD aligned.
  3415. */
  3416. #include <pshpack2.h>
  3417. /*
  3418. * original NT 32 bit dialog template:
  3419. */
  3420. typedef struct {
  3421. DWORD style;
  3422. DWORD dwExtendedStyle;
  3423. WORD cdit;
  3424. short x;
  3425. short y;
  3426. short cx;
  3427. short cy;
  3428. } DLGTEMPLATE;
  3429. typedef DLGTEMPLATE *LPDLGTEMPLATEA;
  3430. typedef DLGTEMPLATE *LPDLGTEMPLATEW;
  3431. #ifdef UNICODE
  3432. typedef LPDLGTEMPLATEW LPDLGTEMPLATE;
  3433. #else
  3434. typedef LPDLGTEMPLATEA LPDLGTEMPLATE;
  3435. #endif // UNICODE
  3436. typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEA;
  3437. typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEW;
  3438. #ifdef UNICODE
  3439. typedef LPCDLGTEMPLATEW LPCDLGTEMPLATE;
  3440. #else
  3441. typedef LPCDLGTEMPLATEA LPCDLGTEMPLATE;
  3442. #endif // UNICODE
  3443. /*
  3444. * 32 bit Dialog item template.
  3445. */
  3446. typedef struct {
  3447. DWORD style;
  3448. DWORD dwExtendedStyle;
  3449. short x;
  3450. short y;
  3451. short cx;
  3452. short cy;
  3453. WORD id;
  3454. } DLGITEMTEMPLATE;
  3455. typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEA;
  3456. typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEW;
  3457. #ifdef UNICODE
  3458. typedef PDLGITEMTEMPLATEW PDLGITEMTEMPLATE;
  3459. #else
  3460. typedef PDLGITEMTEMPLATEA PDLGITEMTEMPLATE;
  3461. #endif // UNICODE
  3462. typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEA;
  3463. typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEW;
  3464. #ifdef UNICODE
  3465. typedef LPDLGITEMTEMPLATEW LPDLGITEMTEMPLATE;
  3466. #else
  3467. typedef LPDLGITEMTEMPLATEA LPDLGITEMTEMPLATE;
  3468. #endif // UNICODE
  3469. #include <poppack.h> /* Resume normal packing */
  3470. WINUSERAPI
  3471. HWND
  3472. WINAPI
  3473. CreateDialogParamA(
  3474. IN HINSTANCE hInstance,
  3475. IN LPCSTR lpTemplateName,
  3476. IN HWND hWndParent,
  3477. IN DLGPROC lpDialogFunc,
  3478. IN LPARAM dwInitParam);
  3479. WINUSERAPI
  3480. HWND
  3481. WINAPI
  3482. CreateDialogParamW(
  3483. IN HINSTANCE hInstance,
  3484. IN LPCWSTR lpTemplateName,
  3485. IN HWND hWndParent,
  3486. IN DLGPROC lpDialogFunc,
  3487. IN LPARAM dwInitParam);
  3488. #ifdef UNICODE
  3489. #define CreateDialogParam CreateDialogParamW
  3490. #else
  3491. #define CreateDialogParam CreateDialogParamA
  3492. #endif // !UNICODE
  3493. WINUSERAPI
  3494. HWND
  3495. WINAPI
  3496. CreateDialogIndirectParamA(
  3497. IN HINSTANCE hInstance,
  3498. IN LPCDLGTEMPLATEA lpTemplate,
  3499. IN HWND hWndParent,
  3500. IN DLGPROC lpDialogFunc,
  3501. IN LPARAM dwInitParam);
  3502. WINUSERAPI
  3503. HWND
  3504. WINAPI
  3505. CreateDialogIndirectParamW(
  3506. IN HINSTANCE hInstance,
  3507. IN LPCDLGTEMPLATEW lpTemplate,
  3508. IN HWND hWndParent,
  3509. IN DLGPROC lpDialogFunc,
  3510. IN LPARAM dwInitParam);
  3511. #ifdef UNICODE
  3512. #define CreateDialogIndirectParam CreateDialogIndirectParamW
  3513. #else
  3514. #define CreateDialogIndirectParam CreateDialogIndirectParamA
  3515. #endif // !UNICODE
  3516. #define CreateDialogA(hInstance, lpName, hWndParent, lpDialogFunc) \
  3517. CreateDialogParamA(hInstance, lpName, hWndParent, lpDialogFunc, 0L)
  3518. #define CreateDialogW(hInstance, lpName, hWndParent, lpDialogFunc) \
  3519. CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0L)
  3520. #ifdef UNICODE
  3521. #define CreateDialog CreateDialogW
  3522. #else
  3523. #define CreateDialog CreateDialogA
  3524. #endif // !UNICODE
  3525. #define CreateDialogIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3526. CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3527. #define CreateDialogIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3528. CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3529. #ifdef UNICODE
  3530. #define CreateDialogIndirect CreateDialogIndirectW
  3531. #else
  3532. #define CreateDialogIndirect CreateDialogIndirectA
  3533. #endif // !UNICODE
  3534. WINUSERAPI
  3535. INT_PTR
  3536. WINAPI
  3537. DialogBoxParamA(
  3538. IN HINSTANCE hInstance,
  3539. IN LPCSTR lpTemplateName,
  3540. IN HWND hWndParent,
  3541. IN DLGPROC lpDialogFunc,
  3542. IN LPARAM dwInitParam);
  3543. WINUSERAPI
  3544. INT_PTR
  3545. WINAPI
  3546. DialogBoxParamW(
  3547. IN HINSTANCE hInstance,
  3548. IN LPCWSTR lpTemplateName,
  3549. IN HWND hWndParent,
  3550. IN DLGPROC lpDialogFunc,
  3551. IN LPARAM dwInitParam);
  3552. #ifdef UNICODE
  3553. #define DialogBoxParam DialogBoxParamW
  3554. #else
  3555. #define DialogBoxParam DialogBoxParamA
  3556. #endif // !UNICODE
  3557. WINUSERAPI
  3558. INT_PTR
  3559. WINAPI
  3560. DialogBoxIndirectParamA(
  3561. IN HINSTANCE hInstance,
  3562. IN LPCDLGTEMPLATEA hDialogTemplate,
  3563. IN HWND hWndParent,
  3564. IN DLGPROC lpDialogFunc,
  3565. IN LPARAM dwInitParam);
  3566. WINUSERAPI
  3567. INT_PTR
  3568. WINAPI
  3569. DialogBoxIndirectParamW(
  3570. IN HINSTANCE hInstance,
  3571. IN LPCDLGTEMPLATEW hDialogTemplate,
  3572. IN HWND hWndParent,
  3573. IN DLGPROC lpDialogFunc,
  3574. IN LPARAM dwInitParam);
  3575. #ifdef UNICODE
  3576. #define DialogBoxIndirectParam DialogBoxIndirectParamW
  3577. #else
  3578. #define DialogBoxIndirectParam DialogBoxIndirectParamA
  3579. #endif // !UNICODE
  3580. #define DialogBoxA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3581. DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3582. #define DialogBoxW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3583. DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3584. #ifdef UNICODE
  3585. #define DialogBox DialogBoxW
  3586. #else
  3587. #define DialogBox DialogBoxA
  3588. #endif // !UNICODE
  3589. #define DialogBoxIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3590. DialogBoxIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3591. #define DialogBoxIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3592. DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3593. #ifdef UNICODE
  3594. #define DialogBoxIndirect DialogBoxIndirectW
  3595. #else
  3596. #define DialogBoxIndirect DialogBoxIndirectA
  3597. #endif // !UNICODE
  3598. WINUSERAPI
  3599. BOOL
  3600. WINAPI
  3601. EndDialog(
  3602. IN HWND hDlg,
  3603. IN INT_PTR nResult);
  3604. WINUSERAPI
  3605. HWND
  3606. WINAPI
  3607. GetDlgItem(
  3608. IN HWND hDlg,
  3609. IN int nIDDlgItem);
  3610. WINUSERAPI
  3611. BOOL
  3612. WINAPI
  3613. SetDlgItemInt(
  3614. IN HWND hDlg,
  3615. IN int nIDDlgItem,
  3616. IN UINT uValue,
  3617. IN BOOL bSigned);
  3618. WINUSERAPI
  3619. UINT
  3620. WINAPI
  3621. GetDlgItemInt(
  3622. IN HWND hDlg,
  3623. IN int nIDDlgItem,
  3624. OUT BOOL *lpTranslated,
  3625. IN BOOL bSigned);
  3626. WINUSERAPI
  3627. BOOL
  3628. WINAPI
  3629. SetDlgItemTextA(
  3630. IN HWND hDlg,
  3631. IN int nIDDlgItem,
  3632. IN LPCSTR lpString);
  3633. WINUSERAPI
  3634. BOOL
  3635. WINAPI
  3636. SetDlgItemTextW(
  3637. IN HWND hDlg,
  3638. IN int nIDDlgItem,
  3639. IN LPCWSTR lpString);
  3640. #ifdef UNICODE
  3641. #define SetDlgItemText SetDlgItemTextW
  3642. #else
  3643. #define SetDlgItemText SetDlgItemTextA
  3644. #endif // !UNICODE
  3645. WINUSERAPI
  3646. UINT
  3647. WINAPI
  3648. GetDlgItemTextA(
  3649. IN HWND hDlg,
  3650. IN int nIDDlgItem,
  3651. OUT LPSTR lpString,
  3652. IN int nMaxCount);
  3653. WINUSERAPI
  3654. UINT
  3655. WINAPI
  3656. GetDlgItemTextW(
  3657. IN HWND hDlg,
  3658. IN int nIDDlgItem,
  3659. OUT LPWSTR lpString,
  3660. IN int nMaxCount);
  3661. #ifdef UNICODE
  3662. #define GetDlgItemText GetDlgItemTextW
  3663. #else
  3664. #define GetDlgItemText GetDlgItemTextA
  3665. #endif // !UNICODE
  3666. WINUSERAPI
  3667. BOOL
  3668. WINAPI
  3669. CheckDlgButton(
  3670. IN HWND hDlg,
  3671. IN int nIDButton,
  3672. IN UINT uCheck);
  3673. WINUSERAPI
  3674. BOOL
  3675. WINAPI
  3676. CheckRadioButton(
  3677. IN HWND hDlg,
  3678. IN int nIDFirstButton,
  3679. IN int nIDLastButton,
  3680. IN int nIDCheckButton);
  3681. WINUSERAPI
  3682. UINT
  3683. WINAPI
  3684. IsDlgButtonChecked(
  3685. IN HWND hDlg,
  3686. IN int nIDButton);
  3687. WINUSERAPI
  3688. LRESULT
  3689. WINAPI
  3690. SendDlgItemMessageA(
  3691. IN HWND hDlg,
  3692. IN int nIDDlgItem,
  3693. IN UINT Msg,
  3694. IN WPARAM wParam,
  3695. IN LPARAM lParam);
  3696. WINUSERAPI
  3697. LRESULT
  3698. WINAPI
  3699. SendDlgItemMessageW(
  3700. IN HWND hDlg,
  3701. IN int nIDDlgItem,
  3702. IN UINT Msg,
  3703. IN WPARAM wParam,
  3704. IN LPARAM lParam);
  3705. #ifdef UNICODE
  3706. #define SendDlgItemMessage SendDlgItemMessageW
  3707. #else
  3708. #define SendDlgItemMessage SendDlgItemMessageA
  3709. #endif // !UNICODE
  3710. WINUSERAPI
  3711. HWND
  3712. WINAPI
  3713. GetNextDlgGroupItem(
  3714. IN HWND hDlg,
  3715. IN HWND hCtl,
  3716. IN BOOL bPrevious);
  3717. WINUSERAPI
  3718. HWND
  3719. WINAPI
  3720. GetNextDlgTabItem(
  3721. IN HWND hDlg,
  3722. IN HWND hCtl,
  3723. IN BOOL bPrevious);
  3724. WINUSERAPI
  3725. int
  3726. WINAPI
  3727. GetDlgCtrlID(
  3728. IN HWND hWnd);
  3729. WINUSERAPI
  3730. long
  3731. WINAPI
  3732. GetDialogBaseUnits(VOID);
  3733. WINUSERAPI
  3734. #ifndef _MAC
  3735. LRESULT
  3736. WINAPI
  3737. #else
  3738. LRESULT
  3739. CALLBACK
  3740. #endif
  3741. DefDlgProcA(
  3742. IN HWND hDlg,
  3743. IN UINT Msg,
  3744. IN WPARAM wParam,
  3745. IN LPARAM lParam);
  3746. WINUSERAPI
  3747. #ifndef _MAC
  3748. LRESULT
  3749. WINAPI
  3750. #else
  3751. LRESULT
  3752. CALLBACK
  3753. #endif
  3754. DefDlgProcW(
  3755. IN HWND hDlg,
  3756. IN UINT Msg,
  3757. IN WPARAM wParam,
  3758. IN LPARAM lParam);
  3759. #ifdef UNICODE
  3760. #define DefDlgProc DefDlgProcW
  3761. #else
  3762. #define DefDlgProc DefDlgProcA
  3763. #endif // !UNICODE
  3764. /*
  3765. * Window extra byted needed for private dialog classes.
  3766. */
  3767. #ifndef _MAC
  3768. #define DLGWINDOWEXTRA 30
  3769. #else
  3770. #define DLGWINDOWEXTRA 48
  3771. #endif
  3772. #endif /* !NOCTLMGR */
  3773. #ifndef NOMSG
  3774. WINUSERAPI
  3775. BOOL
  3776. WINAPI
  3777. CallMsgFilterA(
  3778. IN LPMSG lpMsg,
  3779. IN int nCode);
  3780. WINUSERAPI
  3781. BOOL
  3782. WINAPI
  3783. CallMsgFilterW(
  3784. IN LPMSG lpMsg,
  3785. IN int nCode);
  3786. #ifdef UNICODE
  3787. #define CallMsgFilter CallMsgFilterW
  3788. #else
  3789. #define CallMsgFilter CallMsgFilterA
  3790. #endif // !UNICODE
  3791. #endif /* !NOMSG */
  3792. #ifndef NOCLIPBOARD
  3793. /*
  3794. * Clipboard Manager Functions
  3795. */
  3796. WINUSERAPI
  3797. BOOL
  3798. WINAPI
  3799. OpenClipboard(
  3800. IN HWND hWndNewOwner);
  3801. WINUSERAPI
  3802. BOOL
  3803. WINAPI
  3804. CloseClipboard(
  3805. VOID);
  3806. #if(WINVER >= 0x0500)
  3807. WINUSERAPI
  3808. DWORD
  3809. WINAPI
  3810. GetClipboardSequenceNumber(
  3811. VOID);
  3812. #endif /* WINVER >= 0x0500 */
  3813. WINUSERAPI
  3814. HWND
  3815. WINAPI
  3816. GetClipboardOwner(
  3817. VOID);
  3818. WINUSERAPI
  3819. HWND
  3820. WINAPI
  3821. SetClipboardViewer(
  3822. IN HWND hWndNewViewer);
  3823. WINUSERAPI
  3824. HWND
  3825. WINAPI
  3826. GetClipboardViewer(
  3827. VOID);
  3828. WINUSERAPI
  3829. BOOL
  3830. WINAPI
  3831. ChangeClipboardChain(
  3832. IN HWND hWndRemove,
  3833. IN HWND hWndNewNext);
  3834. WINUSERAPI
  3835. HANDLE
  3836. WINAPI
  3837. SetClipboardData(
  3838. IN UINT uFormat,
  3839. IN HANDLE hMem);
  3840. WINUSERAPI
  3841. HANDLE
  3842. WINAPI
  3843. GetClipboardData(
  3844. IN UINT uFormat);
  3845. WINUSERAPI
  3846. UINT
  3847. WINAPI
  3848. RegisterClipboardFormatA(
  3849. IN LPCSTR lpszFormat);
  3850. WINUSERAPI
  3851. UINT
  3852. WINAPI
  3853. RegisterClipboardFormatW(
  3854. IN LPCWSTR lpszFormat);
  3855. #ifdef UNICODE
  3856. #define RegisterClipboardFormat RegisterClipboardFormatW
  3857. #else
  3858. #define RegisterClipboardFormat RegisterClipboardFormatA
  3859. #endif // !UNICODE
  3860. WINUSERAPI
  3861. int
  3862. WINAPI
  3863. CountClipboardFormats(
  3864. VOID);
  3865. WINUSERAPI
  3866. UINT
  3867. WINAPI
  3868. EnumClipboardFormats(
  3869. IN UINT format);
  3870. WINUSERAPI
  3871. int
  3872. WINAPI
  3873. GetClipboardFormatNameA(
  3874. IN UINT format,
  3875. OUT LPSTR lpszFormatName,
  3876. IN int cchMaxCount);
  3877. WINUSERAPI
  3878. int
  3879. WINAPI
  3880. GetClipboardFormatNameW(
  3881. IN UINT format,
  3882. OUT LPWSTR lpszFormatName,
  3883. IN int cchMaxCount);
  3884. #ifdef UNICODE
  3885. #define GetClipboardFormatName GetClipboardFormatNameW
  3886. #else
  3887. #define GetClipboardFormatName GetClipboardFormatNameA
  3888. #endif // !UNICODE
  3889. WINUSERAPI
  3890. BOOL
  3891. WINAPI
  3892. EmptyClipboard(
  3893. VOID);
  3894. WINUSERAPI
  3895. BOOL
  3896. WINAPI
  3897. IsClipboardFormatAvailable(
  3898. IN UINT format);
  3899. WINUSERAPI
  3900. int
  3901. WINAPI
  3902. GetPriorityClipboardFormat(
  3903. OUT UINT *paFormatPriorityList,
  3904. IN int cFormats);
  3905. WINUSERAPI
  3906. HWND
  3907. WINAPI
  3908. GetOpenClipboardWindow(
  3909. VOID);
  3910. #endif /* !NOCLIPBOARD */
  3911. /*
  3912. * Character Translation Routines
  3913. */
  3914. WINUSERAPI
  3915. BOOL
  3916. WINAPI
  3917. CharToOemA(
  3918. IN LPCSTR lpszSrc,
  3919. OUT LPSTR lpszDst);
  3920. WINUSERAPI
  3921. BOOL
  3922. WINAPI
  3923. CharToOemW(
  3924. IN LPCWSTR lpszSrc,
  3925. OUT LPSTR lpszDst);
  3926. #ifdef UNICODE
  3927. #define CharToOem CharToOemW
  3928. #else
  3929. #define CharToOem CharToOemA
  3930. #endif // !UNICODE
  3931. WINUSERAPI
  3932. BOOL
  3933. WINAPI
  3934. OemToCharA(
  3935. IN LPCSTR lpszSrc,
  3936. OUT LPSTR lpszDst);
  3937. WINUSERAPI
  3938. BOOL
  3939. WINAPI
  3940. OemToCharW(
  3941. IN LPCSTR lpszSrc,
  3942. OUT LPWSTR lpszDst);
  3943. #ifdef UNICODE
  3944. #define OemToChar OemToCharW
  3945. #else
  3946. #define OemToChar OemToCharA
  3947. #endif // !UNICODE
  3948. WINUSERAPI
  3949. BOOL
  3950. WINAPI
  3951. CharToOemBuffA(
  3952. IN LPCSTR lpszSrc,
  3953. OUT LPSTR lpszDst,
  3954. IN DWORD cchDstLength);
  3955. WINUSERAPI
  3956. BOOL
  3957. WINAPI
  3958. CharToOemBuffW(
  3959. IN LPCWSTR lpszSrc,
  3960. OUT LPSTR lpszDst,
  3961. IN DWORD cchDstLength);
  3962. #ifdef UNICODE
  3963. #define CharToOemBuff CharToOemBuffW
  3964. #else
  3965. #define CharToOemBuff CharToOemBuffA
  3966. #endif // !UNICODE
  3967. WINUSERAPI
  3968. BOOL
  3969. WINAPI
  3970. OemToCharBuffA(
  3971. IN LPCSTR lpszSrc,
  3972. OUT LPSTR lpszDst,
  3973. IN DWORD cchDstLength);
  3974. WINUSERAPI
  3975. BOOL
  3976. WINAPI
  3977. OemToCharBuffW(
  3978. IN LPCSTR lpszSrc,
  3979. OUT LPWSTR lpszDst,
  3980. IN DWORD cchDstLength);
  3981. #ifdef UNICODE
  3982. #define OemToCharBuff OemToCharBuffW
  3983. #else
  3984. #define OemToCharBuff OemToCharBuffA
  3985. #endif // !UNICODE
  3986. WINUSERAPI
  3987. LPSTR
  3988. WINAPI
  3989. CharUpperA(
  3990. IN OUT LPSTR lpsz);
  3991. WINUSERAPI
  3992. LPWSTR
  3993. WINAPI
  3994. CharUpperW(
  3995. IN OUT LPWSTR lpsz);
  3996. #ifdef UNICODE
  3997. #define CharUpper CharUpperW
  3998. #else
  3999. #define CharUpper CharUpperA
  4000. #endif // !UNICODE
  4001. WINUSERAPI
  4002. DWORD
  4003. WINAPI
  4004. CharUpperBuffA(
  4005. IN OUT LPSTR lpsz,
  4006. IN DWORD cchLength);
  4007. WINUSERAPI
  4008. DWORD
  4009. WINAPI
  4010. CharUpperBuffW(
  4011. IN OUT LPWSTR lpsz,
  4012. IN DWORD cchLength);
  4013. #ifdef UNICODE
  4014. #define CharUpperBuff CharUpperBuffW
  4015. #else
  4016. #define CharUpperBuff CharUpperBuffA
  4017. #endif // !UNICODE
  4018. WINUSERAPI
  4019. LPSTR
  4020. WINAPI
  4021. CharLowerA(
  4022. IN OUT LPSTR lpsz);
  4023. WINUSERAPI
  4024. LPWSTR
  4025. WINAPI
  4026. CharLowerW(
  4027. IN OUT LPWSTR lpsz);
  4028. #ifdef UNICODE
  4029. #define CharLower CharLowerW
  4030. #else
  4031. #define CharLower CharLowerA
  4032. #endif // !UNICODE
  4033. WINUSERAPI
  4034. DWORD
  4035. WINAPI
  4036. CharLowerBuffA(
  4037. IN OUT LPSTR lpsz,
  4038. IN DWORD cchLength);
  4039. WINUSERAPI
  4040. DWORD
  4041. WINAPI
  4042. CharLowerBuffW(
  4043. IN OUT LPWSTR lpsz,
  4044. IN DWORD cchLength);
  4045. #ifdef UNICODE
  4046. #define CharLowerBuff CharLowerBuffW
  4047. #else
  4048. #define CharLowerBuff CharLowerBuffA
  4049. #endif // !UNICODE
  4050. WINUSERAPI
  4051. LPSTR
  4052. WINAPI
  4053. CharNextA(
  4054. IN LPCSTR lpsz);
  4055. WINUSERAPI
  4056. LPWSTR
  4057. WINAPI
  4058. CharNextW(
  4059. IN LPCWSTR lpsz);
  4060. #ifdef UNICODE
  4061. #define CharNext CharNextW
  4062. #else
  4063. #define CharNext CharNextA
  4064. #endif // !UNICODE
  4065. WINUSERAPI
  4066. LPSTR
  4067. WINAPI
  4068. CharPrevA(
  4069. IN LPCSTR lpszStart,
  4070. IN LPCSTR lpszCurrent);
  4071. WINUSERAPI
  4072. LPWSTR
  4073. WINAPI
  4074. CharPrevW(
  4075. IN LPCWSTR lpszStart,
  4076. IN LPCWSTR lpszCurrent);
  4077. #ifdef UNICODE
  4078. #define CharPrev CharPrevW
  4079. #else
  4080. #define CharPrev CharPrevA
  4081. #endif // !UNICODE
  4082. #if(WINVER >= 0x0400)
  4083. WINUSERAPI
  4084. LPSTR
  4085. WINAPI
  4086. CharNextExA(
  4087. IN WORD CodePage,
  4088. IN LPCSTR lpCurrentChar,
  4089. IN DWORD dwFlags);
  4090. WINUSERAPI
  4091. LPSTR
  4092. WINAPI
  4093. CharPrevExA(
  4094. IN WORD CodePage,
  4095. IN LPCSTR lpStart,
  4096. IN LPCSTR lpCurrentChar,
  4097. IN DWORD dwFlags);
  4098. #endif /* WINVER >= 0x0400 */
  4099. /*
  4100. * Compatibility defines for character translation routines
  4101. */
  4102. #define AnsiToOem CharToOemA
  4103. #define OemToAnsi OemToCharA
  4104. #define AnsiToOemBuff CharToOemBuffA
  4105. #define OemToAnsiBuff OemToCharBuffA
  4106. #define AnsiUpper CharUpperA
  4107. #define AnsiUpperBuff CharUpperBuffA
  4108. #define AnsiLower CharLowerA
  4109. #define AnsiLowerBuff CharLowerBuffA
  4110. #define AnsiNext CharNextA
  4111. #define AnsiPrev CharPrevA
  4112. #ifndef NOLANGUAGE
  4113. /*
  4114. * Language dependent Routines
  4115. */
  4116. WINUSERAPI
  4117. BOOL
  4118. WINAPI
  4119. IsCharAlphaA(
  4120. IN CHAR ch);
  4121. WINUSERAPI
  4122. BOOL
  4123. WINAPI
  4124. IsCharAlphaW(
  4125. IN WCHAR ch);
  4126. #ifdef UNICODE
  4127. #define IsCharAlpha IsCharAlphaW
  4128. #else
  4129. #define IsCharAlpha IsCharAlphaA
  4130. #endif // !UNICODE
  4131. WINUSERAPI
  4132. BOOL
  4133. WINAPI
  4134. IsCharAlphaNumericA(
  4135. IN CHAR ch);
  4136. WINUSERAPI
  4137. BOOL
  4138. WINAPI
  4139. IsCharAlphaNumericW(
  4140. IN WCHAR ch);
  4141. #ifdef UNICODE
  4142. #define IsCharAlphaNumeric IsCharAlphaNumericW
  4143. #else
  4144. #define IsCharAlphaNumeric IsCharAlphaNumericA
  4145. #endif // !UNICODE
  4146. WINUSERAPI
  4147. BOOL
  4148. WINAPI
  4149. IsCharUpperA(
  4150. IN CHAR ch);
  4151. WINUSERAPI
  4152. BOOL
  4153. WINAPI
  4154. IsCharUpperW(
  4155. IN WCHAR ch);
  4156. #ifdef UNICODE
  4157. #define IsCharUpper IsCharUpperW
  4158. #else
  4159. #define IsCharUpper IsCharUpperA
  4160. #endif // !UNICODE
  4161. WINUSERAPI
  4162. BOOL
  4163. WINAPI
  4164. IsCharLowerA(
  4165. IN CHAR ch);
  4166. WINUSERAPI
  4167. BOOL
  4168. WINAPI
  4169. IsCharLowerW(
  4170. IN WCHAR ch);
  4171. #ifdef UNICODE
  4172. #define IsCharLower IsCharLowerW
  4173. #else
  4174. #define IsCharLower IsCharLowerA
  4175. #endif // !UNICODE
  4176. #endif /* !NOLANGUAGE */
  4177. WINUSERAPI
  4178. HWND
  4179. WINAPI
  4180. SetFocus(
  4181. IN HWND hWnd);
  4182. WINUSERAPI
  4183. HWND
  4184. WINAPI
  4185. GetActiveWindow(
  4186. VOID);
  4187. WINUSERAPI
  4188. HWND
  4189. WINAPI
  4190. GetFocus(
  4191. VOID);
  4192. WINUSERAPI
  4193. UINT
  4194. WINAPI
  4195. GetKBCodePage(
  4196. VOID);
  4197. WINUSERAPI
  4198. SHORT
  4199. WINAPI
  4200. GetKeyState(
  4201. IN int nVirtKey);
  4202. WINUSERAPI
  4203. SHORT
  4204. WINAPI
  4205. GetAsyncKeyState(
  4206. IN int vKey);
  4207. WINUSERAPI
  4208. BOOL
  4209. WINAPI
  4210. GetKeyboardState(
  4211. OUT PBYTE lpKeyState);
  4212. WINUSERAPI
  4213. BOOL
  4214. WINAPI
  4215. SetKeyboardState(
  4216. IN LPBYTE lpKeyState);
  4217. WINUSERAPI
  4218. int
  4219. WINAPI
  4220. GetKeyNameTextA(
  4221. IN LONG lParam,
  4222. OUT LPSTR lpString,
  4223. IN int nSize
  4224. );
  4225. WINUSERAPI
  4226. int
  4227. WINAPI
  4228. GetKeyNameTextW(
  4229. IN LONG lParam,
  4230. OUT LPWSTR lpString,
  4231. IN int nSize
  4232. );
  4233. #ifdef UNICODE
  4234. #define GetKeyNameText GetKeyNameTextW
  4235. #else
  4236. #define GetKeyNameText GetKeyNameTextA
  4237. #endif // !UNICODE
  4238. WINUSERAPI
  4239. int
  4240. WINAPI
  4241. GetKeyboardType(
  4242. IN int nTypeFlag);
  4243. WINUSERAPI
  4244. int
  4245. WINAPI
  4246. ToAscii(
  4247. IN UINT uVirtKey,
  4248. IN UINT uScanCode,
  4249. IN CONST BYTE *lpKeyState,
  4250. OUT LPWORD lpChar,
  4251. IN UINT uFlags);
  4252. #if(WINVER >= 0x0400)
  4253. WINUSERAPI
  4254. int
  4255. WINAPI
  4256. ToAsciiEx(
  4257. IN UINT uVirtKey,
  4258. IN UINT uScanCode,
  4259. IN CONST BYTE *lpKeyState,
  4260. OUT LPWORD lpChar,
  4261. IN UINT uFlags,
  4262. IN HKL dwhkl);
  4263. #endif /* WINVER >= 0x0400 */
  4264. WINUSERAPI
  4265. int
  4266. WINAPI
  4267. ToUnicode(
  4268. IN UINT wVirtKey,
  4269. IN UINT wScanCode,
  4270. IN CONST BYTE *lpKeyState,
  4271. OUT LPWSTR pwszBuff,
  4272. IN int cchBuff,
  4273. IN UINT wFlags);
  4274. WINUSERAPI
  4275. DWORD
  4276. WINAPI
  4277. OemKeyScan(
  4278. IN WORD wOemChar);
  4279. WINUSERAPI
  4280. SHORT
  4281. WINAPI
  4282. VkKeyScanA(
  4283. IN CHAR ch);
  4284. WINUSERAPI
  4285. SHORT
  4286. WINAPI
  4287. VkKeyScanW(
  4288. IN WCHAR ch);
  4289. #ifdef UNICODE
  4290. #define VkKeyScan VkKeyScanW
  4291. #else
  4292. #define VkKeyScan VkKeyScanA
  4293. #endif // !UNICODE
  4294. #if(WINVER >= 0x0400)
  4295. WINUSERAPI
  4296. SHORT
  4297. WINAPI
  4298. VkKeyScanExA(
  4299. IN CHAR ch,
  4300. IN HKL dwhkl);
  4301. WINUSERAPI
  4302. SHORT
  4303. WINAPI
  4304. VkKeyScanExW(
  4305. IN WCHAR ch,
  4306. IN HKL dwhkl);
  4307. #ifdef UNICODE
  4308. #define VkKeyScanEx VkKeyScanExW
  4309. #else
  4310. #define VkKeyScanEx VkKeyScanExA
  4311. #endif // !UNICODE
  4312. #endif /* WINVER >= 0x0400 */
  4313. #define KEYEVENTF_EXTENDEDKEY 0x0001
  4314. #define KEYEVENTF_KEYUP 0x0002
  4315. #if(_WIN32_WINNT >= 0x0500)
  4316. #define KEYEVENTF_UNICODE 0x0004
  4317. #define KEYEVENTF_SCANCODE 0x0008
  4318. #endif /* _WIN32_WINNT >= 0x0500 */
  4319. WINUSERAPI
  4320. VOID
  4321. WINAPI
  4322. keybd_event(
  4323. IN BYTE bVk,
  4324. IN BYTE bScan,
  4325. IN DWORD dwFlags,
  4326. IN ULONG_PTR dwExtraInfo);
  4327. #define MOUSEEVENTF_MOVE 0x0001 /* mouse move */
  4328. #define MOUSEEVENTF_LEFTDOWN 0x0002 /* left button down */
  4329. #define MOUSEEVENTF_LEFTUP 0x0004 /* left button up */
  4330. #define MOUSEEVENTF_RIGHTDOWN 0x0008 /* right button down */
  4331. #define MOUSEEVENTF_RIGHTUP 0x0010 /* right button up */
  4332. #define MOUSEEVENTF_MIDDLEDOWN 0x0020 /* middle button down */
  4333. #define MOUSEEVENTF_MIDDLEUP 0x0040 /* middle button up */
  4334. #define MOUSEEVENTF_XDOWN 0x0080 /* x button down */
  4335. #define MOUSEEVENTF_XUP 0x0100 /* x button down */
  4336. #define MOUSEEVENTF_WHEEL 0x0800 /* wheel button rolled */
  4337. #define MOUSEEVENTF_VIRTUALDESK 0x4000 /* map to entire virtual desktop */
  4338. #define MOUSEEVENTF_ABSOLUTE 0x8000 /* absolute move */
  4339. WINUSERAPI
  4340. VOID
  4341. WINAPI
  4342. mouse_event(
  4343. IN DWORD dwFlags,
  4344. IN DWORD dx,
  4345. IN DWORD dy,
  4346. IN DWORD dwData,
  4347. IN ULONG_PTR dwExtraInfo);
  4348. #if (_WIN32_WINNT > 0x0400)
  4349. typedef struct tagMOUSEINPUT {
  4350. LONG dx;
  4351. LONG dy;
  4352. DWORD mouseData;
  4353. DWORD dwFlags;
  4354. DWORD time;
  4355. ULONG_PTR dwExtraInfo;
  4356. } MOUSEINPUT, *PMOUSEINPUT, FAR* LPMOUSEINPUT;
  4357. typedef struct tagKEYBDINPUT {
  4358. WORD wVk;
  4359. WORD wScan;
  4360. DWORD dwFlags;
  4361. DWORD time;
  4362. ULONG_PTR dwExtraInfo;
  4363. } KEYBDINPUT, *PKEYBDINPUT, FAR* LPKEYBDINPUT;
  4364. typedef struct tagHARDWAREINPUT {
  4365. DWORD uMsg;
  4366. WORD wParamL;
  4367. WORD wParamH;
  4368. } HARDWAREINPUT, *PHARDWAREINPUT, FAR* LPHARDWAREINPUT;
  4369. #define INPUT_MOUSE 0
  4370. #define INPUT_KEYBOARD 1
  4371. #define INPUT_HARDWARE 2
  4372. typedef struct tagINPUT {
  4373. DWORD type;
  4374. union
  4375. {
  4376. MOUSEINPUT mi;
  4377. KEYBDINPUT ki;
  4378. HARDWAREINPUT hi;
  4379. };
  4380. } INPUT, *PINPUT, FAR* LPINPUT;
  4381. WINUSERAPI
  4382. UINT
  4383. WINAPI
  4384. SendInput(
  4385. IN UINT cInputs, // number of input in the array
  4386. IN LPINPUT pInputs, // array of inputs
  4387. IN int cbSize); // sizeof(INPUT)
  4388. #endif // (_WIN32_WINNT > 0x0400)
  4389. #if(_WIN32_WINNT >= 0x0500)
  4390. typedef struct tagLASTINPUTINFO {
  4391. UINT cbSize;
  4392. DWORD dwTime;
  4393. } LASTINPUTINFO, * PLASTINPUTINFO;
  4394. WINUSERAPI
  4395. BOOL
  4396. WINAPI
  4397. GetLastInputInfo(
  4398. OUT PLASTINPUTINFO plii);
  4399. #endif /* _WIN32_WINNT >= 0x0500 */
  4400. WINUSERAPI
  4401. UINT
  4402. WINAPI
  4403. MapVirtualKeyA(
  4404. IN UINT uCode,
  4405. IN UINT uMapType);
  4406. WINUSERAPI
  4407. UINT
  4408. WINAPI
  4409. MapVirtualKeyW(
  4410. IN UINT uCode,
  4411. IN UINT uMapType);
  4412. #ifdef UNICODE
  4413. #define MapVirtualKey MapVirtualKeyW
  4414. #else
  4415. #define MapVirtualKey MapVirtualKeyA
  4416. #endif // !UNICODE
  4417. #if(WINVER >= 0x0400)
  4418. WINUSERAPI
  4419. UINT
  4420. WINAPI
  4421. MapVirtualKeyExA(
  4422. IN UINT uCode,
  4423. IN UINT uMapType,
  4424. IN HKL dwhkl);
  4425. WINUSERAPI
  4426. UINT
  4427. WINAPI
  4428. MapVirtualKeyExW(
  4429. IN UINT uCode,
  4430. IN UINT uMapType,
  4431. IN HKL dwhkl);
  4432. #ifdef UNICODE
  4433. #define MapVirtualKeyEx MapVirtualKeyExW
  4434. #else
  4435. #define MapVirtualKeyEx MapVirtualKeyExA
  4436. #endif // !UNICODE
  4437. #endif /* WINVER >= 0x0400 */
  4438. WINUSERAPI
  4439. BOOL
  4440. WINAPI
  4441. GetInputState(
  4442. VOID);
  4443. WINUSERAPI
  4444. DWORD
  4445. WINAPI
  4446. GetQueueStatus(
  4447. IN UINT flags);
  4448. WINUSERAPI
  4449. HWND
  4450. WINAPI
  4451. GetCapture(
  4452. VOID);
  4453. WINUSERAPI
  4454. HWND
  4455. WINAPI
  4456. SetCapture(
  4457. IN HWND hWnd);
  4458. WINUSERAPI
  4459. BOOL
  4460. WINAPI
  4461. ReleaseCapture(
  4462. VOID);
  4463. WINUSERAPI
  4464. DWORD
  4465. WINAPI
  4466. MsgWaitForMultipleObjects(
  4467. IN DWORD nCount,
  4468. IN CONST HANDLE *pHandles,
  4469. IN BOOL fWaitAll,
  4470. IN DWORD dwMilliseconds,
  4471. IN DWORD dwWakeMask);
  4472. WINUSERAPI
  4473. DWORD
  4474. WINAPI
  4475. MsgWaitForMultipleObjectsEx(
  4476. IN DWORD nCount,
  4477. IN CONST HANDLE *pHandles,
  4478. IN DWORD dwMilliseconds,
  4479. IN DWORD dwWakeMask,
  4480. IN DWORD dwFlags);
  4481. #define MWMO_WAITALL 0x0001
  4482. #define MWMO_ALERTABLE 0x0002
  4483. #define MWMO_INPUTAVAILABLE 0x0004
  4484. /*
  4485. * Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects()
  4486. */
  4487. #define QS_KEY 0x0001
  4488. #define QS_MOUSEMOVE 0x0002
  4489. #define QS_MOUSEBUTTON 0x0004
  4490. #define QS_POSTMESSAGE 0x0008
  4491. #define QS_TIMER 0x0010
  4492. #define QS_PAINT 0x0020
  4493. #define QS_SENDMESSAGE 0x0040
  4494. #define QS_HOTKEY 0x0080
  4495. #define QS_ALLPOSTMESSAGE 0x0100
  4496. #if(_WIN32_WINNT >= 0x0501)
  4497. #define QS_RAWINPUT 0x0400
  4498. #endif /* _WIN32_WINNT >= 0x0501 */
  4499. #define QS_MOUSE (QS_MOUSEMOVE | \
  4500. QS_MOUSEBUTTON)
  4501. #if (_WIN32_WINNT >= 0x0501)
  4502. #define QS_INPUT (QS_MOUSE | \
  4503. QS_KEY | \
  4504. QS_RAWINPUT)
  4505. #else
  4506. #define QS_INPUT (QS_MOUSE | \
  4507. QS_KEY)
  4508. #endif // (_WIN32_WINNT >= 0x0501)
  4509. #define QS_ALLEVENTS (QS_INPUT | \
  4510. QS_POSTMESSAGE | \
  4511. QS_TIMER | \
  4512. QS_PAINT | \
  4513. QS_HOTKEY)
  4514. #define QS_ALLINPUT (QS_INPUT | \
  4515. QS_POSTMESSAGE | \
  4516. QS_TIMER | \
  4517. QS_PAINT | \
  4518. QS_HOTKEY | \
  4519. QS_SENDMESSAGE)
  4520. /*
  4521. * Windows Functions
  4522. */
  4523. WINUSERAPI
  4524. UINT_PTR
  4525. WINAPI
  4526. SetTimer(
  4527. IN HWND hWnd,
  4528. IN UINT_PTR nIDEvent,
  4529. IN UINT uElapse,
  4530. IN TIMERPROC lpTimerFunc);
  4531. WINUSERAPI
  4532. BOOL
  4533. WINAPI
  4534. KillTimer(
  4535. IN HWND hWnd,
  4536. IN UINT_PTR uIDEvent);
  4537. WINUSERAPI
  4538. BOOL
  4539. WINAPI
  4540. IsWindowUnicode(
  4541. IN HWND hWnd);
  4542. WINUSERAPI
  4543. BOOL
  4544. WINAPI
  4545. EnableWindow(
  4546. IN HWND hWnd,
  4547. IN BOOL bEnable);
  4548. WINUSERAPI
  4549. BOOL
  4550. WINAPI
  4551. IsWindowEnabled(
  4552. IN HWND hWnd);
  4553. WINUSERAPI
  4554. HACCEL
  4555. WINAPI
  4556. LoadAcceleratorsA(
  4557. IN HINSTANCE hInstance,
  4558. IN LPCSTR lpTableName);
  4559. WINUSERAPI
  4560. HACCEL
  4561. WINAPI
  4562. LoadAcceleratorsW(
  4563. IN HINSTANCE hInstance,
  4564. IN LPCWSTR lpTableName);
  4565. #ifdef UNICODE
  4566. #define LoadAccelerators LoadAcceleratorsW
  4567. #else
  4568. #define LoadAccelerators LoadAcceleratorsA
  4569. #endif // !UNICODE
  4570. WINUSERAPI
  4571. HACCEL
  4572. WINAPI
  4573. CreateAcceleratorTableA(
  4574. IN LPACCEL, IN int);
  4575. WINUSERAPI
  4576. HACCEL
  4577. WINAPI
  4578. CreateAcceleratorTableW(
  4579. IN LPACCEL, IN int);
  4580. #ifdef UNICODE
  4581. #define CreateAcceleratorTable CreateAcceleratorTableW
  4582. #else
  4583. #define CreateAcceleratorTable CreateAcceleratorTableA
  4584. #endif // !UNICODE
  4585. WINUSERAPI
  4586. BOOL
  4587. WINAPI
  4588. DestroyAcceleratorTable(
  4589. IN HACCEL hAccel);
  4590. WINUSERAPI
  4591. int
  4592. WINAPI
  4593. CopyAcceleratorTableA(
  4594. IN HACCEL hAccelSrc,
  4595. OUT LPACCEL lpAccelDst,
  4596. IN int cAccelEntries);
  4597. WINUSERAPI
  4598. int
  4599. WINAPI
  4600. CopyAcceleratorTableW(
  4601. IN HACCEL hAccelSrc,
  4602. OUT LPACCEL lpAccelDst,
  4603. IN int cAccelEntries);
  4604. #ifdef UNICODE
  4605. #define CopyAcceleratorTable CopyAcceleratorTableW
  4606. #else
  4607. #define CopyAcceleratorTable CopyAcceleratorTableA
  4608. #endif // !UNICODE
  4609. #ifndef NOMSG
  4610. WINUSERAPI
  4611. int
  4612. WINAPI
  4613. TranslateAcceleratorA(
  4614. IN HWND hWnd,
  4615. IN HACCEL hAccTable,
  4616. IN LPMSG lpMsg);
  4617. WINUSERAPI
  4618. int
  4619. WINAPI
  4620. TranslateAcceleratorW(
  4621. IN HWND hWnd,
  4622. IN HACCEL hAccTable,
  4623. IN LPMSG lpMsg);
  4624. #ifdef UNICODE
  4625. #define TranslateAccelerator TranslateAcceleratorW
  4626. #else
  4627. #define TranslateAccelerator TranslateAcceleratorA
  4628. #endif // !UNICODE
  4629. #endif /* !NOMSG */
  4630. #ifndef NOSYSMETRICS
  4631. /*
  4632. * GetSystemMetrics() codes
  4633. */
  4634. #define SM_CXSCREEN 0
  4635. #define SM_CYSCREEN 1
  4636. #define SM_CXVSCROLL 2
  4637. #define SM_CYHSCROLL 3
  4638. #define SM_CYCAPTION 4
  4639. #define SM_CXBORDER 5
  4640. #define SM_CYBORDER 6
  4641. #define SM_CXDLGFRAME 7
  4642. #define SM_CYDLGFRAME 8
  4643. #define SM_CYVTHUMB 9
  4644. #define SM_CXHTHUMB 10
  4645. #define SM_CXICON 11
  4646. #define SM_CYICON 12
  4647. #define SM_CXCURSOR 13
  4648. #define SM_CYCURSOR 14
  4649. #define SM_CYMENU 15
  4650. #define SM_CXFULLSCREEN 16
  4651. #define SM_CYFULLSCREEN 17
  4652. #define SM_CYKANJIWINDOW 18
  4653. #define SM_MOUSEPRESENT 19
  4654. #define SM_CYVSCROLL 20
  4655. #define SM_CXHSCROLL 21
  4656. #define SM_DEBUG 22
  4657. #define SM_SWAPBUTTON 23
  4658. #define SM_RESERVED1 24
  4659. #define SM_RESERVED2 25
  4660. #define SM_RESERVED3 26
  4661. #define SM_RESERVED4 27
  4662. #define SM_CXMIN 28
  4663. #define SM_CYMIN 29
  4664. #define SM_CXSIZE 30
  4665. #define SM_CYSIZE 31
  4666. #define SM_CXFRAME 32
  4667. #define SM_CYFRAME 33
  4668. #define SM_CXMINTRACK 34
  4669. #define SM_CYMINTRACK 35
  4670. #define SM_CXDOUBLECLK 36
  4671. #define SM_CYDOUBLECLK 37
  4672. #define SM_CXICONSPACING 38
  4673. #define SM_CYICONSPACING 39
  4674. #define SM_MENUDROPALIGNMENT 40
  4675. #define SM_PENWINDOWS 41
  4676. #define SM_DBCSENABLED 42
  4677. #define SM_CMOUSEBUTTONS 43
  4678. #if(WINVER >= 0x0400)
  4679. #define SM_CXFIXEDFRAME SM_CXDLGFRAME /* ;win40 name change */
  4680. #define SM_CYFIXEDFRAME SM_CYDLGFRAME /* ;win40 name change */
  4681. #define SM_CXSIZEFRAME SM_CXFRAME /* ;win40 name change */
  4682. #define SM_CYSIZEFRAME SM_CYFRAME /* ;win40 name change */
  4683. #define SM_SECURE 44
  4684. #define SM_CXEDGE 45
  4685. #define SM_CYEDGE 46
  4686. #define SM_CXMINSPACING 47
  4687. #define SM_CYMINSPACING 48
  4688. #define SM_CXSMICON 49
  4689. #define SM_CYSMICON 50
  4690. #define SM_CYSMCAPTION 51
  4691. #define SM_CXSMSIZE 52
  4692. #define SM_CYSMSIZE 53
  4693. #define SM_CXMENUSIZE 54
  4694. #define SM_CYMENUSIZE 55
  4695. #define SM_ARRANGE 56
  4696. #define SM_CXMINIMIZED 57
  4697. #define SM_CYMINIMIZED 58
  4698. #define SM_CXMAXTRACK 59
  4699. #define SM_CYMAXTRACK 60
  4700. #define SM_CXMAXIMIZED 61
  4701. #define SM_CYMAXIMIZED 62
  4702. #define SM_NETWORK 63
  4703. #define SM_CLEANBOOT 67
  4704. #define SM_CXDRAG 68
  4705. #define SM_CYDRAG 69
  4706. #endif /* WINVER >= 0x0400 */
  4707. #define SM_SHOWSOUNDS 70
  4708. #if(WINVER >= 0x0400)
  4709. #define SM_CXMENUCHECK 71 /* Use instead of GetMenuCheckMarkDimensions()! */
  4710. #define SM_CYMENUCHECK 72
  4711. #define SM_SLOWMACHINE 73
  4712. #define SM_MIDEASTENABLED 74
  4713. #endif /* WINVER >= 0x0400 */
  4714. #if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
  4715. #define SM_MOUSEWHEELPRESENT 75
  4716. #endif
  4717. #if(WINVER >= 0x0500)
  4718. #define SM_XVIRTUALSCREEN 76
  4719. #define SM_YVIRTUALSCREEN 77
  4720. #define SM_CXVIRTUALSCREEN 78
  4721. #define SM_CYVIRTUALSCREEN 79
  4722. #define SM_CMONITORS 80
  4723. #define SM_SAMEDISPLAYFORMAT 81
  4724. #endif /* WINVER >= 0x0500 */
  4725. #if(_WIN32_WINNT >= 0x0500)
  4726. #define SM_IMMENABLED 82
  4727. #endif /* _WIN32_WINNT >= 0x0500 */
  4728. #if(_WIN32_WINNT >= 0x0501)
  4729. #define SM_CXFOCUSBORDER 83
  4730. #define SM_CYFOCUSBORDER 84
  4731. #endif /* _WIN32_WINNT >= 0x0501 */
  4732. #if(_WIN32_WINNT >= 0x0501)
  4733. #define SM_TABLETPC 86
  4734. #define SM_MEDIACENTER 87
  4735. #endif /* _WIN32_WINNT >= 0x0501 */
  4736. #if (WINVER < 0x0500) && (!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0400))
  4737. #define SM_CMETRICS 76
  4738. #elif WINVER == 0x500
  4739. #define SM_CMETRICS 83
  4740. #else
  4741. #define SM_CMETRICS 88
  4742. #endif
  4743. #if(WINVER >= 0x0500)
  4744. #define SM_REMOTESESSION 0x1000
  4745. #if(_WIN32_WINNT >= 0x0501)
  4746. #define SM_SHUTTINGDOWN 0x2000
  4747. #endif /* _WIN32_WINNT >= 0x0501 */
  4748. #endif /* WINVER >= 0x0500 */
  4749. WINUSERAPI
  4750. int
  4751. WINAPI
  4752. GetSystemMetrics(
  4753. IN int nIndex);
  4754. #endif /* !NOSYSMETRICS */
  4755. #ifndef NOMENUS
  4756. WINUSERAPI
  4757. HMENU
  4758. WINAPI
  4759. LoadMenuA(
  4760. IN HINSTANCE hInstance,
  4761. IN LPCSTR lpMenuName);
  4762. WINUSERAPI
  4763. HMENU
  4764. WINAPI
  4765. LoadMenuW(
  4766. IN HINSTANCE hInstance,
  4767. IN LPCWSTR lpMenuName);
  4768. #ifdef UNICODE
  4769. #define LoadMenu LoadMenuW
  4770. #else
  4771. #define LoadMenu LoadMenuA
  4772. #endif // !UNICODE
  4773. WINUSERAPI
  4774. HMENU
  4775. WINAPI
  4776. LoadMenuIndirectA(
  4777. IN CONST MENUTEMPLATEA *lpMenuTemplate);
  4778. WINUSERAPI
  4779. HMENU
  4780. WINAPI
  4781. LoadMenuIndirectW(
  4782. IN CONST MENUTEMPLATEW *lpMenuTemplate);
  4783. #ifdef UNICODE
  4784. #define LoadMenuIndirect LoadMenuIndirectW
  4785. #else
  4786. #define LoadMenuIndirect LoadMenuIndirectA
  4787. #endif // !UNICODE
  4788. WINUSERAPI
  4789. HMENU
  4790. WINAPI
  4791. GetMenu(
  4792. IN HWND hWnd);
  4793. WINUSERAPI
  4794. BOOL
  4795. WINAPI
  4796. SetMenu(
  4797. IN HWND hWnd,
  4798. IN HMENU hMenu);
  4799. WINUSERAPI
  4800. BOOL
  4801. WINAPI
  4802. ChangeMenuA(
  4803. IN HMENU hMenu,
  4804. IN UINT cmd,
  4805. IN LPCSTR lpszNewItem,
  4806. IN UINT cmdInsert,
  4807. IN UINT flags);
  4808. WINUSERAPI
  4809. BOOL
  4810. WINAPI
  4811. ChangeMenuW(
  4812. IN HMENU hMenu,
  4813. IN UINT cmd,
  4814. IN LPCWSTR lpszNewItem,
  4815. IN UINT cmdInsert,
  4816. IN UINT flags);
  4817. #ifdef UNICODE
  4818. #define ChangeMenu ChangeMenuW
  4819. #else
  4820. #define ChangeMenu ChangeMenuA
  4821. #endif // !UNICODE
  4822. WINUSERAPI
  4823. BOOL
  4824. WINAPI
  4825. HiliteMenuItem(
  4826. IN HWND hWnd,
  4827. IN HMENU hMenu,
  4828. IN UINT uIDHiliteItem,
  4829. IN UINT uHilite);
  4830. WINUSERAPI
  4831. int
  4832. WINAPI
  4833. GetMenuStringA(
  4834. IN HMENU hMenu,
  4835. IN UINT uIDItem,
  4836. OUT LPSTR lpString,
  4837. IN int nMaxCount,
  4838. IN UINT uFlag);
  4839. WINUSERAPI
  4840. int
  4841. WINAPI
  4842. GetMenuStringW(
  4843. IN HMENU hMenu,
  4844. IN UINT uIDItem,
  4845. OUT LPWSTR lpString,
  4846. IN int nMaxCount,
  4847. IN UINT uFlag);
  4848. #ifdef UNICODE
  4849. #define GetMenuString GetMenuStringW
  4850. #else
  4851. #define GetMenuString GetMenuStringA
  4852. #endif // !UNICODE
  4853. WINUSERAPI
  4854. UINT
  4855. WINAPI
  4856. GetMenuState(
  4857. IN HMENU hMenu,
  4858. IN UINT uId,
  4859. IN UINT uFlags);
  4860. WINUSERAPI
  4861. BOOL
  4862. WINAPI
  4863. DrawMenuBar(
  4864. IN HWND hWnd);
  4865. #if(_WIN32_WINNT >= 0x0501)
  4866. #define PMB_ACTIVE 0x00000001
  4867. #endif /* _WIN32_WINNT >= 0x0501 */
  4868. WINUSERAPI
  4869. HMENU
  4870. WINAPI
  4871. GetSystemMenu(
  4872. IN HWND hWnd,
  4873. IN BOOL bRevert);
  4874. WINUSERAPI
  4875. HMENU
  4876. WINAPI
  4877. CreateMenu(
  4878. VOID);
  4879. WINUSERAPI
  4880. HMENU
  4881. WINAPI
  4882. CreatePopupMenu(
  4883. VOID);
  4884. WINUSERAPI
  4885. BOOL
  4886. WINAPI
  4887. DestroyMenu(
  4888. IN HMENU hMenu);
  4889. WINUSERAPI
  4890. DWORD
  4891. WINAPI
  4892. CheckMenuItem(
  4893. IN HMENU hMenu,
  4894. IN UINT uIDCheckItem,
  4895. IN UINT uCheck);
  4896. WINUSERAPI
  4897. BOOL
  4898. WINAPI
  4899. EnableMenuItem(
  4900. IN HMENU hMenu,
  4901. IN UINT uIDEnableItem,
  4902. IN UINT uEnable);
  4903. WINUSERAPI
  4904. HMENU
  4905. WINAPI
  4906. GetSubMenu(
  4907. IN HMENU hMenu,
  4908. IN int nPos);
  4909. WINUSERAPI
  4910. UINT
  4911. WINAPI
  4912. GetMenuItemID(
  4913. IN HMENU hMenu,
  4914. IN int nPos);
  4915. WINUSERAPI
  4916. int
  4917. WINAPI
  4918. GetMenuItemCount(
  4919. IN HMENU hMenu);
  4920. WINUSERAPI
  4921. BOOL
  4922. WINAPI
  4923. InsertMenuA(
  4924. IN HMENU hMenu,
  4925. IN UINT uPosition,
  4926. IN UINT uFlags,
  4927. IN UINT_PTR uIDNewItem,
  4928. IN LPCSTR lpNewItem
  4929. );
  4930. WINUSERAPI
  4931. BOOL
  4932. WINAPI
  4933. InsertMenuW(
  4934. IN HMENU hMenu,
  4935. IN UINT uPosition,
  4936. IN UINT uFlags,
  4937. IN UINT_PTR uIDNewItem,
  4938. IN LPCWSTR lpNewItem
  4939. );
  4940. #ifdef UNICODE
  4941. #define InsertMenu InsertMenuW
  4942. #else
  4943. #define InsertMenu InsertMenuA
  4944. #endif // !UNICODE
  4945. WINUSERAPI
  4946. BOOL
  4947. WINAPI
  4948. AppendMenuA(
  4949. IN HMENU hMenu,
  4950. IN UINT uFlags,
  4951. IN UINT_PTR uIDNewItem,
  4952. IN LPCSTR lpNewItem
  4953. );
  4954. WINUSERAPI
  4955. BOOL
  4956. WINAPI
  4957. AppendMenuW(
  4958. IN HMENU hMenu,
  4959. IN UINT uFlags,
  4960. IN UINT_PTR uIDNewItem,
  4961. IN LPCWSTR lpNewItem
  4962. );
  4963. #ifdef UNICODE
  4964. #define AppendMenu AppendMenuW
  4965. #else
  4966. #define AppendMenu AppendMenuA
  4967. #endif // !UNICODE
  4968. WINUSERAPI
  4969. BOOL
  4970. WINAPI
  4971. ModifyMenuA(
  4972. IN HMENU hMnu,
  4973. IN UINT uPosition,
  4974. IN UINT uFlags,
  4975. IN UINT_PTR uIDNewItem,
  4976. IN LPCSTR lpNewItem
  4977. );
  4978. WINUSERAPI
  4979. BOOL
  4980. WINAPI
  4981. ModifyMenuW(
  4982. IN HMENU hMnu,
  4983. IN UINT uPosition,
  4984. IN UINT uFlags,
  4985. IN UINT_PTR uIDNewItem,
  4986. IN LPCWSTR lpNewItem
  4987. );
  4988. #ifdef UNICODE
  4989. #define ModifyMenu ModifyMenuW
  4990. #else
  4991. #define ModifyMenu ModifyMenuA
  4992. #endif // !UNICODE
  4993. WINUSERAPI
  4994. BOOL
  4995. WINAPI RemoveMenu(
  4996. IN HMENU hMenu,
  4997. IN UINT uPosition,
  4998. IN UINT uFlags);
  4999. WINUSERAPI
  5000. BOOL
  5001. WINAPI
  5002. DeleteMenu(
  5003. IN HMENU hMenu,
  5004. IN UINT uPosition,
  5005. IN UINT uFlags);
  5006. WINUSERAPI
  5007. BOOL
  5008. WINAPI
  5009. SetMenuItemBitmaps(
  5010. IN HMENU hMenu,
  5011. IN UINT uPosition,
  5012. IN UINT uFlags,
  5013. IN HBITMAP hBitmapUnchecked,
  5014. IN HBITMAP hBitmapChecked);
  5015. WINUSERAPI
  5016. LONG
  5017. WINAPI
  5018. GetMenuCheckMarkDimensions(
  5019. VOID);
  5020. WINUSERAPI
  5021. BOOL
  5022. WINAPI
  5023. TrackPopupMenu(
  5024. IN HMENU hMenu,
  5025. IN UINT uFlags,
  5026. IN int x,
  5027. IN int y,
  5028. IN int nReserved,
  5029. IN HWND hWnd,
  5030. IN CONST RECT *prcRect);
  5031. #if(WINVER >= 0x0400)
  5032. /* return codes for WM_MENUCHAR */
  5033. #define MNC_IGNORE 0
  5034. #define MNC_CLOSE 1
  5035. #define MNC_EXECUTE 2
  5036. #define MNC_SELECT 3
  5037. typedef struct tagTPMPARAMS
  5038. {
  5039. UINT cbSize; /* Size of structure */
  5040. RECT rcExclude; /* Screen coordinates of rectangle to exclude when positioning */
  5041. } TPMPARAMS;
  5042. typedef TPMPARAMS FAR *LPTPMPARAMS;
  5043. WINUSERAPI
  5044. BOOL
  5045. WINAPI
  5046. TrackPopupMenuEx(
  5047. IN HMENU,
  5048. IN UINT,
  5049. IN int,
  5050. IN int,
  5051. IN HWND,
  5052. IN LPTPMPARAMS);
  5053. #endif /* WINVER >= 0x0400 */
  5054. #if(WINVER >= 0x0500)
  5055. #define MNS_NOCHECK 0x80000000
  5056. #define MNS_MODELESS 0x40000000
  5057. #define MNS_DRAGDROP 0x20000000
  5058. #define MNS_AUTODISMISS 0x10000000
  5059. #define MNS_NOTIFYBYPOS 0x08000000
  5060. #define MNS_CHECKORBMP 0x04000000
  5061. #define MIM_MAXHEIGHT 0x00000001
  5062. #define MIM_BACKGROUND 0x00000002
  5063. #define MIM_HELPID 0x00000004
  5064. #define MIM_MENUDATA 0x00000008
  5065. #define MIM_STYLE 0x00000010
  5066. #define MIM_APPLYTOSUBMENUS 0x80000000
  5067. typedef struct tagMENUINFO
  5068. {
  5069. DWORD cbSize;
  5070. DWORD fMask;
  5071. DWORD dwStyle;
  5072. UINT cyMax;
  5073. HBRUSH hbrBack;
  5074. DWORD dwContextHelpID;
  5075. ULONG_PTR dwMenuData;
  5076. } MENUINFO, FAR *LPMENUINFO;
  5077. typedef MENUINFO CONST FAR *LPCMENUINFO;
  5078. WINUSERAPI
  5079. BOOL
  5080. WINAPI
  5081. GetMenuInfo(
  5082. IN HMENU,
  5083. OUT LPMENUINFO);
  5084. WINUSERAPI
  5085. BOOL
  5086. WINAPI
  5087. SetMenuInfo(
  5088. IN HMENU,
  5089. IN LPCMENUINFO);
  5090. WINUSERAPI
  5091. BOOL
  5092. WINAPI
  5093. EndMenu(
  5094. VOID);
  5095. /*
  5096. * WM_MENUDRAG return values.
  5097. */
  5098. #define MND_CONTINUE 0
  5099. #define MND_ENDMENU 1
  5100. typedef struct tagMENUGETOBJECTINFO
  5101. {
  5102. DWORD dwFlags;
  5103. UINT uPos;
  5104. HMENU hmenu;
  5105. PVOID riid;
  5106. PVOID pvObj;
  5107. } MENUGETOBJECTINFO, * PMENUGETOBJECTINFO;
  5108. /*
  5109. * MENUGETOBJECTINFO dwFlags values
  5110. */
  5111. #define MNGOF_TOPGAP 0x00000001
  5112. #define MNGOF_BOTTOMGAP 0x00000002
  5113. /*
  5114. * WM_MENUGETOBJECT return values
  5115. */
  5116. #define MNGO_NOINTERFACE 0x00000000
  5117. #define MNGO_NOERROR 0x00000001
  5118. #endif /* WINVER >= 0x0500 */
  5119. #if(WINVER >= 0x0400)
  5120. #define MIIM_STATE 0x00000001
  5121. #define MIIM_ID 0x00000002
  5122. #define MIIM_SUBMENU 0x00000004
  5123. #define MIIM_CHECKMARKS 0x00000008
  5124. #define MIIM_TYPE 0x00000010
  5125. #define MIIM_DATA 0x00000020
  5126. #endif /* WINVER >= 0x0400 */
  5127. #if(WINVER >= 0x0500)
  5128. #define MIIM_STRING 0x00000040
  5129. #define MIIM_BITMAP 0x00000080
  5130. #define MIIM_FTYPE 0x00000100
  5131. #define HBMMENU_CALLBACK ((HBITMAP) -1)
  5132. #define HBMMENU_SYSTEM ((HBITMAP) 1)
  5133. #define HBMMENU_MBAR_RESTORE ((HBITMAP) 2)
  5134. #define HBMMENU_MBAR_MINIMIZE ((HBITMAP) 3)
  5135. #define HBMMENU_MBAR_CLOSE ((HBITMAP) 5)
  5136. #define HBMMENU_MBAR_CLOSE_D ((HBITMAP) 6)
  5137. #define HBMMENU_MBAR_MINIMIZE_D ((HBITMAP) 7)
  5138. #define HBMMENU_POPUP_CLOSE ((HBITMAP) 8)
  5139. #define HBMMENU_POPUP_RESTORE ((HBITMAP) 9)
  5140. #define HBMMENU_POPUP_MAXIMIZE ((HBITMAP) 10)
  5141. #define HBMMENU_POPUP_MINIMIZE ((HBITMAP) 11)
  5142. #endif /* WINVER >= 0x0500 */
  5143. #if(WINVER >= 0x0400)
  5144. typedef struct tagMENUITEMINFOA
  5145. {
  5146. UINT cbSize;
  5147. UINT fMask;
  5148. UINT fType; // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
  5149. UINT fState; // used if MIIM_STATE
  5150. UINT wID; // used if MIIM_ID
  5151. HMENU hSubMenu; // used if MIIM_SUBMENU
  5152. HBITMAP hbmpChecked; // used if MIIM_CHECKMARKS
  5153. HBITMAP hbmpUnchecked; // used if MIIM_CHECKMARKS
  5154. ULONG_PTR dwItemData; // used if MIIM_DATA
  5155. LPSTR dwTypeData; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5156. UINT cch; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5157. #if(WINVER >= 0x0500)
  5158. HBITMAP hbmpItem; // used if MIIM_BITMAP
  5159. #endif /* WINVER >= 0x0500 */
  5160. } MENUITEMINFOA, FAR *LPMENUITEMINFOA;
  5161. typedef struct tagMENUITEMINFOW
  5162. {
  5163. UINT cbSize;
  5164. UINT fMask;
  5165. UINT fType; // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
  5166. UINT fState; // used if MIIM_STATE
  5167. UINT wID; // used if MIIM_ID
  5168. HMENU hSubMenu; // used if MIIM_SUBMENU
  5169. HBITMAP hbmpChecked; // used if MIIM_CHECKMARKS
  5170. HBITMAP hbmpUnchecked; // used if MIIM_CHECKMARKS
  5171. ULONG_PTR dwItemData; // used if MIIM_DATA
  5172. LPWSTR dwTypeData; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5173. UINT cch; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5174. #if(WINVER >= 0x0500)
  5175. HBITMAP hbmpItem; // used if MIIM_BITMAP
  5176. #endif /* WINVER >= 0x0500 */
  5177. } MENUITEMINFOW, FAR *LPMENUITEMINFOW;
  5178. #ifdef UNICODE
  5179. typedef MENUITEMINFOW MENUITEMINFO;
  5180. typedef LPMENUITEMINFOW LPMENUITEMINFO;
  5181. #else
  5182. typedef MENUITEMINFOA MENUITEMINFO;
  5183. typedef LPMENUITEMINFOA LPMENUITEMINFO;
  5184. #endif // UNICODE
  5185. typedef MENUITEMINFOA CONST FAR *LPCMENUITEMINFOA;
  5186. typedef MENUITEMINFOW CONST FAR *LPCMENUITEMINFOW;
  5187. #ifdef UNICODE
  5188. typedef LPCMENUITEMINFOW LPCMENUITEMINFO;
  5189. #else
  5190. typedef LPCMENUITEMINFOA LPCMENUITEMINFO;
  5191. #endif // UNICODE
  5192. WINUSERAPI
  5193. BOOL
  5194. WINAPI
  5195. InsertMenuItemA(
  5196. IN HMENU,
  5197. IN UINT,
  5198. IN BOOL,
  5199. IN LPCMENUITEMINFOA
  5200. );
  5201. WINUSERAPI
  5202. BOOL
  5203. WINAPI
  5204. InsertMenuItemW(
  5205. IN HMENU,
  5206. IN UINT,
  5207. IN BOOL,
  5208. IN LPCMENUITEMINFOW
  5209. );
  5210. #ifdef UNICODE
  5211. #define InsertMenuItem InsertMenuItemW
  5212. #else
  5213. #define InsertMenuItem InsertMenuItemA
  5214. #endif // !UNICODE
  5215. WINUSERAPI
  5216. BOOL
  5217. WINAPI
  5218. GetMenuItemInfoA(
  5219. IN HMENU,
  5220. IN UINT,
  5221. IN BOOL,
  5222. IN OUT LPMENUITEMINFOA
  5223. );
  5224. WINUSERAPI
  5225. BOOL
  5226. WINAPI
  5227. GetMenuItemInfoW(
  5228. IN HMENU,
  5229. IN UINT,
  5230. IN BOOL,
  5231. IN OUT LPMENUITEMINFOW
  5232. );
  5233. #ifdef UNICODE
  5234. #define GetMenuItemInfo GetMenuItemInfoW
  5235. #else
  5236. #define GetMenuItemInfo GetMenuItemInfoA
  5237. #endif // !UNICODE
  5238. WINUSERAPI
  5239. BOOL
  5240. WINAPI
  5241. SetMenuItemInfoA(
  5242. IN HMENU,
  5243. IN UINT,
  5244. IN BOOL,
  5245. IN LPCMENUITEMINFOA
  5246. );
  5247. WINUSERAPI
  5248. BOOL
  5249. WINAPI
  5250. SetMenuItemInfoW(
  5251. IN HMENU,
  5252. IN UINT,
  5253. IN BOOL,
  5254. IN LPCMENUITEMINFOW
  5255. );
  5256. #ifdef UNICODE
  5257. #define SetMenuItemInfo SetMenuItemInfoW
  5258. #else
  5259. #define SetMenuItemInfo SetMenuItemInfoA
  5260. #endif // !UNICODE
  5261. #define GMDI_USEDISABLED 0x0001L
  5262. #define GMDI_GOINTOPOPUPS 0x0002L
  5263. WINUSERAPI UINT WINAPI GetMenuDefaultItem( IN HMENU hMenu, IN UINT fByPos, IN UINT gmdiFlags);
  5264. WINUSERAPI BOOL WINAPI SetMenuDefaultItem( IN HMENU hMenu, IN UINT uItem, IN UINT fByPos);
  5265. WINUSERAPI BOOL WINAPI GetMenuItemRect( IN HWND hWnd, IN HMENU hMenu, IN UINT uItem, OUT LPRECT lprcItem);
  5266. WINUSERAPI int WINAPI MenuItemFromPoint( IN HWND hWnd, IN HMENU hMenu, IN POINT ptScreen);
  5267. #endif /* WINVER >= 0x0400 */
  5268. /*
  5269. * Flags for TrackPopupMenu
  5270. */
  5271. #define TPM_LEFTBUTTON 0x0000L
  5272. #define TPM_RIGHTBUTTON 0x0002L
  5273. #define TPM_LEFTALIGN 0x0000L
  5274. #define TPM_CENTERALIGN 0x0004L
  5275. #define TPM_RIGHTALIGN 0x0008L
  5276. #if(WINVER >= 0x0400)
  5277. #define TPM_TOPALIGN 0x0000L
  5278. #define TPM_VCENTERALIGN 0x0010L
  5279. #define TPM_BOTTOMALIGN 0x0020L
  5280. #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
  5281. #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
  5282. #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
  5283. #define TPM_RETURNCMD 0x0100L
  5284. #endif /* WINVER >= 0x0400 */
  5285. #if(WINVER >= 0x0500)
  5286. #define TPM_RECURSE 0x0001L
  5287. #define TPM_HORPOSANIMATION 0x0400L
  5288. #define TPM_HORNEGANIMATION 0x0800L
  5289. #define TPM_VERPOSANIMATION 0x1000L
  5290. #define TPM_VERNEGANIMATION 0x2000L
  5291. #if(_WIN32_WINNT >= 0x0500)
  5292. #define TPM_NOANIMATION 0x4000L
  5293. #endif /* _WIN32_WINNT >= 0x0500 */
  5294. #if(_WIN32_WINNT >= 0x0501)
  5295. #define TPM_LAYOUTRTL 0x8000L
  5296. #endif /* _WIN32_WINNT >= 0x0501 */
  5297. #endif /* WINVER >= 0x0500 */
  5298. #endif /* !NOMENUS */
  5299. #if(WINVER >= 0x0400)
  5300. //
  5301. // Drag-and-drop support
  5302. // Obsolete - use OLE instead
  5303. //
  5304. typedef struct tagDROPSTRUCT
  5305. {
  5306. HWND hwndSource;
  5307. HWND hwndSink;
  5308. DWORD wFmt;
  5309. ULONG_PTR dwData;
  5310. POINT ptDrop;
  5311. DWORD dwControlData;
  5312. } DROPSTRUCT, *PDROPSTRUCT, *LPDROPSTRUCT;
  5313. #define DOF_EXECUTABLE 0x8001 // wFmt flags
  5314. #define DOF_DOCUMENT 0x8002
  5315. #define DOF_DIRECTORY 0x8003
  5316. #define DOF_MULTIPLE 0x8004
  5317. #define DOF_PROGMAN 0x0001
  5318. #define DOF_SHELLDATA 0x0002
  5319. #define DO_DROPFILE 0x454C4946L
  5320. #define DO_PRINTFILE 0x544E5250L
  5321. WINUSERAPI
  5322. DWORD
  5323. WINAPI
  5324. DragObject(
  5325. IN HWND,
  5326. IN HWND,
  5327. IN UINT,
  5328. IN ULONG_PTR,
  5329. IN HCURSOR);
  5330. WINUSERAPI
  5331. BOOL
  5332. WINAPI
  5333. DragDetect(
  5334. IN HWND,
  5335. IN POINT);
  5336. #endif /* WINVER >= 0x0400 */
  5337. WINUSERAPI
  5338. BOOL
  5339. WINAPI
  5340. DrawIcon(
  5341. IN HDC hDC,
  5342. IN int X,
  5343. IN int Y,
  5344. IN HICON hIcon);
  5345. #ifndef NODRAWTEXT
  5346. /*
  5347. * DrawText() Format Flags
  5348. */
  5349. #define DT_TOP 0x00000000
  5350. #define DT_LEFT 0x00000000
  5351. #define DT_CENTER 0x00000001
  5352. #define DT_RIGHT 0x00000002
  5353. #define DT_VCENTER 0x00000004
  5354. #define DT_BOTTOM 0x00000008
  5355. #define DT_WORDBREAK 0x00000010
  5356. #define DT_SINGLELINE 0x00000020
  5357. #define DT_EXPANDTABS 0x00000040
  5358. #define DT_TABSTOP 0x00000080
  5359. #define DT_NOCLIP 0x00000100
  5360. #define DT_EXTERNALLEADING 0x00000200
  5361. #define DT_CALCRECT 0x00000400
  5362. #define DT_NOPREFIX 0x00000800
  5363. #define DT_INTERNAL 0x00001000
  5364. #if(WINVER >= 0x0400)
  5365. #define DT_EDITCONTROL 0x00002000
  5366. #define DT_PATH_ELLIPSIS 0x00004000
  5367. #define DT_END_ELLIPSIS 0x00008000
  5368. #define DT_MODIFYSTRING 0x00010000
  5369. #define DT_RTLREADING 0x00020000
  5370. #define DT_WORD_ELLIPSIS 0x00040000
  5371. #if(WINVER >= 0x0500)
  5372. #define DT_NOFULLWIDTHCHARBREAK 0x00080000
  5373. #if(_WIN32_WINNT >= 0x0500)
  5374. #define DT_HIDEPREFIX 0x00100000
  5375. #define DT_PREFIXONLY 0x00200000
  5376. #endif /* _WIN32_WINNT >= 0x0500 */
  5377. #endif /* WINVER >= 0x0500 */
  5378. typedef struct tagDRAWTEXTPARAMS
  5379. {
  5380. UINT cbSize;
  5381. int iTabLength;
  5382. int iLeftMargin;
  5383. int iRightMargin;
  5384. UINT uiLengthDrawn;
  5385. } DRAWTEXTPARAMS, FAR *LPDRAWTEXTPARAMS;
  5386. #endif /* WINVER >= 0x0400 */
  5387. WINUSERAPI
  5388. int
  5389. WINAPI
  5390. DrawTextA(
  5391. IN HDC hDC,
  5392. IN LPCSTR lpString,
  5393. IN int nCount,
  5394. IN OUT LPRECT lpRect,
  5395. IN UINT uFormat);
  5396. WINUSERAPI
  5397. int
  5398. WINAPI
  5399. DrawTextW(
  5400. IN HDC hDC,
  5401. IN LPCWSTR lpString,
  5402. IN int nCount,
  5403. IN OUT LPRECT lpRect,
  5404. IN UINT uFormat);
  5405. #ifdef UNICODE
  5406. #define DrawText DrawTextW
  5407. #else
  5408. #define DrawText DrawTextA
  5409. #endif // !UNICODE
  5410. #if(WINVER >= 0x0400)
  5411. WINUSERAPI
  5412. int
  5413. WINAPI
  5414. DrawTextExA(
  5415. IN HDC,
  5416. IN OUT LPSTR,
  5417. IN int,
  5418. IN OUT LPRECT,
  5419. IN UINT,
  5420. IN LPDRAWTEXTPARAMS);
  5421. WINUSERAPI
  5422. int
  5423. WINAPI
  5424. DrawTextExW(
  5425. IN HDC,
  5426. IN OUT LPWSTR,
  5427. IN int,
  5428. IN OUT LPRECT,
  5429. IN UINT,
  5430. IN LPDRAWTEXTPARAMS);
  5431. #ifdef UNICODE
  5432. #define DrawTextEx DrawTextExW
  5433. #else
  5434. #define DrawTextEx DrawTextExA
  5435. #endif // !UNICODE
  5436. #endif /* WINVER >= 0x0400 */
  5437. #endif /* !NODRAWTEXT */
  5438. WINUSERAPI
  5439. BOOL
  5440. WINAPI
  5441. GrayStringA(
  5442. IN HDC hDC,
  5443. IN HBRUSH hBrush,
  5444. IN GRAYSTRINGPROC lpOutputFunc,
  5445. IN LPARAM lpData,
  5446. IN int nCount,
  5447. IN int X,
  5448. IN int Y,
  5449. IN int nWidth,
  5450. IN int nHeight);
  5451. WINUSERAPI
  5452. BOOL
  5453. WINAPI
  5454. GrayStringW(
  5455. IN HDC hDC,
  5456. IN HBRUSH hBrush,
  5457. IN GRAYSTRINGPROC lpOutputFunc,
  5458. IN LPARAM lpData,
  5459. IN int nCount,
  5460. IN int X,
  5461. IN int Y,
  5462. IN int nWidth,
  5463. IN int nHeight);
  5464. #ifdef UNICODE
  5465. #define GrayString GrayStringW
  5466. #else
  5467. #define GrayString GrayStringA
  5468. #endif // !UNICODE
  5469. #if(WINVER >= 0x0400)
  5470. /* Monolithic state-drawing routine */
  5471. /* Image type */
  5472. #define DST_COMPLEX 0x0000
  5473. #define DST_TEXT 0x0001
  5474. #define DST_PREFIXTEXT 0x0002
  5475. #define DST_ICON 0x0003
  5476. #define DST_BITMAP 0x0004
  5477. /* State type */
  5478. #define DSS_NORMAL 0x0000
  5479. #define DSS_UNION 0x0010 /* Gray string appearance */
  5480. #define DSS_DISABLED 0x0020
  5481. #define DSS_MONO 0x0080
  5482. #if(_WIN32_WINNT >= 0x0500)
  5483. #define DSS_HIDEPREFIX 0x0200
  5484. #define DSS_PREFIXONLY 0x0400
  5485. #endif /* _WIN32_WINNT >= 0x0500 */
  5486. #define DSS_RIGHT 0x8000
  5487. WINUSERAPI
  5488. BOOL
  5489. WINAPI
  5490. DrawStateA(
  5491. IN HDC,
  5492. IN HBRUSH,
  5493. IN DRAWSTATEPROC,
  5494. IN LPARAM,
  5495. IN WPARAM,
  5496. IN int,
  5497. IN int,
  5498. IN int,
  5499. IN int,
  5500. IN UINT);
  5501. WINUSERAPI
  5502. BOOL
  5503. WINAPI
  5504. DrawStateW(
  5505. IN HDC,
  5506. IN HBRUSH,
  5507. IN DRAWSTATEPROC,
  5508. IN LPARAM,
  5509. IN WPARAM,
  5510. IN int,
  5511. IN int,
  5512. IN int,
  5513. IN int,
  5514. IN UINT);
  5515. #ifdef UNICODE
  5516. #define DrawState DrawStateW
  5517. #else
  5518. #define DrawState DrawStateA
  5519. #endif // !UNICODE
  5520. #endif /* WINVER >= 0x0400 */
  5521. WINUSERAPI
  5522. LONG
  5523. WINAPI
  5524. TabbedTextOutA(
  5525. IN HDC hDC,
  5526. IN int X,
  5527. IN int Y,
  5528. IN LPCSTR lpString,
  5529. IN int nCount,
  5530. IN int nTabPositions,
  5531. IN CONST INT *lpnTabStopPositions,
  5532. IN int nTabOrigin);
  5533. WINUSERAPI
  5534. LONG
  5535. WINAPI
  5536. TabbedTextOutW(
  5537. IN HDC hDC,
  5538. IN int X,
  5539. IN int Y,
  5540. IN LPCWSTR lpString,
  5541. IN int nCount,
  5542. IN int nTabPositions,
  5543. IN CONST INT *lpnTabStopPositions,
  5544. IN int nTabOrigin);
  5545. #ifdef UNICODE
  5546. #define TabbedTextOut TabbedTextOutW
  5547. #else
  5548. #define TabbedTextOut TabbedTextOutA
  5549. #endif // !UNICODE
  5550. WINUSERAPI
  5551. DWORD
  5552. WINAPI
  5553. GetTabbedTextExtentA(
  5554. IN HDC hDC,
  5555. IN LPCSTR lpString,
  5556. IN int nCount,
  5557. IN int nTabPositions,
  5558. IN CONST INT *lpnTabStopPositions);
  5559. WINUSERAPI
  5560. DWORD
  5561. WINAPI
  5562. GetTabbedTextExtentW(
  5563. IN HDC hDC,
  5564. IN LPCWSTR lpString,
  5565. IN int nCount,
  5566. IN int nTabPositions,
  5567. IN CONST INT *lpnTabStopPositions);
  5568. #ifdef UNICODE
  5569. #define GetTabbedTextExtent GetTabbedTextExtentW
  5570. #else
  5571. #define GetTabbedTextExtent GetTabbedTextExtentA
  5572. #endif // !UNICODE
  5573. WINUSERAPI
  5574. BOOL
  5575. WINAPI
  5576. UpdateWindow(
  5577. IN HWND hWnd);
  5578. WINUSERAPI
  5579. HWND
  5580. WINAPI
  5581. SetActiveWindow(
  5582. IN HWND hWnd);
  5583. WINUSERAPI
  5584. HWND
  5585. WINAPI
  5586. GetForegroundWindow(
  5587. VOID);
  5588. #if(WINVER >= 0x0400)
  5589. WINUSERAPI
  5590. BOOL
  5591. WINAPI
  5592. PaintDesktop(
  5593. IN HDC hdc);
  5594. WINUSERAPI
  5595. VOID
  5596. WINAPI
  5597. SwitchToThisWindow(
  5598. IN HWND hwnd,
  5599. IN BOOL fUnknown);
  5600. #endif /* WINVER >= 0x0400 */
  5601. WINUSERAPI
  5602. BOOL
  5603. WINAPI
  5604. SetForegroundWindow(
  5605. IN HWND hWnd);
  5606. #if(_WIN32_WINNT >= 0x0500)
  5607. WINUSERAPI
  5608. BOOL
  5609. WINAPI
  5610. AllowSetForegroundWindow(
  5611. DWORD dwProcessId);
  5612. #define ASFW_ANY ((DWORD)-1)
  5613. WINUSERAPI
  5614. BOOL
  5615. WINAPI
  5616. LockSetForegroundWindow(
  5617. UINT uLockCode);
  5618. #define LSFW_LOCK 1
  5619. #define LSFW_UNLOCK 2
  5620. #endif /* _WIN32_WINNT >= 0x0500 */
  5621. WINUSERAPI
  5622. HWND
  5623. WINAPI
  5624. WindowFromDC(
  5625. IN HDC hDC);
  5626. WINUSERAPI
  5627. HDC
  5628. WINAPI
  5629. GetDC(
  5630. IN HWND hWnd);
  5631. WINUSERAPI
  5632. HDC
  5633. WINAPI
  5634. GetDCEx(
  5635. IN HWND hWnd,
  5636. IN HRGN hrgnClip,
  5637. IN DWORD flags);
  5638. /*
  5639. * GetDCEx() flags
  5640. */
  5641. #define DCX_WINDOW 0x00000001L
  5642. #define DCX_CACHE 0x00000002L
  5643. #define DCX_NORESETATTRS 0x00000004L
  5644. #define DCX_CLIPCHILDREN 0x00000008L
  5645. #define DCX_CLIPSIBLINGS 0x00000010L
  5646. #define DCX_PARENTCLIP 0x00000020L
  5647. #define DCX_EXCLUDERGN 0x00000040L
  5648. #define DCX_INTERSECTRGN 0x00000080L
  5649. #define DCX_EXCLUDEUPDATE 0x00000100L
  5650. #define DCX_INTERSECTUPDATE 0x00000200L
  5651. #define DCX_LOCKWINDOWUPDATE 0x00000400L
  5652. #define DCX_VALIDATE 0x00200000L
  5653. WINUSERAPI
  5654. HDC
  5655. WINAPI
  5656. GetWindowDC(
  5657. IN HWND hWnd);
  5658. WINUSERAPI
  5659. int
  5660. WINAPI
  5661. ReleaseDC(
  5662. IN HWND hWnd,
  5663. IN HDC hDC);
  5664. WINUSERAPI
  5665. HDC
  5666. WINAPI
  5667. BeginPaint(
  5668. IN HWND hWnd,
  5669. OUT LPPAINTSTRUCT lpPaint);
  5670. WINUSERAPI
  5671. BOOL
  5672. WINAPI
  5673. EndPaint(
  5674. IN HWND hWnd,
  5675. IN CONST PAINTSTRUCT *lpPaint);
  5676. WINUSERAPI
  5677. BOOL
  5678. WINAPI
  5679. GetUpdateRect(
  5680. IN HWND hWnd,
  5681. OUT LPRECT lpRect,
  5682. IN BOOL bErase);
  5683. WINUSERAPI
  5684. int
  5685. WINAPI
  5686. GetUpdateRgn(
  5687. IN HWND hWnd,
  5688. IN HRGN hRgn,
  5689. IN BOOL bErase);
  5690. WINUSERAPI
  5691. int
  5692. WINAPI
  5693. SetWindowRgn(
  5694. IN HWND hWnd,
  5695. IN HRGN hRgn,
  5696. IN BOOL bRedraw);
  5697. WINUSERAPI
  5698. int
  5699. WINAPI
  5700. GetWindowRgn(
  5701. IN HWND hWnd,
  5702. IN HRGN hRgn);
  5703. #if(_WIN32_WINNT >= 0x0501)
  5704. WINUSERAPI
  5705. int
  5706. WINAPI
  5707. GetWindowRgnBox(
  5708. IN HWND hWnd,
  5709. OUT LPRECT lprc);
  5710. #endif /* _WIN32_WINNT >= 0x0501 */
  5711. WINUSERAPI
  5712. int
  5713. WINAPI
  5714. ExcludeUpdateRgn(
  5715. IN HDC hDC,
  5716. IN HWND hWnd);
  5717. WINUSERAPI
  5718. BOOL
  5719. WINAPI
  5720. InvalidateRect(
  5721. IN HWND hWnd,
  5722. IN CONST RECT *lpRect,
  5723. IN BOOL bErase);
  5724. WINUSERAPI
  5725. BOOL
  5726. WINAPI
  5727. ValidateRect(
  5728. IN HWND hWnd,
  5729. IN CONST RECT *lpRect);
  5730. WINUSERAPI
  5731. BOOL
  5732. WINAPI
  5733. InvalidateRgn(
  5734. IN HWND hWnd,
  5735. IN HRGN hRgn,
  5736. IN BOOL bErase);
  5737. WINUSERAPI
  5738. BOOL
  5739. WINAPI
  5740. ValidateRgn(
  5741. IN HWND hWnd,
  5742. IN HRGN hRgn);
  5743. WINUSERAPI
  5744. BOOL
  5745. WINAPI
  5746. RedrawWindow(
  5747. IN HWND hWnd,
  5748. IN CONST RECT *lprcUpdate,
  5749. IN HRGN hrgnUpdate,
  5750. IN UINT flags);
  5751. /*
  5752. * RedrawWindow() flags
  5753. */
  5754. #define RDW_INVALIDATE 0x0001
  5755. #define RDW_INTERNALPAINT 0x0002
  5756. #define RDW_ERASE 0x0004
  5757. #define RDW_VALIDATE 0x0008
  5758. #define RDW_NOINTERNALPAINT 0x0010
  5759. #define RDW_NOERASE 0x0020
  5760. #define RDW_NOCHILDREN 0x0040
  5761. #define RDW_ALLCHILDREN 0x0080
  5762. #define RDW_UPDATENOW 0x0100
  5763. #define RDW_ERASENOW 0x0200
  5764. #define RDW_FRAME 0x0400
  5765. #define RDW_NOFRAME 0x0800
  5766. /*
  5767. * LockWindowUpdate API
  5768. */
  5769. WINUSERAPI
  5770. BOOL
  5771. WINAPI
  5772. LockWindowUpdate(
  5773. IN HWND hWndLock);
  5774. WINUSERAPI
  5775. BOOL
  5776. WINAPI
  5777. ScrollWindow(
  5778. IN HWND hWnd,
  5779. IN int XAmount,
  5780. IN int YAmount,
  5781. IN CONST RECT *lpRect,
  5782. IN CONST RECT *lpClipRect);
  5783. WINUSERAPI
  5784. BOOL
  5785. WINAPI
  5786. ScrollDC(
  5787. IN HDC hDC,
  5788. IN int dx,
  5789. IN int dy,
  5790. IN CONST RECT *lprcScroll,
  5791. IN CONST RECT *lprcClip,
  5792. IN HRGN hrgnUpdate,
  5793. OUT LPRECT lprcUpdate);
  5794. WINUSERAPI
  5795. int
  5796. WINAPI
  5797. ScrollWindowEx(
  5798. IN HWND hWnd,
  5799. IN int dx,
  5800. IN int dy,
  5801. IN CONST RECT *prcScroll,
  5802. IN CONST RECT *prcClip,
  5803. IN HRGN hrgnUpdate,
  5804. OUT LPRECT prcUpdate,
  5805. IN UINT flags);
  5806. #define SW_SCROLLCHILDREN 0x0001 /* Scroll children within *lprcScroll. */
  5807. #define SW_INVALIDATE 0x0002 /* Invalidate after scrolling */
  5808. #define SW_ERASE 0x0004 /* If SW_INVALIDATE, don't send WM_ERASEBACKGROUND */
  5809. #if(WINVER >= 0x0500)
  5810. #define SW_SMOOTHSCROLL 0x0010 /* Use smooth scrolling */
  5811. #endif /* WINVER >= 0x0500 */
  5812. #ifndef NOSCROLL
  5813. WINUSERAPI
  5814. int
  5815. WINAPI
  5816. SetScrollPos(
  5817. IN HWND hWnd,
  5818. IN int nBar,
  5819. IN int nPos,
  5820. IN BOOL bRedraw);
  5821. WINUSERAPI
  5822. int
  5823. WINAPI
  5824. GetScrollPos(
  5825. IN HWND hWnd,
  5826. IN int nBar);
  5827. WINUSERAPI
  5828. BOOL
  5829. WINAPI
  5830. SetScrollRange(
  5831. IN HWND hWnd,
  5832. IN int nBar,
  5833. IN int nMinPos,
  5834. IN int nMaxPos,
  5835. IN BOOL bRedraw);
  5836. WINUSERAPI
  5837. BOOL
  5838. WINAPI
  5839. GetScrollRange(
  5840. IN HWND hWnd,
  5841. IN int nBar,
  5842. OUT LPINT lpMinPos,
  5843. OUT LPINT lpMaxPos);
  5844. WINUSERAPI
  5845. BOOL
  5846. WINAPI
  5847. ShowScrollBar(
  5848. IN HWND hWnd,
  5849. IN int wBar,
  5850. IN BOOL bShow);
  5851. WINUSERAPI
  5852. BOOL
  5853. WINAPI
  5854. EnableScrollBar(
  5855. IN HWND hWnd,
  5856. IN UINT wSBflags,
  5857. IN UINT wArrows);
  5858. /*
  5859. * EnableScrollBar() flags
  5860. */
  5861. #define ESB_ENABLE_BOTH 0x0000
  5862. #define ESB_DISABLE_BOTH 0x0003
  5863. #define ESB_DISABLE_LEFT 0x0001
  5864. #define ESB_DISABLE_RIGHT 0x0002
  5865. #define ESB_DISABLE_UP 0x0001
  5866. #define ESB_DISABLE_DOWN 0x0002
  5867. #define ESB_DISABLE_LTUP ESB_DISABLE_LEFT
  5868. #define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT
  5869. #endif /* !NOSCROLL */
  5870. WINUSERAPI
  5871. BOOL
  5872. WINAPI
  5873. SetPropA(
  5874. IN HWND hWnd,
  5875. IN LPCSTR lpString,
  5876. IN HANDLE hData);
  5877. WINUSERAPI
  5878. BOOL
  5879. WINAPI
  5880. SetPropW(
  5881. IN HWND hWnd,
  5882. IN LPCWSTR lpString,
  5883. IN HANDLE hData);
  5884. #ifdef UNICODE
  5885. #define SetProp SetPropW
  5886. #else
  5887. #define SetProp SetPropA
  5888. #endif // !UNICODE
  5889. WINUSERAPI
  5890. HANDLE
  5891. WINAPI
  5892. GetPropA(
  5893. IN HWND hWnd,
  5894. IN LPCSTR lpString);
  5895. WINUSERAPI
  5896. HANDLE
  5897. WINAPI
  5898. GetPropW(
  5899. IN HWND hWnd,
  5900. IN LPCWSTR lpString);
  5901. #ifdef UNICODE
  5902. #define GetProp GetPropW
  5903. #else
  5904. #define GetProp GetPropA
  5905. #endif // !UNICODE
  5906. WINUSERAPI
  5907. HANDLE
  5908. WINAPI
  5909. RemovePropA(
  5910. IN HWND hWnd,
  5911. IN LPCSTR lpString);
  5912. WINUSERAPI
  5913. HANDLE
  5914. WINAPI
  5915. RemovePropW(
  5916. IN HWND hWnd,
  5917. IN LPCWSTR lpString);
  5918. #ifdef UNICODE
  5919. #define RemoveProp RemovePropW
  5920. #else
  5921. #define RemoveProp RemovePropA
  5922. #endif // !UNICODE
  5923. WINUSERAPI
  5924. int
  5925. WINAPI
  5926. EnumPropsExA(
  5927. IN HWND hWnd,
  5928. IN PROPENUMPROCEXA lpEnumFunc,
  5929. IN LPARAM lParam);
  5930. WINUSERAPI
  5931. int
  5932. WINAPI
  5933. EnumPropsExW(
  5934. IN HWND hWnd,
  5935. IN PROPENUMPROCEXW lpEnumFunc,
  5936. IN LPARAM lParam);
  5937. #ifdef UNICODE
  5938. #define EnumPropsEx EnumPropsExW
  5939. #else
  5940. #define EnumPropsEx EnumPropsExA
  5941. #endif // !UNICODE
  5942. WINUSERAPI
  5943. int
  5944. WINAPI
  5945. EnumPropsA(
  5946. IN HWND hWnd,
  5947. IN PROPENUMPROCA lpEnumFunc);
  5948. WINUSERAPI
  5949. int
  5950. WINAPI
  5951. EnumPropsW(
  5952. IN HWND hWnd,
  5953. IN PROPENUMPROCW lpEnumFunc);
  5954. #ifdef UNICODE
  5955. #define EnumProps EnumPropsW
  5956. #else
  5957. #define EnumProps EnumPropsA
  5958. #endif // !UNICODE
  5959. WINUSERAPI
  5960. BOOL
  5961. WINAPI
  5962. SetWindowTextA(
  5963. IN HWND hWnd,
  5964. IN LPCSTR lpString);
  5965. WINUSERAPI
  5966. BOOL
  5967. WINAPI
  5968. SetWindowTextW(
  5969. IN HWND hWnd,
  5970. IN LPCWSTR lpString);
  5971. #ifdef UNICODE
  5972. #define SetWindowText SetWindowTextW
  5973. #else
  5974. #define SetWindowText SetWindowTextA
  5975. #endif // !UNICODE
  5976. WINUSERAPI
  5977. int
  5978. WINAPI
  5979. GetWindowTextA(
  5980. IN HWND hWnd,
  5981. OUT LPSTR lpString,
  5982. IN int nMaxCount);
  5983. WINUSERAPI
  5984. int
  5985. WINAPI
  5986. GetWindowTextW(
  5987. IN HWND hWnd,
  5988. OUT LPWSTR lpString,
  5989. IN int nMaxCount);
  5990. #ifdef UNICODE
  5991. #define GetWindowText GetWindowTextW
  5992. #else
  5993. #define GetWindowText GetWindowTextA
  5994. #endif // !UNICODE
  5995. WINUSERAPI
  5996. int
  5997. WINAPI
  5998. GetWindowTextLengthA(
  5999. IN HWND hWnd);
  6000. WINUSERAPI
  6001. int
  6002. WINAPI
  6003. GetWindowTextLengthW(
  6004. IN HWND hWnd);
  6005. #ifdef UNICODE
  6006. #define GetWindowTextLength GetWindowTextLengthW
  6007. #else
  6008. #define GetWindowTextLength GetWindowTextLengthA
  6009. #endif // !UNICODE
  6010. WINUSERAPI
  6011. BOOL
  6012. WINAPI
  6013. GetClientRect(
  6014. IN HWND hWnd,
  6015. OUT LPRECT lpRect);
  6016. WINUSERAPI
  6017. BOOL
  6018. WINAPI
  6019. GetWindowRect(
  6020. IN HWND hWnd,
  6021. OUT LPRECT lpRect);
  6022. WINUSERAPI
  6023. BOOL
  6024. WINAPI
  6025. AdjustWindowRect(
  6026. IN OUT LPRECT lpRect,
  6027. IN DWORD dwStyle,
  6028. IN BOOL bMenu);
  6029. WINUSERAPI
  6030. BOOL
  6031. WINAPI
  6032. AdjustWindowRectEx(
  6033. IN OUT LPRECT lpRect,
  6034. IN DWORD dwStyle,
  6035. IN BOOL bMenu,
  6036. IN DWORD dwExStyle);
  6037. #if(WINVER >= 0x0400)
  6038. #define HELPINFO_WINDOW 0x0001
  6039. #define HELPINFO_MENUITEM 0x0002
  6040. typedef struct tagHELPINFO /* Structure pointed to by lParam of WM_HELP */
  6041. {
  6042. UINT cbSize; /* Size in bytes of this struct */
  6043. int iContextType; /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
  6044. int iCtrlId; /* Control Id or a Menu item Id. */
  6045. HANDLE hItemHandle; /* hWnd of control or hMenu. */
  6046. DWORD_PTR dwContextId; /* Context Id associated with this item */
  6047. POINT MousePos; /* Mouse Position in screen co-ordinates */
  6048. } HELPINFO, FAR *LPHELPINFO;
  6049. WINUSERAPI
  6050. BOOL
  6051. WINAPI
  6052. SetWindowContextHelpId(
  6053. IN HWND,
  6054. IN DWORD);
  6055. WINUSERAPI
  6056. DWORD
  6057. WINAPI
  6058. GetWindowContextHelpId(
  6059. IN HWND);
  6060. WINUSERAPI
  6061. BOOL
  6062. WINAPI
  6063. SetMenuContextHelpId(
  6064. IN HMENU,
  6065. IN DWORD);
  6066. WINUSERAPI
  6067. DWORD
  6068. WINAPI
  6069. GetMenuContextHelpId(
  6070. IN HMENU);
  6071. #endif /* WINVER >= 0x0400 */
  6072. #ifndef NOMB
  6073. /*
  6074. * MessageBox() Flags
  6075. */
  6076. #define MB_OK 0x00000000L
  6077. #define MB_OKCANCEL 0x00000001L
  6078. #define MB_ABORTRETRYIGNORE 0x00000002L
  6079. #define MB_YESNOCANCEL 0x00000003L
  6080. #define MB_YESNO 0x00000004L
  6081. #define MB_RETRYCANCEL 0x00000005L
  6082. #if(WINVER >= 0x0500)
  6083. #define MB_CANCELTRYCONTINUE 0x00000006L
  6084. #endif /* WINVER >= 0x0500 */
  6085. #define MB_ICONHAND 0x00000010L
  6086. #define MB_ICONQUESTION 0x00000020L
  6087. #define MB_ICONEXCLAMATION 0x00000030L
  6088. #define MB_ICONASTERISK 0x00000040L
  6089. #if(WINVER >= 0x0400)
  6090. #define MB_USERICON 0x00000080L
  6091. #define MB_ICONWARNING MB_ICONEXCLAMATION
  6092. #define MB_ICONERROR MB_ICONHAND
  6093. #endif /* WINVER >= 0x0400 */
  6094. #define MB_ICONINFORMATION MB_ICONASTERISK
  6095. #define MB_ICONSTOP MB_ICONHAND
  6096. #define MB_DEFBUTTON1 0x00000000L
  6097. #define MB_DEFBUTTON2 0x00000100L
  6098. #define MB_DEFBUTTON3 0x00000200L
  6099. #if(WINVER >= 0x0400)
  6100. #define MB_DEFBUTTON4 0x00000300L
  6101. #endif /* WINVER >= 0x0400 */
  6102. #define MB_APPLMODAL 0x00000000L
  6103. #define MB_SYSTEMMODAL 0x00001000L
  6104. #define MB_TASKMODAL 0x00002000L
  6105. #if(WINVER >= 0x0400)
  6106. #define MB_HELP 0x00004000L // Help Button
  6107. #endif /* WINVER >= 0x0400 */
  6108. #define MB_NOFOCUS 0x00008000L
  6109. #define MB_SETFOREGROUND 0x00010000L
  6110. #define MB_DEFAULT_DESKTOP_ONLY 0x00020000L
  6111. #if(WINVER >= 0x0400)
  6112. #define MB_TOPMOST 0x00040000L
  6113. #define MB_RIGHT 0x00080000L
  6114. #define MB_RTLREADING 0x00100000L
  6115. #endif /* WINVER >= 0x0400 */
  6116. #ifdef _WIN32_WINNT
  6117. #if (_WIN32_WINNT >= 0x0400)
  6118. #define MB_SERVICE_NOTIFICATION 0x00200000L
  6119. #else
  6120. #define MB_SERVICE_NOTIFICATION 0x00040000L
  6121. #endif
  6122. #define MB_SERVICE_NOTIFICATION_NT3X 0x00040000L
  6123. #endif
  6124. #define MB_TYPEMASK 0x0000000FL
  6125. #define MB_ICONMASK 0x000000F0L
  6126. #define MB_DEFMASK 0x00000F00L
  6127. #define MB_MODEMASK 0x00003000L
  6128. #define MB_MISCMASK 0x0000C000L
  6129. WINUSERAPI
  6130. int
  6131. WINAPI
  6132. MessageBoxA(
  6133. IN HWND hWnd,
  6134. IN LPCSTR lpText,
  6135. IN LPCSTR lpCaption,
  6136. IN UINT uType);
  6137. WINUSERAPI
  6138. int
  6139. WINAPI
  6140. MessageBoxW(
  6141. IN HWND hWnd,
  6142. IN LPCWSTR lpText,
  6143. IN LPCWSTR lpCaption,
  6144. IN UINT uType);
  6145. #ifdef UNICODE
  6146. #define MessageBox MessageBoxW
  6147. #else
  6148. #define MessageBox MessageBoxA
  6149. #endif // !UNICODE
  6150. WINUSERAPI
  6151. int
  6152. WINAPI
  6153. MessageBoxExA(
  6154. IN HWND hWnd,
  6155. IN LPCSTR lpText,
  6156. IN LPCSTR lpCaption,
  6157. IN UINT uType,
  6158. IN WORD wLanguageId);
  6159. WINUSERAPI
  6160. int
  6161. WINAPI
  6162. MessageBoxExW(
  6163. IN HWND hWnd,
  6164. IN LPCWSTR lpText,
  6165. IN LPCWSTR lpCaption,
  6166. IN UINT uType,
  6167. IN WORD wLanguageId);
  6168. #ifdef UNICODE
  6169. #define MessageBoxEx MessageBoxExW
  6170. #else
  6171. #define MessageBoxEx MessageBoxExA
  6172. #endif // !UNICODE
  6173. #if(WINVER >= 0x0400)
  6174. typedef void (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
  6175. typedef struct tagMSGBOXPARAMSA
  6176. {
  6177. UINT cbSize;
  6178. HWND hwndOwner;
  6179. HINSTANCE hInstance;
  6180. LPCSTR lpszText;
  6181. LPCSTR lpszCaption;
  6182. DWORD dwStyle;
  6183. LPCSTR lpszIcon;
  6184. DWORD_PTR dwContextHelpId;
  6185. MSGBOXCALLBACK lpfnMsgBoxCallback;
  6186. DWORD dwLanguageId;
  6187. } MSGBOXPARAMSA, *PMSGBOXPARAMSA, *LPMSGBOXPARAMSA;
  6188. typedef struct tagMSGBOXPARAMSW
  6189. {
  6190. UINT cbSize;
  6191. HWND hwndOwner;
  6192. HINSTANCE hInstance;
  6193. LPCWSTR lpszText;
  6194. LPCWSTR lpszCaption;
  6195. DWORD dwStyle;
  6196. LPCWSTR lpszIcon;
  6197. DWORD_PTR dwContextHelpId;
  6198. MSGBOXCALLBACK lpfnMsgBoxCallback;
  6199. DWORD dwLanguageId;
  6200. } MSGBOXPARAMSW, *PMSGBOXPARAMSW, *LPMSGBOXPARAMSW;
  6201. #ifdef UNICODE
  6202. typedef MSGBOXPARAMSW MSGBOXPARAMS;
  6203. typedef PMSGBOXPARAMSW PMSGBOXPARAMS;
  6204. typedef LPMSGBOXPARAMSW LPMSGBOXPARAMS;
  6205. #else
  6206. typedef MSGBOXPARAMSA MSGBOXPARAMS;
  6207. typedef PMSGBOXPARAMSA PMSGBOXPARAMS;
  6208. typedef LPMSGBOXPARAMSA LPMSGBOXPARAMS;
  6209. #endif // UNICODE
  6210. WINUSERAPI
  6211. int
  6212. WINAPI
  6213. MessageBoxIndirectA(
  6214. IN CONST MSGBOXPARAMSA *);
  6215. WINUSERAPI
  6216. int
  6217. WINAPI
  6218. MessageBoxIndirectW(
  6219. IN CONST MSGBOXPARAMSW *);
  6220. #ifdef UNICODE
  6221. #define MessageBoxIndirect MessageBoxIndirectW
  6222. #else
  6223. #define MessageBoxIndirect MessageBoxIndirectA
  6224. #endif // !UNICODE
  6225. #endif /* WINVER >= 0x0400 */
  6226. WINUSERAPI
  6227. BOOL
  6228. WINAPI
  6229. MessageBeep(
  6230. IN UINT uType);
  6231. #endif /* !NOMB */
  6232. WINUSERAPI
  6233. int
  6234. WINAPI
  6235. ShowCursor(
  6236. IN BOOL bShow);
  6237. WINUSERAPI
  6238. BOOL
  6239. WINAPI
  6240. SetCursorPos(
  6241. IN int X,
  6242. IN int Y);
  6243. WINUSERAPI
  6244. HCURSOR
  6245. WINAPI
  6246. SetCursor(
  6247. IN HCURSOR hCursor);
  6248. WINUSERAPI
  6249. BOOL
  6250. WINAPI
  6251. GetCursorPos(
  6252. OUT LPPOINT lpPoint);
  6253. WINUSERAPI
  6254. BOOL
  6255. WINAPI
  6256. ClipCursor(
  6257. IN CONST RECT *lpRect);
  6258. WINUSERAPI
  6259. BOOL
  6260. WINAPI
  6261. GetClipCursor(
  6262. OUT LPRECT lpRect);
  6263. WINUSERAPI
  6264. HCURSOR
  6265. WINAPI
  6266. GetCursor(
  6267. VOID);
  6268. WINUSERAPI
  6269. BOOL
  6270. WINAPI
  6271. CreateCaret(
  6272. IN HWND hWnd,
  6273. IN HBITMAP hBitmap,
  6274. IN int nWidth,
  6275. IN int nHeight);
  6276. WINUSERAPI
  6277. UINT
  6278. WINAPI
  6279. GetCaretBlinkTime(
  6280. VOID);
  6281. WINUSERAPI
  6282. BOOL
  6283. WINAPI
  6284. SetCaretBlinkTime(
  6285. IN UINT uMSeconds);
  6286. WINUSERAPI
  6287. BOOL
  6288. WINAPI
  6289. DestroyCaret(
  6290. VOID);
  6291. WINUSERAPI
  6292. BOOL
  6293. WINAPI
  6294. HideCaret(
  6295. IN HWND hWnd);
  6296. WINUSERAPI
  6297. BOOL
  6298. WINAPI
  6299. ShowCaret(
  6300. IN HWND hWnd);
  6301. WINUSERAPI
  6302. BOOL
  6303. WINAPI
  6304. SetCaretPos(
  6305. IN int X,
  6306. IN int Y);
  6307. WINUSERAPI
  6308. BOOL
  6309. WINAPI
  6310. GetCaretPos(
  6311. OUT LPPOINT lpPoint);
  6312. WINUSERAPI
  6313. BOOL
  6314. WINAPI
  6315. ClientToScreen(
  6316. IN HWND hWnd,
  6317. IN OUT LPPOINT lpPoint);
  6318. WINUSERAPI
  6319. BOOL
  6320. WINAPI
  6321. ScreenToClient(
  6322. IN HWND hWnd,
  6323. IN OUT LPPOINT lpPoint);
  6324. WINUSERAPI
  6325. int
  6326. WINAPI
  6327. MapWindowPoints(
  6328. IN HWND hWndFrom,
  6329. IN HWND hWndTo,
  6330. IN OUT LPPOINT lpPoints,
  6331. IN UINT cPoints);
  6332. WINUSERAPI
  6333. HWND
  6334. WINAPI
  6335. WindowFromPoint(
  6336. IN POINT Point);
  6337. WINUSERAPI
  6338. HWND
  6339. WINAPI
  6340. ChildWindowFromPoint(
  6341. IN HWND hWndParent,
  6342. IN POINT Point);
  6343. #if(WINVER >= 0x0400)
  6344. #define CWP_ALL 0x0000
  6345. #define CWP_SKIPINVISIBLE 0x0001
  6346. #define CWP_SKIPDISABLED 0x0002
  6347. #define CWP_SKIPTRANSPARENT 0x0004
  6348. WINUSERAPI HWND WINAPI ChildWindowFromPointEx( IN HWND, IN POINT, IN UINT);
  6349. #endif /* WINVER >= 0x0400 */
  6350. #ifndef NOCOLOR
  6351. /*
  6352. * Color Types
  6353. */
  6354. #define CTLCOLOR_MSGBOX 0
  6355. #define CTLCOLOR_EDIT 1
  6356. #define CTLCOLOR_LISTBOX 2
  6357. #define CTLCOLOR_BTN 3
  6358. #define CTLCOLOR_DLG 4
  6359. #define CTLCOLOR_SCROLLBAR 5
  6360. #define CTLCOLOR_STATIC 6
  6361. #define CTLCOLOR_MAX 7
  6362. #define COLOR_SCROLLBAR 0
  6363. #define COLOR_BACKGROUND 1
  6364. #define COLOR_ACTIVECAPTION 2
  6365. #define COLOR_INACTIVECAPTION 3
  6366. #define COLOR_MENU 4
  6367. #define COLOR_WINDOW 5
  6368. #define COLOR_WINDOWFRAME 6
  6369. #define COLOR_MENUTEXT 7
  6370. #define COLOR_WINDOWTEXT 8
  6371. #define COLOR_CAPTIONTEXT 9
  6372. #define COLOR_ACTIVEBORDER 10
  6373. #define COLOR_INACTIVEBORDER 11
  6374. #define COLOR_APPWORKSPACE 12
  6375. #define COLOR_HIGHLIGHT 13
  6376. #define COLOR_HIGHLIGHTTEXT 14
  6377. #define COLOR_BTNFACE 15
  6378. #define COLOR_BTNSHADOW 16
  6379. #define COLOR_GRAYTEXT 17
  6380. #define COLOR_BTNTEXT 18
  6381. #define COLOR_INACTIVECAPTIONTEXT 19
  6382. #define COLOR_BTNHIGHLIGHT 20
  6383. #if(WINVER >= 0x0400)
  6384. #define COLOR_3DDKSHADOW 21
  6385. #define COLOR_3DLIGHT 22
  6386. #define COLOR_INFOTEXT 23
  6387. #define COLOR_INFOBK 24
  6388. #endif /* WINVER >= 0x0400 */
  6389. #if(WINVER >= 0x0500)
  6390. #define COLOR_HOTLIGHT 26
  6391. #define COLOR_GRADIENTACTIVECAPTION 27
  6392. #define COLOR_GRADIENTINACTIVECAPTION 28
  6393. #if(WINVER >= 0x0501)
  6394. #define COLOR_MENUHILIGHT 29
  6395. #define COLOR_MENUBAR 30
  6396. #endif /* WINVER >= 0x0501 */
  6397. #endif /* WINVER >= 0x0500 */
  6398. #if(WINVER >= 0x0400)
  6399. #define COLOR_DESKTOP COLOR_BACKGROUND
  6400. #define COLOR_3DFACE COLOR_BTNFACE
  6401. #define COLOR_3DSHADOW COLOR_BTNSHADOW
  6402. #define COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT
  6403. #define COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT
  6404. #define COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT
  6405. #endif /* WINVER >= 0x0400 */
  6406. WINUSERAPI
  6407. DWORD
  6408. WINAPI
  6409. GetSysColor(
  6410. IN int nIndex);
  6411. #if(WINVER >= 0x0400)
  6412. WINUSERAPI
  6413. HBRUSH
  6414. WINAPI
  6415. GetSysColorBrush(
  6416. IN int nIndex);
  6417. #endif /* WINVER >= 0x0400 */
  6418. WINUSERAPI
  6419. BOOL
  6420. WINAPI
  6421. SetSysColors(
  6422. IN int cElements,
  6423. IN CONST INT * lpaElements,
  6424. IN CONST COLORREF * lpaRgbValues);
  6425. #endif /* !NOCOLOR */
  6426. WINUSERAPI
  6427. BOOL
  6428. WINAPI
  6429. DrawFocusRect(
  6430. IN HDC hDC,
  6431. IN CONST RECT * lprc);
  6432. WINUSERAPI
  6433. int
  6434. WINAPI
  6435. FillRect(
  6436. IN HDC hDC,
  6437. IN CONST RECT *lprc,
  6438. IN HBRUSH hbr);
  6439. WINUSERAPI
  6440. int
  6441. WINAPI
  6442. FrameRect(
  6443. IN HDC hDC,
  6444. IN CONST RECT *lprc,
  6445. IN HBRUSH hbr);
  6446. WINUSERAPI
  6447. BOOL
  6448. WINAPI
  6449. InvertRect(
  6450. IN HDC hDC,
  6451. IN CONST RECT *lprc);
  6452. WINUSERAPI
  6453. BOOL
  6454. WINAPI
  6455. SetRect(
  6456. OUT LPRECT lprc,
  6457. IN int xLeft,
  6458. IN int yTop,
  6459. IN int xRight,
  6460. IN int yBottom);
  6461. WINUSERAPI
  6462. BOOL
  6463. WINAPI
  6464. SetRectEmpty(
  6465. OUT LPRECT lprc);
  6466. WINUSERAPI
  6467. BOOL
  6468. WINAPI
  6469. CopyRect(
  6470. OUT LPRECT lprcDst,
  6471. IN CONST RECT *lprcSrc);
  6472. WINUSERAPI
  6473. BOOL
  6474. WINAPI
  6475. InflateRect(
  6476. IN OUT LPRECT lprc,
  6477. IN int dx,
  6478. IN int dy);
  6479. WINUSERAPI
  6480. BOOL
  6481. WINAPI
  6482. IntersectRect(
  6483. OUT LPRECT lprcDst,
  6484. IN CONST RECT *lprcSrc1,
  6485. IN CONST RECT *lprcSrc2);
  6486. WINUSERAPI
  6487. BOOL
  6488. WINAPI
  6489. UnionRect(
  6490. OUT LPRECT lprcDst,
  6491. IN CONST RECT *lprcSrc1,
  6492. IN CONST RECT *lprcSrc2);
  6493. WINUSERAPI
  6494. BOOL
  6495. WINAPI
  6496. SubtractRect(
  6497. OUT LPRECT lprcDst,
  6498. IN CONST RECT *lprcSrc1,
  6499. IN CONST RECT *lprcSrc2);
  6500. WINUSERAPI
  6501. BOOL
  6502. WINAPI
  6503. OffsetRect(
  6504. IN OUT LPRECT lprc,
  6505. IN int dx,
  6506. IN int dy);
  6507. WINUSERAPI
  6508. BOOL
  6509. WINAPI
  6510. IsRectEmpty(
  6511. IN CONST RECT *lprc);
  6512. WINUSERAPI
  6513. BOOL
  6514. WINAPI
  6515. EqualRect(
  6516. IN CONST RECT *lprc1,
  6517. IN CONST RECT *lprc2);
  6518. WINUSERAPI
  6519. BOOL
  6520. WINAPI
  6521. PtInRect(
  6522. IN CONST RECT *lprc,
  6523. IN POINT pt);
  6524. #ifndef NOWINOFFSETS
  6525. WINUSERAPI
  6526. WORD
  6527. WINAPI
  6528. GetWindowWord(
  6529. IN HWND hWnd,
  6530. IN int nIndex);
  6531. WINUSERAPI
  6532. WORD
  6533. WINAPI
  6534. SetWindowWord(
  6535. IN HWND hWnd,
  6536. IN int nIndex,
  6537. IN WORD wNewWord);
  6538. WINUSERAPI
  6539. LONG
  6540. WINAPI
  6541. GetWindowLongA(
  6542. IN HWND hWnd,
  6543. IN int nIndex);
  6544. WINUSERAPI
  6545. LONG
  6546. WINAPI
  6547. GetWindowLongW(
  6548. IN HWND hWnd,
  6549. IN int nIndex);
  6550. #ifdef UNICODE
  6551. #define GetWindowLong GetWindowLongW
  6552. #else
  6553. #define GetWindowLong GetWindowLongA
  6554. #endif // !UNICODE
  6555. WINUSERAPI
  6556. LONG
  6557. WINAPI
  6558. SetWindowLongA(
  6559. IN HWND hWnd,
  6560. IN int nIndex,
  6561. IN LONG dwNewLong);
  6562. WINUSERAPI
  6563. LONG
  6564. WINAPI
  6565. SetWindowLongW(
  6566. IN HWND hWnd,
  6567. IN int nIndex,
  6568. IN LONG dwNewLong);
  6569. #ifdef UNICODE
  6570. #define SetWindowLong SetWindowLongW
  6571. #else
  6572. #define SetWindowLong SetWindowLongA
  6573. #endif // !UNICODE
  6574. #ifdef _WIN64
  6575. WINUSERAPI
  6576. LONG_PTR
  6577. WINAPI
  6578. GetWindowLongPtrA(
  6579. HWND hWnd,
  6580. int nIndex);
  6581. WINUSERAPI
  6582. LONG_PTR
  6583. WINAPI
  6584. GetWindowLongPtrW(
  6585. HWND hWnd,
  6586. int nIndex);
  6587. #ifdef UNICODE
  6588. #define GetWindowLongPtr GetWindowLongPtrW
  6589. #else
  6590. #define GetWindowLongPtr GetWindowLongPtrA
  6591. #endif // !UNICODE
  6592. WINUSERAPI
  6593. LONG_PTR
  6594. WINAPI
  6595. SetWindowLongPtrA(
  6596. HWND hWnd,
  6597. int nIndex,
  6598. LONG_PTR dwNewLong);
  6599. WINUSERAPI
  6600. LONG_PTR
  6601. WINAPI
  6602. SetWindowLongPtrW(
  6603. HWND hWnd,
  6604. int nIndex,
  6605. LONG_PTR dwNewLong);
  6606. #ifdef UNICODE
  6607. #define SetWindowLongPtr SetWindowLongPtrW
  6608. #else
  6609. #define SetWindowLongPtr SetWindowLongPtrA
  6610. #endif // !UNICODE
  6611. #else /* _WIN64 */
  6612. #define GetWindowLongPtrA GetWindowLongA
  6613. #define GetWindowLongPtrW GetWindowLongW
  6614. #ifdef UNICODE
  6615. #define GetWindowLongPtr GetWindowLongPtrW
  6616. #else
  6617. #define GetWindowLongPtr GetWindowLongPtrA
  6618. #endif // !UNICODE
  6619. #define SetWindowLongPtrA SetWindowLongA
  6620. #define SetWindowLongPtrW SetWindowLongW
  6621. #ifdef UNICODE
  6622. #define SetWindowLongPtr SetWindowLongPtrW
  6623. #else
  6624. #define SetWindowLongPtr SetWindowLongPtrA
  6625. #endif // !UNICODE
  6626. #endif /* _WIN64 */
  6627. WINUSERAPI
  6628. WORD
  6629. WINAPI
  6630. GetClassWord(
  6631. IN HWND hWnd,
  6632. IN int nIndex);
  6633. WINUSERAPI
  6634. WORD
  6635. WINAPI
  6636. SetClassWord(
  6637. IN HWND hWnd,
  6638. IN int nIndex,
  6639. IN WORD wNewWord);
  6640. WINUSERAPI
  6641. DWORD
  6642. WINAPI
  6643. GetClassLongA(
  6644. IN HWND hWnd,
  6645. IN int nIndex);
  6646. WINUSERAPI
  6647. DWORD
  6648. WINAPI
  6649. GetClassLongW(
  6650. IN HWND hWnd,
  6651. IN int nIndex);
  6652. #ifdef UNICODE
  6653. #define GetClassLong GetClassLongW
  6654. #else
  6655. #define GetClassLong GetClassLongA
  6656. #endif // !UNICODE
  6657. WINUSERAPI
  6658. DWORD
  6659. WINAPI
  6660. SetClassLongA(
  6661. IN HWND hWnd,
  6662. IN int nIndex,
  6663. IN LONG dwNewLong);
  6664. WINUSERAPI
  6665. DWORD
  6666. WINAPI
  6667. SetClassLongW(
  6668. IN HWND hWnd,
  6669. IN int nIndex,
  6670. IN LONG dwNewLong);
  6671. #ifdef UNICODE
  6672. #define SetClassLong SetClassLongW
  6673. #else
  6674. #define SetClassLong SetClassLongA
  6675. #endif // !UNICODE
  6676. #ifdef _WIN64
  6677. WINUSERAPI
  6678. ULONG_PTR
  6679. WINAPI
  6680. GetClassLongPtrA(
  6681. IN HWND hWnd,
  6682. IN int nIndex);
  6683. WINUSERAPI
  6684. ULONG_PTR
  6685. WINAPI
  6686. GetClassLongPtrW(
  6687. IN HWND hWnd,
  6688. IN int nIndex);
  6689. #ifdef UNICODE
  6690. #define GetClassLongPtr GetClassLongPtrW
  6691. #else
  6692. #define GetClassLongPtr GetClassLongPtrA
  6693. #endif // !UNICODE
  6694. WINUSERAPI
  6695. ULONG_PTR
  6696. WINAPI
  6697. SetClassLongPtrA(
  6698. IN HWND hWnd,
  6699. IN int nIndex,
  6700. IN LONG_PTR dwNewLong);
  6701. WINUSERAPI
  6702. ULONG_PTR
  6703. WINAPI
  6704. SetClassLongPtrW(
  6705. IN HWND hWnd,
  6706. IN int nIndex,
  6707. IN LONG_PTR dwNewLong);
  6708. #ifdef UNICODE
  6709. #define SetClassLongPtr SetClassLongPtrW
  6710. #else
  6711. #define SetClassLongPtr SetClassLongPtrA
  6712. #endif // !UNICODE
  6713. #else /* _WIN64 */
  6714. #define GetClassLongPtrA GetClassLongA
  6715. #define GetClassLongPtrW GetClassLongW
  6716. #ifdef UNICODE
  6717. #define GetClassLongPtr GetClassLongPtrW
  6718. #else
  6719. #define GetClassLongPtr GetClassLongPtrA
  6720. #endif // !UNICODE
  6721. #define SetClassLongPtrA SetClassLongA
  6722. #define SetClassLongPtrW SetClassLongW
  6723. #ifdef UNICODE
  6724. #define SetClassLongPtr SetClassLongPtrW
  6725. #else
  6726. #define SetClassLongPtr SetClassLongPtrA
  6727. #endif // !UNICODE
  6728. #endif /* _WIN64 */
  6729. #endif /* !NOWINOFFSETS */
  6730. #if(WINVER >= 0x0500)
  6731. WINUSERAPI
  6732. BOOL
  6733. WINAPI
  6734. GetProcessDefaultLayout(
  6735. OUT DWORD *pdwDefaultLayout);
  6736. WINUSERAPI
  6737. BOOL
  6738. WINAPI
  6739. SetProcessDefaultLayout(
  6740. IN DWORD dwDefaultLayout);
  6741. #endif /* WINVER >= 0x0500 */
  6742. WINUSERAPI
  6743. HWND
  6744. WINAPI
  6745. GetDesktopWindow(
  6746. VOID);
  6747. WINUSERAPI
  6748. HWND
  6749. WINAPI
  6750. GetParent(
  6751. IN HWND hWnd);
  6752. WINUSERAPI
  6753. HWND
  6754. WINAPI
  6755. SetParent(
  6756. IN HWND hWndChild,
  6757. IN HWND hWndNewParent);
  6758. WINUSERAPI
  6759. BOOL
  6760. WINAPI
  6761. EnumChildWindows(
  6762. IN HWND hWndParent,
  6763. IN WNDENUMPROC lpEnumFunc,
  6764. IN LPARAM lParam);
  6765. WINUSERAPI
  6766. HWND
  6767. WINAPI
  6768. FindWindowA(
  6769. IN LPCSTR lpClassName,
  6770. IN LPCSTR lpWindowName);
  6771. WINUSERAPI
  6772. HWND
  6773. WINAPI
  6774. FindWindowW(
  6775. IN LPCWSTR lpClassName,
  6776. IN LPCWSTR lpWindowName);
  6777. #ifdef UNICODE
  6778. #define FindWindow FindWindowW
  6779. #else
  6780. #define FindWindow FindWindowA
  6781. #endif // !UNICODE
  6782. #if(WINVER >= 0x0400)
  6783. WINUSERAPI HWND WINAPI FindWindowExA( IN HWND, IN HWND, IN LPCSTR, IN LPCSTR);
  6784. WINUSERAPI HWND WINAPI FindWindowExW( IN HWND, IN HWND, IN LPCWSTR, IN LPCWSTR);
  6785. #ifdef UNICODE
  6786. #define FindWindowEx FindWindowExW
  6787. #else
  6788. #define FindWindowEx FindWindowExA
  6789. #endif // !UNICODE
  6790. WINUSERAPI HWND WINAPI GetShellWindow(void);
  6791. #endif /* WINVER >= 0x0400 */
  6792. WINUSERAPI BOOL WINAPI RegisterShellHookWindow( IN HWND);
  6793. WINUSERAPI BOOL WINAPI DeregisterShellHookWindow( IN HWND);
  6794. WINUSERAPI
  6795. BOOL
  6796. WINAPI
  6797. EnumWindows(
  6798. IN WNDENUMPROC lpEnumFunc,
  6799. IN LPARAM lParam);
  6800. WINUSERAPI
  6801. BOOL
  6802. WINAPI
  6803. EnumThreadWindows(
  6804. IN DWORD dwThreadId,
  6805. IN WNDENUMPROC lpfn,
  6806. IN LPARAM lParam);
  6807. #define EnumTaskWindows(hTask, lpfn, lParam) EnumThreadWindows(HandleToUlong(hTask), lpfn, lParam)
  6808. WINUSERAPI
  6809. int
  6810. WINAPI
  6811. GetClassNameA(
  6812. IN HWND hWnd,
  6813. OUT LPSTR lpClassName,
  6814. IN int nMaxCount);
  6815. WINUSERAPI
  6816. int
  6817. WINAPI
  6818. GetClassNameW(
  6819. IN HWND hWnd,
  6820. OUT LPWSTR lpClassName,
  6821. IN int nMaxCount);
  6822. #ifdef UNICODE
  6823. #define GetClassName GetClassNameW
  6824. #else
  6825. #define GetClassName GetClassNameA
  6826. #endif // !UNICODE
  6827. WINUSERAPI
  6828. HWND
  6829. WINAPI
  6830. GetTopWindow(
  6831. IN HWND hWnd);
  6832. #define GetNextWindow(hWnd, wCmd) GetWindow(hWnd, wCmd)
  6833. #define GetSysModalWindow() (NULL)
  6834. #define SetSysModalWindow(hWnd) (NULL)
  6835. WINUSERAPI
  6836. DWORD
  6837. WINAPI
  6838. GetWindowThreadProcessId(
  6839. IN HWND hWnd,
  6840. OUT LPDWORD lpdwProcessId);
  6841. #if(_WIN32_WINNT >= 0x0501)
  6842. WINUSERAPI
  6843. BOOL
  6844. WINAPI
  6845. IsGUIThread(
  6846. BOOL bConvert);
  6847. #endif /* _WIN32_WINNT >= 0x0501 */
  6848. #define GetWindowTask(hWnd) \
  6849. ((HANDLE)(DWORD_PTR)GetWindowThreadProcessId(hWnd, NULL))
  6850. WINUSERAPI
  6851. HWND
  6852. WINAPI
  6853. GetLastActivePopup(
  6854. IN HWND hWnd);
  6855. /*
  6856. * GetWindow() Constants
  6857. */
  6858. #define GW_HWNDFIRST 0
  6859. #define GW_HWNDLAST 1
  6860. #define GW_HWNDNEXT 2
  6861. #define GW_HWNDPREV 3
  6862. #define GW_OWNER 4
  6863. #define GW_CHILD 5
  6864. #if(WINVER <= 0x0400)
  6865. #define GW_MAX 5
  6866. #else
  6867. #define GW_ENABLEDPOPUP 6
  6868. #define GW_MAX 6
  6869. #endif
  6870. WINUSERAPI
  6871. HWND
  6872. WINAPI
  6873. GetWindow(
  6874. IN HWND hWnd,
  6875. IN UINT uCmd);
  6876. #ifndef NOWH
  6877. #ifdef STRICT
  6878. WINUSERAPI
  6879. HHOOK
  6880. WINAPI
  6881. SetWindowsHookA(
  6882. IN int nFilterType,
  6883. IN HOOKPROC pfnFilterProc);
  6884. WINUSERAPI
  6885. HHOOK
  6886. WINAPI
  6887. SetWindowsHookW(
  6888. IN int nFilterType,
  6889. IN HOOKPROC pfnFilterProc);
  6890. #ifdef UNICODE
  6891. #define SetWindowsHook SetWindowsHookW
  6892. #else
  6893. #define SetWindowsHook SetWindowsHookA
  6894. #endif // !UNICODE
  6895. #else /* !STRICT */
  6896. WINUSERAPI
  6897. HOOKPROC
  6898. WINAPI
  6899. SetWindowsHookA(
  6900. IN int nFilterType,
  6901. IN HOOKPROC pfnFilterProc);
  6902. WINUSERAPI
  6903. HOOKPROC
  6904. WINAPI
  6905. SetWindowsHookW(
  6906. IN int nFilterType,
  6907. IN HOOKPROC pfnFilterProc);
  6908. #ifdef UNICODE
  6909. #define SetWindowsHook SetWindowsHookW
  6910. #else
  6911. #define SetWindowsHook SetWindowsHookA
  6912. #endif // !UNICODE
  6913. #endif /* !STRICT */
  6914. WINUSERAPI
  6915. BOOL
  6916. WINAPI
  6917. UnhookWindowsHook(
  6918. IN int nCode,
  6919. IN HOOKPROC pfnFilterProc);
  6920. WINUSERAPI
  6921. HHOOK
  6922. WINAPI
  6923. SetWindowsHookExA(
  6924. IN int idHook,
  6925. IN HOOKPROC lpfn,
  6926. IN HINSTANCE hmod,
  6927. IN DWORD dwThreadId);
  6928. WINUSERAPI
  6929. HHOOK
  6930. WINAPI
  6931. SetWindowsHookExW(
  6932. IN int idHook,
  6933. IN HOOKPROC lpfn,
  6934. IN HINSTANCE hmod,
  6935. IN DWORD dwThreadId);
  6936. #ifdef UNICODE
  6937. #define SetWindowsHookEx SetWindowsHookExW
  6938. #else
  6939. #define SetWindowsHookEx SetWindowsHookExA
  6940. #endif // !UNICODE
  6941. WINUSERAPI
  6942. BOOL
  6943. WINAPI
  6944. UnhookWindowsHookEx(
  6945. IN HHOOK hhk);
  6946. WINUSERAPI
  6947. LRESULT
  6948. WINAPI
  6949. CallNextHookEx(
  6950. IN HHOOK hhk,
  6951. IN int nCode,
  6952. IN WPARAM wParam,
  6953. IN LPARAM lParam);
  6954. /*
  6955. * Macros for source-level compatibility with old functions.
  6956. */
  6957. #ifdef STRICT
  6958. #define DefHookProc(nCode, wParam, lParam, phhk)\
  6959. CallNextHookEx(*phhk, nCode, wParam, lParam)
  6960. #else
  6961. #define DefHookProc(nCode, wParam, lParam, phhk)\
  6962. CallNextHookEx((HHOOK)*phhk, nCode, wParam, lParam)
  6963. #endif /* STRICT */
  6964. #endif /* !NOWH */
  6965. #ifndef NOMENUS
  6966. /* ;win40 -- A lot of MF_* flags have been renamed as MFT_* and MFS_* flags */
  6967. /*
  6968. * Menu flags for Add/Check/EnableMenuItem()
  6969. */
  6970. #define MF_INSERT 0x00000000L
  6971. #define MF_CHANGE 0x00000080L
  6972. #define MF_APPEND 0x00000100L
  6973. #define MF_DELETE 0x00000200L
  6974. #define MF_REMOVE 0x00001000L
  6975. #define MF_BYCOMMAND 0x00000000L
  6976. #define MF_BYPOSITION 0x00000400L
  6977. #define MF_SEPARATOR 0x00000800L
  6978. #define MF_ENABLED 0x00000000L
  6979. #define MF_GRAYED 0x00000001L
  6980. #define MF_DISABLED 0x00000002L
  6981. #define MF_UNCHECKED 0x00000000L
  6982. #define MF_CHECKED 0x00000008L
  6983. #define MF_USECHECKBITMAPS 0x00000200L
  6984. #define MF_STRING 0x00000000L
  6985. #define MF_BITMAP 0x00000004L
  6986. #define MF_OWNERDRAW 0x00000100L
  6987. #define MF_POPUP 0x00000010L
  6988. #define MF_MENUBARBREAK 0x00000020L
  6989. #define MF_MENUBREAK 0x00000040L
  6990. #define MF_UNHILITE 0x00000000L
  6991. #define MF_HILITE 0x00000080L
  6992. #if(WINVER >= 0x0400)
  6993. #define MF_DEFAULT 0x00001000L
  6994. #endif /* WINVER >= 0x0400 */
  6995. #define MF_SYSMENU 0x00002000L
  6996. #define MF_HELP 0x00004000L
  6997. #if(WINVER >= 0x0400)
  6998. #define MF_RIGHTJUSTIFY 0x00004000L
  6999. #endif /* WINVER >= 0x0400 */
  7000. #define MF_MOUSESELECT 0x00008000L
  7001. #if(WINVER >= 0x0400)
  7002. #define MF_END 0x00000080L /* Obsolete -- only used by old RES files */
  7003. #endif /* WINVER >= 0x0400 */
  7004. #if(WINVER >= 0x0400)
  7005. #define MFT_STRING MF_STRING
  7006. #define MFT_BITMAP MF_BITMAP
  7007. #define MFT_MENUBARBREAK MF_MENUBARBREAK
  7008. #define MFT_MENUBREAK MF_MENUBREAK
  7009. #define MFT_OWNERDRAW MF_OWNERDRAW
  7010. #define MFT_RADIOCHECK 0x00000200L
  7011. #define MFT_SEPARATOR MF_SEPARATOR
  7012. #define MFT_RIGHTORDER 0x00002000L
  7013. #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
  7014. /* Menu flags for Add/Check/EnableMenuItem() */
  7015. #define MFS_GRAYED 0x00000003L
  7016. #define MFS_DISABLED MFS_GRAYED
  7017. #define MFS_CHECKED MF_CHECKED
  7018. #define MFS_HILITE MF_HILITE
  7019. #define MFS_ENABLED MF_ENABLED
  7020. #define MFS_UNCHECKED MF_UNCHECKED
  7021. #define MFS_UNHILITE MF_UNHILITE
  7022. #define MFS_DEFAULT MF_DEFAULT
  7023. #endif /* WINVER >= 0x0400 */
  7024. #if(WINVER >= 0x0400)
  7025. WINUSERAPI
  7026. BOOL
  7027. WINAPI
  7028. CheckMenuRadioItem(
  7029. IN HMENU,
  7030. IN UINT,
  7031. IN UINT,
  7032. IN UINT,
  7033. IN UINT);
  7034. #endif /* WINVER >= 0x0400 */
  7035. /*
  7036. * Menu item resource format
  7037. */
  7038. typedef struct {
  7039. WORD versionNumber;
  7040. WORD offset;
  7041. } MENUITEMTEMPLATEHEADER, *PMENUITEMTEMPLATEHEADER;
  7042. typedef struct { // version 0
  7043. WORD mtOption;
  7044. WORD mtID;
  7045. WCHAR mtString[1];
  7046. } MENUITEMTEMPLATE, *PMENUITEMTEMPLATE;
  7047. #define MF_END 0x00000080L
  7048. #endif /* !NOMENUS */
  7049. #ifndef NOSYSCOMMANDS
  7050. /*
  7051. * System Menu Command Values
  7052. */
  7053. #define SC_SIZE 0xF000
  7054. #define SC_MOVE 0xF010
  7055. #define SC_MINIMIZE 0xF020
  7056. #define SC_MAXIMIZE 0xF030
  7057. #define SC_NEXTWINDOW 0xF040
  7058. #define SC_PREVWINDOW 0xF050
  7059. #define SC_CLOSE 0xF060
  7060. #define SC_VSCROLL 0xF070
  7061. #define SC_HSCROLL 0xF080
  7062. #define SC_MOUSEMENU 0xF090
  7063. #define SC_KEYMENU 0xF100
  7064. #define SC_ARRANGE 0xF110
  7065. #define SC_RESTORE 0xF120
  7066. #define SC_TASKLIST 0xF130
  7067. #define SC_SCREENSAVE 0xF140
  7068. #define SC_HOTKEY 0xF150
  7069. #if(WINVER >= 0x0400)
  7070. #define SC_DEFAULT 0xF160
  7071. #define SC_MONITORPOWER 0xF170
  7072. #define SC_CONTEXTHELP 0xF180
  7073. #define SC_SEPARATOR 0xF00F
  7074. #endif /* WINVER >= 0x0400 */
  7075. /*
  7076. * Obsolete names
  7077. */
  7078. #define SC_ICON SC_MINIMIZE
  7079. #define SC_ZOOM SC_MAXIMIZE
  7080. #endif /* !NOSYSCOMMANDS */
  7081. /*
  7082. * Resource Loading Routines
  7083. */
  7084. WINUSERAPI
  7085. HBITMAP
  7086. WINAPI
  7087. LoadBitmapA(
  7088. IN HINSTANCE hInstance,
  7089. IN LPCSTR lpBitmapName);
  7090. WINUSERAPI
  7091. HBITMAP
  7092. WINAPI
  7093. LoadBitmapW(
  7094. IN HINSTANCE hInstance,
  7095. IN LPCWSTR lpBitmapName);
  7096. #ifdef UNICODE
  7097. #define LoadBitmap LoadBitmapW
  7098. #else
  7099. #define LoadBitmap LoadBitmapA
  7100. #endif // !UNICODE
  7101. WINUSERAPI
  7102. HCURSOR
  7103. WINAPI
  7104. LoadCursorA(
  7105. IN HINSTANCE hInstance,
  7106. IN LPCSTR lpCursorName);
  7107. WINUSERAPI
  7108. HCURSOR
  7109. WINAPI
  7110. LoadCursorW(
  7111. IN HINSTANCE hInstance,
  7112. IN LPCWSTR lpCursorName);
  7113. #ifdef UNICODE
  7114. #define LoadCursor LoadCursorW
  7115. #else
  7116. #define LoadCursor LoadCursorA
  7117. #endif // !UNICODE
  7118. WINUSERAPI
  7119. HCURSOR
  7120. WINAPI
  7121. LoadCursorFromFileA(
  7122. IN LPCSTR lpFileName);
  7123. WINUSERAPI
  7124. HCURSOR
  7125. WINAPI
  7126. LoadCursorFromFileW(
  7127. IN LPCWSTR lpFileName);
  7128. #ifdef UNICODE
  7129. #define LoadCursorFromFile LoadCursorFromFileW
  7130. #else
  7131. #define LoadCursorFromFile LoadCursorFromFileA
  7132. #endif // !UNICODE
  7133. WINUSERAPI
  7134. HCURSOR
  7135. WINAPI
  7136. CreateCursor(
  7137. IN HINSTANCE hInst,
  7138. IN int xHotSpot,
  7139. IN int yHotSpot,
  7140. IN int nWidth,
  7141. IN int nHeight,
  7142. IN CONST VOID *pvANDPlane,
  7143. IN CONST VOID *pvXORPlane);
  7144. WINUSERAPI
  7145. BOOL
  7146. WINAPI
  7147. DestroyCursor(
  7148. IN HCURSOR hCursor);
  7149. #ifndef _MAC
  7150. #define CopyCursor(pcur) ((HCURSOR)CopyIcon((HICON)(pcur)))
  7151. #else
  7152. WINUSERAPI
  7153. HCURSOR
  7154. WINAPI
  7155. CopyCursor(
  7156. IN HCURSOR hCursor);
  7157. #endif
  7158. /*
  7159. * Standard Cursor IDs
  7160. */
  7161. #define IDC_ARROW MAKEINTRESOURCE(32512)
  7162. #define IDC_IBEAM MAKEINTRESOURCE(32513)
  7163. #define IDC_WAIT MAKEINTRESOURCE(32514)
  7164. #define IDC_CROSS MAKEINTRESOURCE(32515)
  7165. #define IDC_UPARROW MAKEINTRESOURCE(32516)
  7166. #define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
  7167. #define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
  7168. #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
  7169. #define IDC_SIZENESW MAKEINTRESOURCE(32643)
  7170. #define IDC_SIZEWE MAKEINTRESOURCE(32644)
  7171. #define IDC_SIZENS MAKEINTRESOURCE(32645)
  7172. #define IDC_SIZEALL MAKEINTRESOURCE(32646)
  7173. #define IDC_NO MAKEINTRESOURCE(32648) /*not in win3.1 */
  7174. #if(WINVER >= 0x0500)
  7175. #define IDC_HAND MAKEINTRESOURCE(32649)
  7176. #endif /* WINVER >= 0x0500 */
  7177. #define IDC_APPSTARTING MAKEINTRESOURCE(32650) /*not in win3.1 */
  7178. #if(WINVER >= 0x0400)
  7179. #define IDC_HELP MAKEINTRESOURCE(32651)
  7180. #endif /* WINVER >= 0x0400 */
  7181. WINUSERAPI
  7182. BOOL
  7183. WINAPI
  7184. SetSystemCursor(
  7185. IN HCURSOR hcur,
  7186. IN DWORD id);
  7187. typedef struct _ICONINFO {
  7188. BOOL fIcon;
  7189. DWORD xHotspot;
  7190. DWORD yHotspot;
  7191. HBITMAP hbmMask;
  7192. HBITMAP hbmColor;
  7193. } ICONINFO;
  7194. typedef ICONINFO *PICONINFO;
  7195. WINUSERAPI
  7196. HICON
  7197. WINAPI
  7198. LoadIconA(
  7199. IN HINSTANCE hInstance,
  7200. IN LPCSTR lpIconName);
  7201. WINUSERAPI
  7202. HICON
  7203. WINAPI
  7204. LoadIconW(
  7205. IN HINSTANCE hInstance,
  7206. IN LPCWSTR lpIconName);
  7207. #ifdef UNICODE
  7208. #define LoadIcon LoadIconW
  7209. #else
  7210. #define LoadIcon LoadIconA
  7211. #endif // !UNICODE
  7212. WINUSERAPI UINT PrivateExtractIconsA(
  7213. IN LPCSTR szFileName,
  7214. IN int nIconIndex,
  7215. IN int cxIcon,
  7216. IN int cyIcon,
  7217. OUT HICON *phicon,
  7218. OUT UINT *piconid,
  7219. IN UINT nIcons,
  7220. IN UINT flags);
  7221. WINUSERAPI UINT PrivateExtractIconsW(
  7222. IN LPCWSTR szFileName,
  7223. IN int nIconIndex,
  7224. IN int cxIcon,
  7225. IN int cyIcon,
  7226. OUT HICON *phicon,
  7227. OUT UINT *piconid,
  7228. IN UINT nIcons,
  7229. IN UINT flags);
  7230. #ifdef UNICODE
  7231. #define PrivateExtractIcons PrivateExtractIconsW
  7232. #else
  7233. #define PrivateExtractIcons PrivateExtractIconsA
  7234. #endif // !UNICODE
  7235. WINUSERAPI
  7236. HICON
  7237. WINAPI
  7238. CreateIcon(
  7239. IN HINSTANCE hInstance,
  7240. IN int nWidth,
  7241. IN int nHeight,
  7242. IN BYTE cPlanes,
  7243. IN BYTE cBitsPixel,
  7244. IN CONST BYTE *lpbANDbits,
  7245. IN CONST BYTE *lpbXORbits);
  7246. WINUSERAPI
  7247. BOOL
  7248. WINAPI
  7249. DestroyIcon(
  7250. IN HICON hIcon);
  7251. WINUSERAPI
  7252. int
  7253. WINAPI
  7254. LookupIconIdFromDirectory(
  7255. IN PBYTE presbits,
  7256. IN BOOL fIcon);
  7257. #if(WINVER >= 0x0400)
  7258. WINUSERAPI
  7259. int
  7260. WINAPI
  7261. LookupIconIdFromDirectoryEx(
  7262. IN PBYTE presbits,
  7263. IN BOOL fIcon,
  7264. IN int cxDesired,
  7265. IN int cyDesired,
  7266. IN UINT Flags);
  7267. #endif /* WINVER >= 0x0400 */
  7268. WINUSERAPI
  7269. HICON
  7270. WINAPI
  7271. CreateIconFromResource(
  7272. IN PBYTE presbits,
  7273. IN DWORD dwResSize,
  7274. IN BOOL fIcon,
  7275. IN DWORD dwVer);
  7276. #if(WINVER >= 0x0400)
  7277. WINUSERAPI
  7278. HICON
  7279. WINAPI
  7280. CreateIconFromResourceEx(
  7281. IN PBYTE presbits,
  7282. IN DWORD dwResSize,
  7283. IN BOOL fIcon,
  7284. IN DWORD dwVer,
  7285. IN int cxDesired,
  7286. IN int cyDesired,
  7287. IN UINT Flags);
  7288. /* Icon/Cursor header */
  7289. typedef struct tagCURSORSHAPE
  7290. {
  7291. int xHotSpot;
  7292. int yHotSpot;
  7293. int cx;
  7294. int cy;
  7295. int cbWidth;
  7296. BYTE Planes;
  7297. BYTE BitsPixel;
  7298. } CURSORSHAPE, FAR *LPCURSORSHAPE;
  7299. #endif /* WINVER >= 0x0400 */
  7300. #define IMAGE_BITMAP 0
  7301. #define IMAGE_ICON 1
  7302. #define IMAGE_CURSOR 2
  7303. #if(WINVER >= 0x0400)
  7304. #define IMAGE_ENHMETAFILE 3
  7305. #define LR_DEFAULTCOLOR 0x0000
  7306. #define LR_MONOCHROME 0x0001
  7307. #define LR_COLOR 0x0002
  7308. #define LR_COPYRETURNORG 0x0004
  7309. #define LR_COPYDELETEORG 0x0008
  7310. #define LR_LOADFROMFILE 0x0010
  7311. #define LR_LOADTRANSPARENT 0x0020
  7312. #define LR_DEFAULTSIZE 0x0040
  7313. #define LR_VGACOLOR 0x0080
  7314. #define LR_LOADMAP3DCOLORS 0x1000
  7315. #define LR_CREATEDIBSECTION 0x2000
  7316. #define LR_COPYFROMRESOURCE 0x4000
  7317. #define LR_SHARED 0x8000
  7318. WINUSERAPI
  7319. HANDLE
  7320. WINAPI
  7321. LoadImageA(
  7322. IN HINSTANCE,
  7323. IN LPCSTR,
  7324. IN UINT,
  7325. IN int,
  7326. IN int,
  7327. IN UINT);
  7328. WINUSERAPI
  7329. HANDLE
  7330. WINAPI
  7331. LoadImageW(
  7332. IN HINSTANCE,
  7333. IN LPCWSTR,
  7334. IN UINT,
  7335. IN int,
  7336. IN int,
  7337. IN UINT);
  7338. #ifdef UNICODE
  7339. #define LoadImage LoadImageW
  7340. #else
  7341. #define LoadImage LoadImageA
  7342. #endif // !UNICODE
  7343. WINUSERAPI
  7344. HANDLE
  7345. WINAPI
  7346. CopyImage(
  7347. IN HANDLE,
  7348. IN UINT,
  7349. IN int,
  7350. IN int,
  7351. IN UINT);
  7352. #define DI_MASK 0x0001
  7353. #define DI_IMAGE 0x0002
  7354. #define DI_NORMAL 0x0003
  7355. #define DI_COMPAT 0x0004
  7356. #define DI_DEFAULTSIZE 0x0008
  7357. #if(_WIN32_WINNT >= 0x0501)
  7358. #define DI_NOMIRROR 0x0010
  7359. #endif /* _WIN32_WINNT >= 0x0501 */
  7360. WINUSERAPI BOOL WINAPI DrawIconEx( IN HDC hdc, IN int xLeft, IN int yTop,
  7361. IN HICON hIcon, IN int cxWidth, IN int cyWidth,
  7362. IN UINT istepIfAniCur, IN HBRUSH hbrFlickerFreeDraw, IN UINT diFlags);
  7363. #endif /* WINVER >= 0x0400 */
  7364. WINUSERAPI
  7365. HICON
  7366. WINAPI
  7367. CreateIconIndirect(
  7368. IN PICONINFO piconinfo);
  7369. WINUSERAPI
  7370. HICON
  7371. WINAPI
  7372. CopyIcon(
  7373. IN HICON hIcon);
  7374. WINUSERAPI
  7375. BOOL
  7376. WINAPI
  7377. GetIconInfo(
  7378. IN HICON hIcon,
  7379. OUT PICONINFO piconinfo);
  7380. #if(WINVER >= 0x0400)
  7381. #define RES_ICON 1
  7382. #define RES_CURSOR 2
  7383. #endif /* WINVER >= 0x0400 */
  7384. #ifdef OEMRESOURCE
  7385. /*
  7386. * OEM Resource Ordinal Numbers
  7387. */
  7388. #define OBM_CLOSE 32754
  7389. #define OBM_UPARROW 32753
  7390. #define OBM_DNARROW 32752
  7391. #define OBM_RGARROW 32751
  7392. #define OBM_LFARROW 32750
  7393. #define OBM_REDUCE 32749
  7394. #define OBM_ZOOM 32748
  7395. #define OBM_RESTORE 32747
  7396. #define OBM_REDUCED 32746
  7397. #define OBM_ZOOMD 32745
  7398. #define OBM_RESTORED 32744
  7399. #define OBM_UPARROWD 32743
  7400. #define OBM_DNARROWD 32742
  7401. #define OBM_RGARROWD 32741
  7402. #define OBM_LFARROWD 32740
  7403. #define OBM_MNARROW 32739
  7404. #define OBM_COMBO 32738
  7405. #define OBM_UPARROWI 32737
  7406. #define OBM_DNARROWI 32736
  7407. #define OBM_RGARROWI 32735
  7408. #define OBM_LFARROWI 32734
  7409. #define OBM_OLD_CLOSE 32767
  7410. #define OBM_SIZE 32766
  7411. #define OBM_OLD_UPARROW 32765
  7412. #define OBM_OLD_DNARROW 32764
  7413. #define OBM_OLD_RGARROW 32763
  7414. #define OBM_OLD_LFARROW 32762
  7415. #define OBM_BTSIZE 32761
  7416. #define OBM_CHECK 32760
  7417. #define OBM_CHECKBOXES 32759
  7418. #define OBM_BTNCORNERS 32758
  7419. #define OBM_OLD_REDUCE 32757
  7420. #define OBM_OLD_ZOOM 32756
  7421. #define OBM_OLD_RESTORE 32755
  7422. #define OCR_NORMAL 32512
  7423. #define OCR_IBEAM 32513
  7424. #define OCR_WAIT 32514
  7425. #define OCR_CROSS 32515
  7426. #define OCR_UP 32516
  7427. #define OCR_SIZE 32640 /* OBSOLETE: use OCR_SIZEALL */
  7428. #define OCR_ICON 32641 /* OBSOLETE: use OCR_NORMAL */
  7429. #define OCR_SIZENWSE 32642
  7430. #define OCR_SIZENESW 32643
  7431. #define OCR_SIZEWE 32644
  7432. #define OCR_SIZENS 32645
  7433. #define OCR_SIZEALL 32646
  7434. #define OCR_ICOCUR 32647 /* OBSOLETE: use OIC_WINLOGO */
  7435. #define OCR_NO 32648
  7436. #if(WINVER >= 0x0500)
  7437. #define OCR_HAND 32649
  7438. #endif /* WINVER >= 0x0500 */
  7439. #if(WINVER >= 0x0400)
  7440. #define OCR_APPSTARTING 32650
  7441. #endif /* WINVER >= 0x0400 */
  7442. #define OIC_SAMPLE 32512
  7443. #define OIC_HAND 32513
  7444. #define OIC_QUES 32514
  7445. #define OIC_BANG 32515
  7446. #define OIC_NOTE 32516
  7447. #if(WINVER >= 0x0400)
  7448. #define OIC_WINLOGO 32517
  7449. #define OIC_WARNING OIC_BANG
  7450. #define OIC_ERROR OIC_HAND
  7451. #define OIC_INFORMATION OIC_NOTE
  7452. #endif /* WINVER >= 0x0400 */
  7453. #endif /* OEMRESOURCE */
  7454. #define ORD_LANGDRIVER 1 /* The ordinal number for the entry point of
  7455. ** language drivers.
  7456. */
  7457. #ifndef NOICONS
  7458. /*
  7459. * Standard Icon IDs
  7460. */
  7461. #ifdef RC_INVOKED
  7462. #define IDI_APPLICATION 32512
  7463. #define IDI_HAND 32513
  7464. #define IDI_QUESTION 32514
  7465. #define IDI_EXCLAMATION 32515
  7466. #define IDI_ASTERISK 32516
  7467. #if(WINVER >= 0x0400)
  7468. #define IDI_WINLOGO 32517
  7469. #endif /* WINVER >= 0x0400 */
  7470. #else
  7471. #define IDI_APPLICATION MAKEINTRESOURCE(32512)
  7472. #define IDI_HAND MAKEINTRESOURCE(32513)
  7473. #define IDI_QUESTION MAKEINTRESOURCE(32514)
  7474. #define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
  7475. #define IDI_ASTERISK MAKEINTRESOURCE(32516)
  7476. #if(WINVER >= 0x0400)
  7477. #define IDI_WINLOGO MAKEINTRESOURCE(32517)
  7478. #endif /* WINVER >= 0x0400 */
  7479. #endif /* RC_INVOKED */
  7480. #if(WINVER >= 0x0400)
  7481. #define IDI_WARNING IDI_EXCLAMATION
  7482. #define IDI_ERROR IDI_HAND
  7483. #define IDI_INFORMATION IDI_ASTERISK
  7484. #endif /* WINVER >= 0x0400 */
  7485. #endif /* !NOICONS */
  7486. WINUSERAPI
  7487. int
  7488. WINAPI
  7489. LoadStringA(
  7490. IN HINSTANCE hInstance,
  7491. IN UINT uID,
  7492. OUT LPSTR lpBuffer,
  7493. IN int nBufferMax);
  7494. WINUSERAPI
  7495. int
  7496. WINAPI
  7497. LoadStringW(
  7498. IN HINSTANCE hInstance,
  7499. IN UINT uID,
  7500. OUT LPWSTR lpBuffer,
  7501. IN int nBufferMax);
  7502. #ifdef UNICODE
  7503. #define LoadString LoadStringW
  7504. #else
  7505. #define LoadString LoadStringA
  7506. #endif // !UNICODE
  7507. /*
  7508. * Dialog Box Command IDs
  7509. */
  7510. #define IDOK 1
  7511. #define IDCANCEL 2
  7512. #define IDABORT 3
  7513. #define IDRETRY 4
  7514. #define IDIGNORE 5
  7515. #define IDYES 6
  7516. #define IDNO 7
  7517. #if(WINVER >= 0x0400)
  7518. #define IDCLOSE 8
  7519. #define IDHELP 9
  7520. #endif /* WINVER >= 0x0400 */
  7521. #if(WINVER >= 0x0500)
  7522. #define IDTRYAGAIN 10
  7523. #define IDCONTINUE 11
  7524. #endif /* WINVER >= 0x0500 */
  7525. #if(WINVER >= 0x0501)
  7526. #ifndef IDTIMEOUT
  7527. #define IDTIMEOUT 32000
  7528. #endif
  7529. #endif /* WINVER >= 0x0501 */
  7530. #ifndef NOCTLMGR
  7531. /*
  7532. * Control Manager Structures and Definitions
  7533. */
  7534. #ifndef NOWINSTYLES
  7535. /*
  7536. * Edit Control Styles
  7537. */
  7538. #define ES_LEFT 0x0000L
  7539. #define ES_CENTER 0x0001L
  7540. #define ES_RIGHT 0x0002L
  7541. #define ES_MULTILINE 0x0004L
  7542. #define ES_UPPERCASE 0x0008L
  7543. #define ES_LOWERCASE 0x0010L
  7544. #define ES_PASSWORD 0x0020L
  7545. #define ES_AUTOVSCROLL 0x0040L
  7546. #define ES_AUTOHSCROLL 0x0080L
  7547. #define ES_NOHIDESEL 0x0100L
  7548. #define ES_OEMCONVERT 0x0400L
  7549. #define ES_READONLY 0x0800L
  7550. #define ES_WANTRETURN 0x1000L
  7551. #if(WINVER >= 0x0400)
  7552. #define ES_NUMBER 0x2000L
  7553. #endif /* WINVER >= 0x0400 */
  7554. #endif /* !NOWINSTYLES */
  7555. /*
  7556. * Edit Control Notification Codes
  7557. */
  7558. #define EN_SETFOCUS 0x0100
  7559. #define EN_KILLFOCUS 0x0200
  7560. #define EN_CHANGE 0x0300
  7561. #define EN_UPDATE 0x0400
  7562. #define EN_ERRSPACE 0x0500
  7563. #define EN_MAXTEXT 0x0501
  7564. #define EN_HSCROLL 0x0601
  7565. #define EN_VSCROLL 0x0602
  7566. #if(_WIN32_WINNT >= 0x0500)
  7567. #define EN_ALIGN_LTR_EC 0x0700
  7568. #define EN_ALIGN_RTL_EC 0x0701
  7569. #endif /* _WIN32_WINNT >= 0x0500 */
  7570. #if(WINVER >= 0x0400)
  7571. /* Edit control EM_SETMARGIN parameters */
  7572. #define EC_LEFTMARGIN 0x0001
  7573. #define EC_RIGHTMARGIN 0x0002
  7574. #define EC_USEFONTINFO 0xffff
  7575. #endif /* WINVER >= 0x0400 */
  7576. #if(WINVER >= 0x0500)
  7577. /* wParam of EM_GET/SETIMESTATUS */
  7578. #define EMSIS_COMPOSITIONSTRING 0x0001
  7579. /* lParam for EMSIS_COMPOSITIONSTRING */
  7580. #define EIMES_GETCOMPSTRATONCE 0x0001
  7581. #define EIMES_CANCELCOMPSTRINFOCUS 0x0002
  7582. #define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004
  7583. #endif /* WINVER >= 0x0500 */
  7584. #ifndef NOWINMESSAGES
  7585. /*
  7586. * Edit Control Messages
  7587. */
  7588. #define EM_GETSEL 0x00B0
  7589. #define EM_SETSEL 0x00B1
  7590. #define EM_GETRECT 0x00B2
  7591. #define EM_SETRECT 0x00B3
  7592. #define EM_SETRECTNP 0x00B4
  7593. #define EM_SCROLL 0x00B5
  7594. #define EM_LINESCROLL 0x00B6
  7595. #define EM_SCROLLCARET 0x00B7
  7596. #define EM_GETMODIFY 0x00B8
  7597. #define EM_SETMODIFY 0x00B9
  7598. #define EM_GETLINECOUNT 0x00BA
  7599. #define EM_LINEINDEX 0x00BB
  7600. #define EM_SETHANDLE 0x00BC
  7601. #define EM_GETHANDLE 0x00BD
  7602. #define EM_GETTHUMB 0x00BE
  7603. #define EM_LINELENGTH 0x00C1
  7604. #define EM_REPLACESEL 0x00C2
  7605. #define EM_GETLINE 0x00C4
  7606. #define EM_LIMITTEXT 0x00C5
  7607. #define EM_CANUNDO 0x00C6
  7608. #define EM_UNDO 0x00C7
  7609. #define EM_FMTLINES 0x00C8
  7610. #define EM_LINEFROMCHAR 0x00C9
  7611. #define EM_SETTABSTOPS 0x00CB
  7612. #define EM_SETPASSWORDCHAR 0x00CC
  7613. #define EM_EMPTYUNDOBUFFER 0x00CD
  7614. #define EM_GETFIRSTVISIBLELINE 0x00CE
  7615. #define EM_SETREADONLY 0x00CF
  7616. #define EM_SETWORDBREAKPROC 0x00D0
  7617. #define EM_GETWORDBREAKPROC 0x00D1
  7618. #define EM_GETPASSWORDCHAR 0x00D2
  7619. #if(WINVER >= 0x0400)
  7620. #define EM_SETMARGINS 0x00D3
  7621. #define EM_GETMARGINS 0x00D4
  7622. #define EM_SETLIMITTEXT EM_LIMITTEXT /* ;win40 Name change */
  7623. #define EM_GETLIMITTEXT 0x00D5
  7624. #define EM_POSFROMCHAR 0x00D6
  7625. #define EM_CHARFROMPOS 0x00D7
  7626. #endif /* WINVER >= 0x0400 */
  7627. #if(WINVER >= 0x0500)
  7628. #define EM_SETIMESTATUS 0x00D8
  7629. #define EM_GETIMESTATUS 0x00D9
  7630. #endif /* WINVER >= 0x0500 */
  7631. #endif /* !NOWINMESSAGES */
  7632. /*
  7633. * EDITWORDBREAKPROC code values
  7634. */
  7635. #define WB_LEFT 0
  7636. #define WB_RIGHT 1
  7637. #define WB_ISDELIMITER 2
  7638. /*
  7639. * Button Control Styles
  7640. */
  7641. #define BS_PUSHBUTTON 0x00000000L
  7642. #define BS_DEFPUSHBUTTON 0x00000001L
  7643. #define BS_CHECKBOX 0x00000002L
  7644. #define BS_AUTOCHECKBOX 0x00000003L
  7645. #define BS_RADIOBUTTON 0x00000004L
  7646. #define BS_3STATE 0x00000005L
  7647. #define BS_AUTO3STATE 0x00000006L
  7648. #define BS_GROUPBOX 0x00000007L
  7649. #define BS_USERBUTTON 0x00000008L
  7650. #define BS_AUTORADIOBUTTON 0x00000009L
  7651. #define BS_PUSHBOX 0x0000000AL
  7652. #define BS_OWNERDRAW 0x0000000BL
  7653. #define BS_TYPEMASK 0x0000000FL
  7654. #define BS_LEFTTEXT 0x00000020L
  7655. #if(WINVER >= 0x0400)
  7656. #define BS_TEXT 0x00000000L
  7657. #define BS_ICON 0x00000040L
  7658. #define BS_BITMAP 0x00000080L
  7659. #define BS_LEFT 0x00000100L
  7660. #define BS_RIGHT 0x00000200L
  7661. #define BS_CENTER 0x00000300L
  7662. #define BS_TOP 0x00000400L
  7663. #define BS_BOTTOM 0x00000800L
  7664. #define BS_VCENTER 0x00000C00L
  7665. #define BS_PUSHLIKE 0x00001000L
  7666. #define BS_MULTILINE 0x00002000L
  7667. #define BS_NOTIFY 0x00004000L
  7668. #define BS_FLAT 0x00008000L
  7669. #define BS_RIGHTBUTTON BS_LEFTTEXT
  7670. #endif /* WINVER >= 0x0400 */
  7671. /*
  7672. * User Button Notification Codes
  7673. */
  7674. #define BN_CLICKED 0
  7675. #define BN_PAINT 1
  7676. #define BN_HILITE 2
  7677. #define BN_UNHILITE 3
  7678. #define BN_DISABLE 4
  7679. #define BN_DOUBLECLICKED 5
  7680. #if(WINVER >= 0x0400)
  7681. #define BN_PUSHED BN_HILITE
  7682. #define BN_UNPUSHED BN_UNHILITE
  7683. #define BN_DBLCLK BN_DOUBLECLICKED
  7684. #define BN_SETFOCUS 6
  7685. #define BN_KILLFOCUS 7
  7686. #endif /* WINVER >= 0x0400 */
  7687. /*
  7688. * Button Control Messages
  7689. */
  7690. #define BM_GETCHECK 0x00F0
  7691. #define BM_SETCHECK 0x00F1
  7692. #define BM_GETSTATE 0x00F2
  7693. #define BM_SETSTATE 0x00F3
  7694. #define BM_SETSTYLE 0x00F4
  7695. #if(WINVER >= 0x0400)
  7696. #define BM_CLICK 0x00F5
  7697. #define BM_GETIMAGE 0x00F6
  7698. #define BM_SETIMAGE 0x00F7
  7699. #define BST_UNCHECKED 0x0000
  7700. #define BST_CHECKED 0x0001
  7701. #define BST_INDETERMINATE 0x0002
  7702. #define BST_PUSHED 0x0004
  7703. #define BST_FOCUS 0x0008
  7704. #endif /* WINVER >= 0x0400 */
  7705. /*
  7706. * Static Control Constants
  7707. */
  7708. #define SS_LEFT 0x00000000L
  7709. #define SS_CENTER 0x00000001L
  7710. #define SS_RIGHT 0x00000002L
  7711. #define SS_ICON 0x00000003L
  7712. #define SS_BLACKRECT 0x00000004L
  7713. #define SS_GRAYRECT 0x00000005L
  7714. #define SS_WHITERECT 0x00000006L
  7715. #define SS_BLACKFRAME 0x00000007L
  7716. #define SS_GRAYFRAME 0x00000008L
  7717. #define SS_WHITEFRAME 0x00000009L
  7718. #define SS_USERITEM 0x0000000AL
  7719. #define SS_SIMPLE 0x0000000BL
  7720. #define SS_LEFTNOWORDWRAP 0x0000000CL
  7721. #if(WINVER >= 0x0400)
  7722. #define SS_OWNERDRAW 0x0000000DL
  7723. #define SS_BITMAP 0x0000000EL
  7724. #define SS_ENHMETAFILE 0x0000000FL
  7725. #define SS_ETCHEDHORZ 0x00000010L
  7726. #define SS_ETCHEDVERT 0x00000011L
  7727. #define SS_ETCHEDFRAME 0x00000012L
  7728. #define SS_TYPEMASK 0x0000001FL
  7729. #endif /* WINVER >= 0x0400 */
  7730. #if(WINVER >= 0x0501)
  7731. #define SS_REALSIZECONTROL 0x00000040L
  7732. #endif /* WINVER >= 0x0501 */
  7733. #define SS_NOPREFIX 0x00000080L /* Don't do "&" character translation */
  7734. #if(WINVER >= 0x0400)
  7735. #define SS_NOTIFY 0x00000100L
  7736. #define SS_CENTERIMAGE 0x00000200L
  7737. #define SS_RIGHTJUST 0x00000400L
  7738. #define SS_REALSIZEIMAGE 0x00000800L
  7739. #define SS_SUNKEN 0x00001000L
  7740. #define SS_EDITCONTROL 0x00002000L
  7741. #define SS_ENDELLIPSIS 0x00004000L
  7742. #define SS_PATHELLIPSIS 0x00008000L
  7743. #define SS_WORDELLIPSIS 0x0000C000L
  7744. #define SS_ELLIPSISMASK 0x0000C000L
  7745. #endif /* WINVER >= 0x0400 */
  7746. #ifndef NOWINMESSAGES
  7747. /*
  7748. * Static Control Mesages
  7749. */
  7750. #define STM_SETICON 0x0170
  7751. #define STM_GETICON 0x0171
  7752. #if(WINVER >= 0x0400)
  7753. #define STM_SETIMAGE 0x0172
  7754. #define STM_GETIMAGE 0x0173
  7755. #define STN_CLICKED 0
  7756. #define STN_DBLCLK 1
  7757. #define STN_ENABLE 2
  7758. #define STN_DISABLE 3
  7759. #endif /* WINVER >= 0x0400 */
  7760. #define STM_MSGMAX 0x0174
  7761. #endif /* !NOWINMESSAGES */
  7762. /*
  7763. * Dialog window class
  7764. */
  7765. #define WC_DIALOG (MAKEINTATOM(0x8002))
  7766. /*
  7767. * Get/SetWindowWord/Long offsets for use with WC_DIALOG windows
  7768. */
  7769. #define DWL_MSGRESULT 0
  7770. #define DWL_DLGPROC 4
  7771. #define DWL_USER 8
  7772. #ifdef _WIN64
  7773. #undef DWL_MSGRESULT
  7774. #undef DWL_DLGPROC
  7775. #undef DWL_USER
  7776. #endif /* _WIN64 */
  7777. #define DWLP_MSGRESULT 0
  7778. #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
  7779. #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
  7780. /*
  7781. * Dialog Manager Routines
  7782. */
  7783. #ifndef NOMSG
  7784. WINUSERAPI
  7785. BOOL
  7786. WINAPI
  7787. IsDialogMessageA(
  7788. IN HWND hDlg,
  7789. IN LPMSG lpMsg);
  7790. WINUSERAPI
  7791. BOOL
  7792. WINAPI
  7793. IsDialogMessageW(
  7794. IN HWND hDlg,
  7795. IN LPMSG lpMsg);
  7796. #ifdef UNICODE
  7797. #define IsDialogMessage IsDialogMessageW
  7798. #else
  7799. #define IsDialogMessage IsDialogMessageA
  7800. #endif // !UNICODE
  7801. #endif /* !NOMSG */
  7802. WINUSERAPI
  7803. BOOL
  7804. WINAPI
  7805. MapDialogRect(
  7806. IN HWND hDlg,
  7807. IN OUT LPRECT lpRect);
  7808. WINUSERAPI
  7809. int
  7810. WINAPI
  7811. DlgDirListA(
  7812. IN HWND hDlg,
  7813. IN OUT LPSTR lpPathSpec,
  7814. IN int nIDListBox,
  7815. IN int nIDStaticPath,
  7816. IN UINT uFileType);
  7817. WINUSERAPI
  7818. int
  7819. WINAPI
  7820. DlgDirListW(
  7821. IN HWND hDlg,
  7822. IN OUT LPWSTR lpPathSpec,
  7823. IN int nIDListBox,
  7824. IN int nIDStaticPath,
  7825. IN UINT uFileType);
  7826. #ifdef UNICODE
  7827. #define DlgDirList DlgDirListW
  7828. #else
  7829. #define DlgDirList DlgDirListA
  7830. #endif // !UNICODE
  7831. /*
  7832. * DlgDirList, DlgDirListComboBox flags values
  7833. */
  7834. #define DDL_READWRITE 0x0000
  7835. #define DDL_READONLY 0x0001
  7836. #define DDL_HIDDEN 0x0002
  7837. #define DDL_SYSTEM 0x0004
  7838. #define DDL_DIRECTORY 0x0010
  7839. #define DDL_ARCHIVE 0x0020
  7840. #define DDL_POSTMSGS 0x2000
  7841. #define DDL_DRIVES 0x4000
  7842. #define DDL_EXCLUSIVE 0x8000
  7843. WINUSERAPI
  7844. BOOL
  7845. WINAPI
  7846. DlgDirSelectExA(
  7847. IN HWND hDlg,
  7848. OUT LPSTR lpString,
  7849. IN int nCount,
  7850. IN int nIDListBox);
  7851. WINUSERAPI
  7852. BOOL
  7853. WINAPI
  7854. DlgDirSelectExW(
  7855. IN HWND hDlg,
  7856. OUT LPWSTR lpString,
  7857. IN int nCount,
  7858. IN int nIDListBox);
  7859. #ifdef UNICODE
  7860. #define DlgDirSelectEx DlgDirSelectExW
  7861. #else
  7862. #define DlgDirSelectEx DlgDirSelectExA
  7863. #endif // !UNICODE
  7864. WINUSERAPI
  7865. int
  7866. WINAPI
  7867. DlgDirListComboBoxA(
  7868. IN HWND hDlg,
  7869. IN OUT LPSTR lpPathSpec,
  7870. IN int nIDComboBox,
  7871. IN int nIDStaticPath,
  7872. IN UINT uFiletype);
  7873. WINUSERAPI
  7874. int
  7875. WINAPI
  7876. DlgDirListComboBoxW(
  7877. IN HWND hDlg,
  7878. IN OUT LPWSTR lpPathSpec,
  7879. IN int nIDComboBox,
  7880. IN int nIDStaticPath,
  7881. IN UINT uFiletype);
  7882. #ifdef UNICODE
  7883. #define DlgDirListComboBox DlgDirListComboBoxW
  7884. #else
  7885. #define DlgDirListComboBox DlgDirListComboBoxA
  7886. #endif // !UNICODE
  7887. WINUSERAPI
  7888. BOOL
  7889. WINAPI
  7890. DlgDirSelectComboBoxExA(
  7891. IN HWND hDlg,
  7892. OUT LPSTR lpString,
  7893. IN int nCount,
  7894. IN int nIDComboBox);
  7895. WINUSERAPI
  7896. BOOL
  7897. WINAPI
  7898. DlgDirSelectComboBoxExW(
  7899. IN HWND hDlg,
  7900. OUT LPWSTR lpString,
  7901. IN int nCount,
  7902. IN int nIDComboBox);
  7903. #ifdef UNICODE
  7904. #define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExW
  7905. #else
  7906. #define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExA
  7907. #endif // !UNICODE
  7908. /*
  7909. * Dialog Styles
  7910. */
  7911. #define DS_ABSALIGN 0x01L
  7912. #define DS_SYSMODAL 0x02L
  7913. #define DS_LOCALEDIT 0x20L /* Edit items get Local storage. */
  7914. #define DS_SETFONT 0x40L /* User specified font for Dlg controls */
  7915. #define DS_MODALFRAME 0x80L /* Can be combined with WS_CAPTION */
  7916. #define DS_NOIDLEMSG 0x100L /* WM_ENTERIDLE message will not be sent */
  7917. #define DS_SETFOREGROUND 0x200L /* not in win3.1 */
  7918. #if(WINVER >= 0x0400)
  7919. #define DS_3DLOOK 0x0004L
  7920. #define DS_FIXEDSYS 0x0008L
  7921. #define DS_NOFAILCREATE 0x0010L
  7922. #define DS_CONTROL 0x0400L
  7923. #define DS_CENTER 0x0800L
  7924. #define DS_CENTERMOUSE 0x1000L
  7925. #define DS_CONTEXTHELP 0x2000L
  7926. #define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS)
  7927. #endif /* WINVER >= 0x0400 */
  7928. #define DM_GETDEFID (WM_USER+0)
  7929. #define DM_SETDEFID (WM_USER+1)
  7930. #if(WINVER >= 0x0400)
  7931. #define DM_REPOSITION (WM_USER+2)
  7932. #endif /* WINVER >= 0x0400 */
  7933. /*
  7934. * Returned in HIWORD() of DM_GETDEFID result if msg is supported
  7935. */
  7936. #define DC_HASDEFID 0x534B
  7937. /*
  7938. * Dialog Codes
  7939. */
  7940. #define DLGC_WANTARROWS 0x0001 /* Control wants arrow keys */
  7941. #define DLGC_WANTTAB 0x0002 /* Control wants tab keys */
  7942. #define DLGC_WANTALLKEYS 0x0004 /* Control wants all keys */
  7943. #define DLGC_WANTMESSAGE 0x0004 /* Pass message to control */
  7944. #define DLGC_HASSETSEL 0x0008 /* Understands EM_SETSEL message */
  7945. #define DLGC_DEFPUSHBUTTON 0x0010 /* Default pushbutton */
  7946. #define DLGC_UNDEFPUSHBUTTON 0x0020 /* Non-default pushbutton */
  7947. #define DLGC_RADIOBUTTON 0x0040 /* Radio button */
  7948. #define DLGC_WANTCHARS 0x0080 /* Want WM_CHAR messages */
  7949. #define DLGC_STATIC 0x0100 /* Static item: don't include */
  7950. #define DLGC_BUTTON 0x2000 /* Button item: can be checked */
  7951. #define LB_CTLCODE 0L
  7952. /*
  7953. * Listbox Return Values
  7954. */
  7955. #define LB_OKAY 0
  7956. #define LB_ERR (-1)
  7957. #define LB_ERRSPACE (-2)
  7958. /*
  7959. ** The idStaticPath parameter to DlgDirList can have the following values
  7960. ** ORed if the list box should show other details of the files along with
  7961. ** the name of the files;
  7962. */
  7963. /* all other details also will be returned */
  7964. /*
  7965. * Listbox Notification Codes
  7966. */
  7967. #define LBN_ERRSPACE (-2)
  7968. #define LBN_SELCHANGE 1
  7969. #define LBN_DBLCLK 2
  7970. #define LBN_SELCANCEL 3
  7971. #define LBN_SETFOCUS 4
  7972. #define LBN_KILLFOCUS 5
  7973. #ifndef NOWINMESSAGES
  7974. /*
  7975. * Listbox messages
  7976. */
  7977. #define LB_ADDSTRING 0x0180
  7978. #define LB_INSERTSTRING 0x0181
  7979. #define LB_DELETESTRING 0x0182
  7980. #define LB_SELITEMRANGEEX 0x0183
  7981. #define LB_RESETCONTENT 0x0184
  7982. #define LB_SETSEL 0x0185
  7983. #define LB_SETCURSEL 0x0186
  7984. #define LB_GETSEL 0x0187
  7985. #define LB_GETCURSEL 0x0188
  7986. #define LB_GETTEXT 0x0189
  7987. #define LB_GETTEXTLEN 0x018A
  7988. #define LB_GETCOUNT 0x018B
  7989. #define LB_SELECTSTRING 0x018C
  7990. #define LB_DIR 0x018D
  7991. #define LB_GETTOPINDEX 0x018E
  7992. #define LB_FINDSTRING 0x018F
  7993. #define LB_GETSELCOUNT 0x0190
  7994. #define LB_GETSELITEMS 0x0191
  7995. #define LB_SETTABSTOPS 0x0192
  7996. #define LB_GETHORIZONTALEXTENT 0x0193
  7997. #define LB_SETHORIZONTALEXTENT 0x0194
  7998. #define LB_SETCOLUMNWIDTH 0x0195
  7999. #define LB_ADDFILE 0x0196
  8000. #define LB_SETTOPINDEX 0x0197
  8001. #define LB_GETITEMRECT 0x0198
  8002. #define LB_GETITEMDATA 0x0199
  8003. #define LB_SETITEMDATA 0x019A
  8004. #define LB_SELITEMRANGE 0x019B
  8005. #define LB_SETANCHORINDEX 0x019C
  8006. #define LB_GETANCHORINDEX 0x019D
  8007. #define LB_SETCARETINDEX 0x019E
  8008. #define LB_GETCARETINDEX 0x019F
  8009. #define LB_SETITEMHEIGHT 0x01A0
  8010. #define LB_GETITEMHEIGHT 0x01A1
  8011. #define LB_FINDSTRINGEXACT 0x01A2
  8012. #define LB_SETLOCALE 0x01A5
  8013. #define LB_GETLOCALE 0x01A6
  8014. #define LB_SETCOUNT 0x01A7
  8015. #if(WINVER >= 0x0400)
  8016. #define LB_INITSTORAGE 0x01A8
  8017. #define LB_ITEMFROMPOINT 0x01A9
  8018. #endif /* WINVER >= 0x0400 */
  8019. #if(_WIN32_WCE >= 0x0400)
  8020. #define LB_MULTIPLEADDSTRING 0x01B1
  8021. #endif
  8022. #if(_WIN32_WINNT >= 0x0501)
  8023. #define LB_GETLISTBOXINFO 0x01B2
  8024. #endif /* _WIN32_WINNT >= 0x0501 */
  8025. #if(_WIN32_WINNT >= 0x0501)
  8026. #define LB_MSGMAX 0x01B3
  8027. #elif(_WIN32_WCE >= 0x0400)
  8028. #define LB_MSGMAX 0x01B1
  8029. #elif(WINVER >= 0x0400)
  8030. #define LB_MSGMAX 0x01B0
  8031. #else
  8032. #define LB_MSGMAX 0x01A8
  8033. #endif
  8034. #endif /* !NOWINMESSAGES */
  8035. #ifndef NOWINSTYLES
  8036. /*
  8037. * Listbox Styles
  8038. */
  8039. #define LBS_NOTIFY 0x0001L
  8040. #define LBS_SORT 0x0002L
  8041. #define LBS_NOREDRAW 0x0004L
  8042. #define LBS_MULTIPLESEL 0x0008L
  8043. #define LBS_OWNERDRAWFIXED 0x0010L
  8044. #define LBS_OWNERDRAWVARIABLE 0x0020L
  8045. #define LBS_HASSTRINGS 0x0040L
  8046. #define LBS_USETABSTOPS 0x0080L
  8047. #define LBS_NOINTEGRALHEIGHT 0x0100L
  8048. #define LBS_MULTICOLUMN 0x0200L
  8049. #define LBS_WANTKEYBOARDINPUT 0x0400L
  8050. #define LBS_EXTENDEDSEL 0x0800L
  8051. #define LBS_DISABLENOSCROLL 0x1000L
  8052. #define LBS_NODATA 0x2000L
  8053. #if(WINVER >= 0x0400)
  8054. #define LBS_NOSEL 0x4000L
  8055. #endif /* WINVER >= 0x0400 */
  8056. #define LBS_COMBOBOX 0x8000L // Listbox is part of a Combobox - read-only
  8057. #define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  8058. #endif /* !NOWINSTYLES */
  8059. /*
  8060. * Combo Box return Values
  8061. */
  8062. #define CB_OKAY 0
  8063. #define CB_ERR (-1)
  8064. #define CB_ERRSPACE (-2)
  8065. /*
  8066. * Combo Box Notification Codes
  8067. */
  8068. #define CBN_ERRSPACE (-1)
  8069. #define CBN_SELCHANGE 1
  8070. #define CBN_DBLCLK 2
  8071. #define CBN_SETFOCUS 3
  8072. #define CBN_KILLFOCUS 4
  8073. #define CBN_EDITCHANGE 5
  8074. #define CBN_EDITUPDATE 6
  8075. #define CBN_DROPDOWN 7
  8076. #define CBN_CLOSEUP 8
  8077. #define CBN_SELENDOK 9
  8078. #define CBN_SELENDCANCEL 10
  8079. #ifndef NOWINSTYLES
  8080. /*
  8081. * Combo Box styles
  8082. */
  8083. #define CBS_SIMPLE 0x0001L
  8084. #define CBS_DROPDOWN 0x0002L
  8085. #define CBS_DROPDOWNLIST 0x0003L
  8086. #define CBS_OWNERDRAWFIXED 0x0010L
  8087. #define CBS_OWNERDRAWVARIABLE 0x0020L
  8088. #define CBS_AUTOHSCROLL 0x0040L
  8089. #define CBS_OEMCONVERT 0x0080L
  8090. #define CBS_SORT 0x0100L
  8091. #define CBS_HASSTRINGS 0x0200L
  8092. #define CBS_NOINTEGRALHEIGHT 0x0400L
  8093. #define CBS_DISABLENOSCROLL 0x0800L
  8094. #if(WINVER >= 0x0400)
  8095. #define CBS_UPPERCASE 0x2000L
  8096. #define CBS_LOWERCASE 0x4000L
  8097. #endif /* WINVER >= 0x0400 */
  8098. #endif /* !NOWINSTYLES */
  8099. /*
  8100. * Combo Box messages
  8101. */
  8102. #ifndef NOWINMESSAGES
  8103. #define CB_GETEDITSEL 0x0140
  8104. #define CB_LIMITTEXT 0x0141
  8105. #define CB_SETEDITSEL 0x0142
  8106. #define CB_ADDSTRING 0x0143
  8107. #define CB_DELETESTRING 0x0144
  8108. #define CB_DIR 0x0145
  8109. #define CB_GETCOUNT 0x0146
  8110. #define CB_GETCURSEL 0x0147
  8111. #define CB_GETLBTEXT 0x0148
  8112. #define CB_GETLBTEXTLEN 0x0149
  8113. #define CB_INSERTSTRING 0x014A
  8114. #define CB_RESETCONTENT 0x014B
  8115. #define CB_FINDSTRING 0x014C
  8116. #define CB_SELECTSTRING 0x014D
  8117. #define CB_SETCURSEL 0x014E
  8118. #define CB_SHOWDROPDOWN 0x014F
  8119. #define CB_GETITEMDATA 0x0150
  8120. #define CB_SETITEMDATA 0x0151
  8121. #define CB_GETDROPPEDCONTROLRECT 0x0152
  8122. #define CB_SETITEMHEIGHT 0x0153
  8123. #define CB_GETITEMHEIGHT 0x0154
  8124. #define CB_SETEXTENDEDUI 0x0155
  8125. #define CB_GETEXTENDEDUI 0x0156
  8126. #define CB_GETDROPPEDSTATE 0x0157
  8127. #define CB_FINDSTRINGEXACT 0x0158
  8128. #define CB_SETLOCALE 0x0159
  8129. #define CB_GETLOCALE 0x015A
  8130. #if(WINVER >= 0x0400)
  8131. #define CB_GETTOPINDEX 0x015b
  8132. #define CB_SETTOPINDEX 0x015c
  8133. #define CB_GETHORIZONTALEXTENT 0x015d
  8134. #define CB_SETHORIZONTALEXTENT 0x015e
  8135. #define CB_GETDROPPEDWIDTH 0x015f
  8136. #define CB_SETDROPPEDWIDTH 0x0160
  8137. #define CB_INITSTORAGE 0x0161
  8138. #if(_WIN32_WCE >= 0x0400)
  8139. #define CB_MULTIPLEADDSTRING 0x0163
  8140. #endif
  8141. #endif /* WINVER >= 0x0400 */
  8142. #if(_WIN32_WINNT >= 0x0501)
  8143. #define CB_GETCOMBOBOXINFO 0x0164
  8144. #endif /* _WIN32_WINNT >= 0x0501 */
  8145. #if(_WIN32_WINNT >= 0x0501)
  8146. #define CB_MSGMAX 0x0165
  8147. #elif(_WIN32_WCE >= 0x0400)
  8148. #define CB_MSGMAX 0x0163
  8149. #elif(WINVER >= 0x0400)
  8150. #define CB_MSGMAX 0x0162
  8151. #else
  8152. #define CB_MSGMAX 0x015B
  8153. #endif
  8154. #endif /* !NOWINMESSAGES */
  8155. #ifndef NOWINSTYLES
  8156. /*
  8157. * Scroll Bar Styles
  8158. */
  8159. #define SBS_HORZ 0x0000L
  8160. #define SBS_VERT 0x0001L
  8161. #define SBS_TOPALIGN 0x0002L
  8162. #define SBS_LEFTALIGN 0x0002L
  8163. #define SBS_BOTTOMALIGN 0x0004L
  8164. #define SBS_RIGHTALIGN 0x0004L
  8165. #define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
  8166. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  8167. #define SBS_SIZEBOX 0x0008L
  8168. #if(WINVER >= 0x0400)
  8169. #define SBS_SIZEGRIP 0x0010L
  8170. #endif /* WINVER >= 0x0400 */
  8171. #endif /* !NOWINSTYLES */
  8172. /*
  8173. * Scroll bar messages
  8174. */
  8175. #ifndef NOWINMESSAGES
  8176. #define SBM_SETPOS 0x00E0 /*not in win3.1 */
  8177. #define SBM_GETPOS 0x00E1 /*not in win3.1 */
  8178. #define SBM_SETRANGE 0x00E2 /*not in win3.1 */
  8179. #define SBM_SETRANGEREDRAW 0x00E6 /*not in win3.1 */
  8180. #define SBM_GETRANGE 0x00E3 /*not in win3.1 */
  8181. #define SBM_ENABLE_ARROWS 0x00E4 /*not in win3.1 */
  8182. #if(WINVER >= 0x0400)
  8183. #define SBM_SETSCROLLINFO 0x00E9
  8184. #define SBM_GETSCROLLINFO 0x00EA
  8185. #endif /* WINVER >= 0x0400 */
  8186. #if(_WIN32_WINNT >= 0x0501)
  8187. #define SBM_GETSCROLLBARINFO 0x00EB
  8188. #endif /* _WIN32_WINNT >= 0x0501 */
  8189. #if(WINVER >= 0x0400)
  8190. #define SIF_RANGE 0x0001
  8191. #define SIF_PAGE 0x0002
  8192. #define SIF_POS 0x0004
  8193. #define SIF_DISABLENOSCROLL 0x0008
  8194. #define SIF_TRACKPOS 0x0010
  8195. #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
  8196. typedef struct tagSCROLLINFO
  8197. {
  8198. UINT cbSize;
  8199. UINT fMask;
  8200. int nMin;
  8201. int nMax;
  8202. UINT nPage;
  8203. int nPos;
  8204. int nTrackPos;
  8205. } SCROLLINFO, FAR *LPSCROLLINFO;
  8206. typedef SCROLLINFO CONST FAR *LPCSCROLLINFO;
  8207. WINUSERAPI int WINAPI SetScrollInfo(IN HWND, IN int, IN LPCSCROLLINFO, IN BOOL);
  8208. WINUSERAPI BOOL WINAPI GetScrollInfo(IN HWND, IN int, IN OUT LPSCROLLINFO);
  8209. #endif /* WINVER >= 0x0400 */
  8210. #endif /* !NOWINMESSAGES */
  8211. #endif /* !NOCTLMGR */
  8212. #ifndef NOMDI
  8213. /*
  8214. * MDI client style bits
  8215. */
  8216. #define MDIS_ALLCHILDSTYLES 0x0001
  8217. /*
  8218. * wParam Flags for WM_MDITILE and WM_MDICASCADE messages.
  8219. */
  8220. #define MDITILE_VERTICAL 0x0000 /*not in win3.1 */
  8221. #define MDITILE_HORIZONTAL 0x0001 /*not in win3.1 */
  8222. #define MDITILE_SKIPDISABLED 0x0002 /*not in win3.1 */
  8223. #if(_WIN32_WINNT >= 0x0500)
  8224. #define MDITILE_ZORDER 0x0004
  8225. #endif /* _WIN32_WINNT >= 0x0500 */
  8226. typedef struct tagMDICREATESTRUCTA {
  8227. LPCSTR szClass;
  8228. LPCSTR szTitle;
  8229. HANDLE hOwner;
  8230. int x;
  8231. int y;
  8232. int cx;
  8233. int cy;
  8234. DWORD style;
  8235. LPARAM lParam; /* app-defined stuff */
  8236. } MDICREATESTRUCTA, *LPMDICREATESTRUCTA;
  8237. typedef struct tagMDICREATESTRUCTW {
  8238. LPCWSTR szClass;
  8239. LPCWSTR szTitle;
  8240. HANDLE hOwner;
  8241. int x;
  8242. int y;
  8243. int cx;
  8244. int cy;
  8245. DWORD style;
  8246. LPARAM lParam; /* app-defined stuff */
  8247. } MDICREATESTRUCTW, *LPMDICREATESTRUCTW;
  8248. #ifdef UNICODE
  8249. typedef MDICREATESTRUCTW MDICREATESTRUCT;
  8250. typedef LPMDICREATESTRUCTW LPMDICREATESTRUCT;
  8251. #else
  8252. typedef MDICREATESTRUCTA MDICREATESTRUCT;
  8253. typedef LPMDICREATESTRUCTA LPMDICREATESTRUCT;
  8254. #endif // UNICODE
  8255. typedef struct tagCLIENTCREATESTRUCT {
  8256. HANDLE hWindowMenu;
  8257. UINT idFirstChild;
  8258. } CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;
  8259. WINUSERAPI
  8260. LRESULT
  8261. WINAPI
  8262. DefFrameProcA(
  8263. IN HWND hWnd,
  8264. IN HWND hWndMDIClient,
  8265. IN UINT uMsg,
  8266. IN WPARAM wParam,
  8267. IN LPARAM lParam);
  8268. WINUSERAPI
  8269. LRESULT
  8270. WINAPI
  8271. DefFrameProcW(
  8272. IN HWND hWnd,
  8273. IN HWND hWndMDIClient,
  8274. IN UINT uMsg,
  8275. IN WPARAM wParam,
  8276. IN LPARAM lParam);
  8277. #ifdef UNICODE
  8278. #define DefFrameProc DefFrameProcW
  8279. #else
  8280. #define DefFrameProc DefFrameProcA
  8281. #endif // !UNICODE
  8282. WINUSERAPI
  8283. #ifndef _MAC
  8284. LRESULT
  8285. WINAPI
  8286. #else
  8287. LRESULT
  8288. CALLBACK
  8289. #endif
  8290. DefMDIChildProcA(
  8291. IN HWND hWnd,
  8292. IN UINT uMsg,
  8293. IN WPARAM wParam,
  8294. IN LPARAM lParam);
  8295. WINUSERAPI
  8296. #ifndef _MAC
  8297. LRESULT
  8298. WINAPI
  8299. #else
  8300. LRESULT
  8301. CALLBACK
  8302. #endif
  8303. DefMDIChildProcW(
  8304. IN HWND hWnd,
  8305. IN UINT uMsg,
  8306. IN WPARAM wParam,
  8307. IN LPARAM lParam);
  8308. #ifdef UNICODE
  8309. #define DefMDIChildProc DefMDIChildProcW
  8310. #else
  8311. #define DefMDIChildProc DefMDIChildProcA
  8312. #endif // !UNICODE
  8313. #ifndef NOMSG
  8314. WINUSERAPI
  8315. BOOL
  8316. WINAPI
  8317. TranslateMDISysAccel(
  8318. IN HWND hWndClient,
  8319. IN LPMSG lpMsg);
  8320. #endif /* !NOMSG */
  8321. WINUSERAPI
  8322. UINT
  8323. WINAPI
  8324. ArrangeIconicWindows(
  8325. IN HWND hWnd);
  8326. WINUSERAPI
  8327. HWND
  8328. WINAPI
  8329. CreateMDIWindowA(
  8330. IN LPCSTR lpClassName,
  8331. IN LPCSTR lpWindowName,
  8332. IN DWORD dwStyle,
  8333. IN int X,
  8334. IN int Y,
  8335. IN int nWidth,
  8336. IN int nHeight,
  8337. IN HWND hWndParent,
  8338. IN HINSTANCE hInstance,
  8339. IN LPARAM lParam
  8340. );
  8341. WINUSERAPI
  8342. HWND
  8343. WINAPI
  8344. CreateMDIWindowW(
  8345. IN LPCWSTR lpClassName,
  8346. IN LPCWSTR lpWindowName,
  8347. IN DWORD dwStyle,
  8348. IN int X,
  8349. IN int Y,
  8350. IN int nWidth,
  8351. IN int nHeight,
  8352. IN HWND hWndParent,
  8353. IN HINSTANCE hInstance,
  8354. IN LPARAM lParam
  8355. );
  8356. #ifdef UNICODE
  8357. #define CreateMDIWindow CreateMDIWindowW
  8358. #else
  8359. #define CreateMDIWindow CreateMDIWindowA
  8360. #endif // !UNICODE
  8361. #if(WINVER >= 0x0400)
  8362. WINUSERAPI WORD WINAPI TileWindows( IN HWND hwndParent, IN UINT wHow, IN CONST RECT * lpRect, IN UINT cKids, IN const HWND FAR * lpKids);
  8363. WINUSERAPI WORD WINAPI CascadeWindows( IN HWND hwndParent, IN UINT wHow, IN CONST RECT * lpRect, IN UINT cKids, IN const HWND FAR * lpKids);
  8364. #endif /* WINVER >= 0x0400 */
  8365. #endif /* !NOMDI */
  8366. #endif /* !NOUSER */
  8367. /****** Help support ********************************************************/
  8368. #ifndef NOHELP
  8369. typedef DWORD HELPPOLY;
  8370. typedef struct tagMULTIKEYHELPA {
  8371. #ifndef _MAC
  8372. DWORD mkSize;
  8373. #else
  8374. WORD mkSize;
  8375. #endif
  8376. CHAR mkKeylist;
  8377. CHAR szKeyphrase[1];
  8378. } MULTIKEYHELPA, *PMULTIKEYHELPA, *LPMULTIKEYHELPA;
  8379. typedef struct tagMULTIKEYHELPW {
  8380. #ifndef _MAC
  8381. DWORD mkSize;
  8382. #else
  8383. WORD mkSize;
  8384. #endif
  8385. WCHAR mkKeylist;
  8386. WCHAR szKeyphrase[1];
  8387. } MULTIKEYHELPW, *PMULTIKEYHELPW, *LPMULTIKEYHELPW;
  8388. #ifdef UNICODE
  8389. typedef MULTIKEYHELPW MULTIKEYHELP;
  8390. typedef PMULTIKEYHELPW PMULTIKEYHELP;
  8391. typedef LPMULTIKEYHELPW LPMULTIKEYHELP;
  8392. #else
  8393. typedef MULTIKEYHELPA MULTIKEYHELP;
  8394. typedef PMULTIKEYHELPA PMULTIKEYHELP;
  8395. typedef LPMULTIKEYHELPA LPMULTIKEYHELP;
  8396. #endif // UNICODE
  8397. typedef struct tagHELPWININFOA {
  8398. int wStructSize;
  8399. int x;
  8400. int y;
  8401. int dx;
  8402. int dy;
  8403. int wMax;
  8404. CHAR rgchMember[2];
  8405. } HELPWININFOA, *PHELPWININFOA, *LPHELPWININFOA;
  8406. typedef struct tagHELPWININFOW {
  8407. int wStructSize;
  8408. int x;
  8409. int y;
  8410. int dx;
  8411. int dy;
  8412. int wMax;
  8413. WCHAR rgchMember[2];
  8414. } HELPWININFOW, *PHELPWININFOW, *LPHELPWININFOW;
  8415. #ifdef UNICODE
  8416. typedef HELPWININFOW HELPWININFO;
  8417. typedef PHELPWININFOW PHELPWININFO;
  8418. typedef LPHELPWININFOW LPHELPWININFO;
  8419. #else
  8420. typedef HELPWININFOA HELPWININFO;
  8421. typedef PHELPWININFOA PHELPWININFO;
  8422. typedef LPHELPWININFOA LPHELPWININFO;
  8423. #endif // UNICODE
  8424. /*
  8425. * Commands to pass to WinHelp()
  8426. */
  8427. #define HELP_CONTEXT 0x0001L /* Display topic in ulTopic */
  8428. #define HELP_QUIT 0x0002L /* Terminate help */
  8429. #define HELP_INDEX 0x0003L /* Display index */
  8430. #define HELP_CONTENTS 0x0003L
  8431. #define HELP_HELPONHELP 0x0004L /* Display help on using help */
  8432. #define HELP_SETINDEX 0x0005L /* Set current Index for multi index help */
  8433. #define HELP_SETCONTENTS 0x0005L
  8434. #define HELP_CONTEXTPOPUP 0x0008L
  8435. #define HELP_FORCEFILE 0x0009L
  8436. #define HELP_KEY 0x0101L /* Display topic for keyword in offabData */
  8437. #define HELP_COMMAND 0x0102L
  8438. #define HELP_PARTIALKEY 0x0105L
  8439. #define HELP_MULTIKEY 0x0201L
  8440. #define HELP_SETWINPOS 0x0203L
  8441. #if(WINVER >= 0x0400)
  8442. #define HELP_CONTEXTMENU 0x000a
  8443. #define HELP_FINDER 0x000b
  8444. #define HELP_WM_HELP 0x000c
  8445. #define HELP_SETPOPUP_POS 0x000d
  8446. #define HELP_TCARD 0x8000
  8447. #define HELP_TCARD_DATA 0x0010
  8448. #define HELP_TCARD_OTHER_CALLER 0x0011
  8449. // These are in winhelp.h in Win95.
  8450. #define IDH_NO_HELP 28440
  8451. #define IDH_MISSING_CONTEXT 28441 // Control doesn't have matching help context
  8452. #define IDH_GENERIC_HELP_BUTTON 28442 // Property sheet help button
  8453. #define IDH_OK 28443
  8454. #define IDH_CANCEL 28444
  8455. #define IDH_HELP 28445
  8456. #endif /* WINVER >= 0x0400 */
  8457. WINUSERAPI
  8458. BOOL
  8459. WINAPI
  8460. WinHelpA(
  8461. IN HWND hWndMain,
  8462. IN LPCSTR lpszHelp,
  8463. IN UINT uCommand,
  8464. IN ULONG_PTR dwData
  8465. );
  8466. WINUSERAPI
  8467. BOOL
  8468. WINAPI
  8469. WinHelpW(
  8470. IN HWND hWndMain,
  8471. IN LPCWSTR lpszHelp,
  8472. IN UINT uCommand,
  8473. IN ULONG_PTR dwData
  8474. );
  8475. #ifdef UNICODE
  8476. #define WinHelp WinHelpW
  8477. #else
  8478. #define WinHelp WinHelpA
  8479. #endif // !UNICODE
  8480. #endif /* !NOHELP */
  8481. #if(WINVER >= 0x0500)
  8482. #define GR_GDIOBJECTS 0 /* Count of GDI objects */
  8483. #define GR_USEROBJECTS 1 /* Count of USER objects */
  8484. WINUSERAPI
  8485. DWORD
  8486. WINAPI
  8487. GetGuiResources(
  8488. IN HANDLE hProcess,
  8489. IN DWORD uiFlags);
  8490. #endif /* WINVER >= 0x0500 */
  8491. #ifndef NOSYSPARAMSINFO
  8492. /*
  8493. * Parameter for SystemParametersInfo()
  8494. */
  8495. #define SPI_GETBEEP 0x0001
  8496. #define SPI_SETBEEP 0x0002
  8497. #define SPI_GETMOUSE 0x0003
  8498. #define SPI_SETMOUSE 0x0004
  8499. #define SPI_GETBORDER 0x0005
  8500. #define SPI_SETBORDER 0x0006
  8501. #define SPI_GETKEYBOARDSPEED 0x000A
  8502. #define SPI_SETKEYBOARDSPEED 0x000B
  8503. #define SPI_LANGDRIVER 0x000C
  8504. #define SPI_ICONHORIZONTALSPACING 0x000D
  8505. #define SPI_GETSCREENSAVETIMEOUT 0x000E
  8506. #define SPI_SETSCREENSAVETIMEOUT 0x000F
  8507. #define SPI_GETSCREENSAVEACTIVE 0x0010
  8508. #define SPI_SETSCREENSAVEACTIVE 0x0011
  8509. #define SPI_GETGRIDGRANULARITY 0x0012
  8510. #define SPI_SETGRIDGRANULARITY 0x0013
  8511. #define SPI_SETDESKWALLPAPER 0x0014
  8512. #define SPI_SETDESKPATTERN 0x0015
  8513. #define SPI_GETKEYBOARDDELAY 0x0016
  8514. #define SPI_SETKEYBOARDDELAY 0x0017
  8515. #define SPI_ICONVERTICALSPACING 0x0018
  8516. #define SPI_GETICONTITLEWRAP 0x0019
  8517. #define SPI_SETICONTITLEWRAP 0x001A
  8518. #define SPI_GETMENUDROPALIGNMENT 0x001B
  8519. #define SPI_SETMENUDROPALIGNMENT 0x001C
  8520. #define SPI_SETDOUBLECLKWIDTH 0x001D
  8521. #define SPI_SETDOUBLECLKHEIGHT 0x001E
  8522. #define SPI_GETICONTITLELOGFONT 0x001F
  8523. #define SPI_SETDOUBLECLICKTIME 0x0020
  8524. #define SPI_SETMOUSEBUTTONSWAP 0x0021
  8525. #define SPI_SETICONTITLELOGFONT 0x0022
  8526. #define SPI_GETFASTTASKSWITCH 0x0023
  8527. #define SPI_SETFASTTASKSWITCH 0x0024
  8528. #if(WINVER >= 0x0400)
  8529. #define SPI_SETDRAGFULLWINDOWS 0x0025
  8530. #define SPI_GETDRAGFULLWINDOWS 0x0026
  8531. #define SPI_GETNONCLIENTMETRICS 0x0029
  8532. #define SPI_SETNONCLIENTMETRICS 0x002A
  8533. #define SPI_GETMINIMIZEDMETRICS 0x002B
  8534. #define SPI_SETMINIMIZEDMETRICS 0x002C
  8535. #define SPI_GETICONMETRICS 0x002D
  8536. #define SPI_SETICONMETRICS 0x002E
  8537. #define SPI_SETWORKAREA 0x002F
  8538. #define SPI_GETWORKAREA 0x0030
  8539. #define SPI_SETPENWINDOWS 0x0031
  8540. #define SPI_GETHIGHCONTRAST 0x0042
  8541. #define SPI_SETHIGHCONTRAST 0x0043
  8542. #define SPI_GETKEYBOARDPREF 0x0044
  8543. #define SPI_SETKEYBOARDPREF 0x0045
  8544. #define SPI_GETSCREENREADER 0x0046
  8545. #define SPI_SETSCREENREADER 0x0047
  8546. #define SPI_GETANIMATION 0x0048
  8547. #define SPI_SETANIMATION 0x0049
  8548. #define SPI_GETFONTSMOOTHING 0x004A
  8549. #define SPI_SETFONTSMOOTHING 0x004B
  8550. #define SPI_SETDRAGWIDTH 0x004C
  8551. #define SPI_SETDRAGHEIGHT 0x004D
  8552. #define SPI_SETHANDHELD 0x004E
  8553. #define SPI_GETLOWPOWERTIMEOUT 0x004F
  8554. #define SPI_GETPOWEROFFTIMEOUT 0x0050
  8555. #define SPI_SETLOWPOWERTIMEOUT 0x0051
  8556. #define SPI_SETPOWEROFFTIMEOUT 0x0052
  8557. #define SPI_GETLOWPOWERACTIVE 0x0053
  8558. #define SPI_GETPOWEROFFACTIVE 0x0054
  8559. #define SPI_SETLOWPOWERACTIVE 0x0055
  8560. #define SPI_SETPOWEROFFACTIVE 0x0056
  8561. #define SPI_SETCURSORS 0x0057
  8562. #define SPI_SETICONS 0x0058
  8563. #define SPI_GETDEFAULTINPUTLANG 0x0059
  8564. #define SPI_SETDEFAULTINPUTLANG 0x005A
  8565. #define SPI_SETLANGTOGGLE 0x005B
  8566. #define SPI_GETWINDOWSEXTENSION 0x005C
  8567. #define SPI_SETMOUSETRAILS 0x005D
  8568. #define SPI_GETMOUSETRAILS 0x005E
  8569. #define SPI_SETSCREENSAVERRUNNING 0x0061
  8570. #define SPI_SCREENSAVERRUNNING SPI_SETSCREENSAVERRUNNING
  8571. #endif /* WINVER >= 0x0400 */
  8572. #define SPI_GETFILTERKEYS 0x0032
  8573. #define SPI_SETFILTERKEYS 0x0033
  8574. #define SPI_GETTOGGLEKEYS 0x0034
  8575. #define SPI_SETTOGGLEKEYS 0x0035
  8576. #define SPI_GETMOUSEKEYS 0x0036
  8577. #define SPI_SETMOUSEKEYS 0x0037
  8578. #define SPI_GETSHOWSOUNDS 0x0038
  8579. #define SPI_SETSHOWSOUNDS 0x0039
  8580. #define SPI_GETSTICKYKEYS 0x003A
  8581. #define SPI_SETSTICKYKEYS 0x003B
  8582. #define SPI_GETACCESSTIMEOUT 0x003C
  8583. #define SPI_SETACCESSTIMEOUT 0x003D
  8584. #if(WINVER >= 0x0400)
  8585. #define SPI_GETSERIALKEYS 0x003E
  8586. #define SPI_SETSERIALKEYS 0x003F
  8587. #endif /* WINVER >= 0x0400 */
  8588. #define SPI_GETSOUNDSENTRY 0x0040
  8589. #define SPI_SETSOUNDSENTRY 0x0041
  8590. #if(_WIN32_WINNT >= 0x0400)
  8591. #define SPI_GETSNAPTODEFBUTTON 0x005F
  8592. #define SPI_SETSNAPTODEFBUTTON 0x0060
  8593. #endif /* _WIN32_WINNT >= 0x0400 */
  8594. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  8595. #define SPI_GETMOUSEHOVERWIDTH 0x0062
  8596. #define SPI_SETMOUSEHOVERWIDTH 0x0063
  8597. #define SPI_GETMOUSEHOVERHEIGHT 0x0064
  8598. #define SPI_SETMOUSEHOVERHEIGHT 0x0065
  8599. #define SPI_GETMOUSEHOVERTIME 0x0066
  8600. #define SPI_SETMOUSEHOVERTIME 0x0067
  8601. #define SPI_GETWHEELSCROLLLINES 0x0068
  8602. #define SPI_SETWHEELSCROLLLINES 0x0069
  8603. #define SPI_GETMENUSHOWDELAY 0x006A
  8604. #define SPI_SETMENUSHOWDELAY 0x006B
  8605. #define SPI_GETSHOWIMEUI 0x006E
  8606. #define SPI_SETSHOWIMEUI 0x006F
  8607. #endif
  8608. #if(WINVER >= 0x0500)
  8609. #define SPI_GETMOUSESPEED 0x0070
  8610. #define SPI_SETMOUSESPEED 0x0071
  8611. #define SPI_GETSCREENSAVERRUNNING 0x0072
  8612. #define SPI_GETDESKWALLPAPER 0x0073
  8613. #endif /* WINVER >= 0x0500 */
  8614. #if(WINVER >= 0x0500)
  8615. #define SPI_GETACTIVEWINDOWTRACKING 0x1000
  8616. #define SPI_SETACTIVEWINDOWTRACKING 0x1001
  8617. #define SPI_GETMENUANIMATION 0x1002
  8618. #define SPI_SETMENUANIMATION 0x1003
  8619. #define SPI_GETCOMBOBOXANIMATION 0x1004
  8620. #define SPI_SETCOMBOBOXANIMATION 0x1005
  8621. #define SPI_GETLISTBOXSMOOTHSCROLLING 0x1006
  8622. #define SPI_SETLISTBOXSMOOTHSCROLLING 0x1007
  8623. #define SPI_GETGRADIENTCAPTIONS 0x1008
  8624. #define SPI_SETGRADIENTCAPTIONS 0x1009
  8625. #define SPI_GETKEYBOARDCUES 0x100A
  8626. #define SPI_SETKEYBOARDCUES 0x100B
  8627. #define SPI_GETMENUUNDERLINES SPI_GETKEYBOARDCUES
  8628. #define SPI_SETMENUUNDERLINES SPI_SETKEYBOARDCUES
  8629. #define SPI_GETACTIVEWNDTRKZORDER 0x100C
  8630. #define SPI_SETACTIVEWNDTRKZORDER 0x100D
  8631. #define SPI_GETHOTTRACKING 0x100E
  8632. #define SPI_SETHOTTRACKING 0x100F
  8633. #define SPI_GETMENUFADE 0x1012
  8634. #define SPI_SETMENUFADE 0x1013
  8635. #define SPI_GETSELECTIONFADE 0x1014
  8636. #define SPI_SETSELECTIONFADE 0x1015
  8637. #define SPI_GETTOOLTIPANIMATION 0x1016
  8638. #define SPI_SETTOOLTIPANIMATION 0x1017
  8639. #define SPI_GETTOOLTIPFADE 0x1018
  8640. #define SPI_SETTOOLTIPFADE 0x1019
  8641. #define SPI_GETCURSORSHADOW 0x101A
  8642. #define SPI_SETCURSORSHADOW 0x101B
  8643. #if(_WIN32_WINNT >= 0x0501)
  8644. #define SPI_GETMOUSESONAR 0x101C
  8645. #define SPI_SETMOUSESONAR 0x101D
  8646. #define SPI_GETMOUSECLICKLOCK 0x101E
  8647. #define SPI_SETMOUSECLICKLOCK 0x101F
  8648. #define SPI_GETMOUSEVANISH 0x1020
  8649. #define SPI_SETMOUSEVANISH 0x1021
  8650. #define SPI_GETFLATMENU 0x1022
  8651. #define SPI_SETFLATMENU 0x1023
  8652. #define SPI_GETDROPSHADOW 0x1024
  8653. #define SPI_SETDROPSHADOW 0x1025
  8654. #define SPI_GETBLOCKSENDINPUTRESETS 0x1026
  8655. #define SPI_SETBLOCKSENDINPUTRESETS 0x1027
  8656. #endif /* _WIN32_WINNT >= 0x0501 */
  8657. #define SPI_GETUIEFFECTS 0x103E
  8658. #define SPI_SETUIEFFECTS 0x103F
  8659. #define SPI_GETFOREGROUNDLOCKTIMEOUT 0x2000
  8660. #define SPI_SETFOREGROUNDLOCKTIMEOUT 0x2001
  8661. #define SPI_GETACTIVEWNDTRKTIMEOUT 0x2002
  8662. #define SPI_SETACTIVEWNDTRKTIMEOUT 0x2003
  8663. #define SPI_GETFOREGROUNDFLASHCOUNT 0x2004
  8664. #define SPI_SETFOREGROUNDFLASHCOUNT 0x2005
  8665. #define SPI_GETCARETWIDTH 0x2006
  8666. #define SPI_SETCARETWIDTH 0x2007
  8667. #if(_WIN32_WINNT >= 0x0501)
  8668. #define SPI_GETMOUSECLICKLOCKTIME 0x2008
  8669. #define SPI_SETMOUSECLICKLOCKTIME 0x2009
  8670. #define SPI_GETFONTSMOOTHINGTYPE 0x200A
  8671. #define SPI_SETFONTSMOOTHINGTYPE 0x200B
  8672. /* constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE: */
  8673. #define FE_FONTSMOOTHINGSTANDARD 0x0001
  8674. #define FE_FONTSMOOTHINGCLEARTYPE 0x0002
  8675. #define FE_FONTSMOOTHINGDOCKING 0x8000
  8676. #define SPI_GETFONTSMOOTHINGCONTRAST 0x200C
  8677. #define SPI_SETFONTSMOOTHINGCONTRAST 0x200D
  8678. #define SPI_GETFOCUSBORDERWIDTH 0x200E
  8679. #define SPI_SETFOCUSBORDERWIDTH 0x200F
  8680. #define SPI_GETFOCUSBORDERHEIGHT 0x2010
  8681. #define SPI_SETFOCUSBORDERHEIGHT 0x2011
  8682. #define SPI_GETFONTSMOOTHINGORIENTATION 0x2012
  8683. #define SPI_SETFONTSMOOTHINGORIENTATION 0x2013
  8684. /* constants for SPI_GETFONTSMOOTHINGORIENTATION and SPI_SETFONTSMOOTHINGORIENTATION: */
  8685. #define FE_FONTSMOOTHINGORIENTATIONBGR 0x0000
  8686. #define FE_FONTSMOOTHINGORIENTATIONRGB 0x0001
  8687. #endif /* _WIN32_WINNT >= 0x0501 */
  8688. #endif /* WINVER >= 0x0500 */
  8689. /*
  8690. * Flags
  8691. */
  8692. #define SPIF_UPDATEINIFILE 0x0001
  8693. #define SPIF_SENDWININICHANGE 0x0002
  8694. #define SPIF_SENDCHANGE SPIF_SENDWININICHANGE
  8695. #define METRICS_USEDEFAULT -1
  8696. #ifdef _WINGDI_
  8697. #ifndef NOGDI
  8698. typedef struct tagNONCLIENTMETRICSA
  8699. {
  8700. UINT cbSize;
  8701. int iBorderWidth;
  8702. int iScrollWidth;
  8703. int iScrollHeight;
  8704. int iCaptionWidth;
  8705. int iCaptionHeight;
  8706. LOGFONTA lfCaptionFont;
  8707. int iSmCaptionWidth;
  8708. int iSmCaptionHeight;
  8709. LOGFONTA lfSmCaptionFont;
  8710. int iMenuWidth;
  8711. int iMenuHeight;
  8712. LOGFONTA lfMenuFont;
  8713. LOGFONTA lfStatusFont;
  8714. LOGFONTA lfMessageFont;
  8715. } NONCLIENTMETRICSA, *PNONCLIENTMETRICSA, FAR* LPNONCLIENTMETRICSA;
  8716. typedef struct tagNONCLIENTMETRICSW
  8717. {
  8718. UINT cbSize;
  8719. int iBorderWidth;
  8720. int iScrollWidth;
  8721. int iScrollHeight;
  8722. int iCaptionWidth;
  8723. int iCaptionHeight;
  8724. LOGFONTW lfCaptionFont;
  8725. int iSmCaptionWidth;
  8726. int iSmCaptionHeight;
  8727. LOGFONTW lfSmCaptionFont;
  8728. int iMenuWidth;
  8729. int iMenuHeight;
  8730. LOGFONTW lfMenuFont;
  8731. LOGFONTW lfStatusFont;
  8732. LOGFONTW lfMessageFont;
  8733. } NONCLIENTMETRICSW, *PNONCLIENTMETRICSW, FAR* LPNONCLIENTMETRICSW;
  8734. #ifdef UNICODE
  8735. typedef NONCLIENTMETRICSW NONCLIENTMETRICS;
  8736. typedef PNONCLIENTMETRICSW PNONCLIENTMETRICS;
  8737. typedef LPNONCLIENTMETRICSW LPNONCLIENTMETRICS;
  8738. #else
  8739. typedef NONCLIENTMETRICSA NONCLIENTMETRICS;
  8740. typedef PNONCLIENTMETRICSA PNONCLIENTMETRICS;
  8741. typedef LPNONCLIENTMETRICSA LPNONCLIENTMETRICS;
  8742. #endif // UNICODE
  8743. #endif /* NOGDI */
  8744. #endif /* _WINGDI_ */
  8745. #define ARW_BOTTOMLEFT 0x0000L
  8746. #define ARW_BOTTOMRIGHT 0x0001L
  8747. #define ARW_TOPLEFT 0x0002L
  8748. #define ARW_TOPRIGHT 0x0003L
  8749. #define ARW_STARTMASK 0x0003L
  8750. #define ARW_STARTRIGHT 0x0001L
  8751. #define ARW_STARTTOP 0x0002L
  8752. #define ARW_LEFT 0x0000L
  8753. #define ARW_RIGHT 0x0000L
  8754. #define ARW_UP 0x0004L
  8755. #define ARW_DOWN 0x0004L
  8756. #define ARW_HIDE 0x0008L
  8757. typedef struct tagMINIMIZEDMETRICS
  8758. {
  8759. UINT cbSize;
  8760. int iWidth;
  8761. int iHorzGap;
  8762. int iVertGap;
  8763. int iArrange;
  8764. } MINIMIZEDMETRICS, *PMINIMIZEDMETRICS, *LPMINIMIZEDMETRICS;
  8765. #ifdef _WINGDI_
  8766. #ifndef NOGDI
  8767. typedef struct tagICONMETRICSA
  8768. {
  8769. UINT cbSize;
  8770. int iHorzSpacing;
  8771. int iVertSpacing;
  8772. int iTitleWrap;
  8773. LOGFONTA lfFont;
  8774. } ICONMETRICSA, *PICONMETRICSA, *LPICONMETRICSA;
  8775. typedef struct tagICONMETRICSW
  8776. {
  8777. UINT cbSize;
  8778. int iHorzSpacing;
  8779. int iVertSpacing;
  8780. int iTitleWrap;
  8781. LOGFONTW lfFont;
  8782. } ICONMETRICSW, *PICONMETRICSW, *LPICONMETRICSW;
  8783. #ifdef UNICODE
  8784. typedef ICONMETRICSW ICONMETRICS;
  8785. typedef PICONMETRICSW PICONMETRICS;
  8786. typedef LPICONMETRICSW LPICONMETRICS;
  8787. #else
  8788. typedef ICONMETRICSA ICONMETRICS;
  8789. typedef PICONMETRICSA PICONMETRICS;
  8790. typedef LPICONMETRICSA LPICONMETRICS;
  8791. #endif // UNICODE
  8792. #endif /* NOGDI */
  8793. #endif /* _WINGDI_ */
  8794. typedef struct tagANIMATIONINFO
  8795. {
  8796. UINT cbSize;
  8797. int iMinAnimate;
  8798. } ANIMATIONINFO, *LPANIMATIONINFO;
  8799. typedef struct tagSERIALKEYSA
  8800. {
  8801. UINT cbSize;
  8802. DWORD dwFlags;
  8803. LPSTR lpszActivePort;
  8804. LPSTR lpszPort;
  8805. UINT iBaudRate;
  8806. UINT iPortState;
  8807. UINT iActive;
  8808. } SERIALKEYSA, *LPSERIALKEYSA;
  8809. typedef struct tagSERIALKEYSW
  8810. {
  8811. UINT cbSize;
  8812. DWORD dwFlags;
  8813. LPWSTR lpszActivePort;
  8814. LPWSTR lpszPort;
  8815. UINT iBaudRate;
  8816. UINT iPortState;
  8817. UINT iActive;
  8818. } SERIALKEYSW, *LPSERIALKEYSW;
  8819. #ifdef UNICODE
  8820. typedef SERIALKEYSW SERIALKEYS;
  8821. typedef LPSERIALKEYSW LPSERIALKEYS;
  8822. #else
  8823. typedef SERIALKEYSA SERIALKEYS;
  8824. typedef LPSERIALKEYSA LPSERIALKEYS;
  8825. #endif // UNICODE
  8826. /* flags for SERIALKEYS dwFlags field */
  8827. #define SERKF_SERIALKEYSON 0x00000001
  8828. #define SERKF_AVAILABLE 0x00000002
  8829. #define SERKF_INDICATOR 0x00000004
  8830. typedef struct tagHIGHCONTRASTA
  8831. {
  8832. UINT cbSize;
  8833. DWORD dwFlags;
  8834. LPSTR lpszDefaultScheme;
  8835. } HIGHCONTRASTA, *LPHIGHCONTRASTA;
  8836. typedef struct tagHIGHCONTRASTW
  8837. {
  8838. UINT cbSize;
  8839. DWORD dwFlags;
  8840. LPWSTR lpszDefaultScheme;
  8841. } HIGHCONTRASTW, *LPHIGHCONTRASTW;
  8842. #ifdef UNICODE
  8843. typedef HIGHCONTRASTW HIGHCONTRAST;
  8844. typedef LPHIGHCONTRASTW LPHIGHCONTRAST;
  8845. #else
  8846. typedef HIGHCONTRASTA HIGHCONTRAST;
  8847. typedef LPHIGHCONTRASTA LPHIGHCONTRAST;
  8848. #endif // UNICODE
  8849. /* flags for HIGHCONTRAST dwFlags field */
  8850. #define HCF_HIGHCONTRASTON 0x00000001
  8851. #define HCF_AVAILABLE 0x00000002
  8852. #define HCF_HOTKEYACTIVE 0x00000004
  8853. #define HCF_CONFIRMHOTKEY 0x00000008
  8854. #define HCF_HOTKEYSOUND 0x00000010
  8855. #define HCF_INDICATOR 0x00000020
  8856. #define HCF_HOTKEYAVAILABLE 0x00000040
  8857. /* Flags for ChangeDisplaySettings */
  8858. #define CDS_UPDATEREGISTRY 0x00000001
  8859. #define CDS_TEST 0x00000002
  8860. #define CDS_FULLSCREEN 0x00000004
  8861. #define CDS_GLOBAL 0x00000008
  8862. #define CDS_SET_PRIMARY 0x00000010
  8863. #define CDS_VIDEOPARAMETERS 0x00000020
  8864. #define CDS_RESET 0x40000000
  8865. #define CDS_NORESET 0x10000000
  8866. #include <tvout.h>
  8867. /* Return values for ChangeDisplaySettings */
  8868. #define DISP_CHANGE_SUCCESSFUL 0
  8869. #define DISP_CHANGE_RESTART 1
  8870. #define DISP_CHANGE_FAILED -1
  8871. #define DISP_CHANGE_BADMODE -2
  8872. #define DISP_CHANGE_NOTUPDATED -3
  8873. #define DISP_CHANGE_BADFLAGS -4
  8874. #define DISP_CHANGE_BADPARAM -5
  8875. #if(_WIN32_WINNT >= 0x0501)
  8876. #define DISP_CHANGE_BADDUALVIEW -6
  8877. #endif /* _WIN32_WINNT >= 0x0501 */
  8878. #ifdef _WINGDI_
  8879. #ifndef NOGDI
  8880. WINUSERAPI
  8881. LONG
  8882. WINAPI
  8883. ChangeDisplaySettingsA(
  8884. IN LPDEVMODEA lpDevMode,
  8885. IN DWORD dwFlags);
  8886. WINUSERAPI
  8887. LONG
  8888. WINAPI
  8889. ChangeDisplaySettingsW(
  8890. IN LPDEVMODEW lpDevMode,
  8891. IN DWORD dwFlags);
  8892. #ifdef UNICODE
  8893. #define ChangeDisplaySettings ChangeDisplaySettingsW
  8894. #else
  8895. #define ChangeDisplaySettings ChangeDisplaySettingsA
  8896. #endif // !UNICODE
  8897. WINUSERAPI
  8898. LONG
  8899. WINAPI
  8900. ChangeDisplaySettingsExA(
  8901. IN LPCSTR lpszDeviceName,
  8902. IN LPDEVMODEA lpDevMode,
  8903. IN HWND hwnd,
  8904. IN DWORD dwflags,
  8905. IN LPVOID lParam);
  8906. WINUSERAPI
  8907. LONG
  8908. WINAPI
  8909. ChangeDisplaySettingsExW(
  8910. IN LPCWSTR lpszDeviceName,
  8911. IN LPDEVMODEW lpDevMode,
  8912. IN HWND hwnd,
  8913. IN DWORD dwflags,
  8914. IN LPVOID lParam);
  8915. #ifdef UNICODE
  8916. #define ChangeDisplaySettingsEx ChangeDisplaySettingsExW
  8917. #else
  8918. #define ChangeDisplaySettingsEx ChangeDisplaySettingsExA
  8919. #endif // !UNICODE
  8920. #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
  8921. #define ENUM_REGISTRY_SETTINGS ((DWORD)-2)
  8922. WINUSERAPI
  8923. BOOL
  8924. WINAPI
  8925. EnumDisplaySettingsA(
  8926. IN LPCSTR lpszDeviceName,
  8927. IN DWORD iModeNum,
  8928. OUT LPDEVMODEA lpDevMode);
  8929. WINUSERAPI
  8930. BOOL
  8931. WINAPI
  8932. EnumDisplaySettingsW(
  8933. IN LPCWSTR lpszDeviceName,
  8934. IN DWORD iModeNum,
  8935. OUT LPDEVMODEW lpDevMode);
  8936. #ifdef UNICODE
  8937. #define EnumDisplaySettings EnumDisplaySettingsW
  8938. #else
  8939. #define EnumDisplaySettings EnumDisplaySettingsA
  8940. #endif // !UNICODE
  8941. #if(WINVER >= 0x0500)
  8942. WINUSERAPI
  8943. BOOL
  8944. WINAPI
  8945. EnumDisplaySettingsExA(
  8946. IN LPCSTR lpszDeviceName,
  8947. IN DWORD iModeNum,
  8948. OUT LPDEVMODEA lpDevMode,
  8949. IN DWORD dwFlags);
  8950. WINUSERAPI
  8951. BOOL
  8952. WINAPI
  8953. EnumDisplaySettingsExW(
  8954. IN LPCWSTR lpszDeviceName,
  8955. IN DWORD iModeNum,
  8956. OUT LPDEVMODEW lpDevMode,
  8957. IN DWORD dwFlags);
  8958. #ifdef UNICODE
  8959. #define EnumDisplaySettingsEx EnumDisplaySettingsExW
  8960. #else
  8961. #define EnumDisplaySettingsEx EnumDisplaySettingsExA
  8962. #endif // !UNICODE
  8963. /* Flags for EnumDisplaySettingsEx */
  8964. #define EDS_RAWMODE 0x00000002
  8965. WINUSERAPI
  8966. BOOL
  8967. WINAPI
  8968. EnumDisplayDevicesA(
  8969. IN LPCSTR lpDevice,
  8970. IN DWORD iDevNum,
  8971. OUT PDISPLAY_DEVICEA lpDisplayDevice,
  8972. IN DWORD dwFlags);
  8973. WINUSERAPI
  8974. BOOL
  8975. WINAPI
  8976. EnumDisplayDevicesW(
  8977. IN LPCWSTR lpDevice,
  8978. IN DWORD iDevNum,
  8979. OUT PDISPLAY_DEVICEW lpDisplayDevice,
  8980. IN DWORD dwFlags);
  8981. #ifdef UNICODE
  8982. #define EnumDisplayDevices EnumDisplayDevicesW
  8983. #else
  8984. #define EnumDisplayDevices EnumDisplayDevicesA
  8985. #endif // !UNICODE
  8986. #endif /* WINVER >= 0x0500 */
  8987. #endif /* NOGDI */
  8988. #endif /* _WINGDI_ */
  8989. WINUSERAPI
  8990. BOOL
  8991. WINAPI
  8992. SystemParametersInfoA(
  8993. IN UINT uiAction,
  8994. IN UINT uiParam,
  8995. IN OUT PVOID pvParam,
  8996. IN UINT fWinIni);
  8997. WINUSERAPI
  8998. BOOL
  8999. WINAPI
  9000. SystemParametersInfoW(
  9001. IN UINT uiAction,
  9002. IN UINT uiParam,
  9003. IN OUT PVOID pvParam,
  9004. IN UINT fWinIni);
  9005. #ifdef UNICODE
  9006. #define SystemParametersInfo SystemParametersInfoW
  9007. #else
  9008. #define SystemParametersInfo SystemParametersInfoA
  9009. #endif // !UNICODE
  9010. #endif /* !NOSYSPARAMSINFO */
  9011. /*
  9012. * Accessibility support
  9013. */
  9014. typedef struct tagFILTERKEYS
  9015. {
  9016. UINT cbSize;
  9017. DWORD dwFlags;
  9018. DWORD iWaitMSec; // Acceptance Delay
  9019. DWORD iDelayMSec; // Delay Until Repeat
  9020. DWORD iRepeatMSec; // Repeat Rate
  9021. DWORD iBounceMSec; // Debounce Time
  9022. } FILTERKEYS, *LPFILTERKEYS;
  9023. /*
  9024. * FILTERKEYS dwFlags field
  9025. */
  9026. #define FKF_FILTERKEYSON 0x00000001
  9027. #define FKF_AVAILABLE 0x00000002
  9028. #define FKF_HOTKEYACTIVE 0x00000004
  9029. #define FKF_CONFIRMHOTKEY 0x00000008
  9030. #define FKF_HOTKEYSOUND 0x00000010
  9031. #define FKF_INDICATOR 0x00000020
  9032. #define FKF_CLICKON 0x00000040
  9033. typedef struct tagSTICKYKEYS
  9034. {
  9035. UINT cbSize;
  9036. DWORD dwFlags;
  9037. } STICKYKEYS, *LPSTICKYKEYS;
  9038. /*
  9039. * STICKYKEYS dwFlags field
  9040. */
  9041. #define SKF_STICKYKEYSON 0x00000001
  9042. #define SKF_AVAILABLE 0x00000002
  9043. #define SKF_HOTKEYACTIVE 0x00000004
  9044. #define SKF_CONFIRMHOTKEY 0x00000008
  9045. #define SKF_HOTKEYSOUND 0x00000010
  9046. #define SKF_INDICATOR 0x00000020
  9047. #define SKF_AUDIBLEFEEDBACK 0x00000040
  9048. #define SKF_TRISTATE 0x00000080
  9049. #define SKF_TWOKEYSOFF 0x00000100
  9050. #if(_WIN32_WINNT >= 0x0500)
  9051. #define SKF_LALTLATCHED 0x10000000
  9052. #define SKF_LCTLLATCHED 0x04000000
  9053. #define SKF_LSHIFTLATCHED 0x01000000
  9054. #define SKF_RALTLATCHED 0x20000000
  9055. #define SKF_RCTLLATCHED 0x08000000
  9056. #define SKF_RSHIFTLATCHED 0x02000000
  9057. #define SKF_LWINLATCHED 0x40000000
  9058. #define SKF_RWINLATCHED 0x80000000
  9059. #define SKF_LALTLOCKED 0x00100000
  9060. #define SKF_LCTLLOCKED 0x00040000
  9061. #define SKF_LSHIFTLOCKED 0x00010000
  9062. #define SKF_RALTLOCKED 0x00200000
  9063. #define SKF_RCTLLOCKED 0x00080000
  9064. #define SKF_RSHIFTLOCKED 0x00020000
  9065. #define SKF_LWINLOCKED 0x00400000
  9066. #define SKF_RWINLOCKED 0x00800000
  9067. #endif /* _WIN32_WINNT >= 0x0500 */
  9068. typedef struct tagMOUSEKEYS
  9069. {
  9070. UINT cbSize;
  9071. DWORD dwFlags;
  9072. DWORD iMaxSpeed;
  9073. DWORD iTimeToMaxSpeed;
  9074. DWORD iCtrlSpeed;
  9075. DWORD dwReserved1;
  9076. DWORD dwReserved2;
  9077. } MOUSEKEYS, *LPMOUSEKEYS;
  9078. /*
  9079. * MOUSEKEYS dwFlags field
  9080. */
  9081. #define MKF_MOUSEKEYSON 0x00000001
  9082. #define MKF_AVAILABLE 0x00000002
  9083. #define MKF_HOTKEYACTIVE 0x00000004
  9084. #define MKF_CONFIRMHOTKEY 0x00000008
  9085. #define MKF_HOTKEYSOUND 0x00000010
  9086. #define MKF_INDICATOR 0x00000020
  9087. #define MKF_MODIFIERS 0x00000040
  9088. #define MKF_REPLACENUMBERS 0x00000080
  9089. #if(_WIN32_WINNT >= 0x0500)
  9090. #define MKF_LEFTBUTTONSEL 0x10000000
  9091. #define MKF_RIGHTBUTTONSEL 0x20000000
  9092. #define MKF_LEFTBUTTONDOWN 0x01000000
  9093. #define MKF_RIGHTBUTTONDOWN 0x02000000
  9094. #define MKF_MOUSEMODE 0x80000000
  9095. #endif /* _WIN32_WINNT >= 0x0500 */
  9096. typedef struct tagACCESSTIMEOUT
  9097. {
  9098. UINT cbSize;
  9099. DWORD dwFlags;
  9100. DWORD iTimeOutMSec;
  9101. } ACCESSTIMEOUT, *LPACCESSTIMEOUT;
  9102. /*
  9103. * ACCESSTIMEOUT dwFlags field
  9104. */
  9105. #define ATF_TIMEOUTON 0x00000001
  9106. #define ATF_ONOFFFEEDBACK 0x00000002
  9107. /* values for SOUNDSENTRY iFSGrafEffect field */
  9108. #define SSGF_NONE 0
  9109. #define SSGF_DISPLAY 3
  9110. /* values for SOUNDSENTRY iFSTextEffect field */
  9111. #define SSTF_NONE 0
  9112. #define SSTF_CHARS 1
  9113. #define SSTF_BORDER 2
  9114. #define SSTF_DISPLAY 3
  9115. /* values for SOUNDSENTRY iWindowsEffect field */
  9116. #define SSWF_NONE 0
  9117. #define SSWF_TITLE 1
  9118. #define SSWF_WINDOW 2
  9119. #define SSWF_DISPLAY 3
  9120. #define SSWF_CUSTOM 4
  9121. typedef struct tagSOUNDSENTRYA
  9122. {
  9123. UINT cbSize;
  9124. DWORD dwFlags;
  9125. DWORD iFSTextEffect;
  9126. DWORD iFSTextEffectMSec;
  9127. DWORD iFSTextEffectColorBits;
  9128. DWORD iFSGrafEffect;
  9129. DWORD iFSGrafEffectMSec;
  9130. DWORD iFSGrafEffectColor;
  9131. DWORD iWindowsEffect;
  9132. DWORD iWindowsEffectMSec;
  9133. LPSTR lpszWindowsEffectDLL;
  9134. DWORD iWindowsEffectOrdinal;
  9135. } SOUNDSENTRYA, *LPSOUNDSENTRYA;
  9136. typedef struct tagSOUNDSENTRYW
  9137. {
  9138. UINT cbSize;
  9139. DWORD dwFlags;
  9140. DWORD iFSTextEffect;
  9141. DWORD iFSTextEffectMSec;
  9142. DWORD iFSTextEffectColorBits;
  9143. DWORD iFSGrafEffect;
  9144. DWORD iFSGrafEffectMSec;
  9145. DWORD iFSGrafEffectColor;
  9146. DWORD iWindowsEffect;
  9147. DWORD iWindowsEffectMSec;
  9148. LPWSTR lpszWindowsEffectDLL;
  9149. DWORD iWindowsEffectOrdinal;
  9150. } SOUNDSENTRYW, *LPSOUNDSENTRYW;
  9151. #ifdef UNICODE
  9152. typedef SOUNDSENTRYW SOUNDSENTRY;
  9153. typedef LPSOUNDSENTRYW LPSOUNDSENTRY;
  9154. #else
  9155. typedef SOUNDSENTRYA SOUNDSENTRY;
  9156. typedef LPSOUNDSENTRYA LPSOUNDSENTRY;
  9157. #endif // UNICODE
  9158. /*
  9159. * SOUNDSENTRY dwFlags field
  9160. */
  9161. #define SSF_SOUNDSENTRYON 0x00000001
  9162. #define SSF_AVAILABLE 0x00000002
  9163. #define SSF_INDICATOR 0x00000004
  9164. typedef struct tagTOGGLEKEYS
  9165. {
  9166. UINT cbSize;
  9167. DWORD dwFlags;
  9168. } TOGGLEKEYS, *LPTOGGLEKEYS;
  9169. /*
  9170. * TOGGLEKEYS dwFlags field
  9171. */
  9172. #define TKF_TOGGLEKEYSON 0x00000001
  9173. #define TKF_AVAILABLE 0x00000002
  9174. #define TKF_HOTKEYACTIVE 0x00000004
  9175. #define TKF_CONFIRMHOTKEY 0x00000008
  9176. #define TKF_HOTKEYSOUND 0x00000010
  9177. #define TKF_INDICATOR 0x00000020
  9178. /*
  9179. * Set debug level
  9180. */
  9181. WINUSERAPI
  9182. VOID
  9183. WINAPI
  9184. SetDebugErrorLevel(
  9185. IN DWORD dwLevel
  9186. );
  9187. /*
  9188. * SetLastErrorEx() types.
  9189. */
  9190. #define SLE_ERROR 0x00000001
  9191. #define SLE_MINORERROR 0x00000002
  9192. #define SLE_WARNING 0x00000003
  9193. WINUSERAPI
  9194. VOID
  9195. WINAPI
  9196. SetLastErrorEx(
  9197. IN DWORD dwErrCode,
  9198. IN DWORD dwType
  9199. );
  9200. WINUSERAPI
  9201. int
  9202. WINAPI
  9203. InternalGetWindowText(
  9204. IN HWND hWnd,
  9205. OUT LPWSTR lpString,
  9206. IN int nMaxCount);
  9207. #if defined(WINNT)
  9208. WINUSERAPI
  9209. BOOL
  9210. WINAPI
  9211. EndTask(
  9212. IN HWND hWnd,
  9213. IN BOOL fShutDown,
  9214. IN BOOL fForce);
  9215. #endif
  9216. #if(WINVER >= 0x0500)
  9217. /*
  9218. * Multimonitor API.
  9219. */
  9220. #define MONITOR_DEFAULTTONULL 0x00000000
  9221. #define MONITOR_DEFAULTTOPRIMARY 0x00000001
  9222. #define MONITOR_DEFAULTTONEAREST 0x00000002
  9223. WINUSERAPI
  9224. HMONITOR
  9225. WINAPI
  9226. MonitorFromPoint(
  9227. IN POINT pt,
  9228. IN DWORD dwFlags);
  9229. WINUSERAPI
  9230. HMONITOR
  9231. WINAPI
  9232. MonitorFromRect(
  9233. IN LPCRECT lprc,
  9234. IN DWORD dwFlags);
  9235. WINUSERAPI
  9236. HMONITOR
  9237. WINAPI
  9238. MonitorFromWindow( IN HWND hwnd, IN DWORD dwFlags);
  9239. #define MONITORINFOF_PRIMARY 0x00000001
  9240. #ifndef CCHDEVICENAME
  9241. #define CCHDEVICENAME 32
  9242. #endif
  9243. typedef struct tagMONITORINFO
  9244. {
  9245. DWORD cbSize;
  9246. RECT rcMonitor;
  9247. RECT rcWork;
  9248. DWORD dwFlags;
  9249. } MONITORINFO, *LPMONITORINFO;
  9250. #ifdef __cplusplus
  9251. typedef struct tagMONITORINFOEXA : public tagMONITORINFO
  9252. {
  9253. CHAR szDevice[CCHDEVICENAME];
  9254. } MONITORINFOEXA, *LPMONITORINFOEXA;
  9255. typedef struct tagMONITORINFOEXW : public tagMONITORINFO
  9256. {
  9257. WCHAR szDevice[CCHDEVICENAME];
  9258. } MONITORINFOEXW, *LPMONITORINFOEXW;
  9259. #ifdef UNICODE
  9260. typedef MONITORINFOEXW MONITORINFOEX;
  9261. typedef LPMONITORINFOEXW LPMONITORINFOEX;
  9262. #else
  9263. typedef MONITORINFOEXA MONITORINFOEX;
  9264. typedef LPMONITORINFOEXA LPMONITORINFOEX;
  9265. #endif // UNICODE
  9266. #else // ndef __cplusplus
  9267. typedef struct tagMONITORINFOEXA
  9268. {
  9269. MONITORINFO;
  9270. CHAR szDevice[CCHDEVICENAME];
  9271. } MONITORINFOEXA, *LPMONITORINFOEXA;
  9272. typedef struct tagMONITORINFOEXW
  9273. {
  9274. MONITORINFO;
  9275. WCHAR szDevice[CCHDEVICENAME];
  9276. } MONITORINFOEXW, *LPMONITORINFOEXW;
  9277. #ifdef UNICODE
  9278. typedef MONITORINFOEXW MONITORINFOEX;
  9279. typedef LPMONITORINFOEXW LPMONITORINFOEX;
  9280. #else
  9281. typedef MONITORINFOEXA MONITORINFOEX;
  9282. typedef LPMONITORINFOEXA LPMONITORINFOEX;
  9283. #endif // UNICODE
  9284. #endif
  9285. WINUSERAPI BOOL WINAPI GetMonitorInfoA( IN HMONITOR hMonitor, OUT LPMONITORINFO lpmi);
  9286. WINUSERAPI BOOL WINAPI GetMonitorInfoW( IN HMONITOR hMonitor, OUT LPMONITORINFO lpmi);
  9287. #ifdef UNICODE
  9288. #define GetMonitorInfo GetMonitorInfoW
  9289. #else
  9290. #define GetMonitorInfo GetMonitorInfoA
  9291. #endif // !UNICODE
  9292. typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
  9293. WINUSERAPI
  9294. BOOL
  9295. WINAPI
  9296. EnumDisplayMonitors(
  9297. IN HDC hdc,
  9298. IN LPCRECT lprcClip,
  9299. IN MONITORENUMPROC lpfnEnum,
  9300. IN LPARAM dwData);
  9301. #ifndef NOWINABLE
  9302. /*
  9303. * WinEvents - Active Accessibility hooks
  9304. */
  9305. WINUSERAPI
  9306. VOID
  9307. WINAPI
  9308. NotifyWinEvent(
  9309. IN DWORD event,
  9310. IN HWND hwnd,
  9311. IN LONG idObject,
  9312. IN LONG idChild);
  9313. typedef VOID (CALLBACK* WINEVENTPROC)(
  9314. HWINEVENTHOOK hWinEventHook,
  9315. DWORD event,
  9316. HWND hwnd,
  9317. LONG idObject,
  9318. LONG idChild,
  9319. DWORD idEventThread,
  9320. DWORD dwmsEventTime);
  9321. WINUSERAPI
  9322. HWINEVENTHOOK
  9323. WINAPI
  9324. SetWinEventHook(
  9325. IN DWORD eventMin,
  9326. IN DWORD eventMax,
  9327. IN HMODULE hmodWinEventProc,
  9328. IN WINEVENTPROC pfnWinEventProc,
  9329. IN DWORD idProcess,
  9330. IN DWORD idThread,
  9331. IN DWORD dwFlags);
  9332. #if(_WIN32_WINNT >= 0x0501)
  9333. WINUSERAPI
  9334. BOOL
  9335. WINAPI
  9336. IsWinEventHookInstalled(
  9337. IN DWORD event);
  9338. #endif /* _WIN32_WINNT >= 0x0501 */
  9339. /*
  9340. * dwFlags for SetWinEventHook
  9341. */
  9342. #define WINEVENT_OUTOFCONTEXT 0x0000 // Events are ASYNC
  9343. #define WINEVENT_SKIPOWNTHREAD 0x0001 // Don't call back for events on installer's thread
  9344. #define WINEVENT_SKIPOWNPROCESS 0x0002 // Don't call back for events on installer's process
  9345. #define WINEVENT_INCONTEXT 0x0004 // Events are SYNC, this causes your dll to be injected into every process
  9346. WINUSERAPI
  9347. BOOL
  9348. WINAPI
  9349. UnhookWinEvent(
  9350. IN HWINEVENTHOOK hWinEventHook);
  9351. /*
  9352. * idObject values for WinEventProc and NotifyWinEvent
  9353. */
  9354. /*
  9355. * hwnd + idObject can be used with OLEACC.DLL's OleGetObjectFromWindow()
  9356. * to get an interface pointer to the container. indexChild is the item
  9357. * within the container in question. Setup a VARIANT with vt VT_I4 and
  9358. * lVal the indexChild and pass that in to all methods. Then you
  9359. * are raring to go.
  9360. */
  9361. /*
  9362. * Common object IDs (cookies, only for sending WM_GETOBJECT to get at the
  9363. * thing in question). Positive IDs are reserved for apps (app specific),
  9364. * negative IDs are system things and are global, 0 means "just little old
  9365. * me".
  9366. */
  9367. #define CHILDID_SELF 0
  9368. #define INDEXID_OBJECT 0
  9369. #define INDEXID_CONTAINER 0
  9370. /*
  9371. * Reserved IDs for system objects
  9372. */
  9373. #define OBJID_WINDOW ((LONG)0x00000000)
  9374. #define OBJID_SYSMENU ((LONG)0xFFFFFFFF)
  9375. #define OBJID_TITLEBAR ((LONG)0xFFFFFFFE)
  9376. #define OBJID_MENU ((LONG)0xFFFFFFFD)
  9377. #define OBJID_CLIENT ((LONG)0xFFFFFFFC)
  9378. #define OBJID_VSCROLL ((LONG)0xFFFFFFFB)
  9379. #define OBJID_HSCROLL ((LONG)0xFFFFFFFA)
  9380. #define OBJID_SIZEGRIP ((LONG)0xFFFFFFF9)
  9381. #define OBJID_CARET ((LONG)0xFFFFFFF8)
  9382. #define OBJID_CURSOR ((LONG)0xFFFFFFF7)
  9383. #define OBJID_ALERT ((LONG)0xFFFFFFF6)
  9384. #define OBJID_SOUND ((LONG)0xFFFFFFF5)
  9385. #define OBJID_QUERYCLASSNAMEIDX ((LONG)0xFFFFFFF4)
  9386. #define OBJID_NATIVEOM ((LONG)0xFFFFFFF0)
  9387. /*
  9388. * EVENT DEFINITION
  9389. */
  9390. #define EVENT_MIN 0x00000001
  9391. #define EVENT_MAX 0x7FFFFFFF
  9392. /*
  9393. * EVENT_SYSTEM_SOUND
  9394. * Sent when a sound is played. Currently nothing is generating this, we
  9395. * this event when a system sound (for menus, etc) is played. Apps
  9396. * generate this, if accessible, when a private sound is played. For
  9397. * example, if Mail plays a "New Mail" sound.
  9398. *
  9399. * System Sounds:
  9400. * (Generated by PlaySoundEvent in USER itself)
  9401. * hwnd is NULL
  9402. * idObject is OBJID_SOUND
  9403. * idChild is sound child ID if one
  9404. * App Sounds:
  9405. * (PlaySoundEvent won't generate notification; up to app)
  9406. * hwnd + idObject gets interface pointer to Sound object
  9407. * idChild identifies the sound in question
  9408. * are going to be cleaning up the SOUNDSENTRY feature in the control panel
  9409. * and will use this at that time. Applications implementing WinEvents
  9410. * are perfectly welcome to use it. Clients of IAccessible* will simply
  9411. * turn around and get back a non-visual object that describes the sound.
  9412. */
  9413. #define EVENT_SYSTEM_SOUND 0x0001
  9414. /*
  9415. * EVENT_SYSTEM_ALERT
  9416. * System Alerts:
  9417. * (Generated by MessageBox() calls for example)
  9418. * hwnd is hwndMessageBox
  9419. * idObject is OBJID_ALERT
  9420. * App Alerts:
  9421. * (Generated whenever)
  9422. * hwnd+idObject gets interface pointer to Alert
  9423. */
  9424. #define EVENT_SYSTEM_ALERT 0x0002
  9425. /*
  9426. * EVENT_SYSTEM_FOREGROUND
  9427. * Sent when the foreground (active) window changes, even if it is changing
  9428. * to another window in the same thread as the previous one.
  9429. * hwnd is hwndNewForeground
  9430. * idObject is OBJID_WINDOW
  9431. * idChild is INDEXID_OBJECT
  9432. */
  9433. #define EVENT_SYSTEM_FOREGROUND 0x0003
  9434. /*
  9435. * Menu
  9436. * hwnd is window (top level window or popup menu window)
  9437. * idObject is ID of control (OBJID_MENU, OBJID_SYSMENU, OBJID_SELF for popup)
  9438. * idChild is CHILDID_SELF
  9439. *
  9440. * EVENT_SYSTEM_MENUSTART
  9441. * EVENT_SYSTEM_MENUEND
  9442. * For MENUSTART, hwnd+idObject+idChild refers to the control with the menu bar,
  9443. * or the control bringing up the context menu.
  9444. *
  9445. * Sent when entering into and leaving from menu mode (system, app bar, and
  9446. * track popups).
  9447. */
  9448. #define EVENT_SYSTEM_MENUSTART 0x0004
  9449. #define EVENT_SYSTEM_MENUEND 0x0005
  9450. /*
  9451. * EVENT_SYSTEM_MENUPOPUPSTART
  9452. * EVENT_SYSTEM_MENUPOPUPEND
  9453. * Sent when a menu popup comes up and just before it is taken down. Note
  9454. * that for a call to TrackPopupMenu(), a client will see EVENT_SYSTEM_MENUSTART
  9455. * followed almost immediately by EVENT_SYSTEM_MENUPOPUPSTART for the popup
  9456. * being shown.
  9457. *
  9458. * For MENUPOPUP, hwnd+idObject+idChild refers to the NEW popup coming up, not the
  9459. * parent item which is hierarchical. You can get the parent menu/popup by
  9460. * asking for the accParent object.
  9461. */
  9462. #define EVENT_SYSTEM_MENUPOPUPSTART 0x0006
  9463. #define EVENT_SYSTEM_MENUPOPUPEND 0x0007
  9464. /*
  9465. * EVENT_SYSTEM_CAPTURESTART
  9466. * EVENT_SYSTEM_CAPTUREEND
  9467. * Sent when a window takes the capture and releases the capture.
  9468. */
  9469. #define EVENT_SYSTEM_CAPTURESTART 0x0008
  9470. #define EVENT_SYSTEM_CAPTUREEND 0x0009
  9471. /*
  9472. * Move Size
  9473. * EVENT_SYSTEM_MOVESIZESTART
  9474. * EVENT_SYSTEM_MOVESIZEEND
  9475. * Sent when a window enters and leaves move-size dragging mode.
  9476. */
  9477. #define EVENT_SYSTEM_MOVESIZESTART 0x000A
  9478. #define EVENT_SYSTEM_MOVESIZEEND 0x000B
  9479. /*
  9480. * Context Help
  9481. * EVENT_SYSTEM_CONTEXTHELPSTART
  9482. * EVENT_SYSTEM_CONTEXTHELPEND
  9483. * Sent when a window enters and leaves context sensitive help mode.
  9484. */
  9485. #define EVENT_SYSTEM_CONTEXTHELPSTART 0x000C
  9486. #define EVENT_SYSTEM_CONTEXTHELPEND 0x000D
  9487. /*
  9488. * Drag & Drop
  9489. * EVENT_SYSTEM_DRAGDROPSTART
  9490. * EVENT_SYSTEM_DRAGDROPEND
  9491. * Send the START notification just before going into drag&drop loop. Send
  9492. * the END notification just after canceling out.
  9493. * Note that it is up to apps and OLE to generate this, since the system
  9494. * doesn't know. Like EVENT_SYSTEM_SOUND, it will be a while before this
  9495. * is prevalent.
  9496. */
  9497. #define EVENT_SYSTEM_DRAGDROPSTART 0x000E
  9498. #define EVENT_SYSTEM_DRAGDROPEND 0x000F
  9499. /*
  9500. * Dialog
  9501. * Send the START notification right after the dialog is completely
  9502. * initialized and visible. Send the END right before the dialog
  9503. * is hidden and goes away.
  9504. * EVENT_SYSTEM_DIALOGSTART
  9505. * EVENT_SYSTEM_DIALOGEND
  9506. */
  9507. #define EVENT_SYSTEM_DIALOGSTART 0x0010
  9508. #define EVENT_SYSTEM_DIALOGEND 0x0011
  9509. /*
  9510. * EVENT_SYSTEM_SCROLLING
  9511. * EVENT_SYSTEM_SCROLLINGSTART
  9512. * EVENT_SYSTEM_SCROLLINGEND
  9513. * Sent when beginning and ending the tracking of a scrollbar in a window,
  9514. * and also for scrollbar controls.
  9515. */
  9516. #define EVENT_SYSTEM_SCROLLINGSTART 0x0012
  9517. #define EVENT_SYSTEM_SCROLLINGEND 0x0013
  9518. /*
  9519. * Alt-Tab Window
  9520. * Send the START notification right after the switch window is initialized
  9521. * and visible. Send the END right before it is hidden and goes away.
  9522. * EVENT_SYSTEM_SWITCHSTART
  9523. * EVENT_SYSTEM_SWITCHEND
  9524. */
  9525. #define EVENT_SYSTEM_SWITCHSTART 0x0014
  9526. #define EVENT_SYSTEM_SWITCHEND 0x0015
  9527. /*
  9528. * EVENT_SYSTEM_MINIMIZESTART
  9529. * EVENT_SYSTEM_MINIMIZEEND
  9530. * Sent when a window minimizes and just before it restores.
  9531. */
  9532. #define EVENT_SYSTEM_MINIMIZESTART 0x0016
  9533. #define EVENT_SYSTEM_MINIMIZEEND 0x0017
  9534. #if(_WIN32_WINNT >= 0x0501)
  9535. #define EVENT_CONSOLE_CARET 0x4001
  9536. #define EVENT_CONSOLE_UPDATE_REGION 0x4002
  9537. #define EVENT_CONSOLE_UPDATE_SIMPLE 0x4003
  9538. #define EVENT_CONSOLE_UPDATE_SCROLL 0x4004
  9539. #define EVENT_CONSOLE_LAYOUT 0x4005
  9540. #define EVENT_CONSOLE_START_APPLICATION 0x4006
  9541. #define EVENT_CONSOLE_END_APPLICATION 0x4007
  9542. /*
  9543. * Flags for EVENT_CONSOLE_START/END_APPLICATION.
  9544. */
  9545. #define CONSOLE_APPLICATION_16BIT 0x0001
  9546. /*
  9547. * Flags for EVENT_CONSOLE_CARET
  9548. */
  9549. #define CONSOLE_CARET_SELECTION 0x0001
  9550. #define CONSOLE_CARET_VISIBLE 0x0002
  9551. #endif /* _WIN32_WINNT >= 0x0501 */
  9552. /*
  9553. * Object events
  9554. *
  9555. * The system AND apps generate these. The system generates these for
  9556. * real windows. Apps generate these for objects within their window which
  9557. * act like a separate control, e.g. an item in a list view.
  9558. *
  9559. * When the system generate them, dwParam2 is always WMOBJID_SELF. When
  9560. * apps generate them, apps put the has-meaning-to-the-app-only ID value
  9561. * in dwParam2.
  9562. * For all events, if you want detailed accessibility information, callers
  9563. * should
  9564. * * Call AccessibleObjectFromWindow() with the hwnd, idObject parameters
  9565. * of the event, and IID_IAccessible as the REFIID, to get back an
  9566. * IAccessible* to talk to
  9567. * * Initialize and fill in a VARIANT as VT_I4 with lVal the idChild
  9568. * parameter of the event.
  9569. * * If idChild isn't zero, call get_accChild() in the container to see
  9570. * if the child is an object in its own right. If so, you will get
  9571. * back an IDispatch* object for the child. You should release the
  9572. * parent, and call QueryInterface() on the child object to get its
  9573. * IAccessible*. Then you talk directly to the child. Otherwise,
  9574. * if get_accChild() returns you nothing, you should continue to
  9575. * use the child VARIANT. You will ask the container for the properties
  9576. * of the child identified by the VARIANT. In other words, the
  9577. * child in this case is accessible but not a full-blown object.
  9578. * Like a button on a titlebar which is 'small' and has no children.
  9579. */
  9580. /*
  9581. * For all EVENT_OBJECT events,
  9582. * hwnd is the dude to Send the WM_GETOBJECT message to (unless NULL,
  9583. * see above for system things)
  9584. * idObject is the ID of the object that can resolve any queries a
  9585. * client might have. It's a way to deal with windowless controls,
  9586. * controls that are just drawn on the screen in some larger parent
  9587. * window (like SDM), or standard frame elements of a window.
  9588. * idChild is the piece inside of the object that is affected. This
  9589. * allows clients to access things that are too small to have full
  9590. * blown objects in their own right. Like the thumb of a scrollbar.
  9591. * The hwnd/idObject pair gets you to the container, the dude you
  9592. * probably want to talk to most of the time anyway. The idChild
  9593. * can then be passed into the acc properties to get the name/value
  9594. * of it as needed.
  9595. *
  9596. * Example #1:
  9597. * System propagating a listbox selection change
  9598. * EVENT_OBJECT_SELECTION
  9599. * hwnd == listbox hwnd
  9600. * idObject == OBJID_WINDOW
  9601. * idChild == new selected item, or CHILDID_SELF if
  9602. * nothing now selected within container.
  9603. * Word '97 propagating a listbox selection change
  9604. * hwnd == SDM window
  9605. * idObject == SDM ID to get at listbox 'control'
  9606. * idChild == new selected item, or CHILDID_SELF if
  9607. * nothing
  9608. *
  9609. * Example #2:
  9610. * System propagating a menu item selection on the menu bar
  9611. * EVENT_OBJECT_SELECTION
  9612. * hwnd == top level window
  9613. * idObject == OBJID_MENU
  9614. * idChild == ID of child menu bar item selected
  9615. *
  9616. * Example #3:
  9617. * System propagating a dropdown coming off of said menu bar item
  9618. * EVENT_OBJECT_CREATE
  9619. * hwnd == popup item
  9620. * idObject == OBJID_WINDOW
  9621. * idChild == CHILDID_SELF
  9622. *
  9623. * Example #4:
  9624. *
  9625. * For EVENT_OBJECT_REORDER, the object referred to by hwnd/idObject is the
  9626. * PARENT container in which the zorder is occurring. This is because if
  9627. * one child is zordering, all of them are changing their relative zorder.
  9628. */
  9629. #define EVENT_OBJECT_CREATE 0x8000 // hwnd + ID + idChild is created item
  9630. #define EVENT_OBJECT_DESTROY 0x8001 // hwnd + ID + idChild is destroyed item
  9631. #define EVENT_OBJECT_SHOW 0x8002 // hwnd + ID + idChild is shown item
  9632. #define EVENT_OBJECT_HIDE 0x8003 // hwnd + ID + idChild is hidden item
  9633. #define EVENT_OBJECT_REORDER 0x8004 // hwnd + ID + idChild is parent of zordering children
  9634. /*
  9635. * NOTE:
  9636. * Minimize the number of notifications!
  9637. *
  9638. * When you are hiding a parent object, obviously all child objects are no
  9639. * longer visible on screen. They still have the same "visible" status,
  9640. * but are not truly visible. Hence do not send HIDE notifications for the
  9641. * children also. One implies all. The same goes for SHOW.
  9642. */
  9643. #define EVENT_OBJECT_FOCUS 0x8005 // hwnd + ID + idChild is focused item
  9644. #define EVENT_OBJECT_SELECTION 0x8006 // hwnd + ID + idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
  9645. #define EVENT_OBJECT_SELECTIONADD 0x8007 // hwnd + ID + idChild is item added
  9646. #define EVENT_OBJECT_SELECTIONREMOVE 0x8008 // hwnd + ID + idChild is item removed
  9647. #define EVENT_OBJECT_SELECTIONWITHIN 0x8009 // hwnd + ID + idChild is parent of changed selected items
  9648. /*
  9649. * NOTES:
  9650. * There is only one "focused" child item in a parent. This is the place
  9651. * keystrokes are going at a given moment. Hence only send a notification
  9652. * about where the NEW focus is going. A NEW item getting the focus already
  9653. * implies that the OLD item is losing it.
  9654. *
  9655. * SELECTION however can be multiple. Hence the different SELECTION
  9656. * notifications. Here's when to use each:
  9657. *
  9658. * (1) Send a SELECTION notification in the simple single selection
  9659. * case (like the focus) when the item with the selection is
  9660. * merely moving to a different item within a container. hwnd + ID
  9661. * is the container control, idChildItem is the new child with the
  9662. * selection.
  9663. *
  9664. * (2) Send a SELECTIONADD notification when a new item has simply been added
  9665. * to the selection within a container. This is appropriate when the
  9666. * number of newly selected items is very small. hwnd + ID is the
  9667. * container control, idChildItem is the new child added to the selection.
  9668. *
  9669. * (3) Send a SELECTIONREMOVE notification when a new item has simply been
  9670. * removed from the selection within a container. This is appropriate
  9671. * when the number of newly selected items is very small, just like
  9672. * SELECTIONADD. hwnd + ID is the container control, idChildItem is the
  9673. * new child removed from the selection.
  9674. *
  9675. * (4) Send a SELECTIONWITHIN notification when the selected items within a
  9676. * control have changed substantially. Rather than propagate a large
  9677. * number of changes to reflect removal for some items, addition of
  9678. * others, just tell somebody who cares that a lot happened. It will
  9679. * be faster an easier for somebody watching to just turn around and
  9680. * query the container control what the new bunch of selected items
  9681. * are.
  9682. */
  9683. #define EVENT_OBJECT_STATECHANGE 0x800A // hwnd + ID + idChild is item w/ state change
  9684. /*
  9685. * Examples of when to send an EVENT_OBJECT_STATECHANGE include
  9686. * * It is being enabled/disabled (USER does for windows)
  9687. * * It is being pressed/released (USER does for buttons)
  9688. * * It is being checked/unchecked (USER does for radio/check buttons)
  9689. */
  9690. #define EVENT_OBJECT_LOCATIONCHANGE 0x800B // hwnd + ID + idChild is moved/sized item
  9691. /*
  9692. * Note:
  9693. * A LOCATIONCHANGE is not sent for every child object when the parent
  9694. * changes shape/moves. Send one notification for the topmost object
  9695. * that is changing. For example, if the user resizes a top level window,
  9696. * USER will generate a LOCATIONCHANGE for it, but not for the menu bar,
  9697. * title bar, scrollbars, etc. that are also changing shape/moving.
  9698. *
  9699. * In other words, it only generates LOCATIONCHANGE notifications for
  9700. * real windows that are moving/sizing. It will not generate a LOCATIONCHANGE
  9701. * for every non-floating child window when the parent moves (the children are
  9702. * logically moving also on screen, but not relative to the parent).
  9703. *
  9704. * Now, if the app itself resizes child windows as a result of being
  9705. * sized, USER will generate LOCATIONCHANGEs for those dudes also because
  9706. * it doesn't know better.
  9707. *
  9708. * Note also that USER will generate LOCATIONCHANGE notifications for two
  9709. * non-window sys objects:
  9710. * (1) System caret
  9711. * (2) Cursor
  9712. */
  9713. #define EVENT_OBJECT_NAMECHANGE 0x800C // hwnd + ID + idChild is item w/ name change
  9714. #define EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D // hwnd + ID + idChild is item w/ desc change
  9715. #define EVENT_OBJECT_VALUECHANGE 0x800E // hwnd + ID + idChild is item w/ value change
  9716. #define EVENT_OBJECT_PARENTCHANGE 0x800F // hwnd + ID + idChild is item w/ new parent
  9717. #define EVENT_OBJECT_HELPCHANGE 0x8010 // hwnd + ID + idChild is item w/ help change
  9718. #define EVENT_OBJECT_DEFACTIONCHANGE 0x8011 // hwnd + ID + idChild is item w/ def action change
  9719. #define EVENT_OBJECT_ACCELERATORCHANGE 0x8012 // hwnd + ID + idChild is item w/ keybd accel change
  9720. /*
  9721. * Child IDs
  9722. */
  9723. /*
  9724. * System Sounds (idChild of system SOUND notification)
  9725. */
  9726. #define SOUND_SYSTEM_STARTUP 1
  9727. #define SOUND_SYSTEM_SHUTDOWN 2
  9728. #define SOUND_SYSTEM_BEEP 3
  9729. #define SOUND_SYSTEM_ERROR 4
  9730. #define SOUND_SYSTEM_QUESTION 5
  9731. #define SOUND_SYSTEM_WARNING 6
  9732. #define SOUND_SYSTEM_INFORMATION 7
  9733. #define SOUND_SYSTEM_MAXIMIZE 8
  9734. #define SOUND_SYSTEM_MINIMIZE 9
  9735. #define SOUND_SYSTEM_RESTOREUP 10
  9736. #define SOUND_SYSTEM_RESTOREDOWN 11
  9737. #define SOUND_SYSTEM_APPSTART 12
  9738. #define SOUND_SYSTEM_FAULT 13
  9739. #define SOUND_SYSTEM_APPEND 14
  9740. #define SOUND_SYSTEM_MENUCOMMAND 15
  9741. #define SOUND_SYSTEM_MENUPOPUP 16
  9742. #define CSOUND_SYSTEM 16
  9743. /*
  9744. * System Alerts (indexChild of system ALERT notification)
  9745. */
  9746. #define ALERT_SYSTEM_INFORMATIONAL 1 // MB_INFORMATION
  9747. #define ALERT_SYSTEM_WARNING 2 // MB_WARNING
  9748. #define ALERT_SYSTEM_ERROR 3 // MB_ERROR
  9749. #define ALERT_SYSTEM_QUERY 4 // MB_QUESTION
  9750. #define ALERT_SYSTEM_CRITICAL 5 // HardSysErrBox
  9751. #define CALERT_SYSTEM 6
  9752. typedef struct tagGUITHREADINFO
  9753. {
  9754. DWORD cbSize;
  9755. DWORD flags;
  9756. HWND hwndActive;
  9757. HWND hwndFocus;
  9758. HWND hwndCapture;
  9759. HWND hwndMenuOwner;
  9760. HWND hwndMoveSize;
  9761. HWND hwndCaret;
  9762. RECT rcCaret;
  9763. } GUITHREADINFO, *PGUITHREADINFO, FAR * LPGUITHREADINFO;
  9764. #define GUI_CARETBLINKING 0x00000001
  9765. #define GUI_INMOVESIZE 0x00000002
  9766. #define GUI_INMENUMODE 0x00000004
  9767. #define GUI_SYSTEMMENUMODE 0x00000008
  9768. #define GUI_POPUPMENUMODE 0x00000010
  9769. #if(_WIN32_WINNT >= 0x0501)
  9770. #define GUI_16BITTASK 0x00000020
  9771. #endif /* _WIN32_WINNT >= 0x0501 */
  9772. WINUSERAPI
  9773. BOOL
  9774. WINAPI
  9775. GetGUIThreadInfo(
  9776. IN DWORD idThread,
  9777. OUT PGUITHREADINFO pgui);
  9778. WINUSERAPI
  9779. UINT
  9780. WINAPI
  9781. GetWindowModuleFileNameA(
  9782. IN HWND hwnd,
  9783. OUT LPSTR pszFileName,
  9784. IN UINT cchFileNameMax);
  9785. WINUSERAPI
  9786. UINT
  9787. WINAPI
  9788. GetWindowModuleFileNameW(
  9789. IN HWND hwnd,
  9790. OUT LPWSTR pszFileName,
  9791. IN UINT cchFileNameMax);
  9792. #ifdef UNICODE
  9793. #define GetWindowModuleFileName GetWindowModuleFileNameW
  9794. #else
  9795. #define GetWindowModuleFileName GetWindowModuleFileNameA
  9796. #endif // !UNICODE
  9797. #ifndef NO_STATE_FLAGS
  9798. #define STATE_SYSTEM_UNAVAILABLE 0x00000001 // Disabled
  9799. #define STATE_SYSTEM_SELECTED 0x00000002
  9800. #define STATE_SYSTEM_FOCUSED 0x00000004
  9801. #define STATE_SYSTEM_PRESSED 0x00000008
  9802. #define STATE_SYSTEM_CHECKED 0x00000010
  9803. #define STATE_SYSTEM_MIXED 0x00000020 // 3-state checkbox or toolbar button
  9804. #define STATE_SYSTEM_INDETERMINATE STATE_SYSTEM_MIXED
  9805. #define STATE_SYSTEM_READONLY 0x00000040
  9806. #define STATE_SYSTEM_HOTTRACKED 0x00000080
  9807. #define STATE_SYSTEM_DEFAULT 0x00000100
  9808. #define STATE_SYSTEM_EXPANDED 0x00000200
  9809. #define STATE_SYSTEM_COLLAPSED 0x00000400
  9810. #define STATE_SYSTEM_BUSY 0x00000800
  9811. #define STATE_SYSTEM_FLOATING 0x00001000 // Children "owned" not "contained" by parent
  9812. #define STATE_SYSTEM_MARQUEED 0x00002000
  9813. #define STATE_SYSTEM_ANIMATED 0x00004000
  9814. #define STATE_SYSTEM_INVISIBLE 0x00008000
  9815. #define STATE_SYSTEM_OFFSCREEN 0x00010000
  9816. #define STATE_SYSTEM_SIZEABLE 0x00020000
  9817. #define STATE_SYSTEM_MOVEABLE 0x00040000
  9818. #define STATE_SYSTEM_SELFVOICING 0x00080000
  9819. #define STATE_SYSTEM_FOCUSABLE 0x00100000
  9820. #define STATE_SYSTEM_SELECTABLE 0x00200000
  9821. #define STATE_SYSTEM_LINKED 0x00400000
  9822. #define STATE_SYSTEM_TRAVERSED 0x00800000
  9823. #define STATE_SYSTEM_MULTISELECTABLE 0x01000000 // Supports multiple selection
  9824. #define STATE_SYSTEM_EXTSELECTABLE 0x02000000 // Supports extended selection
  9825. #define STATE_SYSTEM_ALERT_LOW 0x04000000 // This information is of low priority
  9826. #define STATE_SYSTEM_ALERT_MEDIUM 0x08000000 // This information is of medium priority
  9827. #define STATE_SYSTEM_ALERT_HIGH 0x10000000 // This information is of high priority
  9828. #define STATE_SYSTEM_PROTECTED 0x20000000 // access to this is restricted
  9829. #define STATE_SYSTEM_VALID 0x3FFFFFFF
  9830. #endif
  9831. #define CCHILDREN_TITLEBAR 5
  9832. #define CCHILDREN_SCROLLBAR 5
  9833. /*
  9834. * Information about the global cursor.
  9835. */
  9836. typedef struct tagCURSORINFO
  9837. {
  9838. DWORD cbSize;
  9839. DWORD flags;
  9840. HCURSOR hCursor;
  9841. POINT ptScreenPos;
  9842. } CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
  9843. #define CURSOR_SHOWING 0x00000001
  9844. WINUSERAPI
  9845. BOOL
  9846. WINAPI
  9847. GetCursorInfo(
  9848. OUT PCURSORINFO pci
  9849. );
  9850. /*
  9851. * Window information snapshot
  9852. */
  9853. typedef struct tagWINDOWINFO
  9854. {
  9855. DWORD cbSize;
  9856. RECT rcWindow;
  9857. RECT rcClient;
  9858. DWORD dwStyle;
  9859. DWORD dwExStyle;
  9860. DWORD dwWindowStatus;
  9861. UINT cxWindowBorders;
  9862. UINT cyWindowBorders;
  9863. ATOM atomWindowType;
  9864. WORD wCreatorVersion;
  9865. } WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO;
  9866. #define WS_ACTIVECAPTION 0x0001
  9867. WINUSERAPI
  9868. BOOL
  9869. WINAPI
  9870. GetWindowInfo(
  9871. IN HWND hwnd,
  9872. OUT PWINDOWINFO pwi
  9873. );
  9874. /*
  9875. * Titlebar information.
  9876. */
  9877. typedef struct tagTITLEBARINFO
  9878. {
  9879. DWORD cbSize;
  9880. RECT rcTitleBar;
  9881. DWORD rgstate[CCHILDREN_TITLEBAR+1];
  9882. } TITLEBARINFO, *PTITLEBARINFO, *LPTITLEBARINFO;
  9883. WINUSERAPI
  9884. BOOL
  9885. WINAPI
  9886. GetTitleBarInfo(
  9887. IN HWND hwnd,
  9888. OUT PTITLEBARINFO pti
  9889. );
  9890. /*
  9891. * Menubar information
  9892. */
  9893. typedef struct tagMENUBARINFO
  9894. {
  9895. DWORD cbSize;
  9896. RECT rcBar; // rect of bar, popup, item
  9897. HMENU hMenu; // real menu handle of bar, popup
  9898. HWND hwndMenu; // hwnd of item submenu if one
  9899. BOOL fBarFocused:1; // bar, popup has the focus
  9900. BOOL fFocused:1; // item has the focus
  9901. } MENUBARINFO, *PMENUBARINFO, *LPMENUBARINFO;
  9902. WINUSERAPI
  9903. BOOL
  9904. WINAPI
  9905. GetMenuBarInfo(
  9906. IN HWND hwnd,
  9907. IN LONG idObject,
  9908. IN LONG idItem,
  9909. OUT PMENUBARINFO pmbi
  9910. );
  9911. /*
  9912. * Scrollbar information
  9913. */
  9914. typedef struct tagSCROLLBARINFO
  9915. {
  9916. DWORD cbSize;
  9917. RECT rcScrollBar;
  9918. int dxyLineButton;
  9919. int xyThumbTop;
  9920. int xyThumbBottom;
  9921. int reserved;
  9922. DWORD rgstate[CCHILDREN_SCROLLBAR+1];
  9923. } SCROLLBARINFO, *PSCROLLBARINFO, *LPSCROLLBARINFO;
  9924. WINUSERAPI
  9925. BOOL
  9926. WINAPI
  9927. GetScrollBarInfo(
  9928. IN HWND hwnd,
  9929. IN LONG idObject,
  9930. OUT PSCROLLBARINFO psbi
  9931. );
  9932. /*
  9933. * Combobox information
  9934. */
  9935. typedef struct tagCOMBOBOXINFO
  9936. {
  9937. DWORD cbSize;
  9938. RECT rcItem;
  9939. RECT rcButton;
  9940. DWORD stateButton;
  9941. HWND hwndCombo;
  9942. HWND hwndItem;
  9943. HWND hwndList;
  9944. } COMBOBOXINFO, *PCOMBOBOXINFO, *LPCOMBOBOXINFO;
  9945. WINUSERAPI
  9946. BOOL
  9947. WINAPI
  9948. GetComboBoxInfo(
  9949. IN HWND hwndCombo,
  9950. OUT PCOMBOBOXINFO pcbi
  9951. );
  9952. /*
  9953. * The "real" ancestor window
  9954. */
  9955. #define GA_PARENT 1
  9956. #define GA_ROOT 2
  9957. #define GA_ROOTOWNER 3
  9958. WINUSERAPI
  9959. HWND
  9960. WINAPI
  9961. GetAncestor(
  9962. IN HWND hwnd,
  9963. IN UINT gaFlags
  9964. );
  9965. /*
  9966. * This gets the REAL child window at the point. If it is in the dead
  9967. * space of a group box, it will try a sibling behind it. But static
  9968. * fields will get returned. In other words, it is kind of a cross between
  9969. * ChildWindowFromPointEx and WindowFromPoint.
  9970. */
  9971. WINUSERAPI
  9972. HWND
  9973. WINAPI
  9974. RealChildWindowFromPoint(
  9975. IN HWND hwndParent,
  9976. IN POINT ptParentClientCoords
  9977. );
  9978. /*
  9979. * This gets the name of the window TYPE, not class. This allows us to
  9980. * recognize ThunderButton32 et al.
  9981. */
  9982. WINUSERAPI
  9983. UINT
  9984. WINAPI
  9985. RealGetWindowClassA(
  9986. IN HWND hwnd,
  9987. OUT LPSTR pszType,
  9988. IN UINT cchType
  9989. );
  9990. /*
  9991. * This gets the name of the window TYPE, not class. This allows us to
  9992. * recognize ThunderButton32 et al.
  9993. */
  9994. WINUSERAPI
  9995. UINT
  9996. WINAPI
  9997. RealGetWindowClassW(
  9998. IN HWND hwnd,
  9999. OUT LPWSTR pszType,
  10000. IN UINT cchType
  10001. );
  10002. #ifdef UNICODE
  10003. #define RealGetWindowClass RealGetWindowClassW
  10004. #else
  10005. #define RealGetWindowClass RealGetWindowClassA
  10006. #endif // !UNICODE
  10007. /*
  10008. * Alt-Tab Switch window information.
  10009. */
  10010. typedef struct tagALTTABINFO
  10011. {
  10012. DWORD cbSize;
  10013. int cItems;
  10014. int cColumns;
  10015. int cRows;
  10016. int iColFocus;
  10017. int iRowFocus;
  10018. int cxItem;
  10019. int cyItem;
  10020. POINT ptStart;
  10021. } ALTTABINFO, *PALTTABINFO, *LPALTTABINFO;
  10022. WINUSERAPI
  10023. BOOL
  10024. WINAPI
  10025. GetAltTabInfoA(
  10026. IN HWND hwnd,
  10027. IN int iItem,
  10028. OUT PALTTABINFO pati,
  10029. OUT LPSTR pszItemText,
  10030. IN UINT cchItemText
  10031. );
  10032. WINUSERAPI
  10033. BOOL
  10034. WINAPI
  10035. GetAltTabInfoW(
  10036. IN HWND hwnd,
  10037. IN int iItem,
  10038. OUT PALTTABINFO pati,
  10039. OUT LPWSTR pszItemText,
  10040. IN UINT cchItemText
  10041. );
  10042. #ifdef UNICODE
  10043. #define GetAltTabInfo GetAltTabInfoW
  10044. #else
  10045. #define GetAltTabInfo GetAltTabInfoA
  10046. #endif // !UNICODE
  10047. /*
  10048. * Listbox information.
  10049. * Returns the number of items per row.
  10050. */
  10051. WINUSERAPI
  10052. DWORD
  10053. WINAPI
  10054. GetListBoxInfo(
  10055. IN HWND hwnd
  10056. );
  10057. #endif /* NOWINABLE */
  10058. #endif /* WINVER >= 0x0500 */
  10059. #if(_WIN32_WINNT >= 0x0500)
  10060. WINUSERAPI
  10061. BOOL
  10062. WINAPI
  10063. LockWorkStation(
  10064. VOID);
  10065. #endif /* _WIN32_WINNT >= 0x0500 */
  10066. #if(_WIN32_WINNT >= 0x0500)
  10067. WINUSERAPI
  10068. BOOL
  10069. WINAPI
  10070. UserHandleGrantAccess(
  10071. HANDLE hUserHandle,
  10072. HANDLE hJob,
  10073. BOOL bGrant);
  10074. #endif /* _WIN32_WINNT >= 0x0500 */
  10075. #if(_WIN32_WINNT >= 0x0501)
  10076. /*
  10077. * Raw Input Messages.
  10078. */
  10079. DECLARE_HANDLE(HRAWINPUT);
  10080. /*
  10081. * WM_INPUT wParam
  10082. */
  10083. /*
  10084. * Use this macro to get the input code from wParam.
  10085. */
  10086. #define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff)
  10087. /*
  10088. * The input is in the regular message flow,
  10089. * the app is required to call DefWindowProc
  10090. * so that the system can perform clean ups.
  10091. */
  10092. #define RIM_INPUT 0
  10093. /*
  10094. * The input is sink only. The app is expected
  10095. * to behave nicely.
  10096. */
  10097. #define RIM_INPUTSINK 1
  10098. /*
  10099. * Raw Input data header
  10100. */
  10101. typedef struct tagRAWINPUTHEADER {
  10102. DWORD dwType;
  10103. DWORD dwSize;
  10104. HANDLE hDevice;
  10105. WPARAM wParam;
  10106. } RAWINPUTHEADER, *PRAWINPUTHEADER, *LPRAWINPUTHEADER;
  10107. /*
  10108. * Type of the raw input
  10109. */
  10110. #define RIM_TYPEMOUSE 0
  10111. #define RIM_TYPEKEYBOARD 1
  10112. #define RIM_TYPEHID 2
  10113. /*
  10114. * Raw format of the mouse input
  10115. */
  10116. typedef struct tagRAWMOUSE {
  10117. /*
  10118. * Indicator flags.
  10119. */
  10120. USHORT usFlags;
  10121. /*
  10122. * The transition state of the mouse buttons.
  10123. */
  10124. union {
  10125. ULONG ulButtons;
  10126. struct {
  10127. USHORT usButtonFlags;
  10128. USHORT usButtonData;
  10129. };
  10130. };
  10131. /*
  10132. * The raw state of the mouse buttons.
  10133. */
  10134. ULONG ulRawButtons;
  10135. /*
  10136. * The signed relative or absolute motion in the X direction.
  10137. */
  10138. LONG lLastX;
  10139. /*
  10140. * The signed relative or absolute motion in the Y direction.
  10141. */
  10142. LONG lLastY;
  10143. /*
  10144. * Device-specific additional information for the event.
  10145. */
  10146. ULONG ulExtraInformation;
  10147. } RAWMOUSE, *PRAWMOUSE, *LPRAWMOUSE;
  10148. /*
  10149. * Define the mouse button state indicators.
  10150. */
  10151. #define RI_MOUSE_LEFT_BUTTON_DOWN 0x0001 // Left Button changed to down.
  10152. #define RI_MOUSE_LEFT_BUTTON_UP 0x0002 // Left Button changed to up.
  10153. #define RI_MOUSE_RIGHT_BUTTON_DOWN 0x0004 // Right Button changed to down.
  10154. #define RI_MOUSE_RIGHT_BUTTON_UP 0x0008 // Right Button changed to up.
  10155. #define RI_MOUSE_MIDDLE_BUTTON_DOWN 0x0010 // Middle Button changed to down.
  10156. #define RI_MOUSE_MIDDLE_BUTTON_UP 0x0020 // Middle Button changed to up.
  10157. #define RI_MOUSE_BUTTON_1_DOWN RI_MOUSE_LEFT_BUTTON_DOWN
  10158. #define RI_MOUSE_BUTTON_1_UP RI_MOUSE_LEFT_BUTTON_UP
  10159. #define RI_MOUSE_BUTTON_2_DOWN RI_MOUSE_RIGHT_BUTTON_DOWN
  10160. #define RI_MOUSE_BUTTON_2_UP RI_MOUSE_RIGHT_BUTTON_UP
  10161. #define RI_MOUSE_BUTTON_3_DOWN RI_MOUSE_MIDDLE_BUTTON_DOWN
  10162. #define RI_MOUSE_BUTTON_3_UP RI_MOUSE_MIDDLE_BUTTON_UP
  10163. #define RI_MOUSE_BUTTON_4_DOWN 0x0040
  10164. #define RI_MOUSE_BUTTON_4_UP 0x0080
  10165. #define RI_MOUSE_BUTTON_5_DOWN 0x0100
  10166. #define RI_MOUSE_BUTTON_5_UP 0x0200
  10167. /*
  10168. * If usButtonFlags has RI_MOUSE_WHEEL, the wheel delta is stored in usButtonData.
  10169. * Take it as a signed value.
  10170. */
  10171. #define RI_MOUSE_WHEEL 0x0400
  10172. /*
  10173. * Define the mouse indicator flags.
  10174. */
  10175. #define MOUSE_MOVE_RELATIVE 0
  10176. #define MOUSE_MOVE_ABSOLUTE 1
  10177. #define MOUSE_VIRTUAL_DESKTOP 0x02 // the coordinates are mapped to the virtual desktop
  10178. #define MOUSE_ATTRIBUTES_CHANGED 0x04 // requery for mouse attributes
  10179. /*
  10180. * Raw format of the keyboard input
  10181. */
  10182. typedef struct tagRAWKEYBOARD {
  10183. /*
  10184. * The "make" scan code (key depression).
  10185. */
  10186. USHORT MakeCode;
  10187. /*
  10188. * The flags field indicates a "break" (key release) and other
  10189. * miscellaneous scan code information defined in ntddkbd.h.
  10190. */
  10191. USHORT Flags;
  10192. USHORT Reserved;
  10193. /*
  10194. * Windows message compatible information
  10195. */
  10196. USHORT VKey;
  10197. UINT Message;
  10198. /*
  10199. * Device-specific additional information for the event.
  10200. */
  10201. ULONG ExtraInformation;
  10202. } RAWKEYBOARD, *PRAWKEYBOARD, *LPRAWKEYBOARD;
  10203. /*
  10204. * Define the keyboard overrun MakeCode.
  10205. */
  10206. #define KEYBOARD_OVERRUN_MAKE_CODE 0xFF
  10207. /*
  10208. * Define the keyboard input data Flags.
  10209. */
  10210. #define RI_KEY_MAKE 0
  10211. #define RI_KEY_BREAK 1
  10212. #define RI_KEY_E0 2
  10213. #define RI_KEY_E1 4
  10214. #define RI_KEY_TERMSRV_SET_LED 8
  10215. #define RI_KEY_TERMSRV_SHADOW 0x10
  10216. /*
  10217. * Raw format of the input from Human Input Devices
  10218. */
  10219. typedef struct tagRAWHID {
  10220. DWORD dwSizeHid; // byte size of each report
  10221. DWORD dwCount; // number of input packed
  10222. BYTE bRawData[1];
  10223. } RAWHID, *PRAWHID, *LPRAWHID;
  10224. /*
  10225. * RAWINPUT data structure.
  10226. */
  10227. typedef struct tagRAWINPUT {
  10228. RAWINPUTHEADER header;
  10229. union {
  10230. RAWMOUSE mouse;
  10231. RAWKEYBOARD keyboard;
  10232. RAWHID hid;
  10233. } data;
  10234. } RAWINPUT, *PRAWINPUT, *LPRAWINPUT;
  10235. #ifdef _WIN64
  10236. #define RAWINPUT_ALIGN(x) (((x) + sizeof(QWORD) - 1) & ~(sizeof(QWORD) - 1))
  10237. #else // _WIN64
  10238. #define RAWINPUT_ALIGN(x) (((x) + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1))
  10239. #endif // _WIN64
  10240. #define NEXTRAWINPUTBLOCK(ptr) ((PRAWINPUT)RAWINPUT_ALIGN((ULONG_PTR)((PBYTE)(ptr) + (ptr)->header.dwSize)))
  10241. /*
  10242. * Flags for GetRawInputData
  10243. */
  10244. #define RID_INPUT 0x10000003
  10245. #define RID_HEADER 0x10000005
  10246. WINUSERAPI
  10247. UINT
  10248. WINAPI
  10249. GetRawInputData(
  10250. IN HRAWINPUT hRawInput,
  10251. IN UINT uiCommand,
  10252. OUT LPVOID pData,
  10253. IN OUT PUINT pcbSize,
  10254. IN UINT cbSizeHeader);
  10255. /*
  10256. * Raw Input Device Information
  10257. */
  10258. #define RIDI_PREPARSEDDATA 0x20000005
  10259. #define RIDI_DEVICENAME 0x20000007 // the return valus is the character length, not the byte size
  10260. #define RIDI_DEVICEINFO 0x2000000b
  10261. typedef struct tagRID_DEVICE_INFO_MOUSE {
  10262. DWORD dwId;
  10263. DWORD dwNumberOfButtons;
  10264. DWORD dwSampleRate;
  10265. } RID_DEVICE_INFO_MOUSE, *PRID_DEVICE_INFO_MOUSE;
  10266. typedef struct tagRID_DEVICE_INFO_KEYBOARD {
  10267. DWORD dwType;
  10268. DWORD dwSubType;
  10269. DWORD dwKeyboardMode;
  10270. DWORD dwNumberOfFunctionKeys;
  10271. DWORD dwNumberOfIndicators;
  10272. DWORD dwNumberOfKeysTotal;
  10273. } RID_DEVICE_INFO_KEYBOARD, *PRID_DEVICE_INFO_KEYBOARD;
  10274. typedef struct tagRID_DEVICE_INFO_HID {
  10275. DWORD dwVendorId;
  10276. DWORD dwProductId;
  10277. DWORD dwVersionNumber;
  10278. /*
  10279. * Top level collection UsagePage and Usage
  10280. */
  10281. USHORT usUsagePage;
  10282. USHORT usUsage;
  10283. } RID_DEVICE_INFO_HID, *PRID_DEVICE_INFO_HID;
  10284. typedef struct tagRID_DEVICE_INFO {
  10285. DWORD cbSize;
  10286. DWORD dwType;
  10287. union {
  10288. RID_DEVICE_INFO_MOUSE mouse;
  10289. RID_DEVICE_INFO_KEYBOARD keyboard;
  10290. RID_DEVICE_INFO_HID hid;
  10291. };
  10292. } RID_DEVICE_INFO, *PRID_DEVICE_INFO, *LPRID_DEVICE_INFO;
  10293. WINUSERAPI
  10294. UINT
  10295. WINAPI
  10296. GetRawInputDeviceInfoA(
  10297. IN HANDLE hDevice,
  10298. IN UINT uiCommand,
  10299. OUT LPVOID pData,
  10300. IN OUT PUINT pcbSize);
  10301. WINUSERAPI
  10302. UINT
  10303. WINAPI
  10304. GetRawInputDeviceInfoW(
  10305. IN HANDLE hDevice,
  10306. IN UINT uiCommand,
  10307. OUT LPVOID pData,
  10308. IN OUT PUINT pcbSize);
  10309. #ifdef UNICODE
  10310. #define GetRawInputDeviceInfo GetRawInputDeviceInfoW
  10311. #else
  10312. #define GetRawInputDeviceInfo GetRawInputDeviceInfoA
  10313. #endif // !UNICODE
  10314. /*
  10315. * Raw Input Bulk Read: GetRawInputBuffer
  10316. */
  10317. WINUSERAPI
  10318. UINT
  10319. WINAPI
  10320. GetRawInputBuffer(
  10321. OUT PRAWINPUT pData,
  10322. IN OUT PUINT pcbSize,
  10323. IN UINT cbSizeHeader);
  10324. /*
  10325. * Raw Input request APIs
  10326. */
  10327. typedef struct tagRAWINPUTDEVICE {
  10328. USHORT usUsagePage; // Toplevel collection UsagePage
  10329. USHORT usUsage; // Toplevel collection Usage
  10330. DWORD dwFlags;
  10331. HWND hwndTarget; // Target hwnd. NULL = follows keyboard focus
  10332. } RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
  10333. typedef CONST RAWINPUTDEVICE* PCRAWINPUTDEVICE;
  10334. #define RIDEV_REMOVE 0x00000001
  10335. #define RIDEV_EXCLUDE 0x00000010
  10336. #define RIDEV_PAGEONLY 0x00000020
  10337. #define RIDEV_NOLEGACY 0x00000030
  10338. #define RIDEV_INPUTSINK 0x00000100
  10339. #define RIDEV_CAPTUREMOUSE 0x00000200 // effective when mouse nolegacy is specified, otherwise it would be an error
  10340. #define RIDEV_NOHOTKEYS 0x00000200 // effective for keyboard.
  10341. #define RIDEV_APPKEYS 0x00000400 // effective for keyboard.
  10342. #define RIDEV_EXMODEMASK 0x000000F0
  10343. #define RIDEV_EXMODE(mode) ((mode) & RIDEV_EXMODEMASK)
  10344. WINUSERAPI
  10345. BOOL
  10346. WINAPI
  10347. RegisterRawInputDevices(
  10348. IN PCRAWINPUTDEVICE pRawInputDevices,
  10349. IN UINT uiNumDevices,
  10350. IN UINT cbSize);
  10351. WINUSERAPI
  10352. UINT
  10353. WINAPI
  10354. GetRegisteredRawInputDevices(
  10355. OUT PRAWINPUTDEVICE pRawInputDevices,
  10356. IN OUT PUINT puiNumDevices,
  10357. IN UINT cbSize);
  10358. typedef struct tagRAWINPUTDEVICELIST {
  10359. HANDLE hDevice;
  10360. DWORD dwType;
  10361. } RAWINPUTDEVICELIST, *PRAWINPUTDEVICELIST;
  10362. WINUSERAPI
  10363. UINT
  10364. WINAPI
  10365. GetRawInputDeviceList(
  10366. OUT PRAWINPUTDEVICELIST pRawInputDeviceList,
  10367. IN OUT PUINT puiNumDevices,
  10368. IN UINT cbSize);
  10369. WINUSERAPI
  10370. LRESULT
  10371. WINAPI
  10372. DefRawInputProc(
  10373. IN PRAWINPUT* paRawInput,
  10374. IN INT nInput,
  10375. IN UINT cbSizeHeader);
  10376. #endif /* _WIN32_WINNT >= 0x0501 */
  10377. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  10378. #if ISOLATION_AWARE_ENABLED
  10379. #include "winuser.inl"
  10380. #endif /* ISOLATION_AWARE_ENABLED */
  10381. #endif /* RC */
  10382. #ifdef __cplusplus
  10383. }
  10384. #endif /* __cplusplus */
  10385. #endif /* !_WINUSER_ */