Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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