1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! USER procedure declarations, constant definitions and macros
7 use ctypes::{c_int, c_long, c_short, c_uint};
8 use shared::basetsd::{
9 DWORD_PTR, INT32, INT_PTR, PDWORD_PTR, UINT16, UINT32, UINT64, UINT_PTR, ULONG_PTR,
10 };
11 #[cfg(target_pointer_width = "64")]
12 use shared::basetsd::LONG_PTR;
13 use shared::guiddef::{GUID, LPCGUID};
14 use shared::minwindef::{
15 ATOM, BOOL, BYTE, DWORD, HINSTANCE, HIWORD, HKL, HMODULE, HRGN, HWINSTA, INT, LOWORD, LPARAM,
16 LPBYTE, LPDWORD, LPINT, LPVOID, LPWORD, LRESULT, PBYTE, PUINT, PULONG, TRUE, UCHAR, UINT,
17 ULONG, USHORT, WORD, WPARAM,
18 };
19 use shared::windef::{
20 COLORREF, DPI_AWARENESS, DPI_AWARENESS_CONTEXT, DPI_HOSTING_BEHAVIOR, HACCEL, HBITMAP, HBRUSH,
21 HCURSOR, HDC, HDESK, HHOOK, HICON, HMENU, HMONITOR, HWINEVENTHOOK, HWND, LPCRECT, LPPOINT,
22 LPRECT, POINT, RECT, SIZE,
23 };
24 use um::minwinbase::LPSECURITY_ATTRIBUTES;
25 use um::wingdi::{
26 BLENDFUNCTION, DEVMODEA, DEVMODEW, LOGFONTA, LOGFONTW, PDISPLAY_DEVICEA, PDISPLAY_DEVICEW
27 };
28 use um::winnt::{
29 ACCESS_MASK, BOOLEAN, CHAR, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, LUID,
30 PSECURITY_DESCRIPTOR, PSECURITY_INFORMATION, PVOID, SHORT, VOID, WCHAR,
31 };
32 use vc::limits::UINT_MAX;
33 use vc::vadefs::va_list;
34 pub type HDWP = HANDLE;
35 pub type MENUTEMPLATEA = VOID;
36 pub type MENUTEMPLATEW = VOID;
37 pub type LPMENUTEMPLATEA = PVOID;
38 pub type LPMENUTEMPLATEW = PVOID;
39 FN!{stdcall WNDPROC(
40 HWND,
41 UINT,
42 WPARAM,
43 LPARAM,
44 ) -> LRESULT}
45 FN!{stdcall DLGPROC(
46 HWND,
47 UINT,
48 WPARAM,
49 LPARAM,
50 ) -> INT_PTR}
51 FN!{stdcall TIMERPROC(
52 HWND,
53 UINT,
54 UINT_PTR,
55 DWORD,
56 ) -> ()}
57 FN!{stdcall GRAYSTRINGPROC(
58 HDC,
59 LPARAM,
60 c_int,
61 ) -> BOOL}
62 FN!{stdcall WNDENUMPROC(
63 HWND,
64 LPARAM,
65 ) -> BOOL}
66 FN!{stdcall HOOKPROC(
67 code: c_int,
68 wParam: WPARAM,
69 lParam: LPARAM,
70 ) -> LRESULT}
71 FN!{stdcall SENDASYNCPROC(
72 HWND,
73 UINT,
74 ULONG_PTR,
75 LRESULT,
76 ) -> ()}
77 FN!{stdcall PROPENUMPROCA(
78 HWND,
79 LPCSTR,
80 HANDLE,
81 ) -> BOOL}
82 FN!{stdcall PROPENUMPROCW(
83 HWND,
84 LPCWSTR,
85 HANDLE,
86 ) -> BOOL}
87 FN!{stdcall PROPENUMPROCEXA(
88 HWND,
89 LPSTR,
90 HANDLE,
91 ULONG_PTR,
92 ) -> BOOL}
93 FN!{stdcall PROPENUMPROCEXW(
94 HWND,
95 LPWSTR,
96 HANDLE,
97 ULONG_PTR,
98 ) -> BOOL}
99 FN!{stdcall EDITWORDBREAKPROCA(
100 lpch: LPSTR,
101 ichCurrent: c_int,
102 cch: c_int,
103 code: c_int,
104 ) -> c_int}
105 FN!{stdcall EDITWORDBREAKPROCW(
106 lpch: LPWSTR,
107 ichCurrent: c_int,
108 cch: c_int,
109 code: c_int,
110 ) -> c_int}
111 FN!{stdcall DRAWSTATEPROC(
112 hdc: HDC,
113 lData: LPARAM,
114 wData: WPARAM,
115 cx: c_int,
116 cy: c_int,
117 ) -> BOOL}
118 FN!{stdcall NAMEENUMPROCA(
119 LPSTR,
120 LPARAM,
121 ) -> BOOL}
122 FN!{stdcall NAMEENUMPROCW(
123 LPWSTR,
124 LPARAM,
125 ) -> BOOL}
126 pub type WINSTAENUMPROCA = NAMEENUMPROCA;
127 pub type DESKTOPENUMPROCA = NAMEENUMPROCA;
128 pub type WINSTAENUMPROCW = NAMEENUMPROCW;
129 pub type DESKTOPENUMPROCW = NAMEENUMPROCW;
130 #[inline]
IS_INTRESOURCE(r: ULONG_PTR) -> bool131 pub fn IS_INTRESOURCE(r: ULONG_PTR) -> bool {
132 (r >> 16) == 0
133 }
134 #[inline]
MAKEINTRESOURCEA(i: WORD) -> LPSTR135 pub fn MAKEINTRESOURCEA(i: WORD) -> LPSTR {
136 i as ULONG_PTR as LPSTR
137 }
138 #[inline]
MAKEINTRESOURCEW(i: WORD) -> LPWSTR139 pub fn MAKEINTRESOURCEW(i: WORD) -> LPWSTR {
140 i as ULONG_PTR as LPWSTR
141 }
142 pub const RT_CURSOR: LPWSTR = MAKEINTRESOURCE!(1);
143 pub const RT_BITMAP: LPWSTR = MAKEINTRESOURCE!(2);
144 pub const RT_ICON: LPWSTR = MAKEINTRESOURCE!(3);
145 pub const RT_MENU: LPWSTR = MAKEINTRESOURCE!(4);
146 pub const RT_DIALOG: LPWSTR = MAKEINTRESOURCE!(5);
147 pub const RT_STRING: LPWSTR = MAKEINTRESOURCE!(6);
148 pub const RT_FONTDIR: LPWSTR = MAKEINTRESOURCE!(7);
149 pub const RT_FONT: LPWSTR = MAKEINTRESOURCE!(8);
150 pub const RT_ACCELERATOR: LPWSTR = MAKEINTRESOURCE!(9);
151 pub const RT_RCDATA: LPWSTR = MAKEINTRESOURCE!(10);
152 pub const RT_MESSAGETABLE: LPWSTR = MAKEINTRESOURCE!(11);
153 pub const DIFFERENCE: WORD = 11;
154 pub const RT_GROUP_CURSOR: LPWSTR = MAKEINTRESOURCE!(1 + DIFFERENCE);
155 pub const RT_GROUP_ICON: LPWSTR = MAKEINTRESOURCE!(3 + DIFFERENCE);
156 pub const RT_VERSION: LPWSTR = MAKEINTRESOURCE!(16);
157 pub const RT_DLGINCLUDE: LPWSTR = MAKEINTRESOURCE!(17);
158 pub const RT_PLUGPLAY: LPWSTR = MAKEINTRESOURCE!(19);
159 pub const RT_VXD: LPWSTR = MAKEINTRESOURCE!(20);
160 pub const RT_ANICURSOR: LPWSTR = MAKEINTRESOURCE!(21);
161 pub const RT_ANIICON: LPWSTR = MAKEINTRESOURCE!(22);
162 pub const RT_HTML: LPWSTR = MAKEINTRESOURCE!(23);
163 pub const RT_MANIFEST: LPWSTR = MAKEINTRESOURCE!(24);
164 pub const CREATEPROCESS_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1);
165 pub const ISOLATIONAWARE_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(2);
166 pub const ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID: LPWSTR
167 = MAKEINTRESOURCE!(3);
168 pub const MINIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1);
169 pub const MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(16);
170 extern "system" {
wvsprintfA( _: LPSTR, _: LPCSTR, arglist: va_list, ) -> c_int171 pub fn wvsprintfA(
172 _: LPSTR,
173 _: LPCSTR,
174 arglist: va_list,
175 ) -> c_int;
wvsprintfW( _: LPWSTR, _: LPCWSTR, arglist: va_list, ) -> c_int176 pub fn wvsprintfW(
177 _: LPWSTR,
178 _: LPCWSTR,
179 arglist: va_list,
180 ) -> c_int;
181 }
182 extern "C" {
wsprintfA( _: LPSTR, _: LPCSTR, ... ) -> c_int183 pub fn wsprintfA(
184 _: LPSTR,
185 _: LPCSTR,
186 ...
187 ) -> c_int;
wsprintfW( _: LPWSTR, _: LPCWSTR, ... ) -> c_int188 pub fn wsprintfW(
189 _: LPWSTR,
190 _: LPCWSTR,
191 ...
192 ) -> c_int;
193 }
194 pub const SETWALLPAPER_DEFAULT: LPWSTR = -1isize as LPWSTR;
195 pub const SB_HORZ: UINT = 0;
196 pub const SB_VERT: UINT = 1;
197 pub const SB_CTL: UINT = 2;
198 pub const SB_BOTH: UINT = 3;
199 pub const SB_LINEUP: LPARAM = 0;
200 pub const SB_LINELEFT: LPARAM = 0;
201 pub const SB_LINEDOWN: LPARAM = 1;
202 pub const SB_LINERIGHT: LPARAM = 1;
203 pub const SB_PAGEUP: LPARAM = 2;
204 pub const SB_PAGELEFT: LPARAM = 2;
205 pub const SB_PAGEDOWN: LPARAM = 3;
206 pub const SB_PAGERIGHT: LPARAM = 3;
207 pub const SB_THUMBPOSITION: LPARAM = 4;
208 pub const SB_THUMBTRACK: LPARAM = 5;
209 pub const SB_TOP: LPARAM = 6;
210 pub const SB_LEFT: LPARAM = 6;
211 pub const SB_BOTTOM: LPARAM = 7;
212 pub const SB_RIGHT: LPARAM = 7;
213 pub const SB_ENDSCROLL: LPARAM = 8;
214 pub const SW_HIDE: c_int = 0;
215 pub const SW_SHOWNORMAL: c_int = 1;
216 pub const SW_NORMAL: c_int = 1;
217 pub const SW_SHOWMINIMIZED: c_int = 2;
218 pub const SW_SHOWMAXIMIZED: c_int = 3;
219 pub const SW_MAXIMIZE: c_int = 3;
220 pub const SW_SHOWNOACTIVATE: c_int = 4;
221 pub const SW_SHOW: c_int = 5;
222 pub const SW_MINIMIZE: c_int = 6;
223 pub const SW_SHOWMINNOACTIVE: c_int = 7;
224 pub const SW_SHOWNA: c_int = 8;
225 pub const SW_RESTORE: c_int = 9;
226 pub const SW_SHOWDEFAULT: c_int = 10;
227 pub const SW_FORCEMINIMIZE: c_int = 11;
228 pub const SW_MAX: c_int = 11;
229 pub const HIDE_WINDOW: c_int = 0;
230 pub const SHOW_OPENWINDOW: c_int = 1;
231 pub const SHOW_ICONWINDOW: c_int = 2;
232 pub const SHOW_FULLSCREEN: c_int = 3;
233 pub const SHOW_OPENNOACTIVATE: c_int = 4;
234 pub const SW_PARENTCLOSING: LPARAM = 1;
235 pub const SW_OTHERZOOM: LPARAM = 2;
236 pub const SW_PARENTOPENING: LPARAM = 3;
237 pub const SW_OTHERUNZOOM: LPARAM = 4;
238 pub const AW_HOR_POSITIVE: DWORD = 0x00000001;
239 pub const AW_HOR_NEGATIVE: DWORD = 0x00000002;
240 pub const AW_VER_POSITIVE: DWORD = 0x00000004;
241 pub const AW_VER_NEGATIVE: DWORD = 0x00000008;
242 pub const AW_CENTER: DWORD = 0x00000010;
243 pub const AW_HIDE: DWORD = 0x00010000;
244 pub const AW_ACTIVATE: DWORD = 0x00020000;
245 pub const AW_SLIDE: DWORD = 0x00040000;
246 pub const AW_BLEND: DWORD = 0x00080000;
247 pub const KF_EXTENDED: WORD = 0x0100;
248 pub const KF_DLGMODE: WORD = 0x0800;
249 pub const KF_MENUMODE: WORD = 0x1000;
250 pub const KF_ALTDOWN: WORD = 0x2000;
251 pub const KF_REPEAT: WORD = 0x4000;
252 pub const KF_UP: WORD = 0x8000;
253 pub const VK_LBUTTON: c_int = 0x01;
254 pub const VK_RBUTTON: c_int = 0x02;
255 pub const VK_CANCEL: c_int = 0x03;
256 pub const VK_MBUTTON: c_int = 0x04;
257 pub const VK_XBUTTON1: c_int = 0x05;
258 pub const VK_XBUTTON2: c_int = 0x06;
259 pub const VK_BACK: c_int = 0x08;
260 pub const VK_TAB: c_int = 0x09;
261 pub const VK_CLEAR: c_int = 0x0C;
262 pub const VK_RETURN: c_int = 0x0D;
263 pub const VK_SHIFT: c_int = 0x10;
264 pub const VK_CONTROL: c_int = 0x11;
265 pub const VK_MENU: c_int = 0x12;
266 pub const VK_PAUSE: c_int = 0x13;
267 pub const VK_CAPITAL: c_int = 0x14;
268 pub const VK_KANA: c_int = 0x15;
269 pub const VK_HANGEUL: c_int = 0x15;
270 pub const VK_HANGUL: c_int = 0x15;
271 pub const VK_JUNJA: c_int = 0x17;
272 pub const VK_FINAL: c_int = 0x18;
273 pub const VK_HANJA: c_int = 0x19;
274 pub const VK_KANJI: c_int = 0x19;
275 pub const VK_ESCAPE: c_int = 0x1B;
276 pub const VK_CONVERT: c_int = 0x1C;
277 pub const VK_NONCONVERT: c_int = 0x1D;
278 pub const VK_ACCEPT: c_int = 0x1E;
279 pub const VK_MODECHANGE: c_int = 0x1F;
280 pub const VK_SPACE: c_int = 0x20;
281 pub const VK_PRIOR: c_int = 0x21;
282 pub const VK_NEXT: c_int = 0x22;
283 pub const VK_END: c_int = 0x23;
284 pub const VK_HOME: c_int = 0x24;
285 pub const VK_LEFT: c_int = 0x25;
286 pub const VK_UP: c_int = 0x26;
287 pub const VK_RIGHT: c_int = 0x27;
288 pub const VK_DOWN: c_int = 0x28;
289 pub const VK_SELECT: c_int = 0x29;
290 pub const VK_PRINT: c_int = 0x2A;
291 pub const VK_EXECUTE: c_int = 0x2B;
292 pub const VK_SNAPSHOT: c_int = 0x2C;
293 pub const VK_INSERT: c_int = 0x2D;
294 pub const VK_DELETE: c_int = 0x2E;
295 pub const VK_HELP: c_int = 0x2F;
296 pub const VK_LWIN: c_int = 0x5B;
297 pub const VK_RWIN: c_int = 0x5C;
298 pub const VK_APPS: c_int = 0x5D;
299 pub const VK_SLEEP: c_int = 0x5F;
300 pub const VK_NUMPAD0: c_int = 0x60;
301 pub const VK_NUMPAD1: c_int = 0x61;
302 pub const VK_NUMPAD2: c_int = 0x62;
303 pub const VK_NUMPAD3: c_int = 0x63;
304 pub const VK_NUMPAD4: c_int = 0x64;
305 pub const VK_NUMPAD5: c_int = 0x65;
306 pub const VK_NUMPAD6: c_int = 0x66;
307 pub const VK_NUMPAD7: c_int = 0x67;
308 pub const VK_NUMPAD8: c_int = 0x68;
309 pub const VK_NUMPAD9: c_int = 0x69;
310 pub const VK_MULTIPLY: c_int = 0x6A;
311 pub const VK_ADD: c_int = 0x6B;
312 pub const VK_SEPARATOR: c_int = 0x6C;
313 pub const VK_SUBTRACT: c_int = 0x6D;
314 pub const VK_DECIMAL: c_int = 0x6E;
315 pub const VK_DIVIDE: c_int = 0x6F;
316 pub const VK_F1: c_int = 0x70;
317 pub const VK_F2: c_int = 0x71;
318 pub const VK_F3: c_int = 0x72;
319 pub const VK_F4: c_int = 0x73;
320 pub const VK_F5: c_int = 0x74;
321 pub const VK_F6: c_int = 0x75;
322 pub const VK_F7: c_int = 0x76;
323 pub const VK_F8: c_int = 0x77;
324 pub const VK_F9: c_int = 0x78;
325 pub const VK_F10: c_int = 0x79;
326 pub const VK_F11: c_int = 0x7A;
327 pub const VK_F12: c_int = 0x7B;
328 pub const VK_F13: c_int = 0x7C;
329 pub const VK_F14: c_int = 0x7D;
330 pub const VK_F15: c_int = 0x7E;
331 pub const VK_F16: c_int = 0x7F;
332 pub const VK_F17: c_int = 0x80;
333 pub const VK_F18: c_int = 0x81;
334 pub const VK_F19: c_int = 0x82;
335 pub const VK_F20: c_int = 0x83;
336 pub const VK_F21: c_int = 0x84;
337 pub const VK_F22: c_int = 0x85;
338 pub const VK_F23: c_int = 0x86;
339 pub const VK_F24: c_int = 0x87;
340 pub const VK_NAVIGATION_VIEW: c_int = 0x88;
341 pub const VK_NAVIGATION_MENU: c_int = 0x89;
342 pub const VK_NAVIGATION_UP: c_int = 0x8A;
343 pub const VK_NAVIGATION_DOWN: c_int = 0x8B;
344 pub const VK_NAVIGATION_LEFT: c_int = 0x8C;
345 pub const VK_NAVIGATION_RIGHT: c_int = 0x8D;
346 pub const VK_NAVIGATION_ACCEPT: c_int = 0x8E;
347 pub const VK_NAVIGATION_CANCEL: c_int = 0x8F;
348 pub const VK_NUMLOCK: c_int = 0x90;
349 pub const VK_SCROLL: c_int = 0x91;
350 pub const VK_OEM_NEC_EQUAL: c_int = 0x92;
351 pub const VK_OEM_FJ_JISHO: c_int = 0x92;
352 pub const VK_OEM_FJ_MASSHOU: c_int = 0x93;
353 pub const VK_OEM_FJ_TOUROKU: c_int = 0x94;
354 pub const VK_OEM_FJ_LOYA: c_int = 0x95;
355 pub const VK_OEM_FJ_ROYA: c_int = 0x96;
356 pub const VK_LSHIFT: c_int = 0xA0;
357 pub const VK_RSHIFT: c_int = 0xA1;
358 pub const VK_LCONTROL: c_int = 0xA2;
359 pub const VK_RCONTROL: c_int = 0xA3;
360 pub const VK_LMENU: c_int = 0xA4;
361 pub const VK_RMENU: c_int = 0xA5;
362 pub const VK_BROWSER_BACK: c_int = 0xA6;
363 pub const VK_BROWSER_FORWARD: c_int = 0xA7;
364 pub const VK_BROWSER_REFRESH: c_int = 0xA8;
365 pub const VK_BROWSER_STOP: c_int = 0xA9;
366 pub const VK_BROWSER_SEARCH: c_int = 0xAA;
367 pub const VK_BROWSER_FAVORITES: c_int = 0xAB;
368 pub const VK_BROWSER_HOME: c_int = 0xAC;
369 pub const VK_VOLUME_MUTE: c_int = 0xAD;
370 pub const VK_VOLUME_DOWN: c_int = 0xAE;
371 pub const VK_VOLUME_UP: c_int = 0xAF;
372 pub const VK_MEDIA_NEXT_TRACK: c_int = 0xB0;
373 pub const VK_MEDIA_PREV_TRACK: c_int = 0xB1;
374 pub const VK_MEDIA_STOP: c_int = 0xB2;
375 pub const VK_MEDIA_PLAY_PAUSE: c_int = 0xB3;
376 pub const VK_LAUNCH_MAIL: c_int = 0xB4;
377 pub const VK_LAUNCH_MEDIA_SELECT: c_int = 0xB5;
378 pub const VK_LAUNCH_APP1: c_int = 0xB6;
379 pub const VK_LAUNCH_APP2: c_int = 0xB7;
380 pub const VK_OEM_1: c_int = 0xBA;
381 pub const VK_OEM_PLUS: c_int = 0xBB;
382 pub const VK_OEM_COMMA: c_int = 0xBC;
383 pub const VK_OEM_MINUS: c_int = 0xBD;
384 pub const VK_OEM_PERIOD: c_int = 0xBE;
385 pub const VK_OEM_2: c_int = 0xBF;
386 pub const VK_OEM_3: c_int = 0xC0;
387 pub const VK_GAMEPAD_A: c_int = 0xC3;
388 pub const VK_GAMEPAD_B: c_int = 0xC4;
389 pub const VK_GAMEPAD_X: c_int = 0xC5;
390 pub const VK_GAMEPAD_Y: c_int = 0xC6;
391 pub const VK_GAMEPAD_RIGHT_SHOULDER: c_int = 0xC7;
392 pub const VK_GAMEPAD_LEFT_SHOULDER: c_int = 0xC8;
393 pub const VK_GAMEPAD_LEFT_TRIGGER: c_int = 0xC9;
394 pub const VK_GAMEPAD_RIGHT_TRIGGER: c_int = 0xCA;
395 pub const VK_GAMEPAD_DPAD_UP: c_int = 0xCB;
396 pub const VK_GAMEPAD_DPAD_DOWN: c_int = 0xCC;
397 pub const VK_GAMEPAD_DPAD_LEFT: c_int = 0xCD;
398 pub const VK_GAMEPAD_DPAD_RIGHT: c_int = 0xCE;
399 pub const VK_GAMEPAD_MENU: c_int = 0xCF;
400 pub const VK_GAMEPAD_VIEW: c_int = 0xD0;
401 pub const VK_GAMEPAD_LEFT_THUMBSTICK_BUTTON: c_int = 0xD1;
402 pub const VK_GAMEPAD_RIGHT_THUMBSTICK_BUTTON: c_int = 0xD2;
403 pub const VK_GAMEPAD_LEFT_THUMBSTICK_UP: c_int = 0xD3;
404 pub const VK_GAMEPAD_LEFT_THUMBSTICK_DOWN: c_int = 0xD4;
405 pub const VK_GAMEPAD_LEFT_THUMBSTICK_RIGHT: c_int = 0xD5;
406 pub const VK_GAMEPAD_LEFT_THUMBSTICK_LEFT: c_int = 0xD6;
407 pub const VK_GAMEPAD_RIGHT_THUMBSTICK_UP: c_int = 0xD7;
408 pub const VK_GAMEPAD_RIGHT_THUMBSTICK_DOWN: c_int = 0xD8;
409 pub const VK_GAMEPAD_RIGHT_THUMBSTICK_RIGHT: c_int = 0xD9;
410 pub const VK_GAMEPAD_RIGHT_THUMBSTICK_LEFT: c_int = 0xDA;
411 pub const VK_OEM_4: c_int = 0xDB;
412 pub const VK_OEM_5: c_int = 0xDC;
413 pub const VK_OEM_6: c_int = 0xDD;
414 pub const VK_OEM_7: c_int = 0xDE;
415 pub const VK_OEM_8: c_int = 0xDF;
416 pub const VK_OEM_AX: c_int = 0xE1;
417 pub const VK_OEM_102: c_int = 0xE2;
418 pub const VK_ICO_HELP: c_int = 0xE3;
419 pub const VK_ICO_00: c_int = 0xE4;
420 pub const VK_PROCESSKEY: c_int = 0xE5;
421 pub const VK_ICO_CLEAR: c_int = 0xE6;
422 pub const VK_PACKET: c_int = 0xE7;
423 pub const VK_OEM_RESET: c_int = 0xE9;
424 pub const VK_OEM_JUMP: c_int = 0xEA;
425 pub const VK_OEM_PA1: c_int = 0xEB;
426 pub const VK_OEM_PA2: c_int = 0xEC;
427 pub const VK_OEM_PA3: c_int = 0xED;
428 pub const VK_OEM_WSCTRL: c_int = 0xEE;
429 pub const VK_OEM_CUSEL: c_int = 0xEF;
430 pub const VK_OEM_ATTN: c_int = 0xF0;
431 pub const VK_OEM_FINISH: c_int = 0xF1;
432 pub const VK_OEM_COPY: c_int = 0xF2;
433 pub const VK_OEM_AUTO: c_int = 0xF3;
434 pub const VK_OEM_ENLW: c_int = 0xF4;
435 pub const VK_OEM_BACKTAB: c_int = 0xF5;
436 pub const VK_ATTN: c_int = 0xF6;
437 pub const VK_CRSEL: c_int = 0xF7;
438 pub const VK_EXSEL: c_int = 0xF8;
439 pub const VK_EREOF: c_int = 0xF9;
440 pub const VK_PLAY: c_int = 0xFA;
441 pub const VK_ZOOM: c_int = 0xFB;
442 pub const VK_NONAME: c_int = 0xFC;
443 pub const VK_PA1: c_int = 0xFD;
444 pub const VK_OEM_CLEAR: c_int = 0xFE;
445 pub const WH_MIN: c_int = -1;
446 pub const WH_MSGFILTER: c_int = -1;
447 pub const WH_JOURNALRECORD: c_int = 0;
448 pub const WH_JOURNALPLAYBACK: c_int = 1;
449 pub const WH_KEYBOARD: c_int = 2;
450 pub const WH_GETMESSAGE: c_int = 3;
451 pub const WH_CALLWNDPROC: c_int = 4;
452 pub const WH_CBT: c_int = 5;
453 pub const WH_SYSMSGFILTER: c_int = 6;
454 pub const WH_MOUSE: c_int = 7;
455 pub const WH_HARDWARE: c_int = 8;
456 pub const WH_DEBUG: c_int = 9;
457 pub const WH_SHELL: c_int = 10;
458 pub const WH_FOREGROUNDIDLE: c_int = 11;
459 pub const WH_CALLWNDPROCRET: c_int = 12;
460 pub const WH_KEYBOARD_LL: c_int = 13;
461 pub const WH_MOUSE_LL: c_int = 14;
462 pub const WH_MAX: c_int = 14;
463 pub const WH_MINHOOK: c_int = WH_MIN;
464 pub const WH_MAXHOOK: c_int = WH_MAX;
465 pub const HC_ACTION: c_int = 0;
466 pub const HC_GETNEXT: c_int = 1;
467 pub const HC_SKIP: c_int = 2;
468 pub const HC_NOREMOVE: c_int = 3;
469 pub const HC_NOREM: c_int = HC_NOREMOVE;
470 pub const HC_SYSMODALON: c_int = 4;
471 pub const HC_SYSMODALOFF: c_int = 5;
472 pub const HCBT_MOVESIZE: c_int = 0;
473 pub const HCBT_MINMAX: c_int = 1;
474 pub const HCBT_QS: c_int = 2;
475 pub const HCBT_CREATEWND: c_int = 3;
476 pub const HCBT_DESTROYWND: c_int = 4;
477 pub const HCBT_ACTIVATE: c_int = 5;
478 pub const HCBT_CLICKSKIPPED: c_int = 6;
479 pub const HCBT_KEYSKIPPED: c_int = 7;
480 pub const HCBT_SYSCOMMAND: c_int = 8;
481 pub const HCBT_SETFOCUS: c_int = 9;
482 STRUCT!{struct CBT_CREATEWNDA {
483 lpcs: *mut CREATESTRUCTA,
484 hwndInsertAfter: HWND,
485 }}
486 pub type LPCBT_CREATEWNDA = *mut CBT_CREATEWNDA;
487 STRUCT!{struct CBT_CREATEWNDW {
488 lpcs: *mut CREATESTRUCTW,
489 hwndInsertAfter: HWND,
490 }}
491 pub type LPCBT_CREATEWNDW = *mut CBT_CREATEWNDW;
492 STRUCT!{struct CBTACTIVATESTRUCT {
493 fMouse: BOOL,
494 hWndActive: HWND,
495 }}
496 pub type LPCBTACTIVATESTRUCT = *mut CBTACTIVATESTRUCT;
497 STRUCT!{struct WTSSESSION_NOTIFICATION {
498 cbSize: DWORD,
499 dwSessionId: DWORD,
500 }}
501 pub type PWTSSESSION_NOTIFICATION = *mut WTSSESSION_NOTIFICATION;
502 pub const WTS_CONSOLE_CONNECT: WPARAM = 0x1;
503 pub const WTS_CONSOLE_DISCONNECT: WPARAM = 0x2;
504 pub const WTS_REMOTE_CONNECT: WPARAM = 0x3;
505 pub const WTS_REMOTE_DISCONNECT: WPARAM = 0x4;
506 pub const WTS_SESSION_LOGON: WPARAM = 0x5;
507 pub const WTS_SESSION_LOGOFF: WPARAM = 0x6;
508 pub const WTS_SESSION_LOCK: WPARAM = 0x7;
509 pub const WTS_SESSION_UNLOCK: WPARAM = 0x8;
510 pub const WTS_SESSION_REMOTE_CONTROL: WPARAM = 0x9;
511 pub const WTS_SESSION_CREATE: WPARAM = 0xa;
512 pub const WTS_SESSION_TERMINATE: WPARAM = 0xb;
513 pub const MSGF_DIALOGBOX: c_int = 0;
514 pub const MSGF_MESSAGEBOX: c_int = 1;
515 pub const MSGF_MENU: c_int = 2;
516 pub const MSGF_SCROLLBAR: c_int = 5;
517 pub const MSGF_NEXTWINDOW: c_int = 6;
518 pub const MSGF_MAX: c_int = 8;
519 pub const MSGF_USER: c_int = 4096;
520 pub const HSHELL_WINDOWCREATED: c_int = 1;
521 pub const HSHELL_WINDOWDESTROYED: c_int = 2;
522 pub const HSHELL_ACTIVATESHELLWINDOW: c_int = 3;
523 pub const HSHELL_WINDOWACTIVATED: c_int = 4;
524 pub const HSHELL_GETMINRECT: c_int = 5;
525 pub const HSHELL_REDRAW: c_int = 6;
526 pub const HSHELL_TASKMAN: c_int = 7;
527 pub const HSHELL_LANGUAGE: c_int = 8;
528 pub const HSHELL_SYSMENU: c_int = 9;
529 pub const HSHELL_ENDTASK: c_int = 10;
530 pub const HSHELL_ACCESSIBILITYSTATE: c_int = 11;
531 pub const HSHELL_APPCOMMAND: c_int = 12;
532 pub const HSHELL_WINDOWREPLACED: c_int = 13;
533 pub const HSHELL_WINDOWREPLACING: c_int = 14;
534 pub const HSHELL_MONITORCHANGED: c_int = 16;
535 pub const HSHELL_HIGHBIT: c_int = 0x8000;
536 pub const HSHELL_FLASH: c_int = HSHELL_REDRAW | HSHELL_HIGHBIT;
537 pub const HSHELL_RUDEAPPACTIVATED: c_int = HSHELL_WINDOWACTIVATED | HSHELL_HIGHBIT;
538 pub const APPCOMMAND_BROWSER_BACKWARD: c_short = 1;
539 pub const APPCOMMAND_BROWSER_FORWARD: c_short = 2;
540 pub const APPCOMMAND_BROWSER_REFRESH: c_short = 3;
541 pub const APPCOMMAND_BROWSER_STOP: c_short = 4;
542 pub const APPCOMMAND_BROWSER_SEARCH: c_short = 5;
543 pub const APPCOMMAND_BROWSER_FAVORITES: c_short = 6;
544 pub const APPCOMMAND_BROWSER_HOME: c_short = 7;
545 pub const APPCOMMAND_VOLUME_MUTE: c_short = 8;
546 pub const APPCOMMAND_VOLUME_DOWN: c_short = 9;
547 pub const APPCOMMAND_VOLUME_UP: c_short = 10;
548 pub const APPCOMMAND_MEDIA_NEXTTRACK: c_short = 11;
549 pub const APPCOMMAND_MEDIA_PREVIOUSTRACK: c_short = 12;
550 pub const APPCOMMAND_MEDIA_STOP: c_short = 13;
551 pub const APPCOMMAND_MEDIA_PLAY_PAUSE: c_short = 14;
552 pub const APPCOMMAND_LAUNCH_MAIL: c_short = 15;
553 pub const APPCOMMAND_LAUNCH_MEDIA_SELECT: c_short = 16;
554 pub const APPCOMMAND_LAUNCH_APP1: c_short = 17;
555 pub const APPCOMMAND_LAUNCH_APP2: c_short = 18;
556 pub const APPCOMMAND_BASS_DOWN: c_short = 19;
557 pub const APPCOMMAND_BASS_BOOST: c_short = 20;
558 pub const APPCOMMAND_BASS_UP: c_short = 21;
559 pub const APPCOMMAND_TREBLE_DOWN: c_short = 22;
560 pub const APPCOMMAND_TREBLE_UP: c_short = 23;
561 pub const APPCOMMAND_MICROPHONE_VOLUME_MUTE: c_short = 24;
562 pub const APPCOMMAND_MICROPHONE_VOLUME_DOWN: c_short = 25;
563 pub const APPCOMMAND_MICROPHONE_VOLUME_UP: c_short = 26;
564 pub const APPCOMMAND_HELP: c_short = 27;
565 pub const APPCOMMAND_FIND: c_short = 28;
566 pub const APPCOMMAND_NEW: c_short = 29;
567 pub const APPCOMMAND_OPEN: c_short = 30;
568 pub const APPCOMMAND_CLOSE: c_short = 31;
569 pub const APPCOMMAND_SAVE: c_short = 32;
570 pub const APPCOMMAND_PRINT: c_short = 33;
571 pub const APPCOMMAND_UNDO: c_short = 34;
572 pub const APPCOMMAND_REDO: c_short = 35;
573 pub const APPCOMMAND_COPY: c_short = 36;
574 pub const APPCOMMAND_CUT: c_short = 37;
575 pub const APPCOMMAND_PASTE: c_short = 38;
576 pub const APPCOMMAND_REPLY_TO_MAIL: c_short = 39;
577 pub const APPCOMMAND_FORWARD_MAIL: c_short = 40;
578 pub const APPCOMMAND_SEND_MAIL: c_short = 41;
579 pub const APPCOMMAND_SPELL_CHECK: c_short = 42;
580 pub const APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE: c_short = 43;
581 pub const APPCOMMAND_MIC_ON_OFF_TOGGLE: c_short = 44;
582 pub const APPCOMMAND_CORRECTION_LIST: c_short = 45;
583 pub const APPCOMMAND_MEDIA_PLAY: c_short = 46;
584 pub const APPCOMMAND_MEDIA_PAUSE: c_short = 47;
585 pub const APPCOMMAND_MEDIA_RECORD: c_short = 48;
586 pub const APPCOMMAND_MEDIA_FAST_FORWARD: c_short = 49;
587 pub const APPCOMMAND_MEDIA_REWIND: c_short = 50;
588 pub const APPCOMMAND_MEDIA_CHANNEL_UP: c_short = 51;
589 pub const APPCOMMAND_MEDIA_CHANNEL_DOWN: c_short = 52;
590 pub const APPCOMMAND_DELETE: c_short = 53;
591 pub const APPCOMMAND_DWM_FLIP3D: c_short = 54;
592 pub const FAPPCOMMAND_MOUSE: WORD = 0x8000;
593 pub const FAPPCOMMAND_KEY: WORD = 0;
594 pub const FAPPCOMMAND_OEM: WORD = 0x1000;
595 pub const FAPPCOMMAND_MASK: WORD = 0xF000;
596 #[inline]
GET_APPCOMMAND_LPARAM(lParam: LPARAM) -> c_short597 pub fn GET_APPCOMMAND_LPARAM(lParam: LPARAM) -> c_short {
598 (HIWORD(lParam as DWORD) & !FAPPCOMMAND_MASK) as c_short
599 }
600 #[inline]
GET_DEVICE_LPARAM(lParam: LPARAM) -> WORD601 pub fn GET_DEVICE_LPARAM(lParam: LPARAM) -> WORD {
602 HIWORD(lParam as DWORD) & FAPPCOMMAND_MASK
603 }
604 pub use self::GET_DEVICE_LPARAM as GET_MOUSEORKEY_LPARAM;
605 pub use shared::minwindef::LOWORD as GET_FLAGS_LPARAM;
606 pub use self::GET_FLAGS_LPARAM as GET_KEYSTATE_LPARAM;
607 STRUCT!{struct SHELLHOOKINFO {
608 hwnd: HWND,
609 rc: RECT,
610 }}
611 pub type LPSHELLHOOKINFO = *mut SHELLHOOKINFO;
612 STRUCT!{struct EVENTMSG {
613 message: UINT,
614 paramL: UINT,
615 paramH: UINT,
616 time: DWORD,
617 hwnd: HWND,
618 }}
619 pub type PEVENTMSGMSG = *mut EVENTMSG;
620 pub type NPEVENTMSGMSG = *mut EVENTMSG;
621 pub type LPEVENTMSGMSG = *mut EVENTMSG;
622 pub type PEVENTMSG = *mut EVENTMSG;
623 pub type NPEVENTMSG = *mut EVENTMSG;
624 pub type LPEVENTMSG = *mut EVENTMSG;
625 STRUCT!{struct CWPSTRUCT {
626 lParam: LPARAM,
627 wParam: WPARAM,
628 message: UINT,
629 hwnd: HWND,
630 }}
631 pub type PCWPSTRUCT = *mut CWPSTRUCT;
632 pub type NPCWPSTRUCT = *mut CWPSTRUCT;
633 pub type LPCWPSTRUCT = *mut CWPSTRUCT;
634 STRUCT!{struct CWPRETSTRUCT {
635 lResult: LRESULT,
636 lParam: LPARAM,
637 wParam: WPARAM,
638 message: UINT,
639 hwnd: HWND,
640 }}
641 pub type PCWPRETSTRUCT = *mut CWPRETSTRUCT;
642 pub type NPCWPRETSTRUCT = *mut CWPRETSTRUCT;
643 pub type LPCWPRETSTRUCT = *mut CWPRETSTRUCT;
644 pub const LLKHF_EXTENDED: DWORD = (KF_EXTENDED >> 8) as u32;
645 pub const LLKHF_INJECTED: DWORD = 0x00000010;
646 pub const LLKHF_ALTDOWN: DWORD = (KF_ALTDOWN >> 8) as u32;
647 pub const LLKHF_UP: DWORD = (KF_UP >> 8) as u32;
648 pub const LLKHF_LOWER_IL_INJECTED: DWORD = 0x00000002;
649 pub const LLMHF_INJECTED: DWORD = 0x00000001;
650 pub const LLMHF_LOWER_IL_INJECTED: DWORD = 0x00000002;
651 STRUCT!{struct KBDLLHOOKSTRUCT {
652 vkCode: DWORD,
653 scanCode: DWORD,
654 flags: DWORD,
655 time: DWORD,
656 dwExtraInfo: ULONG_PTR,
657 }}
658 pub type LPKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT;
659 pub type PKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT;
660 STRUCT!{struct MSLLHOOKSTRUCT {
661 pt: POINT,
662 mouseData: DWORD,
663 flags: DWORD,
664 time: DWORD,
665 dwExtraInfo: ULONG_PTR,
666 }}
667 pub type LPMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT;
668 pub type PMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT;
669 STRUCT!{struct DEBUGHOOKINFO {
670 idThread: DWORD,
671 idThreadInstaller: DWORD,
672 lParam: LPARAM,
673 wParam: WPARAM,
674 code: c_int,
675 }}
676 pub type PDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
677 pub type NPDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
678 pub type LPDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
679 STRUCT!{struct MOUSEHOOKSTRUCT {
680 pt: POINT,
681 hwnd: HWND,
682 wHitTestCode: UINT,
683 dwExtraInfo: ULONG_PTR,
684 }}
685 pub type LPMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT;
686 pub type PMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT;
687 STRUCT!{struct MOUSEHOOKSTRUCTEX {
688 parent: MOUSEHOOKSTRUCT,
689 mouseData: DWORD,
690 }}
691 pub type LPMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX;
692 pub type PMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX;
693 STRUCT!{struct HARDWAREHOOKSTRUCT {
694 hwnd: HWND,
695 message: UINT,
696 wParam: WPARAM,
697 lParam: LPARAM,
698 }}
699 pub type LPHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT;
700 pub type PHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT;
701 pub const HKL_PREV: HKL = 0 as HKL;
702 pub const HKL_NEXT: HKL = 1 as HKL;
703 pub const KLF_ACTIVATE: UINT = 0x00000001;
704 pub const KLF_SUBSTITUTE_OK: UINT = 0x00000002;
705 pub const KLF_REORDER: UINT = 0x00000008;
706 pub const KLF_REPLACELANG: UINT = 0x00000010;
707 pub const KLF_NOTELLSHELL: UINT = 0x00000080;
708 pub const KLF_SETFORPROCESS: UINT = 0x00000100;
709 pub const KLF_SHIFTLOCK: UINT = 0x00010000;
710 pub const KLF_RESET: UINT = 0x40000000;
711 pub const INPUTLANGCHANGE_SYSCHARSET: WPARAM = 0x0001;
712 pub const INPUTLANGCHANGE_FORWARD: WPARAM = 0x0002;
713 pub const INPUTLANGCHANGE_BACKWARD: WPARAM = 0x0004;
714 pub const KL_NAMELENGTH: usize = 9;
715 extern "system" {
LoadKeyboardLayoutA( pwszKLID: LPCSTR, Flags: DWORD, ) -> HKL716 pub fn LoadKeyboardLayoutA(
717 pwszKLID: LPCSTR,
718 Flags: DWORD,
719 ) -> HKL;
LoadKeyboardLayoutW( pwszKLID: LPCWSTR, Flags: DWORD, ) -> HKL720 pub fn LoadKeyboardLayoutW(
721 pwszKLID: LPCWSTR,
722 Flags: DWORD,
723 ) -> HKL;
ActivateKeyboardLayout( hkl: HKL, Flags: UINT, ) -> HKL724 pub fn ActivateKeyboardLayout(
725 hkl: HKL,
726 Flags: UINT,
727 ) -> HKL;
ToUnicodeEx( wVirtKey: UINT, wScanCode: UINT, lpKeyState: *const BYTE, pwszBuff: LPWSTR, cchBuff: c_int, wFlags: UINT, dwhkl: HKL, ) -> c_int728 pub fn ToUnicodeEx(
729 wVirtKey: UINT,
730 wScanCode: UINT,
731 lpKeyState: *const BYTE,
732 pwszBuff: LPWSTR,
733 cchBuff: c_int,
734 wFlags: UINT,
735 dwhkl: HKL,
736 ) -> c_int;
UnloadKeyboardLayout( hkl: HKL, ) -> BOOL737 pub fn UnloadKeyboardLayout(
738 hkl: HKL,
739 ) -> BOOL;
GetKeyboardLayoutNameA( pwszKLID: LPSTR, ) -> BOOL740 pub fn GetKeyboardLayoutNameA(
741 pwszKLID: LPSTR,
742 ) -> BOOL;
GetKeyboardLayoutNameW( pwszKLID: LPWSTR, ) -> BOOL743 pub fn GetKeyboardLayoutNameW(
744 pwszKLID: LPWSTR,
745 ) -> BOOL;
GetKeyboardLayoutList( nBuff: c_int, lpList: *mut HKL, ) -> c_int746 pub fn GetKeyboardLayoutList(
747 nBuff: c_int,
748 lpList: *mut HKL,
749 ) -> c_int;
GetKeyboardLayout( idThread: DWORD, ) -> HKL750 pub fn GetKeyboardLayout(
751 idThread: DWORD,
752 ) -> HKL;
753 }
754 STRUCT!{struct MOUSEMOVEPOINT {
755 x: c_int,
756 y: c_int,
757 time: DWORD,
758 dwExtraInfo: ULONG_PTR,
759 }}
760 pub type PMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT;
761 pub type LPMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT;
762 pub const GMMP_USE_DISPLAY_POINTS: DWORD = 1;
763 pub const GMMP_USE_HIGH_RESOLUTION_POINTS: DWORD = 2;
764 extern "system" {
GetMouseMovePointsEx( cbSize: UINT, lppt: LPMOUSEMOVEPOINT, lpptBuf: LPMOUSEMOVEPOINT, nBufPoints: c_int, resolution: DWORD, ) -> c_int765 pub fn GetMouseMovePointsEx(
766 cbSize: UINT,
767 lppt: LPMOUSEMOVEPOINT,
768 lpptBuf: LPMOUSEMOVEPOINT,
769 nBufPoints: c_int,
770 resolution: DWORD,
771 ) -> c_int;
772 }
773 pub const DESKTOP_READOBJECTS: DWORD = 0x0001;
774 pub const DESKTOP_CREATEWINDOW: DWORD = 0x0002;
775 pub const DESKTOP_CREATEMENU: DWORD = 0x0004;
776 pub const DESKTOP_HOOKCONTROL: DWORD = 0x0008;
777 pub const DESKTOP_JOURNALRECORD: DWORD = 0x0010;
778 pub const DESKTOP_JOURNALPLAYBACK: DWORD = 0x0020;
779 pub const DESKTOP_ENUMERATE: DWORD = 0x0040;
780 pub const DESKTOP_WRITEOBJECTS: DWORD = 0x0080;
781 pub const DESKTOP_SWITCHDESKTOP: DWORD = 0x0100;
782 pub const DF_ALLOWOTHERACCOUNTHOOK: DWORD = 0x0001;
783 extern "system" {
CreateDesktopA( lpszDesktop: LPCSTR, lpszDevice: LPCSTR, pDevmode: *mut DEVMODEA, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ) -> HDESK784 pub fn CreateDesktopA(
785 lpszDesktop: LPCSTR,
786 lpszDevice: LPCSTR,
787 pDevmode: *mut DEVMODEA,
788 dwFlags: DWORD,
789 dwDesiredAccess: ACCESS_MASK,
790 lpsa: LPSECURITY_ATTRIBUTES,
791 ) -> HDESK;
CreateDesktopW( lpszDesktop: LPCWSTR, lpszDevice: LPCWSTR, pDevmode: *mut DEVMODEW, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ) -> HDESK792 pub fn CreateDesktopW(
793 lpszDesktop: LPCWSTR,
794 lpszDevice: LPCWSTR,
795 pDevmode: *mut DEVMODEW,
796 dwFlags: DWORD,
797 dwDesiredAccess: ACCESS_MASK,
798 lpsa: LPSECURITY_ATTRIBUTES,
799 ) -> HDESK;
CreateDesktopExA( lpszDesktop: LPCSTR, lpszDevice: LPCSTR, pDevmode: *mut DEVMODEA, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ulHeapSize: ULONG, pvoid: PVOID, ) -> HDESK800 pub fn CreateDesktopExA(
801 lpszDesktop: LPCSTR,
802 lpszDevice: LPCSTR,
803 pDevmode: *mut DEVMODEA,
804 dwFlags: DWORD,
805 dwDesiredAccess: ACCESS_MASK,
806 lpsa: LPSECURITY_ATTRIBUTES,
807 ulHeapSize: ULONG,
808 pvoid: PVOID,
809 ) -> HDESK;
CreateDesktopExW( lpszDesktop: LPCWSTR, lpszDevice: LPCWSTR, pDevmode: *mut DEVMODEW, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ulHeapSize: ULONG, pvoid: PVOID, ) -> HDESK810 pub fn CreateDesktopExW(
811 lpszDesktop: LPCWSTR,
812 lpszDevice: LPCWSTR,
813 pDevmode: *mut DEVMODEW,
814 dwFlags: DWORD,
815 dwDesiredAccess: ACCESS_MASK,
816 lpsa: LPSECURITY_ATTRIBUTES,
817 ulHeapSize: ULONG,
818 pvoid: PVOID,
819 ) -> HDESK;
OpenDesktopA( lpszDesktop: LPCSTR, dwFlags: DWORD, fInherit: BOOL, dwDesiredAccess: ACCESS_MASK, ) -> HDESK820 pub fn OpenDesktopA(
821 lpszDesktop: LPCSTR,
822 dwFlags: DWORD,
823 fInherit: BOOL,
824 dwDesiredAccess: ACCESS_MASK,
825 ) -> HDESK;
OpenDesktopW( lpszDesktop: LPCWSTR, dwFlags: DWORD, fInherit: BOOL, dwDesiredAccess: ACCESS_MASK, ) -> HDESK826 pub fn OpenDesktopW(
827 lpszDesktop: LPCWSTR,
828 dwFlags: DWORD,
829 fInherit: BOOL,
830 dwDesiredAccess: ACCESS_MASK,
831 ) -> HDESK;
OpenInputDesktop( dwFlags: DWORD, fInherit: BOOL, dwDesiredAccess: ACCESS_MASK, ) -> HDESK832 pub fn OpenInputDesktop(
833 dwFlags: DWORD,
834 fInherit: BOOL,
835 dwDesiredAccess: ACCESS_MASK,
836 ) -> HDESK;
EnumDesktopsA( hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROCA, lParam: LPARAM, ) -> BOOL837 pub fn EnumDesktopsA(
838 hwinsta: HWINSTA,
839 lpEnumFunc: DESKTOPENUMPROCA,
840 lParam: LPARAM,
841 ) -> BOOL;
EnumDesktopsW( hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROCW, lParam: LPARAM, ) -> BOOL842 pub fn EnumDesktopsW(
843 hwinsta: HWINSTA,
844 lpEnumFunc: DESKTOPENUMPROCW,
845 lParam: LPARAM,
846 ) -> BOOL;
EnumDesktopWindows( hDesktop: HDESK, lpfn: WNDENUMPROC, lParam: LPARAM, ) -> BOOL847 pub fn EnumDesktopWindows(
848 hDesktop: HDESK,
849 lpfn: WNDENUMPROC,
850 lParam: LPARAM,
851 ) -> BOOL;
SwitchDesktop( hDesktop: HDESK, ) -> BOOL852 pub fn SwitchDesktop(
853 hDesktop: HDESK,
854 ) -> BOOL;
SetThreadDesktop( hDesktop: HDESK, ) -> BOOL855 pub fn SetThreadDesktop(
856 hDesktop: HDESK,
857 ) -> BOOL;
CloseDesktop( hDesktop: HDESK, ) -> BOOL858 pub fn CloseDesktop(
859 hDesktop: HDESK,
860 ) -> BOOL;
GetThreadDesktop( dwThreadId: DWORD, ) -> HDESK861 pub fn GetThreadDesktop(
862 dwThreadId: DWORD,
863 ) -> HDESK;
864 }
865 pub const WINSTA_ENUMDESKTOPS: DWORD = 0x0001;
866 pub const WINSTA_READATTRIBUTES: DWORD = 0x0002;
867 pub const WINSTA_ACCESSCLIPBOARD: DWORD = 0x0004;
868 pub const WINSTA_CREATEDESKTOP: DWORD = 0x0008;
869 pub const WINSTA_WRITEATTRIBUTES: DWORD = 0x0010;
870 pub const WINSTA_ACCESSGLOBALATOMS: DWORD = 0x0020;
871 pub const WINSTA_EXITWINDOWS: DWORD = 0x0040;
872 pub const WINSTA_ENUMERATE: DWORD = 0x0100;
873 pub const WINSTA_READSCREEN: DWORD = 0x0200;
874 pub const WINSTA_ALL_ACCESS: DWORD = WINSTA_ENUMDESKTOPS | WINSTA_READATTRIBUTES
875 | WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | WINSTA_WRITEATTRIBUTES
876 | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | WINSTA_READSCREEN;
877 pub const CWF_CREATE_ONLY: DWORD = 0x00000001;
878 pub const WSF_VISIBLE: DWORD = 0x0001;
879 extern "system" {
CreateWindowStationA( lpwinsta: LPCSTR, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ) -> HWINSTA880 pub fn CreateWindowStationA(
881 lpwinsta: LPCSTR,
882 dwFlags: DWORD,
883 dwDesiredAccess: ACCESS_MASK,
884 lpsa: LPSECURITY_ATTRIBUTES,
885 ) -> HWINSTA;
CreateWindowStationW( lpwinsta: LPCWSTR, dwFlags: DWORD, dwDesiredAccess: ACCESS_MASK, lpsa: LPSECURITY_ATTRIBUTES, ) -> HWINSTA886 pub fn CreateWindowStationW(
887 lpwinsta: LPCWSTR,
888 dwFlags: DWORD,
889 dwDesiredAccess: ACCESS_MASK,
890 lpsa: LPSECURITY_ATTRIBUTES,
891 ) -> HWINSTA;
OpenWindowStationA( lpszWinSta: LPCSTR, fInherit: BOOL, dwDesiredAccess: ACCESS_MASK, ) -> HWINSTA892 pub fn OpenWindowStationA(
893 lpszWinSta: LPCSTR,
894 fInherit: BOOL,
895 dwDesiredAccess: ACCESS_MASK,
896 ) -> HWINSTA;
OpenWindowStationW( lpszWinSta: LPCWSTR, fInherit: BOOL, dwDesiredAccess: ACCESS_MASK, ) -> HWINSTA897 pub fn OpenWindowStationW(
898 lpszWinSta: LPCWSTR,
899 fInherit: BOOL,
900 dwDesiredAccess: ACCESS_MASK,
901 ) -> HWINSTA;
EnumWindowStationsA( lpEnumFunc: WINSTAENUMPROCA, lParam: LPARAM, ) -> BOOL902 pub fn EnumWindowStationsA(
903 lpEnumFunc: WINSTAENUMPROCA,
904 lParam: LPARAM,
905 ) -> BOOL;
EnumWindowStationsW( lpEnumFunc: WINSTAENUMPROCW, lParam: LPARAM, ) -> BOOL906 pub fn EnumWindowStationsW(
907 lpEnumFunc: WINSTAENUMPROCW,
908 lParam: LPARAM,
909 ) -> BOOL;
CloseWindowStation( hWinSta: HWINSTA, ) -> BOOL910 pub fn CloseWindowStation(
911 hWinSta: HWINSTA,
912 ) -> BOOL;
SetProcessWindowStation( hWinSta: HWINSTA, ) -> BOOL913 pub fn SetProcessWindowStation(
914 hWinSta: HWINSTA,
915 ) -> BOOL;
GetProcessWindowStation() -> HWINSTA916 pub fn GetProcessWindowStation() -> HWINSTA;
SetUserObjectSecurity( hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, pSID: PSECURITY_DESCRIPTOR, ) -> BOOL917 pub fn SetUserObjectSecurity(
918 hObj: HANDLE,
919 pSIRequested: PSECURITY_INFORMATION,
920 pSID: PSECURITY_DESCRIPTOR,
921 ) -> BOOL;
GetUserObjectSecurity( hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, pSID: PSECURITY_DESCRIPTOR, nLength: DWORD, lpnLengthNeeded: LPDWORD, ) -> BOOL922 pub fn GetUserObjectSecurity(
923 hObj: HANDLE,
924 pSIRequested: PSECURITY_INFORMATION,
925 pSID: PSECURITY_DESCRIPTOR,
926 nLength: DWORD,
927 lpnLengthNeeded: LPDWORD,
928 ) -> BOOL;
929 }
930 pub const UOI_FLAGS: DWORD = 1;
931 pub const UOI_NAME: DWORD = 2;
932 pub const UOI_TYPE: DWORD = 3;
933 pub const UOI_USER_SID: DWORD = 4;
934 pub const UOI_HEAPSIZE: DWORD = 5;
935 pub const UOI_IO: DWORD = 6;
936 pub const UOI_TIMERPROC_EXCEPTION_SUPPRESSION: DWORD = 7;
937 STRUCT!{struct USEROBJECTFLAGS {
938 fInherit: BOOL,
939 fReserved: BOOL,
940 dwFlags: DWORD,
941 }}
942 pub type PUSEROBJECTFLAGS = *mut USEROBJECTFLAGS;
943 extern "system" {
GetUserObjectInformationA( hObj: HANDLE, nIndex: c_int, pvInfo: PVOID, nLength: DWORD, lpnLengthNeeded: LPDWORD, ) -> BOOL944 pub fn GetUserObjectInformationA(
945 hObj: HANDLE,
946 nIndex: c_int,
947 pvInfo: PVOID,
948 nLength: DWORD,
949 lpnLengthNeeded: LPDWORD,
950 ) -> BOOL;
GetUserObjectInformationW( hObj: HANDLE, nIndex: c_int, pvInfo: PVOID, nLength: DWORD, lpnLengthNeeded: LPDWORD, ) -> BOOL951 pub fn GetUserObjectInformationW(
952 hObj: HANDLE,
953 nIndex: c_int,
954 pvInfo: PVOID,
955 nLength: DWORD,
956 lpnLengthNeeded: LPDWORD,
957 ) -> BOOL;
SetUserObjectInformationA( hObj: HANDLE, nIndex: c_int, pvInfo: PVOID, nLength: DWORD, ) -> BOOL958 pub fn SetUserObjectInformationA(
959 hObj: HANDLE,
960 nIndex: c_int,
961 pvInfo: PVOID,
962 nLength: DWORD,
963 ) -> BOOL;
SetUserObjectInformationW( hObj: HANDLE, nIndex: c_int, pvInfo: PVOID, nLength: DWORD, ) -> BOOL964 pub fn SetUserObjectInformationW(
965 hObj: HANDLE,
966 nIndex: c_int,
967 pvInfo: PVOID,
968 nLength: DWORD,
969 ) -> BOOL;
970 }
971 STRUCT!{struct WNDCLASSEXA {
972 cbSize: UINT,
973 style: UINT,
974 lpfnWndProc: WNDPROC,
975 cbClsExtra: c_int,
976 cbWndExtra: c_int,
977 hInstance: HINSTANCE,
978 hIcon: HICON,
979 hCursor: HCURSOR,
980 hbrBackground: HBRUSH,
981 lpszMenuName: LPCSTR,
982 lpszClassName: LPCSTR,
983 hIconSm: HICON,
984 }}
985 pub type PWNDCLASSEXA = *mut WNDCLASSEXA;
986 pub type NPWNDCLASSEXA = *mut WNDCLASSEXA;
987 pub type LPWNDCLASSEXA = *mut WNDCLASSEXA;
988 STRUCT!{struct WNDCLASSEXW {
989 cbSize: UINT,
990 style: UINT,
991 lpfnWndProc: WNDPROC,
992 cbClsExtra: c_int,
993 cbWndExtra: c_int,
994 hInstance: HINSTANCE,
995 hIcon: HICON,
996 hCursor: HCURSOR,
997 hbrBackground: HBRUSH,
998 lpszMenuName: LPCWSTR,
999 lpszClassName: LPCWSTR,
1000 hIconSm: HICON,
1001 }}
1002 pub type PWNDCLASSEXW = *mut WNDCLASSEXW;
1003 pub type NPWNDCLASSEXW = *mut WNDCLASSEXW;
1004 pub type LPWNDCLASSEXW = *mut WNDCLASSEXW;
1005 STRUCT!{struct WNDCLASSA {
1006 style: UINT,
1007 lpfnWndProc: WNDPROC,
1008 cbClsExtra: c_int,
1009 cbWndExtra: c_int,
1010 hInstance: HINSTANCE,
1011 hIcon: HICON,
1012 hCursor: HCURSOR,
1013 hbrBackground: HBRUSH,
1014 lpszMenuName: LPCSTR,
1015 lpszClassName: LPCSTR,
1016 }}
1017 pub type PWNDCLASSA = *mut WNDCLASSA;
1018 pub type NPWNDCLASSA = *mut WNDCLASSA;
1019 pub type LPWNDCLASSA = *mut WNDCLASSA;
1020 STRUCT!{struct WNDCLASSW {
1021 style: UINT,
1022 lpfnWndProc: WNDPROC,
1023 cbClsExtra: c_int,
1024 cbWndExtra: c_int,
1025 hInstance: HINSTANCE,
1026 hIcon: HICON,
1027 hCursor: HCURSOR,
1028 hbrBackground: HBRUSH,
1029 lpszMenuName: LPCWSTR,
1030 lpszClassName: LPCWSTR,
1031 }}
1032 pub type PWNDCLASSW = *mut WNDCLASSW;
1033 pub type NPWNDCLASSW = *mut WNDCLASSW;
1034 pub type LPWNDCLASSW = *mut WNDCLASSW;
1035 extern "system" {
IsHungAppWindow( hwnd: HWND, ) -> BOOL1036 pub fn IsHungAppWindow(
1037 hwnd: HWND,
1038 ) -> BOOL;
DisableProcessWindowsGhosting()1039 pub fn DisableProcessWindowsGhosting();
1040 }
1041 STRUCT!{struct MSG {
1042 hwnd: HWND,
1043 message: UINT,
1044 wParam: WPARAM,
1045 lParam: LPARAM,
1046 time: DWORD,
1047 pt: POINT,
1048 }}
1049 pub type PMSG = *mut MSG;
1050 pub type NPMSG = *mut MSG;
1051 pub type LPMSG = *mut MSG;
1052 //POINTSTOPOINT
1053 //POINTTOPOINTS
1054 //MAKEWPARAM
1055 //MAKELPARAM
1056 //MAKELRESULT
1057 pub const GWL_WNDPROC: c_int = -4;
1058 pub const GWL_HINSTANCE: c_int = -6;
1059 pub const GWL_HWNDPARENT: c_int = -8;
1060 pub const GWL_STYLE: c_int = -16;
1061 pub const GWL_EXSTYLE: c_int = -20;
1062 pub const GWL_USERDATA: c_int = -21;
1063 pub const GWL_ID: c_int = -12;
1064 pub const GWLP_WNDPROC: c_int = -4;
1065 pub const GWLP_HINSTANCE: c_int = -6;
1066 pub const GWLP_HWNDPARENT: c_int = -8;
1067 pub const GWLP_USERDATA: c_int = -21;
1068 pub const GWLP_ID: c_int = -12;
1069 pub const GCL_MENUNAME: c_int = -8;
1070 pub const GCL_HBRBACKGROUND: c_int = -10;
1071 pub const GCL_HCURSOR: c_int = -12;
1072 pub const GCL_HICON: c_int = -14;
1073 pub const GCL_HMODULE: c_int = -16;
1074 pub const GCL_CBWNDEXTRA: c_int = -18;
1075 pub const GCL_CBCLSEXTRA: c_int = -20;
1076 pub const GCL_WNDPROC: c_int = -24;
1077 pub const GCL_STYLE: c_int = -26;
1078 pub const GCW_ATOM: c_int = -32;
1079 pub const GCL_HICONSM: c_int = -34;
1080 pub const GCLP_MENUNAME: c_int = -8;
1081 pub const GCLP_HBRBACKGROUND: c_int = -10;
1082 pub const GCLP_HCURSOR: c_int = -12;
1083 pub const GCLP_HICON: c_int = -14;
1084 pub const GCLP_HMODULE: c_int = -16;
1085 pub const GCLP_WNDPROC: c_int = -24;
1086 pub const GCLP_HICONSM: c_int = -34;
1087 pub const WM_NULL: UINT = 0x0000;
1088 pub const WM_CREATE: UINT = 0x0001;
1089 pub const WM_DESTROY: UINT = 0x0002;
1090 pub const WM_MOVE: UINT = 0x0003;
1091 pub const WM_SIZE: UINT = 0x0005;
1092 pub const WM_ACTIVATE: UINT = 0x0006;
1093 pub const WA_INACTIVE: WORD = 0;
1094 pub const WA_ACTIVE: WORD = 1;
1095 pub const WA_CLICKACTIVE: WORD = 2;
1096 pub const WM_SETFOCUS: UINT = 0x0007;
1097 pub const WM_KILLFOCUS: UINT = 0x0008;
1098 pub const WM_ENABLE: UINT = 0x000A;
1099 pub const WM_SETREDRAW: UINT = 0x000B;
1100 pub const WM_SETTEXT: UINT = 0x000C;
1101 pub const WM_GETTEXT: UINT = 0x000D;
1102 pub const WM_GETTEXTLENGTH: UINT = 0x000E;
1103 pub const WM_PAINT: UINT = 0x000F;
1104 pub const WM_CLOSE: UINT = 0x0010;
1105 pub const WM_QUERYENDSESSION: UINT = 0x0011;
1106 pub const WM_QUERYOPEN: UINT = 0x0013;
1107 pub const WM_ENDSESSION: UINT = 0x0016;
1108 pub const WM_QUIT: UINT = 0x0012;
1109 pub const WM_ERASEBKGND: UINT = 0x0014;
1110 pub const WM_SYSCOLORCHANGE: UINT = 0x0015;
1111 pub const WM_SHOWWINDOW: UINT = 0x0018;
1112 pub const WM_WININICHANGE: UINT = 0x001A;
1113 pub const WM_SETTINGCHANGE: UINT = WM_WININICHANGE;
1114 pub const WM_DEVMODECHANGE: UINT = 0x001B;
1115 pub const WM_ACTIVATEAPP: UINT = 0x001C;
1116 pub const WM_FONTCHANGE: UINT = 0x001D;
1117 pub const WM_TIMECHANGE: UINT = 0x001E;
1118 pub const WM_CANCELMODE: UINT = 0x001F;
1119 pub const WM_SETCURSOR: UINT = 0x0020;
1120 pub const WM_MOUSEACTIVATE: UINT = 0x0021;
1121 pub const WM_CHILDACTIVATE: UINT = 0x0022;
1122 pub const WM_QUEUESYNC: UINT = 0x0023;
1123 pub const WM_GETMINMAXINFO: UINT = 0x0024;
1124 STRUCT!{struct MINMAXINFO {
1125 ptReserved: POINT,
1126 ptMaxSize: POINT,
1127 ptMaxPosition: POINT,
1128 ptMinTrackSize: POINT,
1129 ptMaxTrackSize: POINT,
1130 }}
1131 pub type PMINMAXINFO = *mut MINMAXINFO;
1132 pub type LPMINMAXINFO = *mut MINMAXINFO;
1133 pub const WM_PAINTICON: UINT = 0x0026;
1134 pub const WM_ICONERASEBKGND: UINT = 0x0027;
1135 pub const WM_NEXTDLGCTL: UINT = 0x0028;
1136 pub const WM_SPOOLERSTATUS: UINT = 0x002A;
1137 pub const WM_DRAWITEM: UINT = 0x002B;
1138 pub const WM_MEASUREITEM: UINT = 0x002C;
1139 pub const WM_DELETEITEM: UINT = 0x002D;
1140 pub const WM_VKEYTOITEM: UINT = 0x002E;
1141 pub const WM_CHARTOITEM: UINT = 0x002F;
1142 pub const WM_SETFONT: UINT = 0x0030;
1143 pub const WM_GETFONT: UINT = 0x0031;
1144 pub const WM_SETHOTKEY: UINT = 0x0032;
1145 pub const WM_GETHOTKEY: UINT = 0x0033;
1146 pub const WM_QUERYDRAGICON: UINT = 0x0037;
1147 pub const WM_COMPAREITEM: UINT = 0x0039;
1148 pub const WM_GETOBJECT: UINT = 0x003D;
1149 pub const WM_COMPACTING: UINT = 0x0041;
1150 pub const WM_COMMNOTIFY: UINT = 0x0044;
1151 pub const WM_WINDOWPOSCHANGING: UINT = 0x0046;
1152 pub const WM_WINDOWPOSCHANGED: UINT = 0x0047;
1153 pub const WM_POWER: UINT = 0x0048;
1154 pub const PWR_OK: WPARAM = 1;
1155 pub const PWR_FAIL: WPARAM = -1isize as usize;
1156 pub const PWR_SUSPENDREQUEST: WPARAM = 1;
1157 pub const PWR_SUSPENDRESUME: WPARAM = 2;
1158 pub const PWR_CRITICALRESUME: WPARAM = 3;
1159 pub const WM_COPYDATA: UINT = 0x004A;
1160 pub const WM_CANCELJOURNAL: UINT = 0x004B;
1161 STRUCT!{struct COPYDATASTRUCT {
1162 dwData: ULONG_PTR,
1163 cbData: DWORD,
1164 lpData: PVOID,
1165 }}
1166 pub type PCOPYDATASTRUCT = *mut COPYDATASTRUCT;
1167 STRUCT!{struct MDINEXTMENU {
1168 hmenuIn: HMENU,
1169 hmenuNext: HMENU,
1170 hwndNext: HWND,
1171 }}
1172 pub type PMDINEXTMENU = *mut MDINEXTMENU;
1173 pub type LPMDINEXTMENU = *mut MDINEXTMENU;
1174 pub const WM_NOTIFY: UINT = 0x004E;
1175 pub const WM_INPUTLANGCHANGEREQUEST: UINT = 0x0050;
1176 pub const WM_INPUTLANGCHANGE: UINT = 0x0051;
1177 pub const WM_TCARD: UINT = 0x0052;
1178 pub const WM_HELP: UINT = 0x0053;
1179 pub const WM_USERCHANGED: UINT = 0x0054;
1180 pub const WM_NOTIFYFORMAT: UINT = 0x0055;
1181 pub const NFR_ANSI: LRESULT = 1;
1182 pub const NFR_UNICODE: LRESULT = 2;
1183 pub const NF_QUERY: LPARAM = 3;
1184 pub const NF_REQUERY: LPARAM = 4;
1185 pub const WM_CONTEXTMENU: UINT = 0x007B;
1186 pub const WM_STYLECHANGING: UINT = 0x007C;
1187 pub const WM_STYLECHANGED: UINT = 0x007D;
1188 pub const WM_DISPLAYCHANGE: UINT = 0x007E;
1189 pub const WM_GETICON: UINT = 0x007F;
1190 pub const WM_SETICON: UINT = 0x0080;
1191 pub const WM_NCCREATE: UINT = 0x0081;
1192 pub const WM_NCDESTROY: UINT = 0x0082;
1193 pub const WM_NCCALCSIZE: UINT = 0x0083;
1194 pub const WM_NCHITTEST: UINT = 0x0084;
1195 pub const WM_NCPAINT: UINT = 0x0085;
1196 pub const WM_NCACTIVATE: UINT = 0x0086;
1197 pub const WM_GETDLGCODE: UINT = 0x0087;
1198 pub const WM_SYNCPAINT: UINT = 0x0088;
1199 pub const WM_NCMOUSEMOVE: UINT = 0x00A0;
1200 pub const WM_NCLBUTTONDOWN: UINT = 0x00A1;
1201 pub const WM_NCLBUTTONUP: UINT = 0x00A2;
1202 pub const WM_NCLBUTTONDBLCLK: UINT = 0x00A3;
1203 pub const WM_NCRBUTTONDOWN: UINT = 0x00A4;
1204 pub const WM_NCRBUTTONUP: UINT = 0x00A5;
1205 pub const WM_NCRBUTTONDBLCLK: UINT = 0x00A6;
1206 pub const WM_NCMBUTTONDOWN: UINT = 0x00A7;
1207 pub const WM_NCMBUTTONUP: UINT = 0x00A8;
1208 pub const WM_NCMBUTTONDBLCLK: UINT = 0x00A9;
1209 pub const WM_NCXBUTTONDOWN: UINT = 0x00AB;
1210 pub const WM_NCXBUTTONUP: UINT = 0x00AC;
1211 pub const WM_NCXBUTTONDBLCLK: UINT = 0x00AD;
1212 pub const WM_INPUT_DEVICE_CHANGE: UINT = 0x00FE;
1213 pub const WM_INPUT: UINT = 0x00FF;
1214 pub const WM_KEYFIRST: UINT = 0x0100;
1215 pub const WM_KEYDOWN: UINT = 0x0100;
1216 pub const WM_KEYUP: UINT = 0x0101;
1217 pub const WM_CHAR: UINT = 0x0102;
1218 pub const WM_DEADCHAR: UINT = 0x0103;
1219 pub const WM_SYSKEYDOWN: UINT = 0x0104;
1220 pub const WM_SYSKEYUP: UINT = 0x0105;
1221 pub const WM_SYSCHAR: UINT = 0x0106;
1222 pub const WM_SYSDEADCHAR: UINT = 0x0107;
1223 pub const WM_UNICHAR: UINT = 0x0109;
1224 pub const WM_KEYLAST: UINT = 0x0109;
1225 pub const UNICODE_NOCHAR: WPARAM = 0xFFFF;
1226 pub const WM_IME_STARTCOMPOSITION: UINT = 0x010D;
1227 pub const WM_IME_ENDCOMPOSITION: UINT = 0x010E;
1228 pub const WM_IME_COMPOSITION: UINT = 0x010F;
1229 pub const WM_IME_KEYLAST: UINT = 0x010F;
1230 pub const WM_INITDIALOG: UINT = 0x0110;
1231 pub const WM_COMMAND: UINT = 0x0111;
1232 pub const WM_SYSCOMMAND: UINT = 0x0112;
1233 pub const WM_TIMER: UINT = 0x0113;
1234 pub const WM_HSCROLL: UINT = 0x0114;
1235 pub const WM_VSCROLL: UINT = 0x0115;
1236 pub const WM_INITMENU: UINT = 0x0116;
1237 pub const WM_INITMENUPOPUP: UINT = 0x0117;
1238 pub const WM_GESTURE: UINT = 0x0119;
1239 pub const WM_GESTURENOTIFY: UINT = 0x011A;
1240 pub const WM_MENUSELECT: UINT = 0x011F;
1241 pub const WM_MENUCHAR: UINT = 0x0120;
1242 pub const WM_ENTERIDLE: UINT = 0x0121;
1243 pub const WM_MENURBUTTONUP: UINT = 0x0122;
1244 pub const WM_MENUDRAG: UINT = 0x0123;
1245 pub const WM_MENUGETOBJECT: UINT = 0x0124;
1246 pub const WM_UNINITMENUPOPUP: UINT = 0x0125;
1247 pub const WM_MENUCOMMAND: UINT = 0x0126;
1248 pub const WM_CHANGEUISTATE: UINT = 0x0127;
1249 pub const WM_UPDATEUISTATE: UINT = 0x0128;
1250 pub const WM_QUERYUISTATE: UINT = 0x0129;
1251 pub const UIS_SET: WORD = 1;
1252 pub const UIS_CLEAR: WORD = 2;
1253 pub const UIS_INITIALIZE: WORD = 3;
1254 pub const UISF_HIDEFOCUS: WORD = 0x1;
1255 pub const UISF_HIDEACCEL: WORD = 0x2;
1256 pub const UISF_ACTIVE: WORD = 0x4;
1257 pub const WM_CTLCOLORMSGBOX: UINT = 0x0132;
1258 pub const WM_CTLCOLOREDIT: UINT = 0x0133;
1259 pub const WM_CTLCOLORLISTBOX: UINT = 0x0134;
1260 pub const WM_CTLCOLORBTN: UINT = 0x0135;
1261 pub const WM_CTLCOLORDLG: UINT = 0x0136;
1262 pub const WM_CTLCOLORSCROLLBAR: UINT = 0x0137;
1263 pub const WM_CTLCOLORSTATIC: UINT = 0x0138;
1264 pub const MN_GETHMENU: UINT = 0x01E1;
1265 pub const WM_MOUSEFIRST: UINT = 0x0200;
1266 pub const WM_MOUSEMOVE: UINT = 0x0200;
1267 pub const WM_LBUTTONDOWN: UINT = 0x0201;
1268 pub const WM_LBUTTONUP: UINT = 0x0202;
1269 pub const WM_LBUTTONDBLCLK: UINT = 0x0203;
1270 pub const WM_RBUTTONDOWN: UINT = 0x0204;
1271 pub const WM_RBUTTONUP: UINT = 0x0205;
1272 pub const WM_RBUTTONDBLCLK: UINT = 0x0206;
1273 pub const WM_MBUTTONDOWN: UINT = 0x0207;
1274 pub const WM_MBUTTONUP: UINT = 0x0208;
1275 pub const WM_MBUTTONDBLCLK: UINT = 0x0209;
1276 pub const WM_MOUSEWHEEL: UINT = 0x020A;
1277 pub const WM_XBUTTONDOWN: UINT = 0x020B;
1278 pub const WM_XBUTTONUP: UINT = 0x020C;
1279 pub const WM_XBUTTONDBLCLK: UINT = 0x020D;
1280 pub const WM_MOUSEHWHEEL: UINT = 0x020E;
1281 pub const WM_MOUSELAST: UINT = 0x020E;
1282 pub const WHEEL_DELTA: c_short = 120;
1283 #[inline]
GET_WHEEL_DELTA_WPARAM(wParam: WPARAM) -> c_short1284 pub fn GET_WHEEL_DELTA_WPARAM(wParam: WPARAM) -> c_short {
1285 HIWORD(wParam as DWORD) as c_short
1286 }
1287 pub const WHEEL_PAGESCROLL: UINT = UINT_MAX;
1288 #[inline]
GET_KEYSTATE_WPARAM(wParam: WPARAM) -> WORD1289 pub fn GET_KEYSTATE_WPARAM(wParam: WPARAM) -> WORD {
1290 LOWORD(wParam as DWORD)
1291 }
1292 #[inline]
GET_NCHITTEST_WPARAM(wParam: WPARAM) -> c_short1293 pub fn GET_NCHITTEST_WPARAM(wParam: WPARAM) -> c_short {
1294 LOWORD(wParam as DWORD) as c_short
1295 }
1296 #[inline]
GET_XBUTTON_WPARAM(wParam: WPARAM) -> WORD1297 pub fn GET_XBUTTON_WPARAM(wParam: WPARAM) -> WORD {
1298 HIWORD(wParam as DWORD)
1299 }
1300 pub const XBUTTON1: WORD = 0x0001;
1301 pub const XBUTTON2: WORD = 0x0002;
1302 pub const WM_PARENTNOTIFY: UINT = 0x0210;
1303 pub const WM_ENTERMENULOOP: UINT = 0x0211;
1304 pub const WM_EXITMENULOOP: UINT = 0x0212;
1305 pub const WM_NEXTMENU: UINT = 0x0213;
1306 pub const WM_SIZING: UINT = 0x0214;
1307 pub const WM_CAPTURECHANGED: UINT = 0x0215;
1308 pub const WM_MOVING: UINT = 0x0216;
1309 pub const WM_POWERBROADCAST: UINT = 0x0218;
1310 pub const PBT_APMQUERYSUSPEND: WPARAM = 0x0000;
1311 pub const PBT_APMQUERYSTANDBY: WPARAM = 0x0001;
1312 pub const PBT_APMQUERYSUSPENDFAILED: WPARAM = 0x0002;
1313 pub const PBT_APMQUERYSTANDBYFAILED: WPARAM = 0x0003;
1314 pub const PBT_APMSUSPEND: WPARAM = 0x0004;
1315 pub const PBT_APMSTANDBY: WPARAM = 0x0005;
1316 pub const PBT_APMRESUMECRITICAL: WPARAM = 0x0006;
1317 pub const PBT_APMRESUMESUSPEND: WPARAM = 0x0007;
1318 pub const PBT_APMRESUMESTANDBY: WPARAM = 0x0008;
1319 pub const PBTF_APMRESUMEFROMFAILURE: LPARAM = 0x00000001;
1320 pub const PBT_APMBATTERYLOW: WPARAM = 0x0009;
1321 pub const PBT_APMPOWERSTATUSCHANGE: WPARAM = 0x000A;
1322 pub const PBT_APMOEMEVENT: WPARAM = 0x000B;
1323 pub const PBT_APMRESUMEAUTOMATIC: WPARAM = 0x0012;
1324 pub const PBT_POWERSETTINGCHANGE: WPARAM = 0x8013;
1325 STRUCT!{struct POWERBROADCAST_SETTING {
1326 PowerSetting: GUID,
1327 DataLength: DWORD,
1328 Data: [UCHAR; 1],
1329 }}
1330 pub type PPOWERBROADCAST_SETTING = *mut POWERBROADCAST_SETTING;
1331 pub const WM_DEVICECHANGE: UINT = 0x0219;
1332 pub const WM_MDICREATE: UINT = 0x0220;
1333 pub const WM_MDIDESTROY: UINT = 0x0221;
1334 pub const WM_MDIACTIVATE: UINT = 0x0222;
1335 pub const WM_MDIRESTORE: UINT = 0x0223;
1336 pub const WM_MDINEXT: UINT = 0x0224;
1337 pub const WM_MDIMAXIMIZE: UINT = 0x0225;
1338 pub const WM_MDITILE: UINT = 0x0226;
1339 pub const WM_MDICASCADE: UINT = 0x0227;
1340 pub const WM_MDIICONARRANGE: UINT = 0x0228;
1341 pub const WM_MDIGETACTIVE: UINT = 0x0229;
1342 pub const WM_MDISETMENU: UINT = 0x0230;
1343 pub const WM_ENTERSIZEMOVE: UINT = 0x0231;
1344 pub const WM_EXITSIZEMOVE: UINT = 0x0232;
1345 pub const WM_DROPFILES: UINT = 0x0233;
1346 pub const WM_MDIREFRESHMENU: UINT = 0x0234;
1347 pub const WM_POINTERDEVICECHANGE: UINT = 0x238;
1348 pub const WM_POINTERDEVICEINRANGE: UINT = 0x239;
1349 pub const WM_POINTERDEVICEOUTOFRANGE: UINT = 0x23A;
1350 pub const WM_TOUCH: UINT = 0x0240;
1351 pub const WM_NCPOINTERUPDATE: UINT = 0x0241;
1352 pub const WM_NCPOINTERDOWN: UINT = 0x0242;
1353 pub const WM_NCPOINTERUP: UINT = 0x0243;
1354 pub const WM_POINTERUPDATE: UINT = 0x0245;
1355 pub const WM_POINTERDOWN: UINT = 0x0246;
1356 pub const WM_POINTERUP: UINT = 0x0247;
1357 pub const WM_POINTERENTER: UINT = 0x0249;
1358 pub const WM_POINTERLEAVE: UINT = 0x024A;
1359 pub const WM_POINTERACTIVATE: UINT = 0x024B;
1360 pub const WM_POINTERCAPTURECHANGED: UINT = 0x024C;
1361 pub const WM_TOUCHHITTESTING: UINT = 0x024D;
1362 pub const WM_POINTERWHEEL: UINT = 0x024E;
1363 pub const WM_POINTERHWHEEL: UINT = 0x024F;
1364 pub const DM_POINTERHITTEST: UINT = 0x0250;
1365 pub const WM_POINTERROUTEDTO: UINT = 0x0251;
1366 pub const WM_POINTERROUTEDAWAY: UINT = 0x0252;
1367 pub const WM_POINTERROUTEDRELEASED: UINT = 0x0253;
1368 pub const WM_IME_SETCONTEXT: UINT = 0x0281;
1369 pub const WM_IME_NOTIFY: UINT = 0x0282;
1370 pub const WM_IME_CONTROL: UINT = 0x0283;
1371 pub const WM_IME_COMPOSITIONFULL: UINT = 0x0284;
1372 pub const WM_IME_SELECT: UINT = 0x0285;
1373 pub const WM_IME_CHAR: UINT = 0x0286;
1374 pub const WM_IME_REQUEST: UINT = 0x0288;
1375 pub const WM_IME_KEYDOWN: UINT = 0x0290;
1376 pub const WM_IME_KEYUP: UINT = 0x0291;
1377 pub const WM_MOUSEHOVER: UINT = 0x02A1;
1378 pub const WM_MOUSELEAVE: UINT = 0x02A3;
1379 pub const WM_NCMOUSEHOVER: UINT = 0x02A0;
1380 pub const WM_NCMOUSELEAVE: UINT = 0x02A2;
1381 pub const WM_WTSSESSION_CHANGE: UINT = 0x02B1;
1382 pub const WM_TABLET_FIRST: UINT = 0x02c0;
1383 pub const WM_TABLET_LAST: UINT = 0x02df;
1384 pub const WM_DPICHANGED: UINT = 0x02E0;
1385 pub const WM_DPICHANGED_BEFOREPARENT: UINT = 0x02E2;
1386 pub const WM_DPICHANGED_AFTERPARENT: UINT = 0x02E3;
1387 pub const WM_GETDPISCALEDSIZE: UINT = 0x02E4;
1388 pub const WM_CUT: UINT = 0x0300;
1389 pub const WM_COPY: UINT = 0x0301;
1390 pub const WM_PASTE: UINT = 0x0302;
1391 pub const WM_CLEAR: UINT = 0x0303;
1392 pub const WM_UNDO: UINT = 0x0304;
1393 pub const WM_RENDERFORMAT: UINT = 0x0305;
1394 pub const WM_RENDERALLFORMATS: UINT = 0x0306;
1395 pub const WM_DESTROYCLIPBOARD: UINT = 0x0307;
1396 pub const WM_DRAWCLIPBOARD: UINT = 0x0308;
1397 pub const WM_PAINTCLIPBOARD: UINT = 0x0309;
1398 pub const WM_VSCROLLCLIPBOARD: UINT = 0x030A;
1399 pub const WM_SIZECLIPBOARD: UINT = 0x030B;
1400 pub const WM_ASKCBFORMATNAME: UINT = 0x030C;
1401 pub const WM_CHANGECBCHAIN: UINT = 0x030D;
1402 pub const WM_HSCROLLCLIPBOARD: UINT = 0x030E;
1403 pub const WM_QUERYNEWPALETTE: UINT = 0x030F;
1404 pub const WM_PALETTEISCHANGING: UINT = 0x0310;
1405 pub const WM_PALETTECHANGED: UINT = 0x0311;
1406 pub const WM_HOTKEY: UINT = 0x0312;
1407 pub const WM_PRINT: UINT = 0x0317;
1408 pub const WM_PRINTCLIENT: UINT = 0x0318;
1409 pub const WM_APPCOMMAND: UINT = 0x0319;
1410 pub const WM_THEMECHANGED: UINT = 0x031A;
1411 pub const WM_CLIPBOARDUPDATE: UINT = 0x031D;
1412 pub const WM_DWMCOMPOSITIONCHANGED: UINT = 0x031E;
1413 pub const WM_DWMNCRENDERINGCHANGED: UINT = 0x031F;
1414 pub const WM_DWMCOLORIZATIONCOLORCHANGED: UINT = 0x0320;
1415 pub const WM_DWMWINDOWMAXIMIZEDCHANGE: UINT = 0x0321;
1416 pub const WM_DWMSENDICONICTHUMBNAIL: UINT = 0x0323;
1417 pub const WM_DWMSENDICONICLIVEPREVIEWBITMAP: UINT = 0x0326;
1418 pub const WM_GETTITLEBARINFOEX: UINT = 0x033F;
1419 pub const WM_HANDHELDFIRST: UINT = 0x0358;
1420 pub const WM_HANDHELDLAST: UINT = 0x035F;
1421 pub const WM_AFXFIRST: UINT = 0x0360;
1422 pub const WM_AFXLAST: UINT = 0x037F;
1423 pub const WM_PENWINFIRST: UINT = 0x0380;
1424 pub const WM_PENWINLAST: UINT = 0x038F;
1425 pub const WM_APP: UINT = 0x8000;
1426 pub const WM_USER: UINT = 0x0400;
1427 pub const WMSZ_LEFT: UINT = 1;
1428 pub const WMSZ_RIGHT: UINT = 2;
1429 pub const WMSZ_TOP: UINT = 3;
1430 pub const WMSZ_TOPLEFT: UINT = 4;
1431 pub const WMSZ_TOPRIGHT: UINT = 5;
1432 pub const WMSZ_BOTTOM: UINT = 6;
1433 pub const WMSZ_BOTTOMLEFT: UINT = 7;
1434 pub const WMSZ_BOTTOMRIGHT: UINT = 8;
1435 pub const HTERROR: LRESULT = -2;
1436 pub const HTTRANSPARENT: LRESULT = -1;
1437 pub const HTNOWHERE: LRESULT = 0;
1438 pub const HTCLIENT: LRESULT = 1;
1439 pub const HTCAPTION: LRESULT = 2;
1440 pub const HTSYSMENU: LRESULT = 3;
1441 pub const HTGROWBOX: LRESULT = 4;
1442 pub const HTSIZE: LRESULT = HTGROWBOX;
1443 pub const HTMENU: LRESULT = 5;
1444 pub const HTHSCROLL: LRESULT = 6;
1445 pub const HTVSCROLL: LRESULT = 7;
1446 pub const HTMINBUTTON: LRESULT = 8;
1447 pub const HTMAXBUTTON: LRESULT = 9;
1448 pub const HTLEFT: LRESULT = 10;
1449 pub const HTRIGHT: LRESULT = 11;
1450 pub const HTTOP: LRESULT = 12;
1451 pub const HTTOPLEFT: LRESULT = 13;
1452 pub const HTTOPRIGHT: LRESULT = 14;
1453 pub const HTBOTTOM: LRESULT = 15;
1454 pub const HTBOTTOMLEFT: LRESULT = 16;
1455 pub const HTBOTTOMRIGHT: LRESULT = 17;
1456 pub const HTBORDER: LRESULT = 18;
1457 pub const HTREDUCE: LRESULT = HTMINBUTTON;
1458 pub const HTZOOM: LRESULT = HTMAXBUTTON;
1459 pub const HTSIZEFIRST: LRESULT = HTLEFT;
1460 pub const HTSIZELAST: LRESULT = HTBOTTOMRIGHT;
1461 pub const HTOBJECT: LRESULT = 19;
1462 pub const HTCLOSE: LRESULT = 20;
1463 pub const HTHELP: LRESULT = 21;
1464 pub const SMTO_NORMAL: UINT = 0x0000;
1465 pub const SMTO_BLOCK: UINT = 0x0001;
1466 pub const SMTO_ABORTIFHUNG: UINT = 0x0002;
1467 pub const SMTO_NOTIMEOUTIFNOTHUNG: UINT = 0x0008;
1468 pub const SMTO_ERRORONEXIT: UINT = 0x0020;
1469 pub const MA_ACTIVATE: UINT = 1;
1470 pub const MA_ACTIVATEANDEAT: UINT = 2;
1471 pub const MA_NOACTIVATE: UINT = 3;
1472 pub const MA_NOACTIVATEANDEAT: UINT = 4;
1473 pub const ICON_SMALL: UINT = 0;
1474 pub const ICON_BIG: UINT = 1;
1475 pub const ICON_SMALL2: UINT = 2;
1476 extern "system" {
RegisterWindowMessageA( lpString: LPCSTR, ) -> UINT1477 pub fn RegisterWindowMessageA(
1478 lpString: LPCSTR,
1479 ) -> UINT;
RegisterWindowMessageW( lpString: LPCWSTR, ) -> UINT1480 pub fn RegisterWindowMessageW(
1481 lpString: LPCWSTR,
1482 ) -> UINT;
1483 }
1484 pub const SIZE_RESTORED: WPARAM = 0;
1485 pub const SIZE_MINIMIZED: WPARAM = 1;
1486 pub const SIZE_MAXIMIZED: WPARAM = 2;
1487 pub const SIZE_MAXSHOW: WPARAM = 3;
1488 pub const SIZE_MAXHIDE: WPARAM = 4;
1489 pub const SIZENORMAL: WPARAM = SIZE_RESTORED;
1490 pub const SIZEICONIC: WPARAM = SIZE_MINIMIZED;
1491 pub const SIZEFULLSCREEN: WPARAM = SIZE_MAXIMIZED;
1492 pub const SIZEZOOMSHOW: WPARAM = SIZE_MAXSHOW;
1493 pub const SIZEZOOMHIDE: WPARAM = SIZE_MAXHIDE;
1494 STRUCT!{struct WINDOWPOS {
1495 hwnd: HWND,
1496 hwndInsertAfter: HWND,
1497 x: c_int,
1498 y: c_int,
1499 cx: c_int,
1500 cy: c_int,
1501 flags: UINT,
1502 }}
1503 pub type LPWINDOWPOS = *mut WINDOWPOS;
1504 pub type PWINDOWPOS = *mut WINDOWPOS;
1505 STRUCT!{struct NCCALCSIZE_PARAMS {
1506 rgrc: [RECT; 3],
1507 lppos: PWINDOWPOS,
1508 }}
1509 pub type LPNCCALCSIZE_PARAMS = *mut NCCALCSIZE_PARAMS;
1510 pub const WVR_ALIGNTOP: LRESULT = 0x0010;
1511 pub const WVR_ALIGNLEFT: LRESULT = 0x0020;
1512 pub const WVR_ALIGNBOTTOM: LRESULT = 0x0040;
1513 pub const WVR_ALIGNRIGHT: LRESULT = 0x0080;
1514 pub const WVR_HREDRAW: LRESULT = 0x0100;
1515 pub const WVR_VREDRAW: LRESULT = 0x0200;
1516 pub const WVR_REDRAW: LRESULT = WVR_HREDRAW | WVR_VREDRAW;
1517 pub const WVR_VALIDRECTS: LRESULT = 0x0400;
1518 pub const MK_LBUTTON: WPARAM = 0x0001;
1519 pub const MK_RBUTTON: WPARAM = 0x0002;
1520 pub const MK_SHIFT: WPARAM = 0x0004;
1521 pub const MK_CONTROL: WPARAM = 0x0008;
1522 pub const MK_MBUTTON: WPARAM = 0x0010;
1523 pub const MK_XBUTTON1: WPARAM = 0x0020;
1524 pub const MK_XBUTTON2: WPARAM = 0x0040;
1525 pub const TME_HOVER: DWORD = 0x00000001;
1526 pub const TME_LEAVE: DWORD = 0x00000002;
1527 pub const TME_NONCLIENT: DWORD = 0x00000010;
1528 pub const TME_QUERY: DWORD = 0x40000000;
1529 pub const TME_CANCEL: DWORD = 0x80000000;
1530 pub const HOVER_DEFAULT: DWORD = 0xFFFFFFFF;
1531 STRUCT!{struct TRACKMOUSEEVENT {
1532 cbSize: DWORD,
1533 dwFlags: DWORD,
1534 hwndTrack: HWND,
1535 dwHoverTime: DWORD,
1536 }}
1537 pub type LPTRACKMOUSEEVENT = *mut TRACKMOUSEEVENT;
1538 extern "system" {
TrackMouseEvent( lpEventTrack: LPTRACKMOUSEEVENT, ) -> BOOL1539 pub fn TrackMouseEvent(
1540 lpEventTrack: LPTRACKMOUSEEVENT,
1541 ) -> BOOL;
1542 }
1543 pub const WS_OVERLAPPED: DWORD = 0x00000000;
1544 pub const WS_POPUP: DWORD = 0x80000000;
1545 pub const WS_CHILD: DWORD = 0x40000000;
1546 pub const WS_MINIMIZE: DWORD = 0x20000000;
1547 pub const WS_VISIBLE: DWORD = 0x10000000;
1548 pub const WS_DISABLED: DWORD = 0x08000000;
1549 pub const WS_CLIPSIBLINGS: DWORD = 0x04000000;
1550 pub const WS_CLIPCHILDREN: DWORD = 0x02000000;
1551 pub const WS_MAXIMIZE: DWORD = 0x01000000;
1552 pub const WS_CAPTION: DWORD = 0x00C00000;
1553 pub const WS_BORDER: DWORD = 0x00800000;
1554 pub const WS_DLGFRAME: DWORD = 0x00400000;
1555 pub const WS_VSCROLL: DWORD = 0x00200000;
1556 pub const WS_HSCROLL: DWORD = 0x00100000;
1557 pub const WS_SYSMENU: DWORD = 0x00080000;
1558 pub const WS_THICKFRAME: DWORD = 0x00040000;
1559 pub const WS_GROUP: DWORD = 0x00020000;
1560 pub const WS_TABSTOP: DWORD = 0x00010000;
1561 pub const WS_MINIMIZEBOX: DWORD = 0x00020000;
1562 pub const WS_MAXIMIZEBOX: DWORD = 0x00010000;
1563 pub const WS_TILED: DWORD = WS_OVERLAPPED;
1564 pub const WS_ICONIC: DWORD = WS_MINIMIZE;
1565 pub const WS_SIZEBOX: DWORD = WS_THICKFRAME;
1566 pub const WS_TILEDWINDOW: DWORD = WS_OVERLAPPEDWINDOW;
1567 pub const WS_OVERLAPPEDWINDOW: DWORD = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
1568 | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
1569 pub const WS_POPUPWINDOW: DWORD = WS_POPUP | WS_BORDER | WS_SYSMENU;
1570 pub const WS_CHILDWINDOW: DWORD = WS_CHILD;
1571 pub const WS_EX_DLGMODALFRAME: DWORD = 0x00000001;
1572 pub const WS_EX_NOPARENTNOTIFY: DWORD = 0x00000004;
1573 pub const WS_EX_TOPMOST: DWORD = 0x00000008;
1574 pub const WS_EX_ACCEPTFILES: DWORD = 0x00000010;
1575 pub const WS_EX_TRANSPARENT: DWORD = 0x00000020;
1576 pub const WS_EX_MDICHILD: DWORD = 0x00000040;
1577 pub const WS_EX_TOOLWINDOW: DWORD = 0x00000080;
1578 pub const WS_EX_WINDOWEDGE: DWORD = 0x00000100;
1579 pub const WS_EX_CLIENTEDGE: DWORD = 0x00000200;
1580 pub const WS_EX_CONTEXTHELP: DWORD = 0x00000400;
1581 pub const WS_EX_RIGHT: DWORD = 0x00001000;
1582 pub const WS_EX_LEFT: DWORD = 0x00000000;
1583 pub const WS_EX_RTLREADING: DWORD = 0x00002000;
1584 pub const WS_EX_LTRREADING: DWORD = 0x00000000;
1585 pub const WS_EX_LEFTSCROLLBAR: DWORD = 0x00004000;
1586 pub const WS_EX_RIGHTSCROLLBAR: DWORD = 0x00000000;
1587 pub const WS_EX_CONTROLPARENT: DWORD = 0x00010000;
1588 pub const WS_EX_STATICEDGE: DWORD = 0x00020000;
1589 pub const WS_EX_APPWINDOW: DWORD = 0x00040000;
1590 pub const WS_EX_OVERLAPPEDWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE;
1591 pub const WS_EX_PALETTEWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
1592 pub const WS_EX_LAYERED: DWORD = 0x00080000;
1593 pub const WS_EX_NOINHERITLAYOUT: DWORD = 0x00100000;
1594 pub const WS_EX_NOREDIRECTIONBITMAP: DWORD = 0x00200000;
1595 pub const WS_EX_LAYOUTRTL: DWORD = 0x00400000;
1596 pub const WS_EX_COMPOSITED: DWORD = 0x02000000;
1597 pub const WS_EX_NOACTIVATE: DWORD = 0x08000000;
1598 pub const CS_VREDRAW: UINT = 0x0001;
1599 pub const CS_HREDRAW: UINT = 0x0002;
1600 pub const CS_DBLCLKS: UINT = 0x0008;
1601 pub const CS_OWNDC: UINT = 0x0020;
1602 pub const CS_CLASSDC: UINT = 0x0040;
1603 pub const CS_PARENTDC: UINT = 0x0080;
1604 pub const CS_NOCLOSE: UINT = 0x0200;
1605 pub const CS_SAVEBITS: UINT = 0x0800;
1606 pub const CS_BYTEALIGNCLIENT: UINT = 0x1000;
1607 pub const CS_BYTEALIGNWINDOW: UINT = 0x2000;
1608 pub const CS_GLOBALCLASS: UINT = 0x4000;
1609 pub const CS_IME: UINT = 0x00010000;
1610 pub const CS_DROPSHADOW: UINT = 0x00020000;
1611 pub const PRF_CHECKVISIBLE: UINT = 0x00000001;
1612 pub const PRF_NONCLIENT: UINT = 0x00000002;
1613 pub const PRF_CLIENT: UINT = 0x00000004;
1614 pub const PRF_ERASEBKGND: UINT = 0x00000008;
1615 pub const PRF_CHILDREN: UINT = 0x00000010;
1616 pub const PRF_OWNED: UINT = 0x00000020;
1617 pub const BDR_RAISEDOUTER: UINT = 0x0001;
1618 pub const BDR_SUNKENOUTER: UINT = 0x0002;
1619 pub const BDR_RAISEDINNER: UINT = 0x0004;
1620 pub const BDR_SUNKENINNER: UINT = 0x0008;
1621 pub const BDR_OUTER: UINT = BDR_RAISEDOUTER | BDR_SUNKENOUTER;
1622 pub const BDR_INNER: UINT = BDR_RAISEDINNER | BDR_SUNKENINNER;
1623 pub const BDR_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER;
1624 pub const BDR_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER;
1625 pub const EDGE_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER;
1626 pub const EDGE_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER;
1627 pub const EDGE_ETCHED: UINT = BDR_SUNKENOUTER | BDR_RAISEDINNER;
1628 pub const EDGE_BUMP: UINT = BDR_RAISEDOUTER | BDR_SUNKENINNER;
1629 pub const BF_LEFT: UINT = 0x0001;
1630 pub const BF_TOP: UINT = 0x0002;
1631 pub const BF_RIGHT: UINT = 0x0004;
1632 pub const BF_BOTTOM: UINT = 0x0008;
1633 pub const BF_TOPLEFT: UINT = BF_TOP | BF_LEFT;
1634 pub const BF_TOPRIGHT: UINT = BF_TOP | BF_RIGHT;
1635 pub const BF_BOTTOMLEFT: UINT = BF_BOTTOM | BF_LEFT;
1636 pub const BF_BOTTOMRIGHT: UINT = BF_BOTTOM | BF_RIGHT;
1637 pub const BF_RECT: UINT = BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM;
1638 pub const BF_DIAGONAL: UINT = 0x0010;
1639 pub const BF_DIAGONAL_ENDTOPRIGHT: UINT = BF_DIAGONAL | BF_TOP | BF_RIGHT;
1640 pub const BF_DIAGONAL_ENDTOPLEFT: UINT = BF_DIAGONAL | BF_TOP | BF_LEFT;
1641 pub const BF_DIAGONAL_ENDBOTTOMLEFT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_LEFT;
1642 pub const BF_DIAGONAL_ENDBOTTOMRIGHT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_RIGHT;
1643 pub const BF_MIDDLE: UINT = 0x0800;
1644 pub const BF_SOFT: UINT = 0x1000;
1645 pub const BF_ADJUST: UINT = 0x2000;
1646 pub const BF_FLAT: UINT = 0x4000;
1647 pub const BF_MONO: UINT = 0x8000;
1648 extern "system" {
DrawEdge( hdc: HDC, qrc: LPRECT, edge: UINT, grfFlags: UINT, ) -> BOOL1649 pub fn DrawEdge(
1650 hdc: HDC,
1651 qrc: LPRECT,
1652 edge: UINT,
1653 grfFlags: UINT,
1654 ) -> BOOL;
1655 }
1656 pub const DFC_CAPTION: UINT = 1;
1657 pub const DFC_MENU: UINT = 2;
1658 pub const DFC_SCROLL: UINT = 3;
1659 pub const DFC_BUTTON: UINT = 4;
1660 pub const DFC_POPUPMENU: UINT = 5;
1661 pub const DFCS_CAPTIONCLOSE: UINT = 0x0000;
1662 pub const DFCS_CAPTIONMIN: UINT = 0x0001;
1663 pub const DFCS_CAPTIONMAX: UINT = 0x0002;
1664 pub const DFCS_CAPTIONRESTORE: UINT = 0x0003;
1665 pub const DFCS_CAPTIONHELP: UINT = 0x0004;
1666 pub const DFCS_MENUARROW: UINT = 0x0000;
1667 pub const DFCS_MENUCHECK: UINT = 0x0001;
1668 pub const DFCS_MENUBULLET: UINT = 0x0002;
1669 pub const DFCS_MENUARROWRIGHT: UINT = 0x0004;
1670 pub const DFCS_SCROLLUP: UINT = 0x0000;
1671 pub const DFCS_SCROLLDOWN: UINT = 0x0001;
1672 pub const DFCS_SCROLLLEFT: UINT = 0x0002;
1673 pub const DFCS_SCROLLRIGHT: UINT = 0x0003;
1674 pub const DFCS_SCROLLCOMBOBOX: UINT = 0x0005;
1675 pub const DFCS_SCROLLSIZEGRIP: UINT = 0x0008;
1676 pub const DFCS_SCROLLSIZEGRIPRIGHT: UINT = 0x0010;
1677 pub const DFCS_BUTTONCHECK: UINT = 0x0000;
1678 pub const DFCS_BUTTONRADIOIMAGE: UINT = 0x0001;
1679 pub const DFCS_BUTTONRADIOMASK: UINT = 0x0002;
1680 pub const DFCS_BUTTONRADIO: UINT = 0x0004;
1681 pub const DFCS_BUTTON3STATE: UINT = 0x0008;
1682 pub const DFCS_BUTTONPUSH: UINT = 0x0010;
1683 pub const DFCS_INACTIVE: UINT = 0x0100;
1684 pub const DFCS_PUSHED: UINT = 0x0200;
1685 pub const DFCS_CHECKED: UINT = 0x0400;
1686 pub const DFCS_TRANSPARENT: UINT = 0x0800;
1687 pub const DFCS_HOT: UINT = 0x1000;
1688 pub const DFCS_ADJUSTRECT: UINT = 0x2000;
1689 pub const DFCS_FLAT: UINT = 0x4000;
1690 pub const DFCS_MONO: UINT = 0x8000;
1691 extern "system" {
DrawFrameControl( hdc: HDC, lprc: LPRECT, uType: UINT, uState: UINT, ) -> BOOL1692 pub fn DrawFrameControl(
1693 hdc: HDC,
1694 lprc: LPRECT,
1695 uType: UINT,
1696 uState: UINT,
1697 ) -> BOOL;
1698 }
1699 pub const DC_ACTIVE: UINT = 0x0001;
1700 pub const DC_SMALLCAP: UINT = 0x0002;
1701 pub const DC_ICON: UINT = 0x0004;
1702 pub const DC_TEXT: UINT = 0x0008;
1703 pub const DC_INBUTTON: UINT = 0x0010;
1704 pub const DC_GRADIENT: UINT = 0x0020;
1705 pub const DC_BUTTONS: UINT = 0x1000;
1706 extern "system" {
DrawCaption( hwnd: HWND, hdc: HDC, lprect: *const RECT, flags: UINT, ) -> BOOL1707 pub fn DrawCaption(
1708 hwnd: HWND,
1709 hdc: HDC,
1710 lprect: *const RECT,
1711 flags: UINT,
1712 ) -> BOOL;
1713 }
1714 pub const IDANI_OPEN: c_int = 1;
1715 pub const IDANI_CAPTION: c_int = 3;
1716 extern "system" {
DrawAnimatedRects( hwnd: HWND, idAni: c_int, lprcFrom: *const RECT, lprcTo: *const RECT, ) -> BOOL1717 pub fn DrawAnimatedRects(
1718 hwnd: HWND,
1719 idAni: c_int,
1720 lprcFrom: *const RECT,
1721 lprcTo: *const RECT,
1722 ) -> BOOL;
1723 }
1724 pub const CF_TEXT: UINT = 1;
1725 pub const CF_BITMAP: UINT = 2;
1726 pub const CF_METAFILEPICT: UINT = 3;
1727 pub const CF_SYLK: UINT = 4;
1728 pub const CF_DIF: UINT = 5;
1729 pub const CF_TIFF: UINT = 6;
1730 pub const CF_OEMTEXT: UINT = 7;
1731 pub const CF_DIB: UINT = 8;
1732 pub const CF_PALETTE: UINT = 9;
1733 pub const CF_PENDATA: UINT = 10;
1734 pub const CF_RIFF: UINT = 11;
1735 pub const CF_WAVE: UINT = 12;
1736 pub const CF_UNICODETEXT: UINT = 13;
1737 pub const CF_ENHMETAFILE: UINT = 14;
1738 pub const CF_HDROP: UINT = 15;
1739 pub const CF_LOCALE: UINT = 16;
1740 pub const CF_DIBV5: UINT = 17;
1741 pub const CF_MAX: UINT = 18;
1742 pub const CF_OWNERDISPLAY: UINT = 0x0080;
1743 pub const CF_DSPTEXT: UINT = 0x0081;
1744 pub const CF_DSPBITMAP: UINT = 0x0082;
1745 pub const CF_DSPMETAFILEPICT: UINT = 0x0083;
1746 pub const CF_DSPENHMETAFILE: UINT = 0x008E;
1747 pub const CF_PRIVATEFIRST: UINT = 0x0200;
1748 pub const CF_PRIVATELAST: UINT = 0x02FF;
1749 pub const CF_GDIOBJFIRST: UINT = 0x0300;
1750 pub const CF_GDIOBJLAST: UINT = 0x03FF;
1751 pub const FVIRTKEY: BYTE = TRUE as u8;
1752 pub const FNOINVERT: BYTE = 0x02;
1753 pub const FSHIFT: BYTE = 0x04;
1754 pub const FCONTROL: BYTE = 0x08;
1755 pub const FALT: BYTE = 0x10;
1756 STRUCT!{struct ACCEL {
1757 fVirt: BYTE,
1758 key: WORD,
1759 cmd: WORD,
1760 }}
1761 pub type LPACCEL = *mut ACCEL;
1762 STRUCT!{struct PAINTSTRUCT {
1763 hdc: HDC,
1764 fErase: BOOL,
1765 rcPaint: RECT,
1766 fRestore: BOOL,
1767 fIncUpdate: BOOL,
1768 rgbReserved: [BYTE; 32],
1769 }}
1770 pub type PPAINTSTRUCT = *mut PAINTSTRUCT;
1771 pub type NPPAINTSTRUCT = *mut PAINTSTRUCT;
1772 pub type LPPAINTSTRUCT = *mut PAINTSTRUCT;
1773 STRUCT!{struct CREATESTRUCTA {
1774 lpCreateParams: LPVOID,
1775 hInstance: HINSTANCE,
1776 hMenu: HMENU,
1777 hwndParent: HWND,
1778 cy: c_int,
1779 cx: c_int,
1780 y: c_int,
1781 x: c_int,
1782 style: LONG,
1783 lpszName: LPCSTR,
1784 lpszClass: LPCSTR,
1785 dwExStyle: DWORD,
1786 }}
1787 pub type LPCREATESTRUCTA = *mut CREATESTRUCTA;
1788 STRUCT!{struct CREATESTRUCTW {
1789 lpCreateParams: LPVOID,
1790 hInstance: HINSTANCE,
1791 hMenu: HMENU,
1792 hwndParent: HWND,
1793 cy: c_int,
1794 cx: c_int,
1795 y: c_int,
1796 x: c_int,
1797 style: LONG,
1798 lpszName: LPCWSTR,
1799 lpszClass: LPCWSTR,
1800 dwExStyle: DWORD,
1801 }}
1802 pub type LPCREATESTRUCTW = *mut CREATESTRUCTW;
1803 STRUCT!{struct WINDOWPLACEMENT {
1804 length: UINT,
1805 flags: UINT,
1806 showCmd: UINT,
1807 ptMinPosition: POINT,
1808 ptMaxPosition: POINT,
1809 rcNormalPosition: RECT,
1810 }}
1811 pub type PWINDOWPLACEMENT = *mut WINDOWPLACEMENT;
1812 pub type LPWINDOWPLACEMENT = *mut WINDOWPLACEMENT;
1813 pub const WPF_SETMINPOSITION: UINT = 0x0001;
1814 pub const WPF_RESTORETOMAXIMIZED: UINT = 0x0002;
1815 pub const WPF_ASYNCWINDOWPLACEMENT: UINT = 0x0004;
1816 STRUCT!{struct NMHDR {
1817 hwndFrom: HWND,
1818 idFrom: UINT_PTR,
1819 code: UINT,
1820 }}
1821 pub type LPNMHDR = *mut NMHDR;
1822 STRUCT!{struct STYLESTRUCT {
1823 styleOld: DWORD,
1824 styleNew: DWORD,
1825 }}
1826 pub type LPSTYLESTRUCT = *mut STYLESTRUCT;
1827 pub const ODT_MENU: UINT = 1;
1828 pub const ODT_LISTBOX: UINT = 2;
1829 pub const ODT_COMBOBOX: UINT = 3;
1830 pub const ODT_BUTTON: UINT = 4;
1831 pub const ODT_STATIC: UINT = 5;
1832 pub const ODA_DRAWENTIRE: UINT = 0x0001;
1833 pub const ODA_SELECT: UINT = 0x0002;
1834 pub const ODA_FOCUS: UINT = 0x0004;
1835 pub const ODS_SELECTED: UINT = 0x0001;
1836 pub const ODS_GRAYED: UINT = 0x0002;
1837 pub const ODS_DISABLED: UINT = 0x0004;
1838 pub const ODS_CHECKED: UINT = 0x0008;
1839 pub const ODS_FOCUS: UINT = 0x0010;
1840 pub const ODS_DEFAULT: UINT = 0x0020;
1841 pub const ODS_COMBOBOXEDIT: UINT = 0x1000;
1842 pub const ODS_HOTLIGHT: UINT = 0x0040;
1843 pub const ODS_INACTIVE: UINT = 0x0080;
1844 pub const ODS_NOACCEL: UINT = 0x0100;
1845 pub const ODS_NOFOCUSRECT: UINT = 0x0200;
1846 STRUCT!{struct MEASUREITEMSTRUCT {
1847 CtlType: UINT,
1848 CtlID: UINT,
1849 itemID: UINT,
1850 itemWidth: UINT,
1851 itemHeight: UINT,
1852 itemData: ULONG_PTR,
1853 }}
1854 pub type PMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT;
1855 pub type LPMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT;
1856 STRUCT!{struct DRAWITEMSTRUCT {
1857 CtlType: UINT,
1858 CtlID: UINT,
1859 itemID: UINT,
1860 itemAction: UINT,
1861 itemState: UINT,
1862 hwndItem: HWND,
1863 hDC: HDC,
1864 rcItem: RECT,
1865 itemData: ULONG_PTR,
1866 }}
1867 pub type PDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT;
1868 pub type LPDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT;
1869 STRUCT!{struct DELETEITEMSTRUCT {
1870 CtlType: UINT,
1871 CtlID: UINT,
1872 itemID: UINT,
1873 hwndItem: HWND,
1874 itemData: ULONG_PTR,
1875 }}
1876 pub type PDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT;
1877 pub type LPDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT;
1878 STRUCT!{struct COMPAREITEMSTRUCT {
1879 CtlType: UINT,
1880 CtlID: UINT,
1881 hwndItem: HWND,
1882 itemID1: UINT,
1883 itemData1: ULONG_PTR,
1884 itemID2: UINT,
1885 itemData2: ULONG_PTR,
1886 dwLocaleId: DWORD,
1887 }}
1888 pub type PCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT;
1889 pub type LPCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT;
1890 extern "system" {
GetMessageA( lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, ) -> BOOL1891 pub fn GetMessageA(
1892 lpMsg: LPMSG,
1893 hWnd: HWND,
1894 wMsgFilterMin: UINT,
1895 wMsgFilterMax: UINT,
1896 ) -> BOOL;
GetMessageW( lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, ) -> BOOL1897 pub fn GetMessageW(
1898 lpMsg: LPMSG,
1899 hWnd: HWND,
1900 wMsgFilterMin: UINT,
1901 wMsgFilterMax: UINT,
1902 ) -> BOOL;
TranslateMessage( lpmsg: *const MSG, ) -> BOOL1903 pub fn TranslateMessage(
1904 lpmsg: *const MSG,
1905 ) -> BOOL;
DispatchMessageA( lpmsg: *const MSG, ) -> LRESULT1906 pub fn DispatchMessageA(
1907 lpmsg: *const MSG,
1908 ) -> LRESULT;
DispatchMessageW( lpmsg: *const MSG, ) -> LRESULT1909 pub fn DispatchMessageW(
1910 lpmsg: *const MSG,
1911 ) -> LRESULT;
SetMessageQueue( cMessagesMax: c_int, ) -> BOOL1912 pub fn SetMessageQueue(
1913 cMessagesMax: c_int,
1914 ) -> BOOL;
PeekMessageA( lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT, ) -> BOOL1915 pub fn PeekMessageA(
1916 lpMsg: LPMSG,
1917 hWnd: HWND,
1918 wMsgFilterMin: UINT,
1919 wMsgFilterMax: UINT,
1920 wRemoveMsg: UINT,
1921 ) -> BOOL;
PeekMessageW( lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT, ) -> BOOL1922 pub fn PeekMessageW(
1923 lpMsg: LPMSG,
1924 hWnd: HWND,
1925 wMsgFilterMin: UINT,
1926 wMsgFilterMax: UINT,
1927 wRemoveMsg: UINT,
1928 ) -> BOOL;
1929 }
1930 pub const PM_NOREMOVE: UINT = 0x0000;
1931 pub const PM_REMOVE: UINT = 0x0001;
1932 pub const PM_NOYIELD: UINT = 0x0002;
1933 pub const PM_QS_INPUT: UINT = QS_INPUT << 16;
1934 pub const PM_QS_POSTMESSAGE: UINT = (QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16;
1935 pub const PM_QS_PAINT: UINT = QS_PAINT << 16;
1936 pub const PM_QS_SENDMESSAGE: UINT = QS_SENDMESSAGE << 16;
1937 extern "system" {
RegisterHotKey( hwnd: HWND, id: c_int, fsModifiers: UINT, vk: UINT, ) -> BOOL1938 pub fn RegisterHotKey(
1939 hwnd: HWND,
1940 id: c_int,
1941 fsModifiers: UINT,
1942 vk: UINT,
1943 ) -> BOOL;
UnregisterHotKey( hWnd: HWND, id: c_int, ) -> BOOL1944 pub fn UnregisterHotKey(
1945 hWnd: HWND,
1946 id: c_int,
1947 ) -> BOOL;
1948 }
1949 pub const MOD_ALT: LPARAM = 0x0001;
1950 pub const MOD_CONTROL: LPARAM = 0x0002;
1951 pub const MOD_SHIFT: LPARAM = 0x0004;
1952 pub const MOD_WIN: LPARAM = 0x0008;
1953 pub const MOD_NOREPEAT: LPARAM = 0x4000;
1954 pub const IDHOT_SNAPWINDOW: WPARAM = -1isize as usize;
1955 pub const IDHOT_SNAPDESKTOP: WPARAM = -2isize as usize;
1956 pub const ENDSESSION_CLOSEAPP: UINT = 0x00000001;
1957 pub const ENDSESSION_CRITICAL: UINT = 0x40000000;
1958 pub const ENDSESSION_LOGOFF: UINT = 0x80000000;
1959 pub const EWX_LOGOFF: UINT = 0x00000000;
1960 pub const EWX_SHUTDOWN: UINT = 0x00000001;
1961 pub const EWX_REBOOT: UINT = 0x00000002;
1962 pub const EWX_FORCE: UINT = 0x00000004;
1963 pub const EWX_POWEROFF: UINT = 0x00000008;
1964 pub const EWX_FORCEIFHUNG: UINT = 0x00000010;
1965 pub const EWX_QUICKRESOLVE: UINT = 0x00000020;
1966 pub const EWX_RESTARTAPPS: UINT = 0x00000040;
1967 pub const EWX_HYBRID_SHUTDOWN: UINT = 0x00400000;
1968 pub const EWX_BOOTOPTIONS: UINT = 0x01000000;
1969 // ExitWindows
1970 extern "system" {
ExitWindowsEx( uFlags: UINT, dwReason: DWORD, ) -> BOOL1971 pub fn ExitWindowsEx(
1972 uFlags: UINT,
1973 dwReason: DWORD,
1974 ) -> BOOL;
SwapMouseButton( fSwap: BOOL, ) -> BOOL1975 pub fn SwapMouseButton(
1976 fSwap: BOOL,
1977 ) -> BOOL;
GetMessagePos() -> DWORD1978 pub fn GetMessagePos() -> DWORD;
GetMessageTime() -> LONG1979 pub fn GetMessageTime() -> LONG;
GetMessageExtraInfo() -> LPARAM1980 pub fn GetMessageExtraInfo() -> LPARAM;
GetUnpredictedMessagePos() -> DWORD1981 pub fn GetUnpredictedMessagePos() -> DWORD;
IsWow64Message() -> BOOL1982 pub fn IsWow64Message() -> BOOL;
SetMessageExtraInfo( lParam: LPARAM, ) -> LPARAM1983 pub fn SetMessageExtraInfo(
1984 lParam: LPARAM,
1985 ) -> LPARAM;
SendMessageA( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT1986 pub fn SendMessageA(
1987 hWnd: HWND,
1988 Msg: UINT,
1989 wParam: WPARAM,
1990 lParam: LPARAM,
1991 ) -> LRESULT;
SendMessageW( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT1992 pub fn SendMessageW(
1993 hWnd: HWND,
1994 Msg: UINT,
1995 wParam: WPARAM,
1996 lParam: LPARAM,
1997 ) -> LRESULT;
SendMessageTimeoutA( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, fuFlags: UINT, uTimeout: UINT, lpdwResult: PDWORD_PTR, ) -> LRESULT1998 pub fn SendMessageTimeoutA(
1999 hWnd: HWND,
2000 Msg: UINT,
2001 wParam: WPARAM,
2002 lParam: LPARAM,
2003 fuFlags: UINT,
2004 uTimeout: UINT,
2005 lpdwResult: PDWORD_PTR,
2006 ) -> LRESULT;
SendMessageTimeoutW( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, fuFlags: UINT, uTimeout: UINT, lpdwResult: PDWORD_PTR, ) -> LRESULT2007 pub fn SendMessageTimeoutW(
2008 hWnd: HWND,
2009 Msg: UINT,
2010 wParam: WPARAM,
2011 lParam: LPARAM,
2012 fuFlags: UINT,
2013 uTimeout: UINT,
2014 lpdwResult: PDWORD_PTR,
2015 ) -> LRESULT;
SendNotifyMessageA( hWnd: HWND, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2016 pub fn SendNotifyMessageA(
2017 hWnd: HWND,
2018 msg: UINT,
2019 wParam: WPARAM,
2020 lParam: LPARAM,
2021 ) -> BOOL;
SendNotifyMessageW( hWnd: HWND, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2022 pub fn SendNotifyMessageW(
2023 hWnd: HWND,
2024 msg: UINT,
2025 wParam: WPARAM,
2026 lParam: LPARAM,
2027 ) -> BOOL;
SendMessageCallbackA( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, lpResultCallBack: SENDASYNCPROC, dwData: ULONG_PTR, ) -> BOOL2028 pub fn SendMessageCallbackA(
2029 hWnd: HWND,
2030 Msg: UINT,
2031 wParam: WPARAM,
2032 lParam: LPARAM,
2033 lpResultCallBack: SENDASYNCPROC,
2034 dwData: ULONG_PTR,
2035 ) -> BOOL;
SendMessageCallbackW( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, lpResultCallBack: SENDASYNCPROC, dwData: ULONG_PTR, ) -> BOOL2036 pub fn SendMessageCallbackW(
2037 hWnd: HWND,
2038 Msg: UINT,
2039 wParam: WPARAM,
2040 lParam: LPARAM,
2041 lpResultCallBack: SENDASYNCPROC,
2042 dwData: ULONG_PTR,
2043 ) -> BOOL;
2044 }
2045 STRUCT!{struct BSMINFO {
2046 cbSize: UINT,
2047 hdesk: HDESK,
2048 hwnd: HWND,
2049 luid: LUID,
2050 }}
2051 pub type PBSMINFO = *mut BSMINFO;
2052 extern "system" {
BroadcastSystemMessageExA( flags: DWORD, lpInfo: LPDWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM, pbsmInfo: PBSMINFO, ) -> c_long2053 pub fn BroadcastSystemMessageExA(
2054 flags: DWORD,
2055 lpInfo: LPDWORD,
2056 Msg: UINT,
2057 wParam: WPARAM,
2058 lParam: LPARAM,
2059 pbsmInfo: PBSMINFO,
2060 ) -> c_long;
BroadcastSystemMessageExW( flags: DWORD, lpInfo: LPDWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM, pbsmInfo: PBSMINFO, ) -> c_long2061 pub fn BroadcastSystemMessageExW(
2062 flags: DWORD,
2063 lpInfo: LPDWORD,
2064 Msg: UINT,
2065 wParam: WPARAM,
2066 lParam: LPARAM,
2067 pbsmInfo: PBSMINFO,
2068 ) -> c_long;
BroadcastSystemMessageA( flags: DWORD, lpInfo: LPDWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LONG2069 pub fn BroadcastSystemMessageA(
2070 flags: DWORD,
2071 lpInfo: LPDWORD,
2072 Msg: UINT,
2073 wParam: WPARAM,
2074 lParam: LPARAM,
2075 ) -> LONG;
BroadcastSystemMessageW( flags: DWORD, lpInfo: LPDWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LONG2076 pub fn BroadcastSystemMessageW(
2077 flags: DWORD,
2078 lpInfo: LPDWORD,
2079 Msg: UINT,
2080 wParam: WPARAM,
2081 lParam: LPARAM,
2082 ) -> LONG;
2083 }
2084 pub const BSM_ALLCOMPONENTS: DWORD = 0x00000000;
2085 pub const BSM_VXDS: DWORD = 0x00000001;
2086 pub const BSM_NETDRIVER: DWORD = 0x00000002;
2087 pub const BSM_INSTALLABLEDRIVERS: DWORD = 0x00000004;
2088 pub const BSM_APPLICATIONS: DWORD = 0x00000008;
2089 pub const BSM_ALLDESKTOPS: DWORD = 0x00000010;
2090 pub const BSF_QUERY: DWORD = 0x00000001;
2091 pub const BSF_IGNORECURRENTTASK: DWORD = 0x00000002;
2092 pub const BSF_FLUSHDISK: DWORD = 0x00000004;
2093 pub const BSF_NOHANG: DWORD = 0x00000008;
2094 pub const BSF_POSTMESSAGE: DWORD = 0x00000010;
2095 pub const BSF_FORCEIFHUNG: DWORD = 0x00000020;
2096 pub const BSF_NOTIMEOUTIFNOTHUNG: DWORD = 0x00000040;
2097 pub const BSF_ALLOWSFW: DWORD = 0x00000080;
2098 pub const BSF_SENDNOTIFYMESSAGE: DWORD = 0x00000100;
2099 pub const BSF_RETURNHDESK: DWORD = 0x00000200;
2100 pub const BSF_LUID: DWORD = 0x00000400;
2101 pub const BROADCAST_QUERY_DENY: DWORD = 0x424D5144;
2102 pub type HDEVNOTIFY = PVOID;
2103 pub type PHDEVNOTIFY = *mut HDEVNOTIFY;
2104 pub const DEVICE_NOTIFY_WINDOW_HANDLE: DWORD = 0x00000000;
2105 pub const DEVICE_NOTIFY_SERVICE_HANDLE: DWORD = 0x00000001;
2106 pub const DEVICE_NOTIFY_ALL_INTERFACE_CLASSES: DWORD = 0x00000004;
2107 extern "system" {
RegisterDeviceNotificationA( hRecipient: HANDLE, notificationFilter: LPVOID, flags: DWORD, ) -> HDEVNOTIFY2108 pub fn RegisterDeviceNotificationA(
2109 hRecipient: HANDLE,
2110 notificationFilter: LPVOID,
2111 flags: DWORD,
2112 ) -> HDEVNOTIFY;
RegisterDeviceNotificationW( hRecipient: HANDLE, notificationFilter: LPVOID, flags: DWORD, ) -> HDEVNOTIFY2113 pub fn RegisterDeviceNotificationW(
2114 hRecipient: HANDLE,
2115 notificationFilter: LPVOID,
2116 flags: DWORD,
2117 ) -> HDEVNOTIFY;
UnregisterDeviceNotification( Handle: HDEVNOTIFY, ) -> BOOL2118 pub fn UnregisterDeviceNotification(
2119 Handle: HDEVNOTIFY,
2120 ) -> BOOL;
2121 }
2122 pub type HPOWERNOTIFY = PVOID;
2123 pub type PHPOWERNOTIFY = *mut HPOWERNOTIFY;
2124 extern "system" {
RegisterPowerSettingNotification( hRecipient: HANDLE, PowerSettingGuid: LPCGUID, Flags: DWORD, ) -> HPOWERNOTIFY2125 pub fn RegisterPowerSettingNotification(
2126 hRecipient: HANDLE,
2127 PowerSettingGuid: LPCGUID,
2128 Flags: DWORD,
2129 ) -> HPOWERNOTIFY;
UnregisterPowerSettingNotification( Handle: HPOWERNOTIFY, ) -> BOOL2130 pub fn UnregisterPowerSettingNotification(
2131 Handle: HPOWERNOTIFY,
2132 ) -> BOOL;
RegisterSuspendResumeNotification( hRecipient: HANDLE, Flags: DWORD, ) -> HPOWERNOTIFY2133 pub fn RegisterSuspendResumeNotification(
2134 hRecipient: HANDLE,
2135 Flags: DWORD,
2136 ) -> HPOWERNOTIFY;
UnregisterSuspendResumeNotification( Handle: HPOWERNOTIFY, ) -> BOOL2137 pub fn UnregisterSuspendResumeNotification(
2138 Handle: HPOWERNOTIFY,
2139 ) -> BOOL;
PostMessageA( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2140 pub fn PostMessageA(
2141 hWnd: HWND,
2142 Msg: UINT,
2143 wParam: WPARAM,
2144 lParam: LPARAM,
2145 ) -> BOOL;
PostMessageW( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2146 pub fn PostMessageW(
2147 hWnd: HWND,
2148 Msg: UINT,
2149 wParam: WPARAM,
2150 lParam: LPARAM,
2151 ) -> BOOL;
PostThreadMessageA( idThread: DWORD, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2152 pub fn PostThreadMessageA(
2153 idThread: DWORD,
2154 msg: UINT,
2155 wParam: WPARAM,
2156 lParam: LPARAM,
2157 ) -> BOOL;
PostThreadMessageW( idThread: DWORD, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL2158 pub fn PostThreadMessageW(
2159 idThread: DWORD,
2160 msg: UINT,
2161 wParam: WPARAM,
2162 lParam: LPARAM,
2163 ) -> BOOL;
2164 }
2165 // PostAppMessageA
2166 // PostAppMessageW
2167 pub const HWND_BROADCAST: HWND = 0xffff as HWND;
2168 pub const HWND_MESSAGE: HWND = -3isize as HWND;
2169 extern "system" {
AttachThreadInput( idAttach: DWORD, idAttachTo: DWORD, fAttach: BOOL, ) -> BOOL2170 pub fn AttachThreadInput(
2171 idAttach: DWORD,
2172 idAttachTo: DWORD,
2173 fAttach: BOOL,
2174 ) -> BOOL;
ReplyMessage( lResult: LRESULT, ) -> BOOL2175 pub fn ReplyMessage(
2176 lResult: LRESULT,
2177 ) -> BOOL;
WaitMessage() -> BOOL2178 pub fn WaitMessage() -> BOOL;
WaitForInputIdle( hProcess: HANDLE, dwMilliseconds: DWORD, ) -> DWORD2179 pub fn WaitForInputIdle(
2180 hProcess: HANDLE,
2181 dwMilliseconds: DWORD,
2182 ) -> DWORD;
DefWindowProcA( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2183 pub fn DefWindowProcA(
2184 hWnd: HWND,
2185 Msg: UINT,
2186 wParam: WPARAM,
2187 lParam: LPARAM,
2188 ) -> LRESULT;
DefWindowProcW( hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2189 pub fn DefWindowProcW(
2190 hWnd: HWND,
2191 Msg: UINT,
2192 wParam: WPARAM,
2193 lParam: LPARAM,
2194 ) -> LRESULT;
PostQuitMessage( nExitCode: c_int, )2195 pub fn PostQuitMessage(
2196 nExitCode: c_int,
2197 );
CallWindowProcA( lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2198 pub fn CallWindowProcA(
2199 lpPrevWndFunc: WNDPROC,
2200 hWnd: HWND,
2201 Msg: UINT,
2202 wParam: WPARAM,
2203 lParam: LPARAM,
2204 ) -> LRESULT;
CallWindowProcW( lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2205 pub fn CallWindowProcW(
2206 lpPrevWndFunc: WNDPROC,
2207 hWnd: HWND,
2208 Msg: UINT,
2209 wParam: WPARAM,
2210 lParam: LPARAM,
2211 ) -> LRESULT;
InSendMessage() -> BOOL2212 pub fn InSendMessage() -> BOOL;
InSendMessageEx( lpReserved: LPVOID, ) -> DWORD2213 pub fn InSendMessageEx(
2214 lpReserved: LPVOID,
2215 ) -> DWORD;
2216 }
2217 pub const ISMEX_NOSEND: DWORD = 0x00000000;
2218 pub const ISMEX_SEND: DWORD = 0x00000001;
2219 pub const ISMEX_NOTIFY: DWORD = 0x00000002;
2220 pub const ISMEX_CALLBACK: DWORD = 0x00000004;
2221 pub const ISMEX_REPLIED: DWORD = 0x00000008;
2222 extern "system" {
GetDoubleClickTime() -> UINT2223 pub fn GetDoubleClickTime() -> UINT;
SetDoubleClickTime( uInterval: UINT, ) -> BOOL2224 pub fn SetDoubleClickTime(
2225 uInterval: UINT,
2226 ) -> BOOL;
RegisterClassA( lpWndClass: *const WNDCLASSA, ) -> ATOM2227 pub fn RegisterClassA(
2228 lpWndClass: *const WNDCLASSA,
2229 ) -> ATOM;
RegisterClassW( lpWndClass: *const WNDCLASSW, ) -> ATOM2230 pub fn RegisterClassW(
2231 lpWndClass: *const WNDCLASSW,
2232 ) -> ATOM;
UnregisterClassA( lpClassName: LPCSTR, hInstance: HINSTANCE, ) -> BOOL2233 pub fn UnregisterClassA(
2234 lpClassName: LPCSTR,
2235 hInstance: HINSTANCE,
2236 ) -> BOOL;
UnregisterClassW( lpClassName: LPCWSTR, hInstance: HINSTANCE, ) -> BOOL2237 pub fn UnregisterClassW(
2238 lpClassName: LPCWSTR,
2239 hInstance: HINSTANCE,
2240 ) -> BOOL;
GetClassInfoA( hInstance: HINSTANCE, lpClassName: LPCSTR, lpWndClass: LPWNDCLASSA, ) -> BOOL2241 pub fn GetClassInfoA(
2242 hInstance: HINSTANCE,
2243 lpClassName: LPCSTR,
2244 lpWndClass: LPWNDCLASSA,
2245 ) -> BOOL;
GetClassInfoW( hInstance: HINSTANCE, lpClassName: LPCWSTR, lpWndClass: LPWNDCLASSW, ) -> BOOL2246 pub fn GetClassInfoW(
2247 hInstance: HINSTANCE,
2248 lpClassName: LPCWSTR,
2249 lpWndClass: LPWNDCLASSW,
2250 ) -> BOOL;
RegisterClassExA( lpWndClass: *const WNDCLASSEXA, ) -> ATOM2251 pub fn RegisterClassExA(
2252 lpWndClass: *const WNDCLASSEXA,
2253 ) -> ATOM;
RegisterClassExW( lpWndClass: *const WNDCLASSEXW, ) -> ATOM2254 pub fn RegisterClassExW(
2255 lpWndClass: *const WNDCLASSEXW,
2256 ) -> ATOM;
GetClassInfoExA( hinst: HINSTANCE, lpszClass: LPCSTR, lpwcx: LPWNDCLASSEXA, ) -> BOOL2257 pub fn GetClassInfoExA(
2258 hinst: HINSTANCE,
2259 lpszClass: LPCSTR,
2260 lpwcx: LPWNDCLASSEXA,
2261 ) -> BOOL;
GetClassInfoExW( hinst: HINSTANCE, lpszClass: LPCWSTR, lpwcx: LPWNDCLASSEXW, ) -> BOOL2262 pub fn GetClassInfoExW(
2263 hinst: HINSTANCE,
2264 lpszClass: LPCWSTR,
2265 lpwcx: LPWNDCLASSEXW,
2266 ) -> BOOL;
2267 }
2268 pub const CW_USEDEFAULT: c_int = 0x80000000;
2269 pub const HWND_DESKTOP: HWND = 0 as HWND;
2270 FN!{stdcall PREGISTERCLASSNAMEW(
2271 LPCWSTR,
2272 ) -> BOOLEAN}
2273 extern "system" {
CreateWindowExA( dwExStyle: DWORD, lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD, x: c_int, y: c_int, nWidth: c_int, nHeight: c_int, hWndParent: HWND, hMenu: HMENU, hInstance: HINSTANCE, lpParam: LPVOID, ) -> HWND2274 pub fn CreateWindowExA(
2275 dwExStyle: DWORD,
2276 lpClassName: LPCSTR,
2277 lpWindowName: LPCSTR,
2278 dwStyle: DWORD,
2279 x: c_int,
2280 y: c_int,
2281 nWidth: c_int,
2282 nHeight: c_int,
2283 hWndParent: HWND,
2284 hMenu: HMENU,
2285 hInstance: HINSTANCE,
2286 lpParam: LPVOID,
2287 ) -> HWND;
CreateWindowExW( dwExStyle: DWORD, lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, x: c_int, y: c_int, nWidth: c_int, nHeight: c_int, hWndParent: HWND, hMenu: HMENU, hInstance: HINSTANCE, lpParam: LPVOID, ) -> HWND2288 pub fn CreateWindowExW(
2289 dwExStyle: DWORD,
2290 lpClassName: LPCWSTR,
2291 lpWindowName: LPCWSTR,
2292 dwStyle: DWORD,
2293 x: c_int,
2294 y: c_int,
2295 nWidth: c_int,
2296 nHeight: c_int,
2297 hWndParent: HWND,
2298 hMenu: HMENU,
2299 hInstance: HINSTANCE,
2300 lpParam: LPVOID,
2301 ) -> HWND;
2302 }
2303 // CreateWindowA
2304 // CreateWindowW
2305 extern "system" {
IsWindow( hWnd: HWND, ) -> BOOL2306 pub fn IsWindow(
2307 hWnd: HWND,
2308 ) -> BOOL;
IsMenu( hMenu: HMENU, ) -> BOOL2309 pub fn IsMenu(
2310 hMenu: HMENU,
2311 ) -> BOOL;
IsChild( hWndParent: HWND, hWnd: HWND, ) -> BOOL2312 pub fn IsChild(
2313 hWndParent: HWND,
2314 hWnd: HWND,
2315 ) -> BOOL;
DestroyWindow( hWnd: HWND, ) -> BOOL2316 pub fn DestroyWindow(
2317 hWnd: HWND,
2318 ) -> BOOL;
ShowWindow( hWnd: HWND, nCmdShow: c_int, ) -> BOOL2319 pub fn ShowWindow(
2320 hWnd: HWND,
2321 nCmdShow: c_int,
2322 ) -> BOOL;
AnimateWindow( hWnd: HWND, dwTime: DWORD, dwFlags: DWORD, ) -> BOOL2323 pub fn AnimateWindow(
2324 hWnd: HWND,
2325 dwTime: DWORD,
2326 dwFlags: DWORD,
2327 ) -> BOOL;
UpdateLayeredWindow( hWnd: HWND, hdcDst: HDC, pptDst: *mut POINT, psize: *mut SIZE, hdcSrc: HDC, pptSrc: *mut POINT, crKey: COLORREF, pblend: *mut BLENDFUNCTION, dwFlags: DWORD, ) -> BOOL2328 pub fn UpdateLayeredWindow(
2329 hWnd: HWND,
2330 hdcDst: HDC,
2331 pptDst: *mut POINT,
2332 psize: *mut SIZE,
2333 hdcSrc: HDC,
2334 pptSrc: *mut POINT,
2335 crKey: COLORREF,
2336 pblend: *mut BLENDFUNCTION,
2337 dwFlags: DWORD,
2338 ) -> BOOL;
2339 }
2340 STRUCT!{struct UPDATELAYEREDWINDOWINFO {
2341 cbSize: DWORD,
2342 hdcDst: HDC,
2343 pptDst: *const POINT,
2344 psize: *const SIZE,
2345 hdcSrc: HDC,
2346 pptSrc: *const POINT,
2347 crKey: COLORREF,
2348 pblend: *const BLENDFUNCTION,
2349 dwFlags: DWORD,
2350 prcDirty: *const RECT,
2351 }}
2352 pub type PUPDATELAYEREDWINDOWINFO = *mut UPDATELAYEREDWINDOWINFO;
2353 extern "system" {
UpdateLayeredWindowIndirect( hWnd: HWND, pULWInfo: *mut UPDATELAYEREDWINDOWINFO, ) -> BOOL2354 pub fn UpdateLayeredWindowIndirect(
2355 hWnd: HWND,
2356 pULWInfo: *mut UPDATELAYEREDWINDOWINFO,
2357 ) -> BOOL;
GetLayeredWindowAttributes( hwnd: HWND, pcrKey: *mut COLORREF, pbAlpha: *mut BYTE, pdwFlags: *mut DWORD, ) -> BOOL2358 pub fn GetLayeredWindowAttributes(
2359 hwnd: HWND,
2360 pcrKey: *mut COLORREF,
2361 pbAlpha: *mut BYTE,
2362 pdwFlags: *mut DWORD,
2363 ) -> BOOL;
2364 }
2365 pub const PW_CLIENTONLY: DWORD = 0x00000001;
2366 pub const PW_RENDERFULLCONTENT: DWORD = 0x00000002;
2367 extern "system" {
PrintWindow( hwnd: HWND, hdcBlt: HDC, nFlags: UINT, ) -> BOOL2368 pub fn PrintWindow(
2369 hwnd: HWND,
2370 hdcBlt: HDC,
2371 nFlags: UINT,
2372 ) -> BOOL;
SetLayeredWindowAttributes( hwnd: HWND, crKey: COLORREF, bAlpha: BYTE, dwFlags: DWORD, ) -> BOOL2373 pub fn SetLayeredWindowAttributes(
2374 hwnd: HWND,
2375 crKey: COLORREF,
2376 bAlpha: BYTE,
2377 dwFlags: DWORD,
2378 ) -> BOOL;
2379 }
2380 pub const LWA_COLORKEY: DWORD = 0x00000001;
2381 pub const LWA_ALPHA: DWORD = 0x00000002;
2382 pub const ULW_COLORKEY: DWORD = 0x00000001;
2383 pub const ULW_ALPHA: DWORD = 0x00000002;
2384 pub const ULW_OPAQUE: DWORD = 0x00000004;
2385 pub const ULW_EX_NORESIZE: DWORD = 0x00000008;
2386 extern "system" {
ShowWindowAsync( hWnd: HWND, nCmdShow: c_int, ) -> BOOL2387 pub fn ShowWindowAsync(
2388 hWnd: HWND,
2389 nCmdShow: c_int,
2390 ) -> BOOL;
FlashWindow( hwnd: HWND, bInvert: BOOL, ) -> BOOL2391 pub fn FlashWindow(
2392 hwnd: HWND,
2393 bInvert: BOOL,
2394 ) -> BOOL;
2395 }
2396 STRUCT!{struct FLASHWINFO {
2397 cbSize: UINT,
2398 hwnd: HWND,
2399 dwFlags: DWORD,
2400 uCount: UINT,
2401 dwTimeout: DWORD,
2402 }}
2403 pub type PFLASHWINFO = *mut FLASHWINFO;
2404 extern "system" {
FlashWindowEx( pfwi: PFLASHWINFO, ) -> BOOL2405 pub fn FlashWindowEx(
2406 pfwi: PFLASHWINFO,
2407 ) -> BOOL;
2408 }
2409 pub const FLASHW_STOP: DWORD = 0;
2410 pub const FLASHW_CAPTION: DWORD = 0x00000001;
2411 pub const FLASHW_TRAY: DWORD = 0x00000002;
2412 pub const FLASHW_ALL: DWORD = FLASHW_CAPTION | FLASHW_TRAY;
2413 pub const FLASHW_TIMER: DWORD = 0x00000004;
2414 pub const FLASHW_TIMERNOFG: DWORD = 0x0000000C;
2415 extern "system" {
ShowOwnedPopups( hWnd: HWND, fShow: BOOL, ) -> BOOL2416 pub fn ShowOwnedPopups(
2417 hWnd: HWND,
2418 fShow: BOOL,
2419 ) -> BOOL;
OpenIcon( hWnd: HWND, ) -> BOOL2420 pub fn OpenIcon(
2421 hWnd: HWND,
2422 ) -> BOOL;
CloseWindow( hWnd: HWND, ) -> BOOL2423 pub fn CloseWindow(
2424 hWnd: HWND,
2425 ) -> BOOL;
MoveWindow( hWnd: HWND, X: c_int, Y: c_int, nWidth: c_int, nHeight: c_int, bRepaint: BOOL, ) -> BOOL2426 pub fn MoveWindow(
2427 hWnd: HWND,
2428 X: c_int,
2429 Y: c_int,
2430 nWidth: c_int,
2431 nHeight: c_int,
2432 bRepaint: BOOL,
2433 ) -> BOOL;
SetWindowPos( hWnd: HWND, hWndInsertAfter: HWND, X: c_int, Y: c_int, cx: c_int, cy: c_int, uFlags: UINT, ) -> BOOL2434 pub fn SetWindowPos(
2435 hWnd: HWND,
2436 hWndInsertAfter: HWND,
2437 X: c_int,
2438 Y: c_int,
2439 cx: c_int,
2440 cy: c_int,
2441 uFlags: UINT,
2442 ) -> BOOL;
GetWindowPlacement( hWnd: HWND, lpwndpl: *mut WINDOWPLACEMENT, ) -> BOOL2443 pub fn GetWindowPlacement(
2444 hWnd: HWND,
2445 lpwndpl: *mut WINDOWPLACEMENT,
2446 ) -> BOOL;
SetWindowPlacement( hWnd: HWND, lpwndpl: *const WINDOWPLACEMENT, ) -> BOOL2447 pub fn SetWindowPlacement(
2448 hWnd: HWND,
2449 lpwndpl: *const WINDOWPLACEMENT,
2450 ) -> BOOL;
2451 }
2452 pub const WDA_NONE: DWORD = 0x00000000;
2453 pub const WDA_MONITOR: DWORD = 0x00000001;
2454 extern "system" {
GetWindowDisplayAffinity( hWnd: HWND, pdwAffinity: *mut DWORD, ) -> BOOL2455 pub fn GetWindowDisplayAffinity(
2456 hWnd: HWND,
2457 pdwAffinity: *mut DWORD,
2458 ) -> BOOL;
SetWindowDisplayAffinity( hWnd: HWND, dwAffinity: DWORD, ) -> BOOL2459 pub fn SetWindowDisplayAffinity(
2460 hWnd: HWND,
2461 dwAffinity: DWORD,
2462 ) -> BOOL;
BeginDeferWindowPos( nNumWindows: c_int, ) -> HDWP2463 pub fn BeginDeferWindowPos(
2464 nNumWindows: c_int,
2465 ) -> HDWP;
DeferWindowPos( hWinPosInfo: HDWP, hWnd: HWND, hWndInserAfter: HWND, x: c_int, y: c_int, cx: c_int, cy: c_int, uFlags: UINT, ) -> HDWP2466 pub fn DeferWindowPos(
2467 hWinPosInfo: HDWP,
2468 hWnd: HWND,
2469 hWndInserAfter: HWND,
2470 x: c_int,
2471 y: c_int,
2472 cx: c_int,
2473 cy: c_int,
2474 uFlags: UINT,
2475 ) -> HDWP;
EndDeferWindowPos( hWinPosInfo: HDWP, ) -> BOOL2476 pub fn EndDeferWindowPos(
2477 hWinPosInfo: HDWP,
2478 ) -> BOOL;
IsWindowVisible( hWnd: HWND, ) -> BOOL2479 pub fn IsWindowVisible(
2480 hWnd: HWND,
2481 ) -> BOOL;
IsIconic( hWnd: HWND, ) -> BOOL2482 pub fn IsIconic(
2483 hWnd: HWND,
2484 ) -> BOOL;
AnyPopup() -> BOOL2485 pub fn AnyPopup() -> BOOL;
BringWindowToTop( hWnd: HWND, ) -> BOOL2486 pub fn BringWindowToTop(
2487 hWnd: HWND,
2488 ) -> BOOL;
IsZoomed( hwnd: HWND, ) -> BOOL2489 pub fn IsZoomed(
2490 hwnd: HWND,
2491 ) -> BOOL;
2492 }
2493 pub const SWP_NOSIZE: UINT = 0x0001;
2494 pub const SWP_NOMOVE: UINT = 0x0002;
2495 pub const SWP_NOZORDER: UINT = 0x0004;
2496 pub const SWP_NOREDRAW: UINT = 0x0008;
2497 pub const SWP_NOACTIVATE: UINT = 0x0010;
2498 pub const SWP_FRAMECHANGED: UINT = 0x0020;
2499 pub const SWP_SHOWWINDOW: UINT = 0x0040;
2500 pub const SWP_HIDEWINDOW: UINT = 0x0080;
2501 pub const SWP_NOCOPYBITS: UINT = 0x0100;
2502 pub const SWP_NOOWNERZORDER: UINT = 0x0200;
2503 pub const SWP_NOSENDCHANGING: UINT = 0x0400;
2504 pub const SWP_DRAWFRAME: UINT = SWP_FRAMECHANGED;
2505 pub const SWP_NOREPOSITION: UINT = SWP_NOOWNERZORDER;
2506 pub const SWP_DEFERERASE: UINT = 0x2000;
2507 pub const SWP_ASYNCWINDOWPOS: UINT = 0x4000;
2508 pub const HWND_TOP: HWND = 0 as HWND;
2509 pub const HWND_BOTTOM: HWND = 1 as HWND;
2510 pub const HWND_TOPMOST: HWND = -1isize as HWND;
2511 pub const HWND_NOTOPMOST: HWND = -2isize as HWND;
2512 // FIXME packed(2)
2513 STRUCT!{#[repr(packed)] struct DLGTEMPLATE {
2514 style: DWORD,
2515 dwExtendedStyle: DWORD,
2516 cdit: WORD,
2517 x: c_short,
2518 y: c_short,
2519 cx: c_short,
2520 cy: c_short,
2521 }}
2522 pub type LPDLGTEMPLATEA = *mut DLGTEMPLATE;
2523 pub type LPDLGTEMPLATEW = *mut DLGTEMPLATE;
2524 pub type LPCDLGTEMPLATEA = *const DLGTEMPLATE;
2525 pub type LPCDLGTEMPLATEW = *const DLGTEMPLATE;
2526 // FIXME packed(2)
2527 STRUCT!{#[repr(packed)] struct DLGITEMTEMPLATE {
2528 style: DWORD,
2529 dwExtendedStyle: DWORD,
2530 x: c_short,
2531 y: c_short,
2532 cx: c_short,
2533 cy: c_short,
2534 id: WORD,
2535 }}
2536 pub type PDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE;
2537 pub type PDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE;
2538 pub type LPDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE;
2539 pub type LPDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE;
2540 extern "system" {
CreateDialogParamA( hInstance: HINSTANCE, lpTemplateName: LPCSTR, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> HWND2541 pub fn CreateDialogParamA(
2542 hInstance: HINSTANCE,
2543 lpTemplateName: LPCSTR,
2544 hWndParent: HWND,
2545 lpDialogFunc: DLGPROC,
2546 dwInitParam: LPARAM,
2547 ) -> HWND;
CreateDialogParamW( hInstance: HINSTANCE, lpTemplateName: LPCWSTR, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> HWND2548 pub fn CreateDialogParamW(
2549 hInstance: HINSTANCE,
2550 lpTemplateName: LPCWSTR,
2551 hWndParent: HWND,
2552 lpDialogFunc: DLGPROC,
2553 dwInitParam: LPARAM,
2554 ) -> HWND;
CreateDialogIndirectParamA( hInstance: HINSTANCE, lpTemplate: LPCDLGTEMPLATEA, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> HWND2555 pub fn CreateDialogIndirectParamA(
2556 hInstance: HINSTANCE,
2557 lpTemplate: LPCDLGTEMPLATEA,
2558 hWndParent: HWND,
2559 lpDialogFunc: DLGPROC,
2560 dwInitParam: LPARAM,
2561 ) -> HWND;
CreateDialogIndirectParamW( hInstance: HINSTANCE, lpTemplate: LPCDLGTEMPLATEW, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> HWND2562 pub fn CreateDialogIndirectParamW(
2563 hInstance: HINSTANCE,
2564 lpTemplate: LPCDLGTEMPLATEW,
2565 hWndParent: HWND,
2566 lpDialogFunc: DLGPROC,
2567 dwInitParam: LPARAM,
2568 ) -> HWND;
2569 }
2570 // CreateDialogA
2571 // CreateDialogW
2572 // CreateDialogIndirectA
2573 // CreateDialogIndirectW
2574 extern "system" {
DialogBoxParamA( hInstance: HINSTANCE, lpTemplateName: LPCSTR, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> INT_PTR2575 pub fn DialogBoxParamA(
2576 hInstance: HINSTANCE,
2577 lpTemplateName: LPCSTR,
2578 hWndParent: HWND,
2579 lpDialogFunc: DLGPROC,
2580 dwInitParam: LPARAM,
2581 ) -> INT_PTR;
DialogBoxParamW( hInstance: HINSTANCE, lpTemplateName: LPCWSTR, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> INT_PTR2582 pub fn DialogBoxParamW(
2583 hInstance: HINSTANCE,
2584 lpTemplateName: LPCWSTR,
2585 hWndParent: HWND,
2586 lpDialogFunc: DLGPROC,
2587 dwInitParam: LPARAM,
2588 ) -> INT_PTR;
DialogBoxIndirectParamA( hInstance: HINSTANCE, hDialogTemplate: LPCDLGTEMPLATEA, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> INT_PTR2589 pub fn DialogBoxIndirectParamA(
2590 hInstance: HINSTANCE,
2591 hDialogTemplate: LPCDLGTEMPLATEA,
2592 hWndParent: HWND,
2593 lpDialogFunc: DLGPROC,
2594 dwInitParam: LPARAM,
2595 ) -> INT_PTR;
DialogBoxIndirectParamW( hInstance: HINSTANCE, hDialogTemplate: LPCDLGTEMPLATEW, hWndParent: HWND, lpDialogFunc: DLGPROC, dwInitParam: LPARAM, ) -> INT_PTR2596 pub fn DialogBoxIndirectParamW(
2597 hInstance: HINSTANCE,
2598 hDialogTemplate: LPCDLGTEMPLATEW,
2599 hWndParent: HWND,
2600 lpDialogFunc: DLGPROC,
2601 dwInitParam: LPARAM,
2602 ) -> INT_PTR;
2603 }
2604 // DialogBoxA
2605 // DialogBoxW
2606 // DialogBoxIndirectA
2607 // DialogBoxIndirectW
2608 extern "system" {
EndDialog( hDlg: HWND, nResult: INT_PTR, ) -> BOOL2609 pub fn EndDialog(
2610 hDlg: HWND,
2611 nResult: INT_PTR,
2612 ) -> BOOL;
GetDlgItem( hDlg: HWND, nIDDlgItem: c_int, ) -> HWND2613 pub fn GetDlgItem(
2614 hDlg: HWND,
2615 nIDDlgItem: c_int,
2616 ) -> HWND;
SetDlgItemInt( hDlg: HWND, nIDDlgItem: c_int, uValue: UINT, bSigned: BOOL, ) -> BOOL2617 pub fn SetDlgItemInt(
2618 hDlg: HWND,
2619 nIDDlgItem: c_int,
2620 uValue: UINT,
2621 bSigned: BOOL,
2622 ) -> BOOL;
GetDlgItemInt( hDlg: HWND, nIDDlgItem: c_int, lpTranslated: *mut BOOL, bSigned: BOOL, ) -> UINT2623 pub fn GetDlgItemInt(
2624 hDlg: HWND,
2625 nIDDlgItem: c_int,
2626 lpTranslated: *mut BOOL,
2627 bSigned: BOOL,
2628 ) -> UINT;
SetDlgItemTextA( hDlg: HWND, nIDDlgItem: c_int, lpString: LPCSTR, ) -> BOOL2629 pub fn SetDlgItemTextA(
2630 hDlg: HWND,
2631 nIDDlgItem: c_int,
2632 lpString: LPCSTR,
2633 ) -> BOOL;
SetDlgItemTextW( hDlg: HWND, nIDDlgItem: c_int, lpString: LPCWSTR, ) -> BOOL2634 pub fn SetDlgItemTextW(
2635 hDlg: HWND,
2636 nIDDlgItem: c_int,
2637 lpString: LPCWSTR,
2638 ) -> BOOL;
GetDlgItemTextA( hDlg: HWND, nIDDlgItem: c_int, lpString: LPSTR, nMaxCount: c_int, ) -> UINT2639 pub fn GetDlgItemTextA(
2640 hDlg: HWND,
2641 nIDDlgItem: c_int,
2642 lpString: LPSTR,
2643 nMaxCount: c_int,
2644 ) -> UINT;
GetDlgItemTextW( hDlg: HWND, nIDDlgItem: c_int, lpString: LPWSTR, nMaxCount: c_int, ) -> UINT2645 pub fn GetDlgItemTextW(
2646 hDlg: HWND,
2647 nIDDlgItem: c_int,
2648 lpString: LPWSTR,
2649 nMaxCount: c_int,
2650 ) -> UINT;
CheckDlgButton( hDlg: HWND, nIDButton: c_int, uCheck: UINT, ) -> BOOL2651 pub fn CheckDlgButton(
2652 hDlg: HWND,
2653 nIDButton: c_int,
2654 uCheck: UINT,
2655 ) -> BOOL;
CheckRadioButton( hDlg: HWND, nIDFirstButton: c_int, nIDLasatButton: c_int, nIDCheckButton: c_int, ) -> BOOL2656 pub fn CheckRadioButton(
2657 hDlg: HWND,
2658 nIDFirstButton: c_int,
2659 nIDLasatButton: c_int,
2660 nIDCheckButton: c_int,
2661 ) -> BOOL;
IsDlgButtonChecked( hDlg: HWND, nIDButton: c_int, ) -> UINT2662 pub fn IsDlgButtonChecked(
2663 hDlg: HWND,
2664 nIDButton: c_int,
2665 ) -> UINT;
SendDlgItemMessageA( hDlg: HWND, nIDDlgItem: c_int, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2666 pub fn SendDlgItemMessageA(
2667 hDlg: HWND,
2668 nIDDlgItem: c_int,
2669 Msg: UINT,
2670 wParam: WPARAM,
2671 lParam: LPARAM,
2672 ) -> LRESULT;
SendDlgItemMessageW( hDlg: HWND, nIDDlgItem: c_int, Msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2673 pub fn SendDlgItemMessageW(
2674 hDlg: HWND,
2675 nIDDlgItem: c_int,
2676 Msg: UINT,
2677 wParam: WPARAM,
2678 lParam: LPARAM,
2679 ) -> LRESULT;
GetNextDlgGroupItem( hDlg: HWND, hCtl: HWND, bPrevious: BOOL, ) -> HWND2680 pub fn GetNextDlgGroupItem(
2681 hDlg: HWND,
2682 hCtl: HWND,
2683 bPrevious: BOOL,
2684 ) -> HWND;
GetNextDlgTabItem( hDlg: HWND, hCtl: HWND, bPrevious: BOOL, ) -> HWND2685 pub fn GetNextDlgTabItem(
2686 hDlg: HWND,
2687 hCtl: HWND,
2688 bPrevious: BOOL,
2689 ) -> HWND;
GetDlgCtrlID( hwnd: HWND, ) -> c_int2690 pub fn GetDlgCtrlID(
2691 hwnd: HWND,
2692 ) -> c_int;
GetDialogBaseUnits() -> LONG2693 pub fn GetDialogBaseUnits() -> LONG;
DefDlgProcA( hDlg: HWND, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2694 pub fn DefDlgProcA(
2695 hDlg: HWND,
2696 msg: UINT,
2697 wParam: WPARAM,
2698 lParam: LPARAM,
2699 ) -> LRESULT;
DefDlgProcW( hDlg: HWND, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> LRESULT2700 pub fn DefDlgProcW(
2701 hDlg: HWND,
2702 msg: UINT,
2703 wParam: WPARAM,
2704 lParam: LPARAM,
2705 ) -> LRESULT;
2706 }
2707 ENUM!{enum DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS {
2708 DCDC_DEFAULT = 0x0000,
2709 DCDC_DISABLE_FONT_UPDATE = 0x0001,
2710 DCDC_DISABLE_RELAYOUT = 0x0002,
2711 }}
2712 extern "system" {
SetDialogControlDpiChangeBehavior( hwnd: HWND, mask: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS, values: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS, ) -> BOOL2713 pub fn SetDialogControlDpiChangeBehavior(
2714 hwnd: HWND,
2715 mask: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS,
2716 values: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS,
2717 ) -> BOOL;
GetDialogControlDpiChangeBehavior( hwnd: HWND, ) -> DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS2718 pub fn GetDialogControlDpiChangeBehavior(
2719 hwnd: HWND,
2720 ) -> DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS;
2721 }
2722 ENUM!{enum DIALOG_DPI_CHANGE_BEHAVIORS {
2723 DDC_DEFAULT = 0x0000,
2724 DDC_DISABLE_ALL = 0x0001,
2725 DDC_DISABLE_RESIZE = 0x0002,
2726 DDC_DISABLE_CONTROL_RELAYOUT = 0x0004,
2727 }}
2728 extern "system" {
SetDialogDpiChangeBehavior( hDlg: HWND, mask: DIALOG_DPI_CHANGE_BEHAVIORS, values: DIALOG_DPI_CHANGE_BEHAVIORS, ) -> BOOL2729 pub fn SetDialogDpiChangeBehavior(
2730 hDlg: HWND,
2731 mask: DIALOG_DPI_CHANGE_BEHAVIORS,
2732 values: DIALOG_DPI_CHANGE_BEHAVIORS,
2733 ) -> BOOL;
GetDialogDpiChangeBehavior( hDlg: HWND, ) -> DIALOG_DPI_CHANGE_BEHAVIORS2734 pub fn GetDialogDpiChangeBehavior(
2735 hDlg: HWND,
2736 ) -> DIALOG_DPI_CHANGE_BEHAVIORS;
CallMsgFilterA( lpMsg: LPMSG, nCode: c_int, ) -> BOOL2737 pub fn CallMsgFilterA(
2738 lpMsg: LPMSG,
2739 nCode: c_int,
2740 ) -> BOOL;
CallMsgFilterW( lpMsg: LPMSG, nCode: c_int, ) -> BOOL2741 pub fn CallMsgFilterW(
2742 lpMsg: LPMSG,
2743 nCode: c_int,
2744 ) -> BOOL;
OpenClipboard( hWnd: HWND, ) -> BOOL2745 pub fn OpenClipboard(
2746 hWnd: HWND,
2747 ) -> BOOL;
CloseClipboard() -> BOOL2748 pub fn CloseClipboard() -> BOOL;
GetClipboardSequenceNumber() -> DWORD2749 pub fn GetClipboardSequenceNumber() -> DWORD;
GetClipboardOwner() -> HWND2750 pub fn GetClipboardOwner() -> HWND;
SetClipboardViewer( hWndNewViewer: HWND, ) -> HWND2751 pub fn SetClipboardViewer(
2752 hWndNewViewer: HWND,
2753 ) -> HWND;
GetClipboardViewer() -> HWND2754 pub fn GetClipboardViewer() -> HWND;
ChangeClipboardChain( hwndRemove: HWND, hwndNewNext: HWND, ) -> BOOL2755 pub fn ChangeClipboardChain(
2756 hwndRemove: HWND,
2757 hwndNewNext: HWND,
2758 ) -> BOOL;
SetClipboardData( uFormat: UINT, hMem: HANDLE, ) -> HANDLE2759 pub fn SetClipboardData(
2760 uFormat: UINT,
2761 hMem: HANDLE,
2762 ) -> HANDLE;
GetClipboardData( uFormat: UINT, ) -> HANDLE2763 pub fn GetClipboardData(
2764 uFormat: UINT,
2765 ) -> HANDLE;
RegisterClipboardFormatA( lpszFormat: LPCSTR, ) -> UINT2766 pub fn RegisterClipboardFormatA(
2767 lpszFormat: LPCSTR,
2768 ) -> UINT;
RegisterClipboardFormatW( lpszFormat: LPCWSTR, ) -> UINT2769 pub fn RegisterClipboardFormatW(
2770 lpszFormat: LPCWSTR,
2771 ) -> UINT;
CountClipboardFormats() -> c_int2772 pub fn CountClipboardFormats() -> c_int;
EnumClipboardFormats( format: UINT, ) -> UINT2773 pub fn EnumClipboardFormats(
2774 format: UINT,
2775 ) -> UINT;
GetClipboardFormatNameA( format: UINT, lpszFormatName: LPSTR, cchMaxCount: c_int, ) -> c_int2776 pub fn GetClipboardFormatNameA(
2777 format: UINT,
2778 lpszFormatName: LPSTR,
2779 cchMaxCount: c_int,
2780 ) -> c_int;
GetClipboardFormatNameW( format: UINT, lpszFormatName: LPWSTR, cchMaxCount: c_int, ) -> c_int2781 pub fn GetClipboardFormatNameW(
2782 format: UINT,
2783 lpszFormatName: LPWSTR,
2784 cchMaxCount: c_int,
2785 ) -> c_int;
EmptyClipboard() -> BOOL2786 pub fn EmptyClipboard() -> BOOL;
IsClipboardFormatAvailable( format: UINT, ) -> BOOL2787 pub fn IsClipboardFormatAvailable(
2788 format: UINT,
2789 ) -> BOOL;
GetPriorityClipboardFormat( paFormatPriorityList: *mut UINT, cFormats: c_int, ) -> c_int2790 pub fn GetPriorityClipboardFormat(
2791 paFormatPriorityList: *mut UINT,
2792 cFormats: c_int,
2793 ) -> c_int;
GetOpenClipboardWindow() -> HWND2794 pub fn GetOpenClipboardWindow() -> HWND;
AddClipboardFormatListener( hWnd: HWND, ) -> BOOL2795 pub fn AddClipboardFormatListener(
2796 hWnd: HWND,
2797 ) -> BOOL;
RemoveClipboardFormatListener( hWnd: HWND, ) -> BOOL2798 pub fn RemoveClipboardFormatListener(
2799 hWnd: HWND,
2800 ) -> BOOL;
GetUpdatedClipboardFormats( lpuiFormats: PUINT, cFormats: UINT, pcFormatsOUT: PUINT, ) -> BOOL2801 pub fn GetUpdatedClipboardFormats(
2802 lpuiFormats: PUINT,
2803 cFormats: UINT,
2804 pcFormatsOUT: PUINT,
2805 ) -> BOOL;
CharToOemA( pSrc: LPCSTR, pDst: LPSTR, ) -> BOOL2806 pub fn CharToOemA(
2807 pSrc: LPCSTR,
2808 pDst: LPSTR,
2809 ) -> BOOL;
CharToOemW( pSrc: LPCWSTR, pDst: LPSTR, ) -> BOOL2810 pub fn CharToOemW(
2811 pSrc: LPCWSTR,
2812 pDst: LPSTR,
2813 ) -> BOOL;
OemToCharA( pSrc: LPCSTR, pDst: LPSTR, ) -> BOOL2814 pub fn OemToCharA(
2815 pSrc: LPCSTR,
2816 pDst: LPSTR,
2817 ) -> BOOL;
OemToCharW( pSrc: LPCSTR, pDst: LPWSTR, ) -> BOOL2818 pub fn OemToCharW(
2819 pSrc: LPCSTR,
2820 pDst: LPWSTR,
2821 ) -> BOOL;
CharToOemBuffA( lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD, ) -> BOOL2822 pub fn CharToOemBuffA(
2823 lpszSrc: LPCSTR,
2824 lpszDst: LPSTR,
2825 cchDstLength: DWORD,
2826 ) -> BOOL;
CharToOemBuffW( lpszSrc: LPCWSTR, lpszDst: LPSTR, cchDstLength: DWORD, ) -> BOOL2827 pub fn CharToOemBuffW(
2828 lpszSrc: LPCWSTR,
2829 lpszDst: LPSTR,
2830 cchDstLength: DWORD,
2831 ) -> BOOL;
OemToCharBuffA( lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD, ) -> BOOL2832 pub fn OemToCharBuffA(
2833 lpszSrc: LPCSTR,
2834 lpszDst: LPSTR,
2835 cchDstLength: DWORD,
2836 ) -> BOOL;
OemToCharBuffW( lpszSrc: LPCSTR, lpszDst: LPWSTR, cchDstLength: DWORD, ) -> BOOL2837 pub fn OemToCharBuffW(
2838 lpszSrc: LPCSTR,
2839 lpszDst: LPWSTR,
2840 cchDstLength: DWORD,
2841 ) -> BOOL;
CharUpperA( lpsz: LPSTR, ) -> LPSTR2842 pub fn CharUpperA(
2843 lpsz: LPSTR,
2844 ) -> LPSTR;
CharUpperW( lpsz: LPWSTR, ) -> LPWSTR2845 pub fn CharUpperW(
2846 lpsz: LPWSTR,
2847 ) -> LPWSTR;
CharUpperBuffA( lpsz: LPSTR, cchLength: DWORD, ) -> DWORD2848 pub fn CharUpperBuffA(
2849 lpsz: LPSTR,
2850 cchLength: DWORD,
2851 ) -> DWORD;
CharUpperBuffW( lpsz: LPWSTR, cchLength: DWORD, ) -> DWORD2852 pub fn CharUpperBuffW(
2853 lpsz: LPWSTR,
2854 cchLength: DWORD,
2855 ) -> DWORD;
CharLowerA( lpsz: LPSTR, ) -> LPSTR2856 pub fn CharLowerA(
2857 lpsz: LPSTR,
2858 ) -> LPSTR;
CharLowerW( lpsz: LPWSTR, ) -> LPWSTR2859 pub fn CharLowerW(
2860 lpsz: LPWSTR,
2861 ) -> LPWSTR;
CharLowerBuffA( lpsz: LPSTR, cchLength: DWORD, ) -> DWORD2862 pub fn CharLowerBuffA(
2863 lpsz: LPSTR,
2864 cchLength: DWORD,
2865 ) -> DWORD;
CharLowerBuffW( lpsz: LPWSTR, cchLength: DWORD, ) -> DWORD2866 pub fn CharLowerBuffW(
2867 lpsz: LPWSTR,
2868 cchLength: DWORD,
2869 ) -> DWORD;
CharNextA( lpsz: LPCSTR, ) -> LPSTR2870 pub fn CharNextA(
2871 lpsz: LPCSTR,
2872 ) -> LPSTR;
CharNextW( lpsz: LPCWSTR, ) -> LPWSTR2873 pub fn CharNextW(
2874 lpsz: LPCWSTR,
2875 ) -> LPWSTR;
CharPrevA( lpszStart: LPCSTR, lpszCurrent: LPCSTR, ) -> LPSTR2876 pub fn CharPrevA(
2877 lpszStart: LPCSTR,
2878 lpszCurrent: LPCSTR,
2879 ) -> LPSTR;
CharPrevW( lpszStart: LPCWSTR, lpszCurrent: LPCWSTR, ) -> LPWSTR2880 pub fn CharPrevW(
2881 lpszStart: LPCWSTR,
2882 lpszCurrent: LPCWSTR,
2883 ) -> LPWSTR;
CharNextExA( codePage: WORD, lpCurrentChar: LPSTR, dwFlags: DWORD, ) -> LPSTR2884 pub fn CharNextExA(
2885 codePage: WORD,
2886 lpCurrentChar: LPSTR,
2887 dwFlags: DWORD,
2888 ) -> LPSTR;
CharPrevExA( codePage: WORD, lpStart: LPCSTR, lpCurrentChar: LPCSTR, dwFlags: DWORD, ) -> LPSTR2889 pub fn CharPrevExA(
2890 codePage: WORD,
2891 lpStart: LPCSTR,
2892 lpCurrentChar: LPCSTR,
2893 dwFlags: DWORD,
2894 ) -> LPSTR;
2895 }
2896 // AnsiToOem
2897 // OemToAnsi
2898 // AnsiToOemBuff
2899 // OemToAnsiBuff
2900 // AnsiUpper
2901 // AnsiUpperBuff
2902 // AnsiLower
2903 // AnsiLowerBuff
2904 // AnsiNext
2905 // AnsiPrev
2906 extern "system" {
IsCharAlphaA( ch: CHAR, ) -> BOOL2907 pub fn IsCharAlphaA(
2908 ch: CHAR,
2909 ) -> BOOL;
IsCharAlphaW( ch: WCHAR, ) -> BOOL2910 pub fn IsCharAlphaW(
2911 ch: WCHAR,
2912 ) -> BOOL;
IsCharAlphaNumericA( ch: CHAR, ) -> BOOL2913 pub fn IsCharAlphaNumericA(
2914 ch: CHAR,
2915 ) -> BOOL;
IsCharAlphaNumericW( ch: WCHAR, ) -> BOOL2916 pub fn IsCharAlphaNumericW(
2917 ch: WCHAR,
2918 ) -> BOOL;
IsCharUpperA( ch: CHAR, ) -> BOOL2919 pub fn IsCharUpperA(
2920 ch: CHAR,
2921 ) -> BOOL;
IsCharUpperW( ch: WCHAR, ) -> BOOL2922 pub fn IsCharUpperW(
2923 ch: WCHAR,
2924 ) -> BOOL;
IsCharLowerA( ch: CHAR, ) -> BOOL2925 pub fn IsCharLowerA(
2926 ch: CHAR,
2927 ) -> BOOL;
IsCharLowerW( ch: WCHAR, ) -> BOOL2928 pub fn IsCharLowerW(
2929 ch: WCHAR,
2930 ) -> BOOL;
SetFocus( hWnd: HWND, ) -> HWND2931 pub fn SetFocus(
2932 hWnd: HWND,
2933 ) -> HWND;
GetActiveWindow() -> HWND2934 pub fn GetActiveWindow() -> HWND;
GetFocus() -> HWND2935 pub fn GetFocus() -> HWND;
GetKBCodePage() -> UINT2936 pub fn GetKBCodePage() -> UINT;
GetKeyState( nVirtKey: c_int, ) -> SHORT2937 pub fn GetKeyState(
2938 nVirtKey: c_int,
2939 ) -> SHORT;
GetAsyncKeyState( vKey: c_int, ) -> SHORT2940 pub fn GetAsyncKeyState(
2941 vKey: c_int,
2942 ) -> SHORT;
GetKeyboardState( lpKeyState: PBYTE, ) -> BOOL2943 pub fn GetKeyboardState(
2944 lpKeyState: PBYTE,
2945 ) -> BOOL;
SetKeyboardState( lpKeyState: LPBYTE, ) -> BOOL2946 pub fn SetKeyboardState(
2947 lpKeyState: LPBYTE,
2948 ) -> BOOL;
GetKeyNameTextA( lparam: LONG, lpString: LPSTR, cchSize: c_int, ) -> c_int2949 pub fn GetKeyNameTextA(
2950 lparam: LONG,
2951 lpString: LPSTR,
2952 cchSize: c_int,
2953 ) -> c_int;
GetKeyNameTextW( lParam: LONG, lpString: LPWSTR, cchSize: c_int, ) -> c_int2954 pub fn GetKeyNameTextW(
2955 lParam: LONG,
2956 lpString: LPWSTR,
2957 cchSize: c_int,
2958 ) -> c_int;
GetKeyboardType( nTypeFlag: c_int, ) -> c_int2959 pub fn GetKeyboardType(
2960 nTypeFlag: c_int,
2961 ) -> c_int;
ToAscii( uVirtKey: UINT, uScanCode: UINT, lpKeyState: *const BYTE, lpChar: LPWORD, uFlags: UINT, ) -> c_int2962 pub fn ToAscii(
2963 uVirtKey: UINT,
2964 uScanCode: UINT,
2965 lpKeyState: *const BYTE,
2966 lpChar: LPWORD,
2967 uFlags: UINT,
2968 ) -> c_int;
ToAsciiEx( uVirtKey: UINT, uScanCode: UINT, lpKeyState: *const BYTE, lpChar: LPWORD, uFlags: UINT, dwhkl: HKL, ) -> c_int2969 pub fn ToAsciiEx(
2970 uVirtKey: UINT,
2971 uScanCode: UINT,
2972 lpKeyState: *const BYTE,
2973 lpChar: LPWORD,
2974 uFlags: UINT,
2975 dwhkl: HKL,
2976 ) -> c_int;
ToUnicode( wVirtKey: UINT, wScanCode: UINT, lpKeyState: *const BYTE, lwszBuff: LPWSTR, cchBuff: c_int, wFlags: UINT, ) -> c_int2977 pub fn ToUnicode(
2978 wVirtKey: UINT,
2979 wScanCode: UINT,
2980 lpKeyState: *const BYTE,
2981 lwszBuff: LPWSTR,
2982 cchBuff: c_int,
2983 wFlags: UINT,
2984 ) -> c_int;
OemKeyScan( wOemChar: WORD, ) -> DWORD2985 pub fn OemKeyScan(
2986 wOemChar: WORD,
2987 ) -> DWORD;
VkKeyScanA( ch: CHAR, ) -> SHORT2988 pub fn VkKeyScanA(
2989 ch: CHAR,
2990 ) -> SHORT;
VkKeyScanW( ch: WCHAR, ) -> SHORT2991 pub fn VkKeyScanW(
2992 ch: WCHAR,
2993 ) -> SHORT;
VkKeyScanExA( ch: CHAR, dwhkl: HKL, ) -> SHORT2994 pub fn VkKeyScanExA(
2995 ch: CHAR,
2996 dwhkl: HKL,
2997 ) -> SHORT;
VkKeyScanExW( ch: WCHAR, dwhkl: HKL, ) -> SHORT2998 pub fn VkKeyScanExW(
2999 ch: WCHAR,
3000 dwhkl: HKL,
3001 ) -> SHORT;
3002 }
3003 pub const KEYEVENTF_EXTENDEDKEY: DWORD = 0x0001;
3004 pub const KEYEVENTF_KEYUP: DWORD = 0x0002;
3005 pub const KEYEVENTF_UNICODE: DWORD = 0x0004;
3006 pub const KEYEVENTF_SCANCODE: DWORD = 0x0008;
3007 extern "system" {
keybd_event( bVk: BYTE, bScan: BYTE, dwFlags: DWORD, dwExtraInfo: ULONG_PTR, )3008 pub fn keybd_event(
3009 bVk: BYTE,
3010 bScan: BYTE,
3011 dwFlags: DWORD,
3012 dwExtraInfo: ULONG_PTR,
3013 );
3014 }
3015 pub const MOUSEEVENTF_MOVE: DWORD = 0x0001;
3016 pub const MOUSEEVENTF_LEFTDOWN: DWORD = 0x0002;
3017 pub const MOUSEEVENTF_LEFTUP: DWORD = 0x0004;
3018 pub const MOUSEEVENTF_RIGHTDOWN: DWORD = 0x0008;
3019 pub const MOUSEEVENTF_RIGHTUP: DWORD = 0x0010;
3020 pub const MOUSEEVENTF_MIDDLEDOWN: DWORD = 0x0020;
3021 pub const MOUSEEVENTF_MIDDLEUP: DWORD = 0x0040;
3022 pub const MOUSEEVENTF_XDOWN: DWORD = 0x0080;
3023 pub const MOUSEEVENTF_XUP: DWORD = 0x0100;
3024 pub const MOUSEEVENTF_WHEEL: DWORD = 0x0800;
3025 pub const MOUSEEVENTF_HWHEEL: DWORD = 0x01000;
3026 pub const MOUSEEVENTF_MOVE_NOCOALESCE: DWORD = 0x2000;
3027 pub const MOUSEEVENTF_VIRTUALDESK: DWORD = 0x4000;
3028 pub const MOUSEEVENTF_ABSOLUTE: DWORD = 0x8000;
3029 extern "system" {
mouse_event( dwFlags: DWORD, dx: DWORD, dy: DWORD, dwData: DWORD, dwExtraInfo: ULONG_PTR, )3030 pub fn mouse_event(
3031 dwFlags: DWORD,
3032 dx: DWORD,
3033 dy: DWORD,
3034 dwData: DWORD,
3035 dwExtraInfo: ULONG_PTR,
3036 );
3037 }
3038 STRUCT!{struct MOUSEINPUT {
3039 dx: LONG,
3040 dy: LONG,
3041 mouseData: DWORD,
3042 dwFlags: DWORD,
3043 time: DWORD,
3044 dwExtraInfo: ULONG_PTR,
3045 }}
3046 pub type PMOUSEINPUT = *mut MOUSEINPUT;
3047 pub type LPMOUSEINPUT = *mut MOUSEINPUT;
3048 STRUCT!{struct KEYBDINPUT {
3049 wVk: WORD,
3050 wScan: WORD,
3051 dwFlags: DWORD,
3052 time: DWORD,
3053 dwExtraInfo: ULONG_PTR,
3054 }}
3055 pub type PKEYBDINPUT = *mut KEYBDINPUT;
3056 pub type LPKEYBDINPUT = *mut KEYBDINPUT;
3057 STRUCT!{struct HARDWAREINPUT {
3058 uMsg: DWORD,
3059 wParamL: WORD,
3060 wParamH: WORD,
3061 }}
3062 pub type PHARDWAREINPUT = *mut HARDWAREINPUT;
3063 pub type LPHARDWAREINPUT= *mut HARDWAREINPUT;
3064 pub const INPUT_MOUSE: DWORD = 0;
3065 pub const INPUT_KEYBOARD: DWORD = 1;
3066 pub const INPUT_HARDWARE: DWORD = 2;
3067 UNION!{union INPUT_u {
3068 [u32; 6] [u64; 4],
3069 mi mi_mut: MOUSEINPUT,
3070 ki ki_mut: KEYBDINPUT,
3071 hi hi_mut: HARDWAREINPUT,
3072 }}
3073 STRUCT!{struct INPUT {
3074 type_: DWORD,
3075 u: INPUT_u,
3076 }}
3077 pub type PINPUT = *mut INPUT;
3078 pub type LPINPUT = *mut INPUT;
3079 extern "system" {
SendInput( cInputs: UINT, pInputs: LPINPUT, cbSize: c_int, ) -> UINT3080 pub fn SendInput(
3081 cInputs: UINT,
3082 pInputs: LPINPUT,
3083 cbSize: c_int,
3084 ) -> UINT;
3085 }
3086 DECLARE_HANDLE!{HTOUCHINPUT, HTOUCHINPUT__}
3087 STRUCT!{struct TOUCHINPUT {
3088 x: LONG,
3089 y: LONG,
3090 hSource: HANDLE,
3091 dwID: DWORD,
3092 dwFlags: DWORD,
3093 dwMask: DWORD,
3094 dwTime: DWORD,
3095 dwExtraInfo: ULONG_PTR,
3096 cxContact: DWORD,
3097 cyContact: DWORD,
3098 }}
3099 pub type PTOUCHINPUT = *mut TOUCHINPUT;
3100 pub type PCTOUCHINPUT = *const TOUCHINPUT;
3101 // TOUCH_COORD_TO_PIXEL
3102 pub const TOUCHEVENTF_MOVE: DWORD = 0x0001;
3103 pub const TOUCHEVENTF_DOWN: DWORD = 0x0002;
3104 pub const TOUCHEVENTF_UP: DWORD = 0x0004;
3105 pub const TOUCHEVENTF_INRANGE: DWORD = 0x0008;
3106 pub const TOUCHEVENTF_PRIMARY: DWORD = 0x0010;
3107 pub const TOUCHEVENTF_NOCOALESCE: DWORD = 0x0020;
3108 pub const TOUCHEVENTF_PEN: DWORD = 0x0040;
3109 pub const TOUCHEVENTF_PALM: DWORD = 0x0080;
3110 pub const TOUCHINPUTMASKF_TIMEFROMSYSTEM: DWORD = 0x0001;
3111 pub const TOUCHINPUTMASKF_EXTRAINFO: DWORD = 0x0002;
3112 pub const TOUCHINPUTMASKF_CONTACTAREA: DWORD = 0x0004;
3113 extern "system" {
GetTouchInputInfo( hTouchInput: HTOUCHINPUT, cInputs: c_uint, pInputs: PTOUCHINPUT, cbSize: c_int, ) -> BOOL3114 pub fn GetTouchInputInfo(
3115 hTouchInput: HTOUCHINPUT,
3116 cInputs: c_uint,
3117 pInputs: PTOUCHINPUT,
3118 cbSize: c_int,
3119 ) -> BOOL;
CloseTouchInputHandle( hTouchInput: HTOUCHINPUT, ) -> BOOL3120 pub fn CloseTouchInputHandle(
3121 hTouchInput: HTOUCHINPUT,
3122 ) -> BOOL;
3123 }
3124 pub const TWF_FINETOUCH: DWORD = 0x00000001;
3125 pub const TWF_WANTPALM: DWORD = 0x00000002;
3126 extern "system" {
RegisterTouchWindow( hWnd: HWND, flags: ULONG, ) -> BOOL3127 pub fn RegisterTouchWindow(
3128 hWnd: HWND,
3129 flags: ULONG,
3130 ) -> BOOL;
UnregisterTouchWindow( hwnd: HWND, ) -> BOOL3131 pub fn UnregisterTouchWindow(
3132 hwnd: HWND,
3133 ) -> BOOL;
IsTouchWindow( hwnd: HWND, pulFlags: PULONG, ) -> BOOL3134 pub fn IsTouchWindow(
3135 hwnd: HWND,
3136 pulFlags: PULONG,
3137 ) -> BOOL;
3138 }
3139 ENUM!{enum POINTER_INPUT_TYPE {
3140 PT_POINTER = 0x00000001,
3141 PT_TOUCH = 0x00000002,
3142 PT_PEN = 0x00000003,
3143 PT_MOUSE = 0x00000004,
3144 PT_TOUCHPAD = 0x00000005,
3145 }}
3146 ENUM!{enum POINTER_FLAGS {
3147 POINTER_FLAG_NONE = 0x00000000,
3148 POINTER_FLAG_NEW = 0x00000001,
3149 POINTER_FLAG_INRANGE = 0x00000002,
3150 POINTER_FLAG_INCONTACT = 0x00000004,
3151 POINTER_FLAG_FIRSTBUTTON = 0x00000010,
3152 POINTER_FLAG_SECONDBUTTON = 0x00000020,
3153 POINTER_FLAG_THIRDBUTTON = 0x00000040,
3154 POINTER_FLAG_FOURTHBUTTON = 0x00000080,
3155 POINTER_FLAG_FIFTHBUTTON = 0x00000100,
3156 POINTER_FLAG_PRIMARY = 0x00002000,
3157 POINTER_FLAG_CONFIDENCE = 0x00004000,
3158 POINTER_FLAG_CANCELED = 0x00008000,
3159 POINTER_FLAG_DOWN = 0x00010000,
3160 POINTER_FLAG_UPDATE = 0x00020000,
3161 POINTER_FLAG_UP = 0x00040000,
3162 POINTER_FLAG_WHEEL = 0x00080000,
3163 POINTER_FLAG_HWHEEL = 0x00100000,
3164 POINTER_FLAG_CAPTURECHANGED = 0x00200000,
3165 POINTER_FLAG_HASTRANSFORM = 0x00400000,
3166 }}
3167 pub const POINTER_MOD_SHIFT: DWORD = 0x0004;
3168 pub const POINTER_MOD_CTRL: DWORD = 0x0008;
3169 ENUM!{enum POINTER_BUTTON_CHANGE_TYPE {
3170 POINTER_CHANGE_NONE,
3171 POINTER_CHANGE_FIRSTBUTTON_DOWN,
3172 POINTER_CHANGE_FIRSTBUTTON_UP,
3173 POINTER_CHANGE_SECONDBUTTON_DOWN,
3174 POINTER_CHANGE_SECONDBUTTON_UP,
3175 POINTER_CHANGE_THIRDBUTTON_DOWN,
3176 POINTER_CHANGE_THIRDBUTTON_UP,
3177 POINTER_CHANGE_FOURTHBUTTON_DOWN,
3178 POINTER_CHANGE_FOURTHBUTTON_UP,
3179 POINTER_CHANGE_FIFTHBUTTON_DOWN,
3180 POINTER_CHANGE_FIFTHBUTTON_UP,
3181 }}
3182 STRUCT!{struct POINTER_INFO {
3183 pointerType: POINTER_INPUT_TYPE,
3184 pointerId: UINT32,
3185 frameId: UINT32,
3186 pointerFlags: POINTER_FLAGS,
3187 sourceDevice: HANDLE,
3188 hwndTarget: HWND,
3189 ptPixelLocation: POINT,
3190 ptHimetricLocation: POINT,
3191 ptPixelLocationRaw: POINT,
3192 ptHimetricLocationRaw: POINT,
3193 dwTime: DWORD,
3194 historyCount: UINT32,
3195 InputData: INT32,
3196 dwKeyStates: DWORD,
3197 PerformanceCount: UINT64,
3198 ButtonChangeType: POINTER_BUTTON_CHANGE_TYPE,
3199 }}
3200 ENUM!{enum TOUCH_FLAGS {
3201 TOUCH_FLAG_NONE = 0x00000000,
3202 }}
3203 ENUM!{enum TOUCH_MASK {
3204 TOUCH_MASK_NONE = 0x00000000,
3205 TOUCH_MASK_CONTACTAREA = 0x00000001,
3206 TOUCH_MASK_ORIENTATION = 0x00000002,
3207 TOUCH_MASK_PRESSURE = 0x00000004,
3208 }}
3209 STRUCT!{struct POINTER_TOUCH_INFO {
3210 pointerInfo: POINTER_INFO,
3211 touchFlags: TOUCH_FLAGS,
3212 touchMask: TOUCH_MASK,
3213 rcContact: RECT,
3214 rcContactRaw: RECT,
3215 orientation: UINT32,
3216 pressure: UINT32,
3217 }}
3218 ENUM!{enum PEN_FLAGS {
3219 PEN_FLAG_NONE = 0x00000000,
3220 PEN_FLAG_BARREL = 0x00000001,
3221 PEN_FLAG_INVERTED = 0x00000002,
3222 PEN_FLAG_ERASER = 0x00000004,
3223 }}
3224 ENUM!{enum PEN_MASK {
3225 PEN_MASK_NONE = 0x00000000,
3226 PEN_MASK_PRESSURE = 0x00000001,
3227 PEN_MASK_ROTATION = 0x00000002,
3228 PEN_MASK_TILT_X = 0x00000004,
3229 PEN_MASK_TILT_Y = 0x00000008,
3230 }}
3231 STRUCT!{struct POINTER_PEN_INFO {
3232 pointerInfo: POINTER_INFO,
3233 penFlags: PEN_FLAGS,
3234 penMask: PEN_MASK,
3235 pressure: UINT32,
3236 rotation: UINT32,
3237 tiltX: INT32,
3238 tiltY: INT32,
3239 }}
3240 pub const POINTER_MESSAGE_FLAG_NEW: DWORD = 0x00000001;
3241 pub const POINTER_MESSAGE_FLAG_INRANGE: DWORD = 0x00000002;
3242 pub const POINTER_MESSAGE_FLAG_INCONTACT: DWORD = 0x00000004;
3243 pub const POINTER_MESSAGE_FLAG_FIRSTBUTTON: DWORD = 0x00000010;
3244 pub const POINTER_MESSAGE_FLAG_SECONDBUTTON: DWORD = 0x00000020;
3245 pub const POINTER_MESSAGE_FLAG_THIRDBUTTON: DWORD = 0x00000040;
3246 pub const POINTER_MESSAGE_FLAG_FOURTHBUTTON: DWORD = 0x00000080;
3247 pub const POINTER_MESSAGE_FLAG_FIFTHBUTTON: DWORD = 0x00000100;
3248 pub const POINTER_MESSAGE_FLAG_PRIMARY: DWORD = 0x00002000;
3249 pub const POINTER_MESSAGE_FLAG_CONFIDENCE: DWORD = 0x00004000;
3250 pub const POINTER_MESSAGE_FLAG_CANCELED: DWORD = 0x00008000;
3251 pub const PA_ACTIVATE: UINT = MA_ACTIVATE;
3252 pub const PA_NOACTIVATE: UINT = MA_NOACTIVATE;
3253 pub const MAX_TOUCH_COUNT: UINT32 = 256;
3254 pub const TOUCH_FEEDBACK_DEFAULT: DWORD = 0x1;
3255 pub const TOUCH_FEEDBACK_INDIRECT: DWORD = 0x2;
3256 pub const TOUCH_FEEDBACK_NONE: DWORD = 0x3;
3257 ENUM!{enum POINTER_FEEDBACK_MODE {
3258 POINTER_FEEDBACK_DEFAULT = 1,
3259 POINTER_FEEDBACK_INDIRECT = 2,
3260 POINTER_FEEDBACK_NONE = 3,
3261 }}
3262 extern "system" {
InitializeTouchInjection( maxCount: UINT32, dwMode: DWORD, ) -> BOOL3263 pub fn InitializeTouchInjection(
3264 maxCount: UINT32,
3265 dwMode: DWORD,
3266 ) -> BOOL;
InjectTouchInput( count: UINT32, contacts: *const POINTER_TOUCH_INFO, ) -> BOOL3267 pub fn InjectTouchInput(
3268 count: UINT32,
3269 contacts: *const POINTER_TOUCH_INFO,
3270 ) -> BOOL;
3271 }
3272 STRUCT!{struct USAGE_PROPERTIES {
3273 level: USHORT,
3274 page: USHORT,
3275 usage: USHORT,
3276 logicalMinimum: INT32,
3277 logicalMaximum: INT32,
3278 unit: USHORT,
3279 exponent: USHORT,
3280 count: BYTE,
3281 physicalMinimum: INT32,
3282 physicalMaximum: INT32,
3283 }}
3284 pub type PUSAGE_PROPERTIES = *mut USAGE_PROPERTIES;
3285 UNION!{union POINTER_TYPE_INFO_u {
3286 [u64; 17] [u64; 18],
3287 touchInfo touchInfo_mut: POINTER_TOUCH_INFO,
3288 penInfo penInfo_mut: POINTER_PEN_INFO,
3289 }}
3290 STRUCT!{struct POINTER_TYPE_INFO {
3291 type_: POINTER_INPUT_TYPE,
3292 u: POINTER_TYPE_INFO_u,
3293 }}
3294 pub type PPOINTER_TYPE_INFO = *mut POINTER_TYPE_INFO;
3295 STRUCT!{struct INPUT_INJECTION_VALUE {
3296 page: USHORT,
3297 usage: USHORT,
3298 value: INT32,
3299 index: USHORT,
3300 }}
3301 pub type PINPUT_INJECTION_VALUE = *mut INPUT_INJECTION_VALUE;
3302 extern "system" {
GetPointerType( pointerId: UINT32, pointerType: *mut POINTER_INPUT_TYPE, ) -> BOOL3303 pub fn GetPointerType(
3304 pointerId: UINT32,
3305 pointerType: *mut POINTER_INPUT_TYPE,
3306 ) -> BOOL;
GetPointerCursorId( pointerId: UINT32, cursorId: *mut UINT32, ) -> BOOL3307 pub fn GetPointerCursorId(
3308 pointerId: UINT32,
3309 cursorId: *mut UINT32,
3310 ) -> BOOL;
GetPointerInfo( pointerId: UINT32, pointerInfo: *mut POINTER_INFO, ) -> BOOL3311 pub fn GetPointerInfo(
3312 pointerId: UINT32,
3313 pointerInfo: *mut POINTER_INFO,
3314 ) -> BOOL;
GetPointerInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, pointerInfo: *mut POINTER_INFO, ) -> BOOL3315 pub fn GetPointerInfoHistory(
3316 pointerId: UINT32,
3317 entriesCount: *mut UINT32,
3318 pointerInfo: *mut POINTER_INFO,
3319 ) -> BOOL;
GetPointerFrameInfo( pointerId: UINT32, pointerCount: *mut UINT32, pointerInfo: *mut POINTER_INFO, ) -> BOOL3320 pub fn GetPointerFrameInfo(
3321 pointerId: UINT32,
3322 pointerCount: *mut UINT32,
3323 pointerInfo: *mut POINTER_INFO,
3324 ) -> BOOL;
GetPointerFrameInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, pointerCount: *mut UINT32, pointerInfo: *mut POINTER_INFO, ) -> BOOL3325 pub fn GetPointerFrameInfoHistory(
3326 pointerId: UINT32,
3327 entriesCount: *mut UINT32,
3328 pointerCount: *mut UINT32,
3329 pointerInfo: *mut POINTER_INFO,
3330 ) -> BOOL;
GetPointerTouchInfo( pointerId: UINT32, touchInfo: *mut POINTER_TOUCH_INFO, ) -> BOOL3331 pub fn GetPointerTouchInfo(
3332 pointerId: UINT32,
3333 touchInfo: *mut POINTER_TOUCH_INFO,
3334 ) -> BOOL;
GetPointerTouchInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, touchInfo: *mut POINTER_TOUCH_INFO, ) -> BOOL3335 pub fn GetPointerTouchInfoHistory(
3336 pointerId: UINT32,
3337 entriesCount: *mut UINT32,
3338 touchInfo: *mut POINTER_TOUCH_INFO,
3339 ) -> BOOL;
GetPointerFrameTouchInfo( pointerId: UINT32, pointerCount: *mut UINT32, touchInfo: *mut POINTER_TOUCH_INFO, ) -> BOOL3340 pub fn GetPointerFrameTouchInfo(
3341 pointerId: UINT32,
3342 pointerCount: *mut UINT32,
3343 touchInfo: *mut POINTER_TOUCH_INFO,
3344 ) -> BOOL;
GetPointerFrameTouchInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, pointerCount: *mut UINT32, touchInfo: *mut POINTER_TOUCH_INFO, ) -> BOOL3345 pub fn GetPointerFrameTouchInfoHistory(
3346 pointerId: UINT32,
3347 entriesCount: *mut UINT32,
3348 pointerCount: *mut UINT32,
3349 touchInfo: *mut POINTER_TOUCH_INFO,
3350 ) -> BOOL;
GetPointerPenInfo( pointerId: UINT32, penInfo: *mut POINTER_PEN_INFO, ) -> BOOL3351 pub fn GetPointerPenInfo(
3352 pointerId: UINT32,
3353 penInfo: *mut POINTER_PEN_INFO,
3354 ) -> BOOL;
GetPointerPenInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, penInfo: *mut POINTER_PEN_INFO, ) -> BOOL3355 pub fn GetPointerPenInfoHistory(
3356 pointerId: UINT32,
3357 entriesCount: *mut UINT32,
3358 penInfo: *mut POINTER_PEN_INFO,
3359 ) -> BOOL;
GetPointerFramePenInfo( pointerId: UINT32, pointerCount: *mut UINT32, penInfo: *mut POINTER_PEN_INFO, ) -> BOOL3360 pub fn GetPointerFramePenInfo(
3361 pointerId: UINT32,
3362 pointerCount: *mut UINT32,
3363 penInfo: *mut POINTER_PEN_INFO,
3364 ) -> BOOL;
GetPointerFramePenInfoHistory( pointerId: UINT32, entriesCount: *mut UINT32, pointerCount: *mut UINT32, penInfo: *mut POINTER_PEN_INFO, ) -> BOOL3365 pub fn GetPointerFramePenInfoHistory(
3366 pointerId: UINT32,
3367 entriesCount: *mut UINT32,
3368 pointerCount: *mut UINT32,
3369 penInfo: *mut POINTER_PEN_INFO,
3370 ) -> BOOL;
SkipPointerFrameMessages( pointerId: UINT32, ) -> BOOL3371 pub fn SkipPointerFrameMessages(
3372 pointerId: UINT32,
3373 ) -> BOOL;
RegisterPointerInputTarget( hwnd: HWND, pointerType: POINTER_INPUT_TYPE, ) -> BOOL3374 pub fn RegisterPointerInputTarget(
3375 hwnd: HWND,
3376 pointerType: POINTER_INPUT_TYPE,
3377 ) -> BOOL;
UnregisterPointerInputTarget( hwnd: HWND, pointerType: POINTER_INPUT_TYPE, ) -> BOOL3378 pub fn UnregisterPointerInputTarget(
3379 hwnd: HWND,
3380 pointerType: POINTER_INPUT_TYPE,
3381 ) -> BOOL;
RegisterPointerInputTargetEx( hwnd: HWND, pointerType: POINTER_INPUT_TYPE, fObserve: BOOL, ) -> BOOL3382 pub fn RegisterPointerInputTargetEx(
3383 hwnd: HWND,
3384 pointerType: POINTER_INPUT_TYPE,
3385 fObserve: BOOL,
3386 ) -> BOOL;
UnregisterPointerInputTargetEx( hwnd: HWND, pointerType: POINTER_INPUT_TYPE, ) -> BOOL3387 pub fn UnregisterPointerInputTargetEx(
3388 hwnd: HWND,
3389 pointerType: POINTER_INPUT_TYPE,
3390 ) -> BOOL;
3391 }
3392 DECLARE_HANDLE!{HSYNTHETICPOINTERDEVICE, HSYNTHETICPOINTERDEVICE__}
3393 extern "system" {
CreateSyntheticPointerDevice( pointerType: POINTER_INPUT_TYPE, maxCount: ULONG, mode: POINTER_FEEDBACK_MODE, ) -> HSYNTHETICPOINTERDEVICE3394 pub fn CreateSyntheticPointerDevice(
3395 pointerType: POINTER_INPUT_TYPE,
3396 maxCount: ULONG,
3397 mode: POINTER_FEEDBACK_MODE,
3398 ) -> HSYNTHETICPOINTERDEVICE;
InjectSyntheticPointerInput( device: HSYNTHETICPOINTERDEVICE, pointerInfo: *const POINTER_TYPE_INFO, count: UINT32, ) -> BOOL3399 pub fn InjectSyntheticPointerInput(
3400 device: HSYNTHETICPOINTERDEVICE,
3401 pointerInfo: *const POINTER_TYPE_INFO,
3402 count: UINT32,
3403 ) -> BOOL;
DestroySyntheticPointerDevice( device: HSYNTHETICPOINTERDEVICE, )3404 pub fn DestroySyntheticPointerDevice(
3405 device: HSYNTHETICPOINTERDEVICE,
3406 );
3407 }
3408 extern "system" {
EnableMouseInPointer( fEnable: BOOL, ) -> BOOL3409 pub fn EnableMouseInPointer(
3410 fEnable: BOOL,
3411 ) -> BOOL;
IsMouseInPointerEnabled() -> BOOL3412 pub fn IsMouseInPointerEnabled() -> BOOL;
3413 }
3414 pub const TOUCH_HIT_TESTING_DEFAULT: ULONG = 0x0;
3415 pub const TOUCH_HIT_TESTING_CLIENT: ULONG = 0x1;
3416 pub const TOUCH_HIT_TESTING_NONE: ULONG = 0x2;
3417 extern "system" {
RegisterTouchHitTestingWindow( hwnd: HWND, value: ULONG, ) -> BOOL3418 pub fn RegisterTouchHitTestingWindow(
3419 hwnd: HWND,
3420 value: ULONG,
3421 ) -> BOOL;
3422 }
3423 STRUCT!{struct TOUCH_HIT_TESTING_PROXIMITY_EVALUATION {
3424 score: UINT16,
3425 adjustedPoint: POINT,
3426 }}
3427 pub type PTOUCH_HIT_TESTING_PROXIMITY_EVALUATION = *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION;
3428 STRUCT!{struct TOUCH_HIT_TESTING_INPUT {
3429 pointerId: UINT32,
3430 point: POINT,
3431 boundingBox: RECT,
3432 nonOccludedBoundingBox: RECT,
3433 orientation: UINT32,
3434 }}
3435 pub type PTOUCH_HIT_TESTING_INPUT = *mut TOUCH_HIT_TESTING_INPUT;
3436 pub const TOUCH_HIT_TESTING_PROXIMITY_CLOSEST: UINT16 = 0x0;
3437 pub const TOUCH_HIT_TESTING_PROXIMITY_FARTHEST: UINT16 = 0xFFF;
3438 extern "system" {
EvaluateProximityToRect( controlBoundingBox: *const RECT, pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, ) -> BOOL3439 pub fn EvaluateProximityToRect(
3440 controlBoundingBox: *const RECT,
3441 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3442 pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3443 ) -> BOOL;
EvaluateProximityToPolygon( numVertices: UINT32, controlPolygon: *const POINT, pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, ) -> BOOL3444 pub fn EvaluateProximityToPolygon(
3445 numVertices: UINT32,
3446 controlPolygon: *const POINT,
3447 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3448 pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3449 ) -> BOOL;
PackTouchHitTestingProximityEvaluation( pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, pProximityEval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, ) -> LRESULT3450 pub fn PackTouchHitTestingProximityEvaluation(
3451 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3452 pProximityEval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3453 ) -> LRESULT;
3454 }
3455 ENUM!{enum FEEDBACK_TYPE {
3456 FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1,
3457 FEEDBACK_PEN_BARRELVISUALIZATION = 2,
3458 FEEDBACK_PEN_TAP = 3,
3459 FEEDBACK_PEN_DOUBLETAP = 4,
3460 FEEDBACK_PEN_PRESSANDHOLD = 5,
3461 FEEDBACK_PEN_RIGHTTAP = 6,
3462 FEEDBACK_TOUCH_TAP = 7,
3463 FEEDBACK_TOUCH_DOUBLETAP = 8,
3464 FEEDBACK_TOUCH_PRESSANDHOLD = 9,
3465 FEEDBACK_TOUCH_RIGHTTAP = 10,
3466 FEEDBACK_GESTURE_PRESSANDTAP = 11,
3467 FEEDBACK_MAX = 0xFFFFFFFF,
3468 }}
3469 pub const GWFS_INCLUDE_ANCESTORS: DWORD = 0x00000001;
3470 extern "system" {
GetWindowFeedbackSetting( hwnd: HWND, feedback: FEEDBACK_TYPE, dwFlags: DWORD, pSize: *mut UINT32, config: *mut VOID, ) -> BOOL3471 pub fn GetWindowFeedbackSetting(
3472 hwnd: HWND,
3473 feedback: FEEDBACK_TYPE,
3474 dwFlags: DWORD,
3475 pSize: *mut UINT32,
3476 config: *mut VOID,
3477 ) -> BOOL;
SetWindowFeedbackSetting( hwnd: HWND, feedback: FEEDBACK_TYPE, dwFlags: DWORD, size: UINT32, configuration: *const VOID, ) -> BOOL3478 pub fn SetWindowFeedbackSetting(
3479 hwnd: HWND,
3480 feedback: FEEDBACK_TYPE,
3481 dwFlags: DWORD,
3482 size: UINT32,
3483 configuration: *const VOID,
3484 ) -> BOOL;
3485 }
3486 STRUCT!{struct INPUT_TRANSFORM {
3487 m: [[f32; 4]; 4],
3488 }}
3489 extern "system" {
GetPointerInputTransform( pointerId: UINT32, historyCount: UINT32, inputTransform: *mut INPUT_TRANSFORM, ) -> BOOL3490 pub fn GetPointerInputTransform(
3491 pointerId: UINT32,
3492 historyCount: UINT32,
3493 inputTransform: *mut INPUT_TRANSFORM,
3494 ) -> BOOL;
3495 }
3496 STRUCT!{struct LASTINPUTINFO {
3497 cbSize: UINT,
3498 dwTime: DWORD,
3499 }}
3500 pub type PLASTINPUTINFO = *mut LASTINPUTINFO;
3501 extern "system" {
GetLastInputInfo( plii: PLASTINPUTINFO, ) -> BOOL3502 pub fn GetLastInputInfo(
3503 plii: PLASTINPUTINFO,
3504 ) -> BOOL;
MapVirtualKeyA( nCode: UINT, uMapType: UINT, ) -> UINT3505 pub fn MapVirtualKeyA(
3506 nCode: UINT,
3507 uMapType: UINT,
3508 ) -> UINT;
MapVirtualKeyW( nCode: UINT, uMapType: UINT, ) -> UINT3509 pub fn MapVirtualKeyW(
3510 nCode: UINT,
3511 uMapType: UINT,
3512 ) -> UINT;
MapVirtualKeyExA( nCode: UINT, uMapType: UINT, dwhkl: HKL, ) -> UINT3513 pub fn MapVirtualKeyExA(
3514 nCode: UINT,
3515 uMapType: UINT,
3516 dwhkl: HKL,
3517 ) -> UINT;
MapVirtualKeyExW( nCode: UINT, uMapType: UINT, dwhkl: HKL, ) -> UINT3518