]> git.proxmox.com Git - rustc.git/blame - vendor/winapi/src/um/winuser.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / vendor / winapi / src / um / winuser.rs
CommitLineData
ff7c6d11
XL
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
7use ctypes::{c_int, c_long, c_short, c_uint};
8use shared::basetsd::{
9 DWORD_PTR, INT32, INT_PTR, PDWORD_PTR, UINT16, UINT32, UINT64, UINT_PTR, ULONG_PTR,
10};
60c5eb7d 11#[cfg(target_pointer_width = "64")]
ff7c6d11
XL
12use shared::basetsd::LONG_PTR;
13use shared::guiddef::{GUID, LPCGUID};
14use shared::minwindef::{
15 ATOM, BOOL, BYTE, DWORD, HINSTANCE, HIWORD, HKL, HMODULE, HRGN, HWINSTA, INT, LOWORD, LPARAM,
60c5eb7d
XL
16 LPBYTE, LPDWORD, LPINT, LPVOID, LPWORD, LRESULT, PBYTE, PUINT, PULONG, TRUE, UCHAR, UINT,
17 ULONG, USHORT, WORD, WPARAM,
ff7c6d11
XL
18};
19use shared::windef::{
60c5eb7d
XL
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,
ff7c6d11
XL
23};
24use um::minwinbase::LPSECURITY_ATTRIBUTES;
25use um::wingdi::{
26 BLENDFUNCTION, DEVMODEA, DEVMODEW, LOGFONTA, LOGFONTW, PDISPLAY_DEVICEA, PDISPLAY_DEVICEW
27};
28use um::winnt::{
29 ACCESS_MASK, BOOLEAN, CHAR, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, LUID,
30 PSECURITY_DESCRIPTOR, PSECURITY_INFORMATION, PVOID, SHORT, VOID, WCHAR,
31};
32use vc::limits::UINT_MAX;
33use vc::vadefs::va_list;
34pub type HDWP = HANDLE;
35pub type MENUTEMPLATEA = VOID;
36pub type MENUTEMPLATEW = VOID;
37pub type LPMENUTEMPLATEA = PVOID;
38pub type LPMENUTEMPLATEW = PVOID;
39FN!{stdcall WNDPROC(
40 HWND,
41 UINT,
42 WPARAM,
43 LPARAM,
44) -> LRESULT}
45FN!{stdcall DLGPROC(
46 HWND,
47 UINT,
48 WPARAM,
49 LPARAM,
50) -> INT_PTR}
51FN!{stdcall TIMERPROC(
52 HWND,
53 UINT,
54 UINT_PTR,
55 DWORD,
56) -> ()}
57FN!{stdcall GRAYSTRINGPROC(
58 HDC,
59 LPARAM,
60 c_int,
61) -> BOOL}
62FN!{stdcall WNDENUMPROC(
63 HWND,
64 LPARAM,
65) -> BOOL}
66FN!{stdcall HOOKPROC(
67 code: c_int,
68 wParam: WPARAM,
69 lParam: LPARAM,
70) -> LRESULT}
71FN!{stdcall SENDASYNCPROC(
72 HWND,
73 UINT,
74 ULONG_PTR,
75 LRESULT,
76) -> ()}
77FN!{stdcall PROPENUMPROCA(
78 HWND,
79 LPCSTR,
80 HANDLE,
81) -> BOOL}
82FN!{stdcall PROPENUMPROCW(
83 HWND,
84 LPCWSTR,
85 HANDLE,
86) -> BOOL}
87FN!{stdcall PROPENUMPROCEXA(
88 HWND,
89 LPSTR,
90 HANDLE,
91 ULONG_PTR,
92) -> BOOL}
93FN!{stdcall PROPENUMPROCEXW(
94 HWND,
95 LPWSTR,
96 HANDLE,
97 ULONG_PTR,
98) -> BOOL}
99FN!{stdcall EDITWORDBREAKPROCA(
100 lpch: LPSTR,
101 ichCurrent: c_int,
102 cch: c_int,
103 code: c_int,
104) -> c_int}
105FN!{stdcall EDITWORDBREAKPROCW(
106 lpch: LPWSTR,
107 ichCurrent: c_int,
108 cch: c_int,
109 code: c_int,
110) -> c_int}
111FN!{stdcall DRAWSTATEPROC(
112 hdc: HDC,
113 lData: LPARAM,
114 wData: WPARAM,
115 cx: c_int,
116 cy: c_int,
117) -> BOOL}
118FN!{stdcall NAMEENUMPROCA(
119 LPSTR,
120 LPARAM,
121) -> BOOL}
122FN!{stdcall NAMEENUMPROCW(
123 LPWSTR,
124 LPARAM,
125) -> BOOL}
126pub type WINSTAENUMPROCA = NAMEENUMPROCA;
127pub type DESKTOPENUMPROCA = NAMEENUMPROCA;
128pub type WINSTAENUMPROCW = NAMEENUMPROCW;
129pub type DESKTOPENUMPROCW = NAMEENUMPROCW;
130#[inline]
131pub fn IS_INTRESOURCE(r: ULONG_PTR) -> bool {
132 (r >> 16) == 0
133}
134#[inline]
135pub fn MAKEINTRESOURCEA(i: WORD) -> LPSTR {
136 i as ULONG_PTR as LPSTR
137}
138#[inline]
139pub fn MAKEINTRESOURCEW(i: WORD) -> LPWSTR {
140 i as ULONG_PTR as LPWSTR
141}
142pub const RT_CURSOR: LPWSTR = MAKEINTRESOURCE!(1);
143pub const RT_BITMAP: LPWSTR = MAKEINTRESOURCE!(2);
144pub const RT_ICON: LPWSTR = MAKEINTRESOURCE!(3);
145pub const RT_MENU: LPWSTR = MAKEINTRESOURCE!(4);
146pub const RT_DIALOG: LPWSTR = MAKEINTRESOURCE!(5);
147pub const RT_STRING: LPWSTR = MAKEINTRESOURCE!(6);
148pub const RT_FONTDIR: LPWSTR = MAKEINTRESOURCE!(7);
149pub const RT_FONT: LPWSTR = MAKEINTRESOURCE!(8);
150pub const RT_ACCELERATOR: LPWSTR = MAKEINTRESOURCE!(9);
151pub const RT_RCDATA: LPWSTR = MAKEINTRESOURCE!(10);
152pub const RT_MESSAGETABLE: LPWSTR = MAKEINTRESOURCE!(11);
153pub const DIFFERENCE: WORD = 11;
154pub const RT_GROUP_CURSOR: LPWSTR = MAKEINTRESOURCE!(1 + DIFFERENCE);
155pub const RT_GROUP_ICON: LPWSTR = MAKEINTRESOURCE!(3 + DIFFERENCE);
156pub const RT_VERSION: LPWSTR = MAKEINTRESOURCE!(16);
157pub const RT_DLGINCLUDE: LPWSTR = MAKEINTRESOURCE!(17);
158pub const RT_PLUGPLAY: LPWSTR = MAKEINTRESOURCE!(19);
159pub const RT_VXD: LPWSTR = MAKEINTRESOURCE!(20);
160pub const RT_ANICURSOR: LPWSTR = MAKEINTRESOURCE!(21);
161pub const RT_ANIICON: LPWSTR = MAKEINTRESOURCE!(22);
162pub const RT_HTML: LPWSTR = MAKEINTRESOURCE!(23);
163pub const RT_MANIFEST: LPWSTR = MAKEINTRESOURCE!(24);
164pub const CREATEPROCESS_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1);
165pub const ISOLATIONAWARE_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(2);
166pub const ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID: LPWSTR
167 = MAKEINTRESOURCE!(3);
168pub const MINIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1);
169pub const MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(16);
170extern "system" {
171 pub fn wvsprintfA(
172 _: LPSTR,
173 _: LPCSTR,
174 arglist: va_list,
175 ) -> c_int;
176 pub fn wvsprintfW(
177 _: LPWSTR,
178 _: LPCWSTR,
179 arglist: va_list,
180 ) -> c_int;
181}
182extern "C" {
183 pub fn wsprintfA(
184 _: LPSTR,
185 _: LPCSTR,
186 ...
187 ) -> c_int;
188 pub fn wsprintfW(
189 _: LPWSTR,
190 _: LPCWSTR,
191 ...
192 ) -> c_int;
193}
194pub const SETWALLPAPER_DEFAULT: LPWSTR = -1isize as LPWSTR;
195pub const SB_HORZ: UINT = 0;
196pub const SB_VERT: UINT = 1;
197pub const SB_CTL: UINT = 2;
198pub const SB_BOTH: UINT = 3;
199pub const SB_LINEUP: LPARAM = 0;
200pub const SB_LINELEFT: LPARAM = 0;
201pub const SB_LINEDOWN: LPARAM = 1;
202pub const SB_LINERIGHT: LPARAM = 1;
203pub const SB_PAGEUP: LPARAM = 2;
204pub const SB_PAGELEFT: LPARAM = 2;
205pub const SB_PAGEDOWN: LPARAM = 3;
206pub const SB_PAGERIGHT: LPARAM = 3;
207pub const SB_THUMBPOSITION: LPARAM = 4;
208pub const SB_THUMBTRACK: LPARAM = 5;
209pub const SB_TOP: LPARAM = 6;
210pub const SB_LEFT: LPARAM = 6;
211pub const SB_BOTTOM: LPARAM = 7;
212pub const SB_RIGHT: LPARAM = 7;
213pub const SB_ENDSCROLL: LPARAM = 8;
214pub const SW_HIDE: c_int = 0;
215pub const SW_SHOWNORMAL: c_int = 1;
216pub const SW_NORMAL: c_int = 1;
217pub const SW_SHOWMINIMIZED: c_int = 2;
218pub const SW_SHOWMAXIMIZED: c_int = 3;
219pub const SW_MAXIMIZE: c_int = 3;
220pub const SW_SHOWNOACTIVATE: c_int = 4;
221pub const SW_SHOW: c_int = 5;
222pub const SW_MINIMIZE: c_int = 6;
223pub const SW_SHOWMINNOACTIVE: c_int = 7;
224pub const SW_SHOWNA: c_int = 8;
225pub const SW_RESTORE: c_int = 9;
226pub const SW_SHOWDEFAULT: c_int = 10;
227pub const SW_FORCEMINIMIZE: c_int = 11;
228pub const SW_MAX: c_int = 11;
229pub const HIDE_WINDOW: c_int = 0;
230pub const SHOW_OPENWINDOW: c_int = 1;
231pub const SHOW_ICONWINDOW: c_int = 2;
232pub const SHOW_FULLSCREEN: c_int = 3;
233pub const SHOW_OPENNOACTIVATE: c_int = 4;
234pub const SW_PARENTCLOSING: LPARAM = 1;
235pub const SW_OTHERZOOM: LPARAM = 2;
236pub const SW_PARENTOPENING: LPARAM = 3;
237pub const SW_OTHERUNZOOM: LPARAM = 4;
238pub const AW_HOR_POSITIVE: DWORD = 0x00000001;
239pub const AW_HOR_NEGATIVE: DWORD = 0x00000002;
240pub const AW_VER_POSITIVE: DWORD = 0x00000004;
241pub const AW_VER_NEGATIVE: DWORD = 0x00000008;
242pub const AW_CENTER: DWORD = 0x00000010;
243pub const AW_HIDE: DWORD = 0x00010000;
244pub const AW_ACTIVATE: DWORD = 0x00020000;
245pub const AW_SLIDE: DWORD = 0x00040000;
246pub const AW_BLEND: DWORD = 0x00080000;
247pub const KF_EXTENDED: WORD = 0x0100;
248pub const KF_DLGMODE: WORD = 0x0800;
249pub const KF_MENUMODE: WORD = 0x1000;
250pub const KF_ALTDOWN: WORD = 0x2000;
251pub const KF_REPEAT: WORD = 0x4000;
252pub const KF_UP: WORD = 0x8000;
253pub const VK_LBUTTON: c_int = 0x01;
254pub const VK_RBUTTON: c_int = 0x02;
255pub const VK_CANCEL: c_int = 0x03;
256pub const VK_MBUTTON: c_int = 0x04;
257pub const VK_XBUTTON1: c_int = 0x05;
258pub const VK_XBUTTON2: c_int = 0x06;
259pub const VK_BACK: c_int = 0x08;
260pub const VK_TAB: c_int = 0x09;
261pub const VK_CLEAR: c_int = 0x0C;
262pub const VK_RETURN: c_int = 0x0D;
263pub const VK_SHIFT: c_int = 0x10;
264pub const VK_CONTROL: c_int = 0x11;
265pub const VK_MENU: c_int = 0x12;
266pub const VK_PAUSE: c_int = 0x13;
267pub const VK_CAPITAL: c_int = 0x14;
268pub const VK_KANA: c_int = 0x15;
269pub const VK_HANGEUL: c_int = 0x15;
270pub const VK_HANGUL: c_int = 0x15;
271pub const VK_JUNJA: c_int = 0x17;
272pub const VK_FINAL: c_int = 0x18;
273pub const VK_HANJA: c_int = 0x19;
274pub const VK_KANJI: c_int = 0x19;
275pub const VK_ESCAPE: c_int = 0x1B;
276pub const VK_CONVERT: c_int = 0x1C;
277pub const VK_NONCONVERT: c_int = 0x1D;
278pub const VK_ACCEPT: c_int = 0x1E;
279pub const VK_MODECHANGE: c_int = 0x1F;
280pub const VK_SPACE: c_int = 0x20;
281pub const VK_PRIOR: c_int = 0x21;
282pub const VK_NEXT: c_int = 0x22;
283pub const VK_END: c_int = 0x23;
284pub const VK_HOME: c_int = 0x24;
285pub const VK_LEFT: c_int = 0x25;
286pub const VK_UP: c_int = 0x26;
287pub const VK_RIGHT: c_int = 0x27;
288pub const VK_DOWN: c_int = 0x28;
289pub const VK_SELECT: c_int = 0x29;
290pub const VK_PRINT: c_int = 0x2A;
291pub const VK_EXECUTE: c_int = 0x2B;
292pub const VK_SNAPSHOT: c_int = 0x2C;
293pub const VK_INSERT: c_int = 0x2D;
294pub const VK_DELETE: c_int = 0x2E;
295pub const VK_HELP: c_int = 0x2F;
296pub const VK_LWIN: c_int = 0x5B;
297pub const VK_RWIN: c_int = 0x5C;
298pub const VK_APPS: c_int = 0x5D;
299pub const VK_SLEEP: c_int = 0x5F;
300pub const VK_NUMPAD0: c_int = 0x60;
301pub const VK_NUMPAD1: c_int = 0x61;
302pub const VK_NUMPAD2: c_int = 0x62;
303pub const VK_NUMPAD3: c_int = 0x63;
304pub const VK_NUMPAD4: c_int = 0x64;
305pub const VK_NUMPAD5: c_int = 0x65;
306pub const VK_NUMPAD6: c_int = 0x66;
307pub const VK_NUMPAD7: c_int = 0x67;
308pub const VK_NUMPAD8: c_int = 0x68;
309pub const VK_NUMPAD9: c_int = 0x69;
310pub const VK_MULTIPLY: c_int = 0x6A;
311pub const VK_ADD: c_int = 0x6B;
312pub const VK_SEPARATOR: c_int = 0x6C;
313pub const VK_SUBTRACT: c_int = 0x6D;
314pub const VK_DECIMAL: c_int = 0x6E;
315pub const VK_DIVIDE: c_int = 0x6F;
316pub const VK_F1: c_int = 0x70;
317pub const VK_F2: c_int = 0x71;
318pub const VK_F3: c_int = 0x72;
319pub const VK_F4: c_int = 0x73;
320pub const VK_F5: c_int = 0x74;
321pub const VK_F6: c_int = 0x75;
322pub const VK_F7: c_int = 0x76;
323pub const VK_F8: c_int = 0x77;
324pub const VK_F9: c_int = 0x78;
325pub const VK_F10: c_int = 0x79;
326pub const VK_F11: c_int = 0x7A;
327pub const VK_F12: c_int = 0x7B;
328pub const VK_F13: c_int = 0x7C;
329pub const VK_F14: c_int = 0x7D;
330pub const VK_F15: c_int = 0x7E;
331pub const VK_F16: c_int = 0x7F;
332pub const VK_F17: c_int = 0x80;
333pub const VK_F18: c_int = 0x81;
334pub const VK_F19: c_int = 0x82;
335pub const VK_F20: c_int = 0x83;
336pub const VK_F21: c_int = 0x84;
337pub const VK_F22: c_int = 0x85;
338pub const VK_F23: c_int = 0x86;
339pub const VK_F24: c_int = 0x87;
340pub const VK_NAVIGATION_VIEW: c_int = 0x88;
341pub const VK_NAVIGATION_MENU: c_int = 0x89;
342pub const VK_NAVIGATION_UP: c_int = 0x8A;
343pub const VK_NAVIGATION_DOWN: c_int = 0x8B;
344pub const VK_NAVIGATION_LEFT: c_int = 0x8C;
345pub const VK_NAVIGATION_RIGHT: c_int = 0x8D;
346pub const VK_NAVIGATION_ACCEPT: c_int = 0x8E;
347pub const VK_NAVIGATION_CANCEL: c_int = 0x8F;
348pub const VK_NUMLOCK: c_int = 0x90;
349pub const VK_SCROLL: c_int = 0x91;
350pub const VK_OEM_NEC_EQUAL: c_int = 0x92;
351pub const VK_OEM_FJ_JISHO: c_int = 0x92;
352pub const VK_OEM_FJ_MASSHOU: c_int = 0x93;
353pub const VK_OEM_FJ_TOUROKU: c_int = 0x94;
354pub const VK_OEM_FJ_LOYA: c_int = 0x95;
355pub const VK_OEM_FJ_ROYA: c_int = 0x96;
356pub const VK_LSHIFT: c_int = 0xA0;
357pub const VK_RSHIFT: c_int = 0xA1;
358pub const VK_LCONTROL: c_int = 0xA2;
359pub const VK_RCONTROL: c_int = 0xA3;
360pub const VK_LMENU: c_int = 0xA4;
361pub const VK_RMENU: c_int = 0xA5;
362pub const VK_BROWSER_BACK: c_int = 0xA6;
363pub const VK_BROWSER_FORWARD: c_int = 0xA7;
364pub const VK_BROWSER_REFRESH: c_int = 0xA8;
365pub const VK_BROWSER_STOP: c_int = 0xA9;
366pub const VK_BROWSER_SEARCH: c_int = 0xAA;
367pub const VK_BROWSER_FAVORITES: c_int = 0xAB;
368pub const VK_BROWSER_HOME: c_int = 0xAC;
369pub const VK_VOLUME_MUTE: c_int = 0xAD;
370pub const VK_VOLUME_DOWN: c_int = 0xAE;
371pub const VK_VOLUME_UP: c_int = 0xAF;
372pub const VK_MEDIA_NEXT_TRACK: c_int = 0xB0;
373pub const VK_MEDIA_PREV_TRACK: c_int = 0xB1;
374pub const VK_MEDIA_STOP: c_int = 0xB2;
375pub const VK_MEDIA_PLAY_PAUSE: c_int = 0xB3;
376pub const VK_LAUNCH_MAIL: c_int = 0xB4;
377pub const VK_LAUNCH_MEDIA_SELECT: c_int = 0xB5;
378pub const VK_LAUNCH_APP1: c_int = 0xB6;
379pub const VK_LAUNCH_APP2: c_int = 0xB7;
380pub const VK_OEM_1: c_int = 0xBA;
381pub const VK_OEM_PLUS: c_int = 0xBB;
382pub const VK_OEM_COMMA: c_int = 0xBC;
383pub const VK_OEM_MINUS: c_int = 0xBD;
384pub const VK_OEM_PERIOD: c_int = 0xBE;
385pub const VK_OEM_2: c_int = 0xBF;
386pub const VK_OEM_3: c_int = 0xC0;
387pub const VK_GAMEPAD_A: c_int = 0xC3;
388pub const VK_GAMEPAD_B: c_int = 0xC4;
389pub const VK_GAMEPAD_X: c_int = 0xC5;
390pub const VK_GAMEPAD_Y: c_int = 0xC6;
391pub const VK_GAMEPAD_RIGHT_SHOULDER: c_int = 0xC7;
392pub const VK_GAMEPAD_LEFT_SHOULDER: c_int = 0xC8;
393pub const VK_GAMEPAD_LEFT_TRIGGER: c_int = 0xC9;
394pub const VK_GAMEPAD_RIGHT_TRIGGER: c_int = 0xCA;
395pub const VK_GAMEPAD_DPAD_UP: c_int = 0xCB;
396pub const VK_GAMEPAD_DPAD_DOWN: c_int = 0xCC;
397pub const VK_GAMEPAD_DPAD_LEFT: c_int = 0xCD;
398pub const VK_GAMEPAD_DPAD_RIGHT: c_int = 0xCE;
399pub const VK_GAMEPAD_MENU: c_int = 0xCF;
400pub const VK_GAMEPAD_VIEW: c_int = 0xD0;
401pub const VK_GAMEPAD_LEFT_THUMBSTICK_BUTTON: c_int = 0xD1;
402pub const VK_GAMEPAD_RIGHT_THUMBSTICK_BUTTON: c_int = 0xD2;
403pub const VK_GAMEPAD_LEFT_THUMBSTICK_UP: c_int = 0xD3;
404pub const VK_GAMEPAD_LEFT_THUMBSTICK_DOWN: c_int = 0xD4;
405pub const VK_GAMEPAD_LEFT_THUMBSTICK_RIGHT: c_int = 0xD5;
406pub const VK_GAMEPAD_LEFT_THUMBSTICK_LEFT: c_int = 0xD6;
407pub const VK_GAMEPAD_RIGHT_THUMBSTICK_UP: c_int = 0xD7;
408pub const VK_GAMEPAD_RIGHT_THUMBSTICK_DOWN: c_int = 0xD8;
409pub const VK_GAMEPAD_RIGHT_THUMBSTICK_RIGHT: c_int = 0xD9;
410pub const VK_GAMEPAD_RIGHT_THUMBSTICK_LEFT: c_int = 0xDA;
411pub const VK_OEM_4: c_int = 0xDB;
412pub const VK_OEM_5: c_int = 0xDC;
413pub const VK_OEM_6: c_int = 0xDD;
414pub const VK_OEM_7: c_int = 0xDE;
415pub const VK_OEM_8: c_int = 0xDF;
416pub const VK_OEM_AX: c_int = 0xE1;
417pub const VK_OEM_102: c_int = 0xE2;
418pub const VK_ICO_HELP: c_int = 0xE3;
419pub const VK_ICO_00: c_int = 0xE4;
420pub const VK_PROCESSKEY: c_int = 0xE5;
421pub const VK_ICO_CLEAR: c_int = 0xE6;
422pub const VK_PACKET: c_int = 0xE7;
423pub const VK_OEM_RESET: c_int = 0xE9;
424pub const VK_OEM_JUMP: c_int = 0xEA;
425pub const VK_OEM_PA1: c_int = 0xEB;
426pub const VK_OEM_PA2: c_int = 0xEC;
427pub const VK_OEM_PA3: c_int = 0xED;
428pub const VK_OEM_WSCTRL: c_int = 0xEE;
429pub const VK_OEM_CUSEL: c_int = 0xEF;
430pub const VK_OEM_ATTN: c_int = 0xF0;
431pub const VK_OEM_FINISH: c_int = 0xF1;
432pub const VK_OEM_COPY: c_int = 0xF2;
433pub const VK_OEM_AUTO: c_int = 0xF3;
434pub const VK_OEM_ENLW: c_int = 0xF4;
435pub const VK_OEM_BACKTAB: c_int = 0xF5;
436pub const VK_ATTN: c_int = 0xF6;
437pub const VK_CRSEL: c_int = 0xF7;
438pub const VK_EXSEL: c_int = 0xF8;
439pub const VK_EREOF: c_int = 0xF9;
440pub const VK_PLAY: c_int = 0xFA;
441pub const VK_ZOOM: c_int = 0xFB;
442pub const VK_NONAME: c_int = 0xFC;
443pub const VK_PA1: c_int = 0xFD;
444pub const VK_OEM_CLEAR: c_int = 0xFE;
445pub const WH_MIN: c_int = -1;
446pub const WH_MSGFILTER: c_int = -1;
447pub const WH_JOURNALRECORD: c_int = 0;
448pub const WH_JOURNALPLAYBACK: c_int = 1;
449pub const WH_KEYBOARD: c_int = 2;
450pub const WH_GETMESSAGE: c_int = 3;
451pub const WH_CALLWNDPROC: c_int = 4;
452pub const WH_CBT: c_int = 5;
453pub const WH_SYSMSGFILTER: c_int = 6;
454pub const WH_MOUSE: c_int = 7;
455pub const WH_HARDWARE: c_int = 8;
456pub const WH_DEBUG: c_int = 9;
457pub const WH_SHELL: c_int = 10;
458pub const WH_FOREGROUNDIDLE: c_int = 11;
459pub const WH_CALLWNDPROCRET: c_int = 12;
460pub const WH_KEYBOARD_LL: c_int = 13;
461pub const WH_MOUSE_LL: c_int = 14;
462pub const WH_MAX: c_int = 14;
463pub const WH_MINHOOK: c_int = WH_MIN;
464pub const WH_MAXHOOK: c_int = WH_MAX;
465pub const HC_ACTION: c_int = 0;
466pub const HC_GETNEXT: c_int = 1;
467pub const HC_SKIP: c_int = 2;
468pub const HC_NOREMOVE: c_int = 3;
469pub const HC_NOREM: c_int = HC_NOREMOVE;
470pub const HC_SYSMODALON: c_int = 4;
471pub const HC_SYSMODALOFF: c_int = 5;
472pub const HCBT_MOVESIZE: c_int = 0;
473pub const HCBT_MINMAX: c_int = 1;
474pub const HCBT_QS: c_int = 2;
475pub const HCBT_CREATEWND: c_int = 3;
476pub const HCBT_DESTROYWND: c_int = 4;
477pub const HCBT_ACTIVATE: c_int = 5;
478pub const HCBT_CLICKSKIPPED: c_int = 6;
479pub const HCBT_KEYSKIPPED: c_int = 7;
480pub const HCBT_SYSCOMMAND: c_int = 8;
481pub const HCBT_SETFOCUS: c_int = 9;
482STRUCT!{struct CBT_CREATEWNDA {
483 lpcs: *mut CREATESTRUCTA,
484 hwndInsertAfter: HWND,
485}}
486pub type LPCBT_CREATEWNDA = *mut CBT_CREATEWNDA;
487STRUCT!{struct CBT_CREATEWNDW {
488 lpcs: *mut CREATESTRUCTW,
489 hwndInsertAfter: HWND,
490}}
491pub type LPCBT_CREATEWNDW = *mut CBT_CREATEWNDW;
492STRUCT!{struct CBTACTIVATESTRUCT {
493 fMouse: BOOL,
494 hWndActive: HWND,
495}}
496pub type LPCBTACTIVATESTRUCT = *mut CBTACTIVATESTRUCT;
497STRUCT!{struct WTSSESSION_NOTIFICATION {
498 cbSize: DWORD,
499 dwSessionId: DWORD,
500}}
501pub type PWTSSESSION_NOTIFICATION = *mut WTSSESSION_NOTIFICATION;
502pub const WTS_CONSOLE_CONNECT: WPARAM = 0x1;
503pub const WTS_CONSOLE_DISCONNECT: WPARAM = 0x2;
504pub const WTS_REMOTE_CONNECT: WPARAM = 0x3;
505pub const WTS_REMOTE_DISCONNECT: WPARAM = 0x4;
506pub const WTS_SESSION_LOGON: WPARAM = 0x5;
507pub const WTS_SESSION_LOGOFF: WPARAM = 0x6;
508pub const WTS_SESSION_LOCK: WPARAM = 0x7;
509pub const WTS_SESSION_UNLOCK: WPARAM = 0x8;
510pub const WTS_SESSION_REMOTE_CONTROL: WPARAM = 0x9;
511pub const WTS_SESSION_CREATE: WPARAM = 0xa;
512pub const WTS_SESSION_TERMINATE: WPARAM = 0xb;
513pub const MSGF_DIALOGBOX: c_int = 0;
514pub const MSGF_MESSAGEBOX: c_int = 1;
515pub const MSGF_MENU: c_int = 2;
516pub const MSGF_SCROLLBAR: c_int = 5;
517pub const MSGF_NEXTWINDOW: c_int = 6;
518pub const MSGF_MAX: c_int = 8;
519pub const MSGF_USER: c_int = 4096;
520pub const HSHELL_WINDOWCREATED: c_int = 1;
521pub const HSHELL_WINDOWDESTROYED: c_int = 2;
522pub const HSHELL_ACTIVATESHELLWINDOW: c_int = 3;
523pub const HSHELL_WINDOWACTIVATED: c_int = 4;
524pub const HSHELL_GETMINRECT: c_int = 5;
525pub const HSHELL_REDRAW: c_int = 6;
526pub const HSHELL_TASKMAN: c_int = 7;
527pub const HSHELL_LANGUAGE: c_int = 8;
528pub const HSHELL_SYSMENU: c_int = 9;
529pub const HSHELL_ENDTASK: c_int = 10;
530pub const HSHELL_ACCESSIBILITYSTATE: c_int = 11;
531pub const HSHELL_APPCOMMAND: c_int = 12;
532pub const HSHELL_WINDOWREPLACED: c_int = 13;
533pub const HSHELL_WINDOWREPLACING: c_int = 14;
534pub const HSHELL_MONITORCHANGED: c_int = 16;
535pub const HSHELL_HIGHBIT: c_int = 0x8000;
536pub const HSHELL_FLASH: c_int = HSHELL_REDRAW | HSHELL_HIGHBIT;
537pub const HSHELL_RUDEAPPACTIVATED: c_int = HSHELL_WINDOWACTIVATED | HSHELL_HIGHBIT;
538pub const APPCOMMAND_BROWSER_BACKWARD: c_short = 1;
539pub const APPCOMMAND_BROWSER_FORWARD: c_short = 2;
540pub const APPCOMMAND_BROWSER_REFRESH: c_short = 3;
541pub const APPCOMMAND_BROWSER_STOP: c_short = 4;
542pub const APPCOMMAND_BROWSER_SEARCH: c_short = 5;
543pub const APPCOMMAND_BROWSER_FAVORITES: c_short = 6;
544pub const APPCOMMAND_BROWSER_HOME: c_short = 7;
545pub const APPCOMMAND_VOLUME_MUTE: c_short = 8;
546pub const APPCOMMAND_VOLUME_DOWN: c_short = 9;
547pub const APPCOMMAND_VOLUME_UP: c_short = 10;
548pub const APPCOMMAND_MEDIA_NEXTTRACK: c_short = 11;
549pub const APPCOMMAND_MEDIA_PREVIOUSTRACK: c_short = 12;
550pub const APPCOMMAND_MEDIA_STOP: c_short = 13;
551pub const APPCOMMAND_MEDIA_PLAY_PAUSE: c_short = 14;
552pub const APPCOMMAND_LAUNCH_MAIL: c_short = 15;
553pub const APPCOMMAND_LAUNCH_MEDIA_SELECT: c_short = 16;
554pub const APPCOMMAND_LAUNCH_APP1: c_short = 17;
555pub const APPCOMMAND_LAUNCH_APP2: c_short = 18;
556pub const APPCOMMAND_BASS_DOWN: c_short = 19;
557pub const APPCOMMAND_BASS_BOOST: c_short = 20;
558pub const APPCOMMAND_BASS_UP: c_short = 21;
559pub const APPCOMMAND_TREBLE_DOWN: c_short = 22;
560pub const APPCOMMAND_TREBLE_UP: c_short = 23;
561pub const APPCOMMAND_MICROPHONE_VOLUME_MUTE: c_short = 24;
562pub const APPCOMMAND_MICROPHONE_VOLUME_DOWN: c_short = 25;
563pub const APPCOMMAND_MICROPHONE_VOLUME_UP: c_short = 26;
564pub const APPCOMMAND_HELP: c_short = 27;
565pub const APPCOMMAND_FIND: c_short = 28;
566pub const APPCOMMAND_NEW: c_short = 29;
567pub const APPCOMMAND_OPEN: c_short = 30;
568pub const APPCOMMAND_CLOSE: c_short = 31;
569pub const APPCOMMAND_SAVE: c_short = 32;
570pub const APPCOMMAND_PRINT: c_short = 33;
571pub const APPCOMMAND_UNDO: c_short = 34;
572pub const APPCOMMAND_REDO: c_short = 35;
573pub const APPCOMMAND_COPY: c_short = 36;
574pub const APPCOMMAND_CUT: c_short = 37;
575pub const APPCOMMAND_PASTE: c_short = 38;
576pub const APPCOMMAND_REPLY_TO_MAIL: c_short = 39;
577pub const APPCOMMAND_FORWARD_MAIL: c_short = 40;
578pub const APPCOMMAND_SEND_MAIL: c_short = 41;
579pub const APPCOMMAND_SPELL_CHECK: c_short = 42;
580pub const APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE: c_short = 43;
581pub const APPCOMMAND_MIC_ON_OFF_TOGGLE: c_short = 44;
582pub const APPCOMMAND_CORRECTION_LIST: c_short = 45;
583pub const APPCOMMAND_MEDIA_PLAY: c_short = 46;
584pub const APPCOMMAND_MEDIA_PAUSE: c_short = 47;
585pub const APPCOMMAND_MEDIA_RECORD: c_short = 48;
586pub const APPCOMMAND_MEDIA_FAST_FORWARD: c_short = 49;
587pub const APPCOMMAND_MEDIA_REWIND: c_short = 50;
588pub const APPCOMMAND_MEDIA_CHANNEL_UP: c_short = 51;
589pub const APPCOMMAND_MEDIA_CHANNEL_DOWN: c_short = 52;
590pub const APPCOMMAND_DELETE: c_short = 53;
591pub const APPCOMMAND_DWM_FLIP3D: c_short = 54;
592pub const FAPPCOMMAND_MOUSE: WORD = 0x8000;
593pub const FAPPCOMMAND_KEY: WORD = 0;
594pub const FAPPCOMMAND_OEM: WORD = 0x1000;
595pub const FAPPCOMMAND_MASK: WORD = 0xF000;
596#[inline]
597pub fn GET_APPCOMMAND_LPARAM(lParam: LPARAM) -> c_short {
598 (HIWORD(lParam as DWORD) & !FAPPCOMMAND_MASK) as c_short
599}
600#[inline]
601pub fn GET_DEVICE_LPARAM(lParam: LPARAM) -> WORD {
602 HIWORD(lParam as DWORD) & FAPPCOMMAND_MASK
603}
604pub use self::GET_DEVICE_LPARAM as GET_MOUSEORKEY_LPARAM;
605pub use shared::minwindef::LOWORD as GET_FLAGS_LPARAM;
606pub use self::GET_FLAGS_LPARAM as GET_KEYSTATE_LPARAM;
607STRUCT!{struct SHELLHOOKINFO {
608 hwnd: HWND,
609 rc: RECT,
610}}
611pub type LPSHELLHOOKINFO = *mut SHELLHOOKINFO;
612STRUCT!{struct EVENTMSG {
613 message: UINT,
614 paramL: UINT,
615 paramH: UINT,
616 time: DWORD,
617 hwnd: HWND,
618}}
619pub type PEVENTMSGMSG = *mut EVENTMSG;
620pub type NPEVENTMSGMSG = *mut EVENTMSG;
621pub type LPEVENTMSGMSG = *mut EVENTMSG;
622pub type PEVENTMSG = *mut EVENTMSG;
623pub type NPEVENTMSG = *mut EVENTMSG;
624pub type LPEVENTMSG = *mut EVENTMSG;
625STRUCT!{struct CWPSTRUCT {
626 lParam: LPARAM,
627 wParam: WPARAM,
628 message: UINT,
629 hwnd: HWND,
630}}
631pub type PCWPSTRUCT = *mut CWPSTRUCT;
632pub type NPCWPSTRUCT = *mut CWPSTRUCT;
633pub type LPCWPSTRUCT = *mut CWPSTRUCT;
634STRUCT!{struct CWPRETSTRUCT {
635 lResult: LRESULT,
636 lParam: LPARAM,
637 wParam: WPARAM,
638 message: UINT,
639 hwnd: HWND,
640}}
641pub type PCWPRETSTRUCT = *mut CWPRETSTRUCT;
642pub type NPCWPRETSTRUCT = *mut CWPRETSTRUCT;
643pub type LPCWPRETSTRUCT = *mut CWPRETSTRUCT;
644pub const LLKHF_EXTENDED: DWORD = (KF_EXTENDED >> 8) as u32;
645pub const LLKHF_INJECTED: DWORD = 0x00000010;
646pub const LLKHF_ALTDOWN: DWORD = (KF_ALTDOWN >> 8) as u32;
647pub const LLKHF_UP: DWORD = (KF_UP >> 8) as u32;
648pub const LLKHF_LOWER_IL_INJECTED: DWORD = 0x00000002;
649pub const LLMHF_INJECTED: DWORD = 0x00000001;
650pub const LLMHF_LOWER_IL_INJECTED: DWORD = 0x00000002;
651STRUCT!{struct KBDLLHOOKSTRUCT {
652 vkCode: DWORD,
653 scanCode: DWORD,
654 flags: DWORD,
655 time: DWORD,
656 dwExtraInfo: ULONG_PTR,
657}}
658pub type LPKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT;
659pub type PKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT;
660STRUCT!{struct MSLLHOOKSTRUCT {
661 pt: POINT,
662 mouseData: DWORD,
663 flags: DWORD,
664 time: DWORD,
665 dwExtraInfo: ULONG_PTR,
666}}
667pub type LPMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT;
668pub type PMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT;
669STRUCT!{struct DEBUGHOOKINFO {
670 idThread: DWORD,
671 idThreadInstaller: DWORD,
672 lParam: LPARAM,
673 wParam: WPARAM,
674 code: c_int,
675}}
676pub type PDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
677pub type NPDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
678pub type LPDEBUGHOOKINFO = *mut DEBUGHOOKINFO;
679STRUCT!{struct MOUSEHOOKSTRUCT {
680 pt: POINT,
681 hwnd: HWND,
682 wHitTestCode: UINT,
683 dwExtraInfo: ULONG_PTR,
684}}
685pub type LPMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT;
686pub type PMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT;
687STRUCT!{struct MOUSEHOOKSTRUCTEX {
688 parent: MOUSEHOOKSTRUCT,
689 mouseData: DWORD,
690}}
691pub type LPMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX;
692pub type PMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX;
693STRUCT!{struct HARDWAREHOOKSTRUCT {
694 hwnd: HWND,
695 message: UINT,
696 wParam: WPARAM,
697 lParam: LPARAM,
698}}
699pub type LPHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT;
700pub type PHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT;
701pub const HKL_PREV: HKL = 0 as HKL;
702pub const HKL_NEXT: HKL = 1 as HKL;
703pub const KLF_ACTIVATE: UINT = 0x00000001;
704pub const KLF_SUBSTITUTE_OK: UINT = 0x00000002;
705pub const KLF_REORDER: UINT = 0x00000008;
706pub const KLF_REPLACELANG: UINT = 0x00000010;
707pub const KLF_NOTELLSHELL: UINT = 0x00000080;
708pub const KLF_SETFORPROCESS: UINT = 0x00000100;
709pub const KLF_SHIFTLOCK: UINT = 0x00010000;
710pub const KLF_RESET: UINT = 0x40000000;
711pub const INPUTLANGCHANGE_SYSCHARSET: WPARAM = 0x0001;
712pub const INPUTLANGCHANGE_FORWARD: WPARAM = 0x0002;
713pub const INPUTLANGCHANGE_BACKWARD: WPARAM = 0x0004;
714pub const KL_NAMELENGTH: usize = 9;
715extern "system" {
716 pub fn LoadKeyboardLayoutA(
717 pwszKLID: LPCSTR,
718 Flags: DWORD,
719 ) -> HKL;
720 pub fn LoadKeyboardLayoutW(
721 pwszKLID: LPCWSTR,
722 Flags: DWORD,
723 ) -> HKL;
724 pub fn ActivateKeyboardLayout(
725 hkl: HKL,
726 Flags: UINT,
727 ) -> HKL;
728 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;
737 pub fn UnloadKeyboardLayout(
738 hkl: HKL,
739 ) -> BOOL;
740 pub fn GetKeyboardLayoutNameA(
741 pwszKLID: LPSTR,
742 ) -> BOOL;
743 pub fn GetKeyboardLayoutNameW(
744 pwszKLID: LPWSTR,
745 ) -> BOOL;
746 pub fn GetKeyboardLayoutList(
747 nBuff: c_int,
748 lpList: *mut HKL,
749 ) -> c_int;
750 pub fn GetKeyboardLayout(
751 idThread: DWORD,
752 ) -> HKL;
753}
754STRUCT!{struct MOUSEMOVEPOINT {
755 x: c_int,
756 y: c_int,
757 time: DWORD,
758 dwExtraInfo: ULONG_PTR,
759}}
760pub type PMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT;
761pub type LPMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT;
762pub const GMMP_USE_DISPLAY_POINTS: DWORD = 1;
763pub const GMMP_USE_HIGH_RESOLUTION_POINTS: DWORD = 2;
764extern "system" {
765 pub fn GetMouseMovePointsEx(
766 cbSize: UINT,
767 lppt: LPMOUSEMOVEPOINT,
768 lpptBuf: LPMOUSEMOVEPOINT,
769 nBufPoints: c_int,
770 resolution: DWORD,
771 ) -> c_int;
772}
773pub const DESKTOP_READOBJECTS: DWORD = 0x0001;
774pub const DESKTOP_CREATEWINDOW: DWORD = 0x0002;
775pub const DESKTOP_CREATEMENU: DWORD = 0x0004;
776pub const DESKTOP_HOOKCONTROL: DWORD = 0x0008;
777pub const DESKTOP_JOURNALRECORD: DWORD = 0x0010;
778pub const DESKTOP_JOURNALPLAYBACK: DWORD = 0x0020;
779pub const DESKTOP_ENUMERATE: DWORD = 0x0040;
780pub const DESKTOP_WRITEOBJECTS: DWORD = 0x0080;
781pub const DESKTOP_SWITCHDESKTOP: DWORD = 0x0100;
782pub const DF_ALLOWOTHERACCOUNTHOOK: DWORD = 0x0001;
783extern "system" {
784 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;
792 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;
800 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;
810 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;
820 pub fn OpenDesktopA(
821 lpszDesktop: LPCSTR,
822 dwFlags: DWORD,
823 fInherit: BOOL,
824 dwDesiredAccess: ACCESS_MASK,
825 ) -> HDESK;
826 pub fn OpenDesktopW(
827 lpszDesktop: LPCWSTR,
828 dwFlags: DWORD,
829 fInherit: BOOL,
830 dwDesiredAccess: ACCESS_MASK,
831 ) -> HDESK;
832 pub fn OpenInputDesktop(
833 dwFlags: DWORD,
834 fInherit: BOOL,
835 dwDesiredAccess: ACCESS_MASK,
836 ) -> HDESK;
837 pub fn EnumDesktopsA(
838 hwinsta: HWINSTA,
839 lpEnumFunc: DESKTOPENUMPROCA,
840 lParam: LPARAM,
841 ) -> BOOL;
842 pub fn EnumDesktopsW(
843 hwinsta: HWINSTA,
844 lpEnumFunc: DESKTOPENUMPROCW,
845 lParam: LPARAM,
846 ) -> BOOL;
847 pub fn EnumDesktopWindows(
848 hDesktop: HDESK,
849 lpfn: WNDENUMPROC,
850 lParam: LPARAM,
851 ) -> BOOL;
852 pub fn SwitchDesktop(
853 hDesktop: HDESK,
854 ) -> BOOL;
855 pub fn SetThreadDesktop(
856 hDesktop: HDESK,
857 ) -> BOOL;
858 pub fn CloseDesktop(
859 hDesktop: HDESK,
860 ) -> BOOL;
861 pub fn GetThreadDesktop(
862 dwThreadId: DWORD,
863 ) -> HDESK;
864}
865pub const WINSTA_ENUMDESKTOPS: DWORD = 0x0001;
866pub const WINSTA_READATTRIBUTES: DWORD = 0x0002;
867pub const WINSTA_ACCESSCLIPBOARD: DWORD = 0x0004;
868pub const WINSTA_CREATEDESKTOP: DWORD = 0x0008;
869pub const WINSTA_WRITEATTRIBUTES: DWORD = 0x0010;
870pub const WINSTA_ACCESSGLOBALATOMS: DWORD = 0x0020;
871pub const WINSTA_EXITWINDOWS: DWORD = 0x0040;
872pub const WINSTA_ENUMERATE: DWORD = 0x0100;
873pub const WINSTA_READSCREEN: DWORD = 0x0200;
874pub 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;
877pub const CWF_CREATE_ONLY: DWORD = 0x00000001;
878pub const WSF_VISIBLE: DWORD = 0x0001;
879extern "system" {
880 pub fn CreateWindowStationA(
881 lpwinsta: LPCSTR,
882 dwFlags: DWORD,
883 dwDesiredAccess: ACCESS_MASK,
884 lpsa: LPSECURITY_ATTRIBUTES,
885 ) -> HWINSTA;
886 pub fn CreateWindowStationW(
887 lpwinsta: LPCWSTR,
888 dwFlags: DWORD,
889 dwDesiredAccess: ACCESS_MASK,
890 lpsa: LPSECURITY_ATTRIBUTES,
891 ) -> HWINSTA;
892 pub fn OpenWindowStationA(
893 lpszWinSta: LPCSTR,
894 fInherit: BOOL,
895 dwDesiredAccess: ACCESS_MASK,
896 ) -> HWINSTA;
897 pub fn OpenWindowStationW(
898 lpszWinSta: LPCWSTR,
899 fInherit: BOOL,
900 dwDesiredAccess: ACCESS_MASK,
901 ) -> HWINSTA;
902 pub fn EnumWindowStationsA(
903 lpEnumFunc: WINSTAENUMPROCA,
904 lParam: LPARAM,
905 ) -> BOOL;
906 pub fn EnumWindowStationsW(
907 lpEnumFunc: WINSTAENUMPROCW,
908 lParam: LPARAM,
909 ) -> BOOL;
910 pub fn CloseWindowStation(
911 hWinSta: HWINSTA,
912 ) -> BOOL;
913 pub fn SetProcessWindowStation(
914 hWinSta: HWINSTA,
915 ) -> BOOL;
60c5eb7d 916 pub fn GetProcessWindowStation() -> HWINSTA;
ff7c6d11
XL
917 pub fn SetUserObjectSecurity(
918 hObj: HANDLE,
919 pSIRequested: PSECURITY_INFORMATION,
920 pSID: PSECURITY_DESCRIPTOR,
921 ) -> BOOL;
922 pub fn GetUserObjectSecurity(
923 hObj: HANDLE,
924 pSIRequested: PSECURITY_INFORMATION,
925 pSID: PSECURITY_DESCRIPTOR,
926 nLength: DWORD,
927 lpnLengthNeeded: LPDWORD,
928 ) -> BOOL;
929}
930pub const UOI_FLAGS: DWORD = 1;
931pub const UOI_NAME: DWORD = 2;
932pub const UOI_TYPE: DWORD = 3;
933pub const UOI_USER_SID: DWORD = 4;
934pub const UOI_HEAPSIZE: DWORD = 5;
935pub const UOI_IO: DWORD = 6;
936pub const UOI_TIMERPROC_EXCEPTION_SUPPRESSION: DWORD = 7;
937STRUCT!{struct USEROBJECTFLAGS {
938 fInherit: BOOL,
939 fReserved: BOOL,
940 dwFlags: DWORD,
941}}
942pub type PUSEROBJECTFLAGS = *mut USEROBJECTFLAGS;
943extern "system" {
944 pub fn GetUserObjectInformationA(
945 hObj: HANDLE,
946 nIndex: c_int,
947 pvInfo: PVOID,
948 nLength: DWORD,
949 lpnLengthNeeded: LPDWORD,
950 ) -> BOOL;
951 pub fn GetUserObjectInformationW(
952 hObj: HANDLE,
953 nIndex: c_int,
954 pvInfo: PVOID,
955 nLength: DWORD,
956 lpnLengthNeeded: LPDWORD,
957 ) -> BOOL;
958 pub fn SetUserObjectInformationA(
959 hObj: HANDLE,
960 nIndex: c_int,
961 pvInfo: PVOID,
962 nLength: DWORD,
963 ) -> BOOL;
964 pub fn SetUserObjectInformationW(
965 hObj: HANDLE,
966 nIndex: c_int,
967 pvInfo: PVOID,
968 nLength: DWORD,
969 ) -> BOOL;
970}
971STRUCT!{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}}
985pub type PWNDCLASSEXA = *mut WNDCLASSEXA;
986pub type NPWNDCLASSEXA = *mut WNDCLASSEXA;
987pub type LPWNDCLASSEXA = *mut WNDCLASSEXA;
988STRUCT!{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}}
1002pub type PWNDCLASSEXW = *mut WNDCLASSEXW;
1003pub type NPWNDCLASSEXW = *mut WNDCLASSEXW;
1004pub type LPWNDCLASSEXW = *mut WNDCLASSEXW;
1005STRUCT!{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}}
1017pub type PWNDCLASSA = *mut WNDCLASSA;
1018pub type NPWNDCLASSA = *mut WNDCLASSA;
1019pub type LPWNDCLASSA = *mut WNDCLASSA;
1020STRUCT!{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}}
1032pub type PWNDCLASSW = *mut WNDCLASSW;
1033pub type NPWNDCLASSW = *mut WNDCLASSW;
1034pub type LPWNDCLASSW = *mut WNDCLASSW;
1035extern "system" {
1036 pub fn IsHungAppWindow(
1037 hwnd: HWND,
1038 ) -> BOOL;
1039 pub fn DisableProcessWindowsGhosting();
1040}
1041STRUCT!{struct MSG {
1042 hwnd: HWND,
1043 message: UINT,
1044 wParam: WPARAM,
1045 lParam: LPARAM,
1046 time: DWORD,
1047 pt: POINT,
1048}}
1049pub type PMSG = *mut MSG;
1050pub type NPMSG = *mut MSG;
1051pub type LPMSG = *mut MSG;
1052//POINTSTOPOINT
1053//POINTTOPOINTS
1054//MAKEWPARAM
1055//MAKELPARAM
1056//MAKELRESULT
1057pub const GWL_WNDPROC: c_int = -4;
1058pub const GWL_HINSTANCE: c_int = -6;
1059pub const GWL_HWNDPARENT: c_int = -8;
1060pub const GWL_STYLE: c_int = -16;
1061pub const GWL_EXSTYLE: c_int = -20;
1062pub const GWL_USERDATA: c_int = -21;
1063pub const GWL_ID: c_int = -12;
1064pub const GWLP_WNDPROC: c_int = -4;
1065pub const GWLP_HINSTANCE: c_int = -6;
1066pub const GWLP_HWNDPARENT: c_int = -8;
1067pub const GWLP_USERDATA: c_int = -21;
1068pub const GWLP_ID: c_int = -12;
1069pub const GCL_MENUNAME: c_int = -8;
1070pub const GCL_HBRBACKGROUND: c_int = -10;
1071pub const GCL_HCURSOR: c_int = -12;
1072pub const GCL_HICON: c_int = -14;
1073pub const GCL_HMODULE: c_int = -16;
1074pub const GCL_CBWNDEXTRA: c_int = -18;
1075pub const GCL_CBCLSEXTRA: c_int = -20;
1076pub const GCL_WNDPROC: c_int = -24;
1077pub const GCL_STYLE: c_int = -26;
1078pub const GCW_ATOM: c_int = -32;
1079pub const GCL_HICONSM: c_int = -34;
1080pub const GCLP_MENUNAME: c_int = -8;
1081pub const GCLP_HBRBACKGROUND: c_int = -10;
1082pub const GCLP_HCURSOR: c_int = -12;
1083pub const GCLP_HICON: c_int = -14;
1084pub const GCLP_HMODULE: c_int = -16;
1085pub const GCLP_WNDPROC: c_int = -24;
1086pub const GCLP_HICONSM: c_int = -34;
1087pub const WM_NULL: UINT = 0x0000;
1088pub const WM_CREATE: UINT = 0x0001;
1089pub const WM_DESTROY: UINT = 0x0002;
1090pub const WM_MOVE: UINT = 0x0003;
1091pub const WM_SIZE: UINT = 0x0005;
1092pub const WM_ACTIVATE: UINT = 0x0006;
1093pub const WA_INACTIVE: WORD = 0;
1094pub const WA_ACTIVE: WORD = 1;
1095pub const WA_CLICKACTIVE: WORD = 2;
1096pub const WM_SETFOCUS: UINT = 0x0007;
1097pub const WM_KILLFOCUS: UINT = 0x0008;
1098pub const WM_ENABLE: UINT = 0x000A;
1099pub const WM_SETREDRAW: UINT = 0x000B;
1100pub const WM_SETTEXT: UINT = 0x000C;
1101pub const WM_GETTEXT: UINT = 0x000D;
1102pub const WM_GETTEXTLENGTH: UINT = 0x000E;
1103pub const WM_PAINT: UINT = 0x000F;
1104pub const WM_CLOSE: UINT = 0x0010;
1105pub const WM_QUERYENDSESSION: UINT = 0x0011;
1106pub const WM_QUERYOPEN: UINT = 0x0013;
1107pub const WM_ENDSESSION: UINT = 0x0016;
1108pub const WM_QUIT: UINT = 0x0012;
1109pub const WM_ERASEBKGND: UINT = 0x0014;
1110pub const WM_SYSCOLORCHANGE: UINT = 0x0015;
1111pub const WM_SHOWWINDOW: UINT = 0x0018;
1112pub const WM_WININICHANGE: UINT = 0x001A;
1113pub const WM_SETTINGCHANGE: UINT = WM_WININICHANGE;
1114pub const WM_DEVMODECHANGE: UINT = 0x001B;
1115pub const WM_ACTIVATEAPP: UINT = 0x001C;
1116pub const WM_FONTCHANGE: UINT = 0x001D;
1117pub const WM_TIMECHANGE: UINT = 0x001E;
1118pub const WM_CANCELMODE: UINT = 0x001F;
1119pub const WM_SETCURSOR: UINT = 0x0020;
1120pub const WM_MOUSEACTIVATE: UINT = 0x0021;
1121pub const WM_CHILDACTIVATE: UINT = 0x0022;
1122pub const WM_QUEUESYNC: UINT = 0x0023;
1123pub const WM_GETMINMAXINFO: UINT = 0x0024;
1124STRUCT!{struct MINMAXINFO {
1125 ptReserved: POINT,
1126 ptMaxSize: POINT,
1127 ptMaxPosition: POINT,
1128 ptMinTrackSize: POINT,
1129 ptMaxTrackSize: POINT,
1130}}
1131pub type PMINMAXINFO = *mut MINMAXINFO;
1132pub type LPMINMAXINFO = *mut MINMAXINFO;
1133pub const WM_PAINTICON: UINT = 0x0026;
1134pub const WM_ICONERASEBKGND: UINT = 0x0027;
1135pub const WM_NEXTDLGCTL: UINT = 0x0028;
1136pub const WM_SPOOLERSTATUS: UINT = 0x002A;
1137pub const WM_DRAWITEM: UINT = 0x002B;
1138pub const WM_MEASUREITEM: UINT = 0x002C;
1139pub const WM_DELETEITEM: UINT = 0x002D;
1140pub const WM_VKEYTOITEM: UINT = 0x002E;
1141pub const WM_CHARTOITEM: UINT = 0x002F;
1142pub const WM_SETFONT: UINT = 0x0030;
1143pub const WM_GETFONT: UINT = 0x0031;
1144pub const WM_SETHOTKEY: UINT = 0x0032;
1145pub const WM_GETHOTKEY: UINT = 0x0033;
1146pub const WM_QUERYDRAGICON: UINT = 0x0037;
1147pub const WM_COMPAREITEM: UINT = 0x0039;
1148pub const WM_GETOBJECT: UINT = 0x003D;
1149pub const WM_COMPACTING: UINT = 0x0041;
1150pub const WM_COMMNOTIFY: UINT = 0x0044;
1151pub const WM_WINDOWPOSCHANGING: UINT = 0x0046;
1152pub const WM_WINDOWPOSCHANGED: UINT = 0x0047;
1153pub const WM_POWER: UINT = 0x0048;
1154pub const PWR_OK: WPARAM = 1;
1155pub const PWR_FAIL: WPARAM = -1isize as usize;
1156pub const PWR_SUSPENDREQUEST: WPARAM = 1;
1157pub const PWR_SUSPENDRESUME: WPARAM = 2;
1158pub const PWR_CRITICALRESUME: WPARAM = 3;
1159pub const WM_COPYDATA: UINT = 0x004A;
1160pub const WM_CANCELJOURNAL: UINT = 0x004B;
1161STRUCT!{struct COPYDATASTRUCT {
1162 dwData: ULONG_PTR,
1163 cbData: DWORD,
1164 lpData: PVOID,
1165}}
1166pub type PCOPYDATASTRUCT = *mut COPYDATASTRUCT;
1167STRUCT!{struct MDINEXTMENU {
1168 hmenuIn: HMENU,
1169 hmenuNext: HMENU,
1170 hwndNext: HWND,
1171}}
1172pub type PMDINEXTMENU = *mut MDINEXTMENU;
1173pub type LPMDINEXTMENU = *mut MDINEXTMENU;
1174pub const WM_NOTIFY: UINT = 0x004E;
1175pub const WM_INPUTLANGCHANGEREQUEST: UINT = 0x0050;
1176pub const WM_INPUTLANGCHANGE: UINT = 0x0051;
1177pub const WM_TCARD: UINT = 0x0052;
1178pub const WM_HELP: UINT = 0x0053;
1179pub const WM_USERCHANGED: UINT = 0x0054;
1180pub const WM_NOTIFYFORMAT: UINT = 0x0055;
1181pub const NFR_ANSI: LRESULT = 1;
1182pub const NFR_UNICODE: LRESULT = 2;
1183pub const NF_QUERY: LPARAM = 3;
1184pub const NF_REQUERY: LPARAM = 4;
1185pub const WM_CONTEXTMENU: UINT = 0x007B;
1186pub const WM_STYLECHANGING: UINT = 0x007C;
1187pub const WM_STYLECHANGED: UINT = 0x007D;
1188pub const WM_DISPLAYCHANGE: UINT = 0x007E;
1189pub const WM_GETICON: UINT = 0x007F;
1190pub const WM_SETICON: UINT = 0x0080;
1191pub const WM_NCCREATE: UINT = 0x0081;
1192pub const WM_NCDESTROY: UINT = 0x0082;
1193pub const WM_NCCALCSIZE: UINT = 0x0083;
1194pub const WM_NCHITTEST: UINT = 0x0084;
1195pub const WM_NCPAINT: UINT = 0x0085;
1196pub const WM_NCACTIVATE: UINT = 0x0086;
1197pub const WM_GETDLGCODE: UINT = 0x0087;
1198pub const WM_SYNCPAINT: UINT = 0x0088;
1199pub const WM_NCMOUSEMOVE: UINT = 0x00A0;
1200pub const WM_NCLBUTTONDOWN: UINT = 0x00A1;
1201pub const WM_NCLBUTTONUP: UINT = 0x00A2;
1202pub const WM_NCLBUTTONDBLCLK: UINT = 0x00A3;
1203pub const WM_NCRBUTTONDOWN: UINT = 0x00A4;
1204pub const WM_NCRBUTTONUP: UINT = 0x00A5;
1205pub const WM_NCRBUTTONDBLCLK: UINT = 0x00A6;
1206pub const WM_NCMBUTTONDOWN: UINT = 0x00A7;
1207pub const WM_NCMBUTTONUP: UINT = 0x00A8;
1208pub const WM_NCMBUTTONDBLCLK: UINT = 0x00A9;
1209pub const WM_NCXBUTTONDOWN: UINT = 0x00AB;
1210pub const WM_NCXBUTTONUP: UINT = 0x00AC;
1211pub const WM_NCXBUTTONDBLCLK: UINT = 0x00AD;
1212pub const WM_INPUT_DEVICE_CHANGE: UINT = 0x00FE;
1213pub const WM_INPUT: UINT = 0x00FF;
1214pub const WM_KEYFIRST: UINT = 0x0100;
1215pub const WM_KEYDOWN: UINT = 0x0100;
1216pub const WM_KEYUP: UINT = 0x0101;
1217pub const WM_CHAR: UINT = 0x0102;
1218pub const WM_DEADCHAR: UINT = 0x0103;
1219pub const WM_SYSKEYDOWN: UINT = 0x0104;
1220pub const WM_SYSKEYUP: UINT = 0x0105;
1221pub const WM_SYSCHAR: UINT = 0x0106;
1222pub const WM_SYSDEADCHAR: UINT = 0x0107;
1223pub const WM_UNICHAR: UINT = 0x0109;
1224pub const WM_KEYLAST: UINT = 0x0109;
1225pub const UNICODE_NOCHAR: WPARAM = 0xFFFF;
1226pub const WM_IME_STARTCOMPOSITION: UINT = 0x010D;
1227pub const WM_IME_ENDCOMPOSITION: UINT = 0x010E;
1228pub const WM_IME_COMPOSITION: UINT = 0x010F;
1229pub const WM_IME_KEYLAST: UINT = 0x010F;
1230pub const WM_INITDIALOG: UINT = 0x0110;
1231pub const WM_COMMAND: UINT = 0x0111;
1232pub const WM_SYSCOMMAND: UINT = 0x0112;
1233pub const WM_TIMER: UINT = 0x0113;
1234pub const WM_HSCROLL: UINT = 0x0114;
1235pub const WM_VSCROLL: UINT = 0x0115;
1236pub const WM_INITMENU: UINT = 0x0116;
1237pub const WM_INITMENUPOPUP: UINT = 0x0117;
1238pub const WM_GESTURE: UINT = 0x0119;
1239pub const WM_GESTURENOTIFY: UINT = 0x011A;
1240pub const WM_MENUSELECT: UINT = 0x011F;
1241pub const WM_MENUCHAR: UINT = 0x0120;
1242pub const WM_ENTERIDLE: UINT = 0x0121;
1243pub const WM_MENURBUTTONUP: UINT = 0x0122;
1244pub const WM_MENUDRAG: UINT = 0x0123;
1245pub const WM_MENUGETOBJECT: UINT = 0x0124;
1246pub const WM_UNINITMENUPOPUP: UINT = 0x0125;
1247pub const WM_MENUCOMMAND: UINT = 0x0126;
1248pub const WM_CHANGEUISTATE: UINT = 0x0127;
1249pub const WM_UPDATEUISTATE: UINT = 0x0128;
1250pub const WM_QUERYUISTATE: UINT = 0x0129;
1251pub const UIS_SET: WORD = 1;
1252pub const UIS_CLEAR: WORD = 2;
1253pub const UIS_INITIALIZE: WORD = 3;
1254pub const UISF_HIDEFOCUS: WORD = 0x1;
1255pub const UISF_HIDEACCEL: WORD = 0x2;
1256pub const UISF_ACTIVE: WORD = 0x4;
1257pub const WM_CTLCOLORMSGBOX: UINT = 0x0132;
1258pub const WM_CTLCOLOREDIT: UINT = 0x0133;
1259pub const WM_CTLCOLORLISTBOX: UINT = 0x0134;
1260pub const WM_CTLCOLORBTN: UINT = 0x0135;
1261pub const WM_CTLCOLORDLG: UINT = 0x0136;
1262pub const WM_CTLCOLORSCROLLBAR: UINT = 0x0137;
1263pub const WM_CTLCOLORSTATIC: UINT = 0x0138;
1264pub const MN_GETHMENU: UINT = 0x01E1;
1265pub const WM_MOUSEFIRST: UINT = 0x0200;
1266pub const WM_MOUSEMOVE: UINT = 0x0200;
1267pub const WM_LBUTTONDOWN: UINT = 0x0201;
1268pub const WM_LBUTTONUP: UINT = 0x0202;
1269pub const WM_LBUTTONDBLCLK: UINT = 0x0203;
1270pub const WM_RBUTTONDOWN: UINT = 0x0204;
1271pub const WM_RBUTTONUP: UINT = 0x0205;
1272pub const WM_RBUTTONDBLCLK: UINT = 0x0206;
1273pub const WM_MBUTTONDOWN: UINT = 0x0207;
1274pub const WM_MBUTTONUP: UINT = 0x0208;
1275pub const WM_MBUTTONDBLCLK: UINT = 0x0209;
1276pub const WM_MOUSEWHEEL: UINT = 0x020A;
1277pub const WM_XBUTTONDOWN: UINT = 0x020B;
1278pub const WM_XBUTTONUP: UINT = 0x020C;
1279pub const WM_XBUTTONDBLCLK: UINT = 0x020D;
1280pub const WM_MOUSEHWHEEL: UINT = 0x020E;
1281pub const WM_MOUSELAST: UINT = 0x020E;
1282pub const WHEEL_DELTA: c_short = 120;
1283#[inline]
1284pub fn GET_WHEEL_DELTA_WPARAM(wParam: WPARAM) -> c_short {
1285 HIWORD(wParam as DWORD) as c_short
1286}
1287pub const WHEEL_PAGESCROLL: UINT = UINT_MAX;
1288#[inline]
1289pub fn GET_KEYSTATE_WPARAM(wParam: WPARAM) -> WORD {
1290 LOWORD(wParam as DWORD)
1291}
1292#[inline]
1293pub fn GET_NCHITTEST_WPARAM(wParam: WPARAM) -> c_short {
1294 LOWORD(wParam as DWORD) as c_short
1295}
1296#[inline]
1297pub fn GET_XBUTTON_WPARAM(wParam: WPARAM) -> WORD {
1298 HIWORD(wParam as DWORD)
1299}
1300pub const XBUTTON1: WORD = 0x0001;
1301pub const XBUTTON2: WORD = 0x0002;
1302pub const WM_PARENTNOTIFY: UINT = 0x0210;
1303pub const WM_ENTERMENULOOP: UINT = 0x0211;
1304pub const WM_EXITMENULOOP: UINT = 0x0212;
1305pub const WM_NEXTMENU: UINT = 0x0213;
1306pub const WM_SIZING: UINT = 0x0214;
1307pub const WM_CAPTURECHANGED: UINT = 0x0215;
1308pub const WM_MOVING: UINT = 0x0216;
1309pub const WM_POWERBROADCAST: UINT = 0x0218;
1310pub const PBT_APMQUERYSUSPEND: WPARAM = 0x0000;
1311pub const PBT_APMQUERYSTANDBY: WPARAM = 0x0001;
1312pub const PBT_APMQUERYSUSPENDFAILED: WPARAM = 0x0002;
1313pub const PBT_APMQUERYSTANDBYFAILED: WPARAM = 0x0003;
1314pub const PBT_APMSUSPEND: WPARAM = 0x0004;
1315pub const PBT_APMSTANDBY: WPARAM = 0x0005;
1316pub const PBT_APMRESUMECRITICAL: WPARAM = 0x0006;
1317pub const PBT_APMRESUMESUSPEND: WPARAM = 0x0007;
1318pub const PBT_APMRESUMESTANDBY: WPARAM = 0x0008;
1319pub const PBTF_APMRESUMEFROMFAILURE: LPARAM = 0x00000001;
1320pub const PBT_APMBATTERYLOW: WPARAM = 0x0009;
1321pub const PBT_APMPOWERSTATUSCHANGE: WPARAM = 0x000A;
1322pub const PBT_APMOEMEVENT: WPARAM = 0x000B;
1323pub const PBT_APMRESUMEAUTOMATIC: WPARAM = 0x0012;
1324pub const PBT_POWERSETTINGCHANGE: WPARAM = 0x8013;
1325STRUCT!{struct POWERBROADCAST_SETTING {
1326 PowerSetting: GUID,
1327 DataLength: DWORD,
1328 Data: [UCHAR; 1],
1329}}
1330pub type PPOWERBROADCAST_SETTING = *mut POWERBROADCAST_SETTING;
1331pub const WM_DEVICECHANGE: UINT = 0x0219;
1332pub const WM_MDICREATE: UINT = 0x0220;
1333pub const WM_MDIDESTROY: UINT = 0x0221;
1334pub const WM_MDIACTIVATE: UINT = 0x0222;
1335pub const WM_MDIRESTORE: UINT = 0x0223;
1336pub const WM_MDINEXT: UINT = 0x0224;
1337pub const WM_MDIMAXIMIZE: UINT = 0x0225;
1338pub const WM_MDITILE: UINT = 0x0226;
1339pub const WM_MDICASCADE: UINT = 0x0227;
1340pub const WM_MDIICONARRANGE: UINT = 0x0228;
1341pub const WM_MDIGETACTIVE: UINT = 0x0229;
1342pub const WM_MDISETMENU: UINT = 0x0230;
1343pub const WM_ENTERSIZEMOVE: UINT = 0x0231;
1344pub const WM_EXITSIZEMOVE: UINT = 0x0232;
1345pub const WM_DROPFILES: UINT = 0x0233;
1346pub const WM_MDIREFRESHMENU: UINT = 0x0234;
1347pub const WM_POINTERDEVICECHANGE: UINT = 0x238;
1348pub const WM_POINTERDEVICEINRANGE: UINT = 0x239;
1349pub const WM_POINTERDEVICEOUTOFRANGE: UINT = 0x23A;
1350pub const WM_TOUCH: UINT = 0x0240;
1351pub const WM_NCPOINTERUPDATE: UINT = 0x0241;
1352pub const WM_NCPOINTERDOWN: UINT = 0x0242;
1353pub const WM_NCPOINTERUP: UINT = 0x0243;
1354pub const WM_POINTERUPDATE: UINT = 0x0245;
1355pub const WM_POINTERDOWN: UINT = 0x0246;
1356pub const WM_POINTERUP: UINT = 0x0247;
1357pub const WM_POINTERENTER: UINT = 0x0249;
1358pub const WM_POINTERLEAVE: UINT = 0x024A;
1359pub const WM_POINTERACTIVATE: UINT = 0x024B;
1360pub const WM_POINTERCAPTURECHANGED: UINT = 0x024C;
1361pub const WM_TOUCHHITTESTING: UINT = 0x024D;
1362pub const WM_POINTERWHEEL: UINT = 0x024E;
1363pub const WM_POINTERHWHEEL: UINT = 0x024F;
1364pub const DM_POINTERHITTEST: UINT = 0x0250;
1365pub const WM_POINTERROUTEDTO: UINT = 0x0251;
1366pub const WM_POINTERROUTEDAWAY: UINT = 0x0252;
1367pub const WM_POINTERROUTEDRELEASED: UINT = 0x0253;
1368pub const WM_IME_SETCONTEXT: UINT = 0x0281;
1369pub const WM_IME_NOTIFY: UINT = 0x0282;
1370pub const WM_IME_CONTROL: UINT = 0x0283;
1371pub const WM_IME_COMPOSITIONFULL: UINT = 0x0284;
1372pub const WM_IME_SELECT: UINT = 0x0285;
1373pub const WM_IME_CHAR: UINT = 0x0286;
1374pub const WM_IME_REQUEST: UINT = 0x0288;
1375pub const WM_IME_KEYDOWN: UINT = 0x0290;
1376pub const WM_IME_KEYUP: UINT = 0x0291;
1377pub const WM_MOUSEHOVER: UINT = 0x02A1;
1378pub const WM_MOUSELEAVE: UINT = 0x02A3;
1379pub const WM_NCMOUSEHOVER: UINT = 0x02A0;
1380pub const WM_NCMOUSELEAVE: UINT = 0x02A2;
1381pub const WM_WTSSESSION_CHANGE: UINT = 0x02B1;
1382pub const WM_TABLET_FIRST: UINT = 0x02c0;
1383pub const WM_TABLET_LAST: UINT = 0x02df;
1384pub const WM_DPICHANGED: UINT = 0x02E0;
60c5eb7d
XL
1385pub const WM_DPICHANGED_BEFOREPARENT: UINT = 0x02E2;
1386pub const WM_DPICHANGED_AFTERPARENT: UINT = 0x02E3;
1387pub const WM_GETDPISCALEDSIZE: UINT = 0x02E4;
ff7c6d11
XL
1388pub const WM_CUT: UINT = 0x0300;
1389pub const WM_COPY: UINT = 0x0301;
1390pub const WM_PASTE: UINT = 0x0302;
1391pub const WM_CLEAR: UINT = 0x0303;
1392pub const WM_UNDO: UINT = 0x0304;
1393pub const WM_RENDERFORMAT: UINT = 0x0305;
1394pub const WM_RENDERALLFORMATS: UINT = 0x0306;
1395pub const WM_DESTROYCLIPBOARD: UINT = 0x0307;
1396pub const WM_DRAWCLIPBOARD: UINT = 0x0308;
1397pub const WM_PAINTCLIPBOARD: UINT = 0x0309;
1398pub const WM_VSCROLLCLIPBOARD: UINT = 0x030A;
1399pub const WM_SIZECLIPBOARD: UINT = 0x030B;
1400pub const WM_ASKCBFORMATNAME: UINT = 0x030C;
1401pub const WM_CHANGECBCHAIN: UINT = 0x030D;
1402pub const WM_HSCROLLCLIPBOARD: UINT = 0x030E;
1403pub const WM_QUERYNEWPALETTE: UINT = 0x030F;
1404pub const WM_PALETTEISCHANGING: UINT = 0x0310;
1405pub const WM_PALETTECHANGED: UINT = 0x0311;
1406pub const WM_HOTKEY: UINT = 0x0312;
1407pub const WM_PRINT: UINT = 0x0317;
1408pub const WM_PRINTCLIENT: UINT = 0x0318;
1409pub const WM_APPCOMMAND: UINT = 0x0319;
1410pub const WM_THEMECHANGED: UINT = 0x031A;
1411pub const WM_CLIPBOARDUPDATE: UINT = 0x031D;
1412pub const WM_DWMCOMPOSITIONCHANGED: UINT = 0x031E;
1413pub const WM_DWMNCRENDERINGCHANGED: UINT = 0x031F;
1414pub const WM_DWMCOLORIZATIONCOLORCHANGED: UINT = 0x0320;
1415pub const WM_DWMWINDOWMAXIMIZEDCHANGE: UINT = 0x0321;
1416pub const WM_DWMSENDICONICTHUMBNAIL: UINT = 0x0323;
1417pub const WM_DWMSENDICONICLIVEPREVIEWBITMAP: UINT = 0x0326;
1418pub const WM_GETTITLEBARINFOEX: UINT = 0x033F;
1419pub const WM_HANDHELDFIRST: UINT = 0x0358;
1420pub const WM_HANDHELDLAST: UINT = 0x035F;
1421pub const WM_AFXFIRST: UINT = 0x0360;
1422pub const WM_AFXLAST: UINT = 0x037F;
1423pub const WM_PENWINFIRST: UINT = 0x0380;
1424pub const WM_PENWINLAST: UINT = 0x038F;
1425pub const WM_APP: UINT = 0x8000;
1426pub const WM_USER: UINT = 0x0400;
1427pub const WMSZ_LEFT: UINT = 1;
1428pub const WMSZ_RIGHT: UINT = 2;
1429pub const WMSZ_TOP: UINT = 3;
1430pub const WMSZ_TOPLEFT: UINT = 4;
1431pub const WMSZ_TOPRIGHT: UINT = 5;
1432pub const WMSZ_BOTTOM: UINT = 6;
1433pub const WMSZ_BOTTOMLEFT: UINT = 7;
1434pub const WMSZ_BOTTOMRIGHT: UINT = 8;
1435pub const HTERROR: LRESULT = (-2);
1436pub const HTTRANSPARENT: LRESULT = (-1);
1437pub const HTNOWHERE: LRESULT = 0;
1438pub const HTCLIENT: LRESULT = 1;
1439pub const HTCAPTION: LRESULT = 2;
1440pub const HTSYSMENU: LRESULT = 3;
1441pub const HTGROWBOX: LRESULT = 4;
1442pub const HTSIZE: LRESULT = HTGROWBOX;
1443pub const HTMENU: LRESULT = 5;
1444pub const HTHSCROLL: LRESULT = 6;
1445pub const HTVSCROLL: LRESULT = 7;
1446pub const HTMINBUTTON: LRESULT = 8;
1447pub const HTMAXBUTTON: LRESULT = 9;
1448pub const HTLEFT: LRESULT = 10;
1449pub const HTRIGHT: LRESULT = 11;
1450pub const HTTOP: LRESULT = 12;
1451pub const HTTOPLEFT: LRESULT = 13;
1452pub const HTTOPRIGHT: LRESULT = 14;
1453pub const HTBOTTOM: LRESULT = 15;
1454pub const HTBOTTOMLEFT: LRESULT = 16;
1455pub const HTBOTTOMRIGHT: LRESULT = 17;
1456pub const HTBORDER: LRESULT = 18;
1457pub const HTREDUCE: LRESULT = HTMINBUTTON;
1458pub const HTZOOM: LRESULT = HTMAXBUTTON;
1459pub const HTSIZEFIRST: LRESULT = HTLEFT;
1460pub const HTSIZELAST: LRESULT = HTBOTTOMRIGHT;
1461pub const HTOBJECT: LRESULT = 19;
1462pub const HTCLOSE: LRESULT = 20;
1463pub const HTHELP: LRESULT = 21;
1464pub const SMTO_NORMAL: UINT = 0x0000;
1465pub const SMTO_BLOCK: UINT = 0x0001;
1466pub const SMTO_ABORTIFHUNG: UINT = 0x0002;
1467pub const SMTO_NOTIMEOUTIFNOTHUNG: UINT = 0x0008;
1468pub const SMTO_ERRORONEXIT: UINT = 0x0020;
1469pub const MA_ACTIVATE: UINT = 1;
1470pub const MA_ACTIVATEANDEAT: UINT = 2;
1471pub const MA_NOACTIVATE: UINT = 3;
1472pub const MA_NOACTIVATEANDEAT: UINT = 4;
1473pub const ICON_SMALL: UINT = 0;
1474pub const ICON_BIG: UINT = 1;
1475pub const ICON_SMALL2: UINT = 2;
1476extern "system" {
1477 pub fn RegisterWindowMessageA(
1478 lpString: LPCSTR,
1479 ) -> UINT;
1480 pub fn RegisterWindowMessageW(
1481 lpString: LPCWSTR,
1482 ) -> UINT;
1483}
1484pub const SIZE_RESTORED: WPARAM = 0;
1485pub const SIZE_MINIMIZED: WPARAM = 1;
1486pub const SIZE_MAXIMIZED: WPARAM = 2;
1487pub const SIZE_MAXSHOW: WPARAM = 3;
1488pub const SIZE_MAXHIDE: WPARAM = 4;
1489pub const SIZENORMAL: WPARAM = SIZE_RESTORED;
1490pub const SIZEICONIC: WPARAM = SIZE_MINIMIZED;
1491pub const SIZEFULLSCREEN: WPARAM = SIZE_MAXIMIZED;
1492pub const SIZEZOOMSHOW: WPARAM = SIZE_MAXSHOW;
1493pub const SIZEZOOMHIDE: WPARAM = SIZE_MAXHIDE;
1494STRUCT!{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}}
1503pub type LPWINDOWPOS = *mut WINDOWPOS;
1504pub type PWINDOWPOS = *mut WINDOWPOS;
1505STRUCT!{struct NCCALCSIZE_PARAMS {
1506 rgrc: [RECT; 3],
1507 lppos: PWINDOWPOS,
1508}}
1509pub type LPNCCALCSIZE_PARAMS = *mut NCCALCSIZE_PARAMS;
1510pub const WVR_ALIGNTOP: LRESULT = 0x0010;
1511pub const WVR_ALIGNLEFT: LRESULT = 0x0020;
1512pub const WVR_ALIGNBOTTOM: LRESULT = 0x0040;
1513pub const WVR_ALIGNRIGHT: LRESULT = 0x0080;
1514pub const WVR_HREDRAW: LRESULT = 0x0100;
1515pub const WVR_VREDRAW: LRESULT = 0x0200;
1516pub const WVR_REDRAW: LRESULT = WVR_HREDRAW | WVR_VREDRAW;
1517pub const WVR_VALIDRECTS: LRESULT = 0x0400;
1518pub const MK_LBUTTON: WPARAM = 0x0001;
1519pub const MK_RBUTTON: WPARAM = 0x0002;
1520pub const MK_SHIFT: WPARAM = 0x0004;
1521pub const MK_CONTROL: WPARAM = 0x0008;
1522pub const MK_MBUTTON: WPARAM = 0x0010;
1523pub const MK_XBUTTON1: WPARAM = 0x0020;
1524pub const MK_XBUTTON2: WPARAM = 0x0040;
1525pub const TME_HOVER: DWORD = 0x00000001;
1526pub const TME_LEAVE: DWORD = 0x00000002;
1527pub const TME_NONCLIENT: DWORD = 0x00000010;
1528pub const TME_QUERY: DWORD = 0x40000000;
1529pub const TME_CANCEL: DWORD = 0x80000000;
1530pub const HOVER_DEFAULT: DWORD = 0xFFFFFFFF;
1531STRUCT!{struct TRACKMOUSEEVENT {
1532 cbSize: DWORD,
1533 dwFlags: DWORD,
1534 hwndTrack: HWND,
1535 dwHoverTime: DWORD,
1536}}
1537pub type LPTRACKMOUSEEVENT = *mut TRACKMOUSEEVENT;
1538extern "system" {
1539 pub fn TrackMouseEvent(
1540 lpEventTrack: LPTRACKMOUSEEVENT,
1541 ) -> BOOL;
1542}
1543pub const WS_OVERLAPPED: DWORD = 0x00000000;
1544pub const WS_POPUP: DWORD = 0x80000000;
1545pub const WS_CHILD: DWORD = 0x40000000;
1546pub const WS_MINIMIZE: DWORD = 0x20000000;
1547pub const WS_VISIBLE: DWORD = 0x10000000;
1548pub const WS_DISABLED: DWORD = 0x08000000;
1549pub const WS_CLIPSIBLINGS: DWORD = 0x04000000;
1550pub const WS_CLIPCHILDREN: DWORD = 0x02000000;
1551pub const WS_MAXIMIZE: DWORD = 0x01000000;
1552pub const WS_CAPTION: DWORD = 0x00C00000;
1553pub const WS_BORDER: DWORD = 0x00800000;
1554pub const WS_DLGFRAME: DWORD = 0x00400000;
1555pub const WS_VSCROLL: DWORD = 0x00200000;
1556pub const WS_HSCROLL: DWORD = 0x00100000;
1557pub const WS_SYSMENU: DWORD = 0x00080000;
1558pub const WS_THICKFRAME: DWORD = 0x00040000;
1559pub const WS_GROUP: DWORD = 0x00020000;
1560pub const WS_TABSTOP: DWORD = 0x00010000;
1561pub const WS_MINIMIZEBOX: DWORD = 0x00020000;
1562pub const WS_MAXIMIZEBOX: DWORD = 0x00010000;
1563pub const WS_TILED: DWORD = WS_OVERLAPPED;
1564pub const WS_ICONIC: DWORD = WS_MINIMIZE;
1565pub const WS_SIZEBOX: DWORD = WS_THICKFRAME;
1566pub const WS_TILEDWINDOW: DWORD = WS_OVERLAPPEDWINDOW;
1567pub const WS_OVERLAPPEDWINDOW: DWORD = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
1568 | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
1569pub const WS_POPUPWINDOW: DWORD = WS_POPUP | WS_BORDER | WS_SYSMENU;
1570pub const WS_CHILDWINDOW: DWORD = WS_CHILD;
1571pub const WS_EX_DLGMODALFRAME: DWORD = 0x00000001;
1572pub const WS_EX_NOPARENTNOTIFY: DWORD = 0x00000004;
1573pub const WS_EX_TOPMOST: DWORD = 0x00000008;
1574pub const WS_EX_ACCEPTFILES: DWORD = 0x00000010;
1575pub const WS_EX_TRANSPARENT: DWORD = 0x00000020;
1576pub const WS_EX_MDICHILD: DWORD = 0x00000040;
1577pub const WS_EX_TOOLWINDOW: DWORD = 0x00000080;
1578pub const WS_EX_WINDOWEDGE: DWORD = 0x00000100;
1579pub const WS_EX_CLIENTEDGE: DWORD = 0x00000200;
1580pub const WS_EX_CONTEXTHELP: DWORD = 0x00000400;
1581pub const WS_EX_RIGHT: DWORD = 0x00001000;
1582pub const WS_EX_LEFT: DWORD = 0x00000000;
1583pub const WS_EX_RTLREADING: DWORD = 0x00002000;
1584pub const WS_EX_LTRREADING: DWORD = 0x00000000;
1585pub const WS_EX_LEFTSCROLLBAR: DWORD = 0x00004000;
1586pub const WS_EX_RIGHTSCROLLBAR: DWORD = 0x00000000;
1587pub const WS_EX_CONTROLPARENT: DWORD = 0x00010000;
1588pub const WS_EX_STATICEDGE: DWORD = 0x00020000;
1589pub const WS_EX_APPWINDOW: DWORD = 0x00040000;
1590pub const WS_EX_OVERLAPPEDWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE;
1591pub const WS_EX_PALETTEWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
1592pub const WS_EX_LAYERED: DWORD = 0x00080000;
1593pub const WS_EX_NOINHERITLAYOUT: DWORD = 0x00100000;
1594pub const WS_EX_NOREDIRECTIONBITMAP: DWORD = 0x00200000;
1595pub const WS_EX_LAYOUTRTL: DWORD = 0x00400000;
1596pub const WS_EX_COMPOSITED: DWORD = 0x02000000;
1597pub const WS_EX_NOACTIVATE: DWORD = 0x08000000;
1598pub const CS_VREDRAW: UINT = 0x0001;
1599pub const CS_HREDRAW: UINT = 0x0002;
1600pub const CS_DBLCLKS: UINT = 0x0008;
1601pub const CS_OWNDC: UINT = 0x0020;
1602pub const CS_CLASSDC: UINT = 0x0040;
1603pub const CS_PARENTDC: UINT = 0x0080;
1604pub const CS_NOCLOSE: UINT = 0x0200;
1605pub const CS_SAVEBITS: UINT = 0x0800;
1606pub const CS_BYTEALIGNCLIENT: UINT = 0x1000;
1607pub const CS_BYTEALIGNWINDOW: UINT = 0x2000;
1608pub const CS_GLOBALCLASS: UINT = 0x4000;
1609pub const CS_IME: UINT = 0x00010000;
1610pub const CS_DROPSHADOW: UINT = 0x00020000;
1611pub const PRF_CHECKVISIBLE: UINT = 0x00000001;
1612pub const PRF_NONCLIENT: UINT = 0x00000002;
1613pub const PRF_CLIENT: UINT = 0x00000004;
1614pub const PRF_ERASEBKGND: UINT = 0x00000008;
1615pub const PRF_CHILDREN: UINT = 0x00000010;
1616pub const PRF_OWNED: UINT = 0x00000020;
1617pub const BDR_RAISEDOUTER: UINT = 0x0001;
1618pub const BDR_SUNKENOUTER: UINT = 0x0002;
1619pub const BDR_RAISEDINNER: UINT = 0x0004;
1620pub const BDR_SUNKENINNER: UINT = 0x0008;
1621pub const BDR_OUTER: UINT = BDR_RAISEDOUTER | BDR_SUNKENOUTER;
1622pub const BDR_INNER: UINT = BDR_RAISEDINNER | BDR_SUNKENINNER;
1623pub const BDR_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER;
1624pub const BDR_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER;
1625pub const EDGE_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER;
1626pub const EDGE_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER;
1627pub const EDGE_ETCHED: UINT = BDR_SUNKENOUTER | BDR_RAISEDINNER;
1628pub const EDGE_BUMP: UINT = BDR_RAISEDOUTER | BDR_SUNKENINNER;
1629pub const BF_LEFT: UINT = 0x0001;
1630pub const BF_TOP: UINT = 0x0002;
1631pub const BF_RIGHT: UINT = 0x0004;
1632pub const BF_BOTTOM: UINT = 0x0008;
1633pub const BF_TOPLEFT: UINT = BF_TOP | BF_LEFT;
1634pub const BF_TOPRIGHT: UINT = BF_TOP | BF_RIGHT;
1635pub const BF_BOTTOMLEFT: UINT = BF_BOTTOM | BF_LEFT;
1636pub const BF_BOTTOMRIGHT: UINT = BF_BOTTOM | BF_RIGHT;
1637pub const BF_RECT: UINT = BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM;
1638pub const BF_DIAGONAL: UINT = 0x0010;
1639pub const BF_DIAGONAL_ENDTOPRIGHT: UINT = BF_DIAGONAL | BF_TOP | BF_RIGHT;
1640pub const BF_DIAGONAL_ENDTOPLEFT: UINT = BF_DIAGONAL | BF_TOP | BF_LEFT;
1641pub const BF_DIAGONAL_ENDBOTTOMLEFT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_LEFT;
1642pub const BF_DIAGONAL_ENDBOTTOMRIGHT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_RIGHT;
1643pub const BF_MIDDLE: UINT = 0x0800;
1644pub const BF_SOFT: UINT = 0x1000;
1645pub const BF_ADJUST: UINT = 0x2000;
1646pub const BF_FLAT: UINT = 0x4000;
1647pub const BF_MONO: UINT = 0x8000;
1648extern "system" {
1649 pub fn DrawEdge(
1650 hdc: HDC,
1651 qrc: LPRECT,
1652 edge: UINT,
1653 grfFlags: UINT,
1654 ) -> BOOL;
1655}
1656pub const DFC_CAPTION: UINT = 1;
1657pub const DFC_MENU: UINT = 2;
1658pub const DFC_SCROLL: UINT = 3;
1659pub const DFC_BUTTON: UINT = 4;
1660pub const DFC_POPUPMENU: UINT = 5;
1661pub const DFCS_CAPTIONCLOSE: UINT = 0x0000;
1662pub const DFCS_CAPTIONMIN: UINT = 0x0001;
1663pub const DFCS_CAPTIONMAX: UINT = 0x0002;
1664pub const DFCS_CAPTIONRESTORE: UINT = 0x0003;
1665pub const DFCS_CAPTIONHELP: UINT = 0x0004;
1666pub const DFCS_MENUARROW: UINT = 0x0000;
1667pub const DFCS_MENUCHECK: UINT = 0x0001;
1668pub const DFCS_MENUBULLET: UINT = 0x0002;
1669pub const DFCS_MENUARROWRIGHT: UINT = 0x0004;
1670pub const DFCS_SCROLLUP: UINT = 0x0000;
1671pub const DFCS_SCROLLDOWN: UINT = 0x0001;
1672pub const DFCS_SCROLLLEFT: UINT = 0x0002;
1673pub const DFCS_SCROLLRIGHT: UINT = 0x0003;
1674pub const DFCS_SCROLLCOMBOBOX: UINT = 0x0005;
1675pub const DFCS_SCROLLSIZEGRIP: UINT = 0x0008;
1676pub const DFCS_SCROLLSIZEGRIPRIGHT: UINT = 0x0010;
1677pub const DFCS_BUTTONCHECK: UINT = 0x0000;
1678pub const DFCS_BUTTONRADIOIMAGE: UINT = 0x0001;
1679pub const DFCS_BUTTONRADIOMASK: UINT = 0x0002;
1680pub const DFCS_BUTTONRADIO: UINT = 0x0004;
1681pub const DFCS_BUTTON3STATE: UINT = 0x0008;
1682pub const DFCS_BUTTONPUSH: UINT = 0x0010;
1683pub const DFCS_INACTIVE: UINT = 0x0100;
1684pub const DFCS_PUSHED: UINT = 0x0200;
1685pub const DFCS_CHECKED: UINT = 0x0400;
1686pub const DFCS_TRANSPARENT: UINT = 0x0800;
1687pub const DFCS_HOT: UINT = 0x1000;
1688pub const DFCS_ADJUSTRECT: UINT = 0x2000;
1689pub const DFCS_FLAT: UINT = 0x4000;
1690pub const DFCS_MONO: UINT = 0x8000;
1691extern "system" {
1692 pub fn DrawFrameControl(
1693 hdc: HDC,
1694 lprc: LPRECT,
1695 uType: UINT,
1696 uState: UINT,
1697 ) -> BOOL;
1698}
1699pub const DC_ACTIVE: UINT = 0x0001;
1700pub const DC_SMALLCAP: UINT = 0x0002;
1701pub const DC_ICON: UINT = 0x0004;
1702pub const DC_TEXT: UINT = 0x0008;
1703pub const DC_INBUTTON: UINT = 0x0010;
1704pub const DC_GRADIENT: UINT = 0x0020;
1705pub const DC_BUTTONS: UINT = 0x1000;
1706extern "system" {
1707 pub fn DrawCaption(
1708 hwnd: HWND,
1709 hdc: HDC,
1710 lprect: *const RECT,
1711 flags: UINT,
1712 ) -> BOOL;
1713}
1714pub const IDANI_OPEN: c_int = 1;
1715pub const IDANI_CAPTION: c_int = 3;
1716extern "system" {
1717 pub fn DrawAnimatedRects(
1718 hwnd: HWND,
1719 idAni: c_int,
1720 lprcFrom: *const RECT,
1721 lprcTo: *const RECT,
1722 ) -> BOOL;
1723}
1724pub const CF_TEXT: UINT = 1;
1725pub const CF_BITMAP: UINT = 2;
1726pub const CF_METAFILEPICT: UINT = 3;
1727pub const CF_SYLK: UINT = 4;
1728pub const CF_DIF: UINT = 5;
1729pub const CF_TIFF: UINT = 6;
1730pub const CF_OEMTEXT: UINT = 7;
1731pub const CF_DIB: UINT = 8;
1732pub const CF_PALETTE: UINT = 9;
1733pub const CF_PENDATA: UINT = 10;
1734pub const CF_RIFF: UINT = 11;
1735pub const CF_WAVE: UINT = 12;
1736pub const CF_UNICODETEXT: UINT = 13;
1737pub const CF_ENHMETAFILE: UINT = 14;
1738pub const CF_HDROP: UINT = 15;
1739pub const CF_LOCALE: UINT = 16;
1740pub const CF_DIBV5: UINT = 17;
1741pub const CF_MAX: UINT = 18;
1742pub const CF_OWNERDISPLAY: UINT = 0x0080;
1743pub const CF_DSPTEXT: UINT = 0x0081;
1744pub const CF_DSPBITMAP: UINT = 0x0082;
1745pub const CF_DSPMETAFILEPICT: UINT = 0x0083;
1746pub const CF_DSPENHMETAFILE: UINT = 0x008E;
1747pub const CF_PRIVATEFIRST: UINT = 0x0200;
1748pub const CF_PRIVATELAST: UINT = 0x02FF;
1749pub const CF_GDIOBJFIRST: UINT = 0x0300;
1750pub const CF_GDIOBJLAST: UINT = 0x03FF;
1751pub const FVIRTKEY: BYTE = TRUE as u8;
1752pub const FNOINVERT: BYTE = 0x02;
1753pub const FSHIFT: BYTE = 0x04;
1754pub const FCONTROL: BYTE = 0x08;
1755pub const FALT: BYTE = 0x10;
1756STRUCT!{struct ACCEL {
1757 fVirt: BYTE,
1758 key: WORD,
1759 cmd: WORD,
1760}}
1761pub type LPACCEL = *mut ACCEL;
1762STRUCT!{struct PAINTSTRUCT {
1763 hdc: HDC,
1764 fErase: BOOL,
1765 rcPaint: RECT,
1766 fRestore: BOOL,
1767 fIncUpdate: BOOL,
1768 rgbReserved: [BYTE; 32],
1769}}
1770pub type PPAINTSTRUCT = *mut PAINTSTRUCT;
1771pub type NPPAINTSTRUCT = *mut PAINTSTRUCT;
1772pub type LPPAINTSTRUCT = *mut PAINTSTRUCT;
1773STRUCT!{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}}
1787pub type LPCREATESTRUCTA = *mut CREATESTRUCTA;
1788STRUCT!{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}}
1802pub type LPCREATESTRUCTW = *mut CREATESTRUCTW;
1803STRUCT!{struct WINDOWPLACEMENT {
1804 length: UINT,
1805 flags: UINT,
1806 showCmd: UINT,
1807 ptMinPosition: POINT,
1808 ptMaxPosition: POINT,
1809 rcNormalPosition: RECT,
1810}}
1811pub type PWINDOWPLACEMENT = *mut WINDOWPLACEMENT;
1812pub type LPWINDOWPLACEMENT = *mut WINDOWPLACEMENT;
1813pub const WPF_SETMINPOSITION: UINT = 0x0001;
1814pub const WPF_RESTORETOMAXIMIZED: UINT = 0x0002;
1815pub const WPF_ASYNCWINDOWPLACEMENT: UINT = 0x0004;
1816STRUCT!{struct NMHDR {
1817 hwndFrom: HWND,
1818 idFrom: UINT_PTR,
1819 code: UINT,
1820}}
1821pub type LPNMHDR = *mut NMHDR;
1822STRUCT!{struct STYLESTRUCT {
1823 styleOld: DWORD,
1824 styleNew: DWORD,
1825}}
1826pub type LPSTYLESTRUCT = *mut STYLESTRUCT;
1827pub const ODT_MENU: UINT = 1;
1828pub const ODT_LISTBOX: UINT = 2;
1829pub const ODT_COMBOBOX: UINT = 3;
1830pub const ODT_BUTTON: UINT = 4;
1831pub const ODT_STATIC: UINT = 5;
1832pub const ODA_DRAWENTIRE: UINT = 0x0001;
1833pub const ODA_SELECT: UINT = 0x0002;
1834pub const ODA_FOCUS: UINT = 0x0004;
1835pub const ODS_SELECTED: UINT = 0x0001;
1836pub const ODS_GRAYED: UINT = 0x0002;
1837pub const ODS_DISABLED: UINT = 0x0004;
1838pub const ODS_CHECKED: UINT = 0x0008;
1839pub const ODS_FOCUS: UINT = 0x0010;
1840pub const ODS_DEFAULT: UINT = 0x0020;
1841pub const ODS_COMBOBOXEDIT: UINT = 0x1000;
1842pub const ODS_HOTLIGHT: UINT = 0x0040;
1843pub const ODS_INACTIVE: UINT = 0x0080;
1844pub const ODS_NOACCEL: UINT = 0x0100;
1845pub const ODS_NOFOCUSRECT: UINT = 0x0200;
1846STRUCT!{struct MEASUREITEMSTRUCT {
1847 CtlType: UINT,
1848 CtlID: UINT,
1849 itemID: UINT,
1850 itemWidth: UINT,
1851 itemHeight: UINT,
1852 itemData: ULONG_PTR,
1853}}
1854pub type PMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT;
1855pub type LPMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT;
1856STRUCT!{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}}
1867pub type PDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT;
1868pub type LPDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT;
1869STRUCT!{struct DELETEITEMSTRUCT {
1870 CtlType: UINT,
1871 CtlID: UINT,
1872 itemID: UINT,
1873 hwndItem: HWND,
1874 itemData: ULONG_PTR,
1875}}
1876pub type PDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT;
1877pub type LPDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT;
1878STRUCT!{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}}
1888pub type PCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT;
1889pub type LPCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT;
1890extern "system" {
1891 pub fn GetMessageA(
1892 lpMsg: LPMSG,
1893 hWnd: HWND,
1894 wMsgFilterMin: UINT,
1895 wMsgFilterMax: UINT,
1896 ) -> BOOL;
1897 pub fn GetMessageW(
1898 lpMsg: LPMSG,
1899 hWnd: HWND,
1900 wMsgFilterMin: UINT,
1901 wMsgFilterMax: UINT,
1902 ) -> BOOL;
1903 pub fn TranslateMessage(
1904 lpmsg: *const MSG,
1905 ) -> BOOL;
1906 pub fn DispatchMessageA(
1907 lpmsg: *const MSG,
1908 ) -> LRESULT;
1909 pub fn DispatchMessageW(
1910 lpmsg: *const MSG,
1911 ) -> LRESULT;
1912 pub fn SetMessageQueue(
1913 cMessagesMax: c_int,
1914 ) -> BOOL;
1915 pub fn PeekMessageA(
1916 lpMsg: LPMSG,
1917 hWnd: HWND,
1918 wMsgFilterMin: UINT,
1919 wMsgFilterMax: UINT,
1920 wRemoveMsg: UINT,
1921 ) -> BOOL;
1922 pub fn PeekMessageW(
1923 lpMsg: LPMSG,
1924 hWnd: HWND,
1925 wMsgFilterMin: UINT,
1926 wMsgFilterMax: UINT,
1927 wRemoveMsg: UINT,
1928 ) -> BOOL;
1929}
1930pub const PM_NOREMOVE: UINT = 0x0000;
1931pub const PM_REMOVE: UINT = 0x0001;
1932pub const PM_NOYIELD: UINT = 0x0002;
1933pub const PM_QS_INPUT: UINT = QS_INPUT << 16;
1934pub const PM_QS_POSTMESSAGE: UINT = (QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16;
1935pub const PM_QS_PAINT: UINT = QS_PAINT << 16;
1936pub const PM_QS_SENDMESSAGE: UINT = QS_SENDMESSAGE << 16;
1937extern "system" {
1938 pub fn RegisterHotKey(
1939 hwnd: HWND,
1940 id: c_int,
1941 fsModifiers: UINT,
1942 vk: UINT,
1943 ) -> BOOL;
1944 pub fn UnregisterHotKey(
1945 hWnd: HWND,
1946 id: c_int,
1947 ) -> BOOL;
1948}
1949pub const MOD_ALT: LPARAM = 0x0001;
1950pub const MOD_CONTROL: LPARAM = 0x0002;
1951pub const MOD_SHIFT: LPARAM = 0x0004;
1952pub const MOD_WIN: LPARAM = 0x0008;
1953pub const MOD_NOREPEAT: LPARAM = 0x4000;
1954pub const IDHOT_SNAPWINDOW: WPARAM = -1isize as usize;
1955pub const IDHOT_SNAPDESKTOP: WPARAM = -2isize as usize;
1956pub const ENDSESSION_CLOSEAPP: UINT = 0x00000001;
1957pub const ENDSESSION_CRITICAL: UINT = 0x40000000;
1958pub const ENDSESSION_LOGOFF: UINT = 0x80000000;
1959pub const EWX_LOGOFF: UINT = 0x00000000;
1960pub const EWX_SHUTDOWN: UINT = 0x00000001;
1961pub const EWX_REBOOT: UINT = 0x00000002;
1962pub const EWX_FORCE: UINT = 0x00000004;
1963pub const EWX_POWEROFF: UINT = 0x00000008;
1964pub const EWX_FORCEIFHUNG: UINT = 0x00000010;
1965pub const EWX_QUICKRESOLVE: UINT = 0x00000020;
1966pub const EWX_RESTARTAPPS: UINT = 0x00000040;
1967pub const EWX_HYBRID_SHUTDOWN: UINT = 0x00400000;
1968pub const EWX_BOOTOPTIONS: UINT = 0x01000000;
1969// ExitWindows
1970extern "system" {
1971 pub fn ExitWindowsEx(
1972 uFlags: UINT,
1973 dwReason: DWORD,
1974 ) -> BOOL;
1975 pub fn SwapMouseButton(
1976 fSwap: BOOL,
1977 ) -> BOOL;
1978 pub fn GetMessagePos() -> DWORD;
1979 pub fn GetMessageTime() -> LONG;
1980 pub fn GetMessageExtraInfo() -> LPARAM;
1981 pub fn GetUnpredictedMessagePos() -> DWORD;
1982 pub fn IsWow64Message() -> BOOL;
1983 pub fn SetMessageExtraInfo(
1984 lParam: LPARAM,
1985 ) -> LPARAM;
1986 pub fn SendMessageA(
1987 hWnd: HWND,
1988 Msg: UINT,
1989 wParam: WPARAM,
1990 lParam: LPARAM,
1991 ) -> LRESULT;
1992 pub fn SendMessageW(
1993 hWnd: HWND,
1994 Msg: UINT,
1995 wParam: WPARAM,
1996 lParam: LPARAM,
1997 ) -> LRESULT;
1998 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;
2007 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;
2016 pub fn SendNotifyMessageA(
2017 hWnd: HWND,
2018 msg: UINT,
2019 wParam: WPARAM,
2020 lParam: LPARAM,
2021 ) -> BOOL;
2022 pub fn SendNotifyMessageW(
2023 hWnd: HWND,
2024 msg: UINT,
2025 wParam: WPARAM,
2026 lParam: LPARAM,
2027 ) -> BOOL;
2028 pub fn SendMessageCallbackA(
2029 hWnd: HWND,
2030 Msg: UINT,
2031 wParam: WPARAM,
2032 lParam: LPARAM,
2033 lpResultCallBack: SENDASYNCPROC,
2034 dwData: ULONG_PTR,
2035 ) -> BOOL;
2036 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}
2045STRUCT!{struct BSMINFO {
2046 cbSize: UINT,
2047 hdesk: HDESK,
2048 hwnd: HWND,
2049 luid: LUID,
2050}}
2051pub type PBSMINFO = *mut BSMINFO;
2052extern "system" {
2053 pub fn BroadcastSystemMessageExA(
2054 flags: DWORD,
2055 lpInfo: LPDWORD,
2056 Msg: UINT,
2057 wParam: WPARAM,
2058 lParam: LPARAM,
2059 pbsmInfo: PBSMINFO,
2060 ) -> c_long;
2061 pub fn BroadcastSystemMessageExW(
2062 flags: DWORD,
2063 lpInfo: LPDWORD,
2064 Msg: UINT,
2065 wParam: WPARAM,
2066 lParam: LPARAM,
2067 pbsmInfo: PBSMINFO,
2068 ) -> c_long;
2069 pub fn BroadcastSystemMessageA(
2070 flags: DWORD,
2071 lpInfo: LPDWORD,
2072 Msg: UINT,
2073 wParam: WPARAM,
2074 lParam: LPARAM,
2075 ) -> LONG;
2076 pub fn BroadcastSystemMessageW(
2077 flags: DWORD,
2078 lpInfo: LPDWORD,
2079 Msg: UINT,
2080 wParam: WPARAM,
2081 lParam: LPARAM,
2082 ) -> LONG;
2083}
2084pub const BSM_ALLCOMPONENTS: DWORD = 0x00000000;
2085pub const BSM_VXDS: DWORD = 0x00000001;
2086pub const BSM_NETDRIVER: DWORD = 0x00000002;
2087pub const BSM_INSTALLABLEDRIVERS: DWORD = 0x00000004;
2088pub const BSM_APPLICATIONS: DWORD = 0x00000008;
2089pub const BSM_ALLDESKTOPS: DWORD = 0x00000010;
2090pub const BSF_QUERY: DWORD = 0x00000001;
2091pub const BSF_IGNORECURRENTTASK: DWORD = 0x00000002;
2092pub const BSF_FLUSHDISK: DWORD = 0x00000004;
2093pub const BSF_NOHANG: DWORD = 0x00000008;
2094pub const BSF_POSTMESSAGE: DWORD = 0x00000010;
2095pub const BSF_FORCEIFHUNG: DWORD = 0x00000020;
2096pub const BSF_NOTIMEOUTIFNOTHUNG: DWORD = 0x00000040;
2097pub const BSF_ALLOWSFW: DWORD = 0x00000080;
2098pub const BSF_SENDNOTIFYMESSAGE: DWORD = 0x00000100;
2099pub const BSF_RETURNHDESK: DWORD = 0x00000200;
2100pub const BSF_LUID: DWORD = 0x00000400;
2101pub const BROADCAST_QUERY_DENY: DWORD = 0x424D5144;
2102pub type HDEVNOTIFY = PVOID;
2103pub type PHDEVNOTIFY = *mut HDEVNOTIFY;
2104pub const DEVICE_NOTIFY_WINDOW_HANDLE: DWORD = 0x00000000;
2105pub const DEVICE_NOTIFY_SERVICE_HANDLE: DWORD = 0x00000001;
2106pub const DEVICE_NOTIFY_ALL_INTERFACE_CLASSES: DWORD = 0x00000004;
2107extern "system" {
2108 pub fn RegisterDeviceNotificationA(
2109 hRecipient: HANDLE,
2110 notificationFilter: LPVOID,
2111 flags: DWORD,
2112 ) -> HDEVNOTIFY;
2113 pub fn RegisterDeviceNotificationW(
2114 hRecipient: HANDLE,
2115 notificationFilter: LPVOID,
2116 flags: DWORD,
2117 ) -> HDEVNOTIFY;
2118 pub fn UnregisterDeviceNotification(
2119 Handle: HDEVNOTIFY,
2120 ) -> BOOL;
2121}
2122pub type HPOWERNOTIFY = PVOID;
2123pub type PHPOWERNOTIFY = *mut HPOWERNOTIFY;
2124extern "system" {
2125 pub fn RegisterPowerSettingNotification(
2126 hRecipient: HANDLE,
2127 PowerSettingGuid: LPCGUID,
2128 Flags: DWORD,
2129 ) -> HPOWERNOTIFY;
2130 pub fn UnregisterPowerSettingNotification(
2131 Handle: HPOWERNOTIFY,
2132 ) -> BOOL;
2133 pub fn RegisterSuspendResumeNotification(
2134 hRecipient: HANDLE,
2135 Flags: DWORD,
2136 ) -> HPOWERNOTIFY;
2137 pub fn UnregisterSuspendResumeNotification(
2138 Handle: HPOWERNOTIFY,
2139 ) -> BOOL;
2140 pub fn PostMessageA(
2141 hWnd: HWND,
2142 Msg: UINT,
2143 wParam: WPARAM,
2144 lParam: LPARAM,
2145 ) -> BOOL;
2146 pub fn PostMessageW(
2147 hWnd: HWND,
2148 Msg: UINT,
2149 wParam: WPARAM,
2150 lParam: LPARAM,
2151 ) -> BOOL;
2152 pub fn PostThreadMessageA(
2153 idThread: DWORD,
2154 msg: UINT,
2155 wParam: WPARAM,
2156 lParam: LPARAM,
2157 ) -> BOOL;
2158 pub fn PostThreadMessageW(
2159 idThread: DWORD,
2160 msg: UINT,
2161 wParam: WPARAM,
2162 lParam: LPARAM,
2163 ) -> BOOL;
2164}
2165// PostAppMessageA
2166// PostAppMessageW
2167pub const HWND_BROADCAST: HWND = 0xffff as HWND;
2168pub const HWND_MESSAGE: HWND = -3isize as HWND;
2169extern "system" {
2170 pub fn AttachThreadInput(
2171 idAttach: DWORD,
2172 idAttachTo: DWORD,
2173 fAttach: BOOL,
2174 ) -> BOOL;
2175 pub fn ReplyMessage(
2176 lResult: LRESULT,
2177 ) -> BOOL;
2178 pub fn WaitMessage() -> BOOL;
2179 pub fn WaitForInputIdle(
2180 hProcess: HANDLE,
2181 dwMilliseconds: DWORD,
2182 ) -> DWORD;
2183 pub fn DefWindowProcA(
2184 hWnd: HWND,
2185 Msg: UINT,
2186 wParam: WPARAM,
2187 lParam: LPARAM,
2188 ) -> LRESULT;
2189 pub fn DefWindowProcW(
2190 hWnd: HWND,
2191 Msg: UINT,
2192 wParam: WPARAM,
2193 lParam: LPARAM,
2194 ) -> LRESULT;
2195 pub fn PostQuitMessage(
2196 nExitCode: c_int,
2197 );
2198 pub fn CallWindowProcA(
2199 lpPrevWndFunc: WNDPROC,
2200 hWnd: HWND,
2201 Msg: UINT,
2202 wParam: WPARAM,
2203 lParam: LPARAM,
2204 ) -> LRESULT;
2205 pub fn CallWindowProcW(
2206 lpPrevWndFunc: WNDPROC,
2207 hWnd: HWND,
2208 Msg: UINT,
2209 wParam: WPARAM,
2210 lParam: LPARAM,
2211 ) -> LRESULT;
2212 pub fn InSendMessage() -> BOOL;
2213 pub fn InSendMessageEx(
2214 lpReserved: LPVOID,
2215 ) -> DWORD;
2216}
2217pub const ISMEX_NOSEND: DWORD = 0x00000000;
2218pub const ISMEX_SEND: DWORD = 0x00000001;
2219pub const ISMEX_NOTIFY: DWORD = 0x00000002;
2220pub const ISMEX_CALLBACK: DWORD = 0x00000004;
2221pub const ISMEX_REPLIED: DWORD = 0x00000008;
2222extern "system" {
2223 pub fn GetDoubleClickTime() -> UINT;
2224 pub fn SetDoubleClickTime(
2225 uInterval: UINT,
2226 ) -> BOOL;
2227 pub fn RegisterClassA(
2228 lpWndClass: *const WNDCLASSA,
2229 ) -> ATOM;
2230 pub fn RegisterClassW(
2231 lpWndClass: *const WNDCLASSW,
2232 ) -> ATOM;
2233 pub fn UnregisterClassA(
2234 lpClassName: LPCSTR,
2235 hInstance: HINSTANCE,
2236 ) -> BOOL;
2237 pub fn UnregisterClassW(
2238 lpClassName: LPCWSTR,
2239 hInstance: HINSTANCE,
2240 ) -> BOOL;
2241 pub fn GetClassInfoA(
2242 hInstance: HINSTANCE,
2243 lpClassName: LPCSTR,
2244 lpWndClass: LPWNDCLASSA,
2245 ) -> BOOL;
2246 pub fn GetClassInfoW(
2247 hInstance: HINSTANCE,
2248 lpClassName: LPCWSTR,
2249 lpWndClass: LPWNDCLASSW,
2250 ) -> BOOL;
2251 pub fn RegisterClassExA(
2252 lpWndClass: *const WNDCLASSEXA,
2253 ) -> ATOM;
2254 pub fn RegisterClassExW(
2255 lpWndClass: *const WNDCLASSEXW,
2256 ) -> ATOM;
2257 pub fn GetClassInfoExA(
2258 hinst: HINSTANCE,
2259 lpszClass: LPCSTR,
2260 lpwcx: LPWNDCLASSEXA,
2261 ) -> BOOL;
2262 pub fn GetClassInfoExW(
2263 hinst: HINSTANCE,
2264 lpszClass: LPCWSTR,
2265 lpwcx: LPWNDCLASSEXW,
2266 ) -> BOOL;
2267}
2268pub const CW_USEDEFAULT: c_int = 0x80000000;
2269pub const HWND_DESKTOP: HWND = 0 as HWND;
2270FN!{stdcall PREGISTERCLASSNAMEW(
2271 LPCWSTR,
2272) -> BOOLEAN}
2273extern "system" {
2274 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;
2288 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
2305extern "system" {
2306 pub fn IsWindow(
2307 hWnd: HWND,
2308 ) -> BOOL;
2309 pub fn IsMenu(
2310 hMenu: HMENU,
2311 ) -> BOOL;
2312 pub fn IsChild(
2313 hWndParent: HWND,
2314 hWnd: HWND,
2315 ) -> BOOL;
2316 pub fn DestroyWindow(
2317 hWnd: HWND,
2318 ) -> BOOL;
2319 pub fn ShowWindow(
2320 hWnd: HWND,
2321 nCmdShow: c_int,
2322 ) -> BOOL;
2323 pub fn AnimateWindow(
2324 hWnd: HWND,
2325 dwTime: DWORD,
2326 dwFlags: DWORD,
2327 ) -> BOOL;
2328 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}
2340STRUCT!{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}}
2352pub type PUPDATELAYEREDWINDOWINFO = *mut UPDATELAYEREDWINDOWINFO;
2353extern "system" {
2354 pub fn UpdateLayeredWindowIndirect(
2355 hWnd: HWND,
2356 pULWInfo: *mut UPDATELAYEREDWINDOWINFO,
2357 ) -> BOOL;
2358 pub fn GetLayeredWindowAttributes(
2359 hwnd: HWND,
2360 pcrKey: *mut COLORREF,
2361 pbAlpha: *mut BYTE,
2362 pdwFlags: *mut DWORD,
2363 ) -> BOOL;
2364}
2365pub const PW_CLIENTONLY: DWORD = 0x00000001;
2366pub const PW_RENDERFULLCONTENT: DWORD = 0x00000002;
2367extern "system" {
2368 pub fn PrintWindow(
2369 hwnd: HWND,
2370 hdcBlt: HDC,
2371 nFlags: UINT,
2372 ) -> BOOL;
2373 pub fn SetLayeredWindowAttributes(
2374 hwnd: HWND,
2375 crKey: COLORREF,
2376 bAlpha: BYTE,
2377 dwFlags: DWORD,
2378 ) -> BOOL;
2379}
2380pub const LWA_COLORKEY: DWORD = 0x00000001;
2381pub const LWA_ALPHA: DWORD = 0x00000002;
2382pub const ULW_COLORKEY: DWORD = 0x00000001;
2383pub const ULW_ALPHA: DWORD = 0x00000002;
2384pub const ULW_OPAQUE: DWORD = 0x00000004;
2385pub const ULW_EX_NORESIZE: DWORD = 0x00000008;
2386extern "system" {
2387 pub fn ShowWindowAsync(
2388 hWnd: HWND,
2389 nCmdShow: c_int,
2390 ) -> BOOL;
2391 pub fn FlashWindow(
2392 hwnd: HWND,
2393 bInvert: BOOL,
2394 ) -> BOOL;
2395}
2396STRUCT!{struct FLASHWINFO {
2397 cbSize: UINT,
2398 hwnd: HWND,
2399 dwFlags: DWORD,
2400 uCount: UINT,
2401 dwTimeout: DWORD,
2402}}
2403pub type PFLASHWINFO = *mut FLASHWINFO;
2404extern "system" {
2405 pub fn FlashWindowEx(
2406 pfwi: PFLASHWINFO,
2407 ) -> BOOL;
2408}
2409pub const FLASHW_STOP: DWORD = 0;
2410pub const FLASHW_CAPTION: DWORD = 0x00000001;
2411pub const FLASHW_TRAY: DWORD = 0x00000002;
2412pub const FLASHW_ALL: DWORD = FLASHW_CAPTION | FLASHW_TRAY;
2413pub const FLASHW_TIMER: DWORD = 0x00000004;
2414pub const FLASHW_TIMERNOFG: DWORD = 0x0000000C;
2415extern "system" {
2416 pub fn ShowOwnedPopups(
2417 hWnd: HWND,
2418 fShow: BOOL,
2419 ) -> BOOL;
2420 pub fn OpenIcon(
2421 hWnd: HWND,
2422 ) -> BOOL;
2423 pub fn CloseWindow(
2424 hWnd: HWND,
2425 ) -> BOOL;
2426 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;
2434 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;
2443 pub fn GetWindowPlacement(
2444 hWnd: HWND,
2445 lpwndpl: *mut WINDOWPLACEMENT,
2446 ) -> BOOL;
2447 pub fn SetWindowPlacement(
2448 hWnd: HWND,
2449 lpwndpl: *const WINDOWPLACEMENT,
2450 ) -> BOOL;
2451}
2452pub const WDA_NONE: DWORD = 0x00000000;
2453pub const WDA_MONITOR: DWORD = 0x00000001;
2454extern "system" {
2455 pub fn GetWindowDisplayAffinity(
2456 hWnd: HWND,
2457 pdwAffinity: *mut DWORD,
2458 ) -> BOOL;
2459 pub fn SetWindowDisplayAffinity(
2460 hWnd: HWND,
2461 dwAffinity: DWORD,
2462 ) -> BOOL;
2463 pub fn BeginDeferWindowPos(
2464 nNumWindows: c_int,
2465 ) -> HDWP;
2466 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;
2476 pub fn EndDeferWindowPos(
2477 hWinPosInfo: HDWP,
2478 ) -> BOOL;
2479 pub fn IsWindowVisible(
2480 hWnd: HWND,
2481 ) -> BOOL;
2482 pub fn IsIconic(
2483 hWnd: HWND,
2484 ) -> BOOL;
2485 pub fn AnyPopup() -> BOOL;
2486 pub fn BringWindowToTop(
2487 hWnd: HWND,
2488 ) -> BOOL;
2489 pub fn IsZoomed(
2490 hwnd: HWND,
2491 ) -> BOOL;
2492}
2493pub const SWP_NOSIZE: UINT = 0x0001;
2494pub const SWP_NOMOVE: UINT = 0x0002;
2495pub const SWP_NOZORDER: UINT = 0x0004;
2496pub const SWP_NOREDRAW: UINT = 0x0008;
2497pub const SWP_NOACTIVATE: UINT = 0x0010;
2498pub const SWP_FRAMECHANGED: UINT = 0x0020;
2499pub const SWP_SHOWWINDOW: UINT = 0x0040;
2500pub const SWP_HIDEWINDOW: UINT = 0x0080;
2501pub const SWP_NOCOPYBITS: UINT = 0x0100;
2502pub const SWP_NOOWNERZORDER: UINT = 0x0200;
2503pub const SWP_NOSENDCHANGING: UINT = 0x0400;
2504pub const SWP_DRAWFRAME: UINT = SWP_FRAMECHANGED;
2505pub const SWP_NOREPOSITION: UINT = SWP_NOOWNERZORDER;
2506pub const SWP_DEFERERASE: UINT = 0x2000;
2507pub const SWP_ASYNCWINDOWPOS: UINT = 0x4000;
2508pub const HWND_TOP: HWND = 0 as HWND;
2509pub const HWND_BOTTOM: HWND = 1 as HWND;
2510pub const HWND_TOPMOST: HWND = -1isize as HWND;
2511pub const HWND_NOTOPMOST: HWND = -2isize as HWND;
2512STRUCT!{struct DLGTEMPLATE {
2513 style: DWORD,
2514 dwExtendedStyle: DWORD,
2515 cdit: WORD,
2516 x: c_short,
2517 y: c_short,
2518 cx: c_short,
2519 cy: c_short,
2520}}
2521pub type LPDLGTEMPLATEA = *mut DLGTEMPLATE;
2522pub type LPDLGTEMPLATEW = *mut DLGTEMPLATE;
2523pub type LPCDLGTEMPLATEA = *const DLGTEMPLATE;
2524pub type LPCDLGTEMPLATEW = *const DLGTEMPLATE;
2525STRUCT!{struct DLGITEMTEMPLATE {
2526 style: DWORD,
2527 dwExtendedStyle: DWORD,
2528 x: c_short,
2529 y: c_short,
2530 cx: c_short,
2531 cy: c_short,
2532 id: WORD,
2533}}
2534pub type PDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE;
2535pub type PDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE;
2536pub type LPDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE;
2537pub type LPDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE;
2538extern "system" {
2539 pub fn CreateDialogParamA(
2540 hInstance: HINSTANCE,
2541 lpTemplateName: LPCSTR,
2542 hWndParent: HWND,
2543 lpDialogFunc: DLGPROC,
2544 dwInitParam: LPARAM,
2545 ) -> HWND;
2546 pub fn CreateDialogParamW(
2547 hInstance: HINSTANCE,
2548 lpTemplateName: LPCWSTR,
2549 hWndParent: HWND,
2550 lpDialogFunc: DLGPROC,
2551 dwInitParam: LPARAM,
2552 ) -> HWND;
2553 pub fn CreateDialogIndirectParamA(
2554 hInstance: HINSTANCE,
2555 lpTemplate: LPCDLGTEMPLATEA,
2556 hWndParent: HWND,
2557 lpDialogFunc: DLGPROC,
2558 dwInitParam: LPARAM,
2559 ) -> HWND;
2560 pub fn CreateDialogIndirectParamW(
2561 hInstance: HINSTANCE,
2562 lpTemplate: LPCDLGTEMPLATEW,
2563 hWndParent: HWND,
2564 lpDialogFunc: DLGPROC,
2565 dwInitParam: LPARAM,
2566 ) -> HWND;
2567}
2568// CreateDialogA
2569// CreateDialogW
2570// CreateDialogIndirectA
2571// CreateDialogIndirectW
2572extern "system" {
2573 pub fn DialogBoxParamA(
2574 hInstance: HINSTANCE,
2575 lpTemplateName: LPCSTR,
2576 hWndParent: HWND,
2577 lpDialogFunc: DLGPROC,
2578 dwInitParam: LPARAM,
2579 ) -> INT_PTR;
2580 pub fn DialogBoxParamW(
2581 hInstance: HINSTANCE,
2582 lpTemplateName: LPCWSTR,
2583 hWndParent: HWND,
2584 lpDialogFunc: DLGPROC,
2585 dwInitParam: LPARAM,
2586 ) -> INT_PTR;
2587 pub fn DialogBoxIndirectParamA(
2588 hInstance: HINSTANCE,
2589 hDialogTemplate: LPCDLGTEMPLATEA,
2590 hWndParent: HWND,
2591 lpDialogFunc: DLGPROC,
2592 dwInitParam: LPARAM,
2593 ) -> INT_PTR;
2594 pub fn DialogBoxIndirectParamW(
2595 hInstance: HINSTANCE,
2596 hDialogTemplate: LPCDLGTEMPLATEW,
2597 hWndParent: HWND,
2598 lpDialogFunc: DLGPROC,
2599 dwInitParam: LPARAM,
2600 ) -> INT_PTR;
2601}
2602// DialogBoxA
2603// DialogBoxW
2604// DialogBoxIndirectA
2605// DialogBoxIndirectW
2606extern "system" {
2607 pub fn EndDialog(
2608 hDlg: HWND,
2609 nResult: INT_PTR,
2610 ) -> BOOL;
2611 pub fn GetDlgItem(
2612 hDlg: HWND,
2613 nIDDlgItem: c_int,
2614 ) -> HWND;
2615 pub fn SetDlgItemInt(
2616 hDlg: HWND,
2617 nIDDlgItem: c_int,
2618 uValue: UINT,
2619 bSigned: BOOL,
2620 ) -> BOOL;
2621 pub fn GetDlgItemInt(
2622 hDlg: HWND,
2623 nIDDlgItem: c_int,
2624 lpTranslated: *mut BOOL,
2625 bSigned: BOOL,
2626 ) -> UINT;
2627 pub fn SetDlgItemTextA(
2628 hDlg: HWND,
2629 nIDDlgItem: c_int,
2630 lpString: LPCSTR,
2631 ) -> BOOL;
2632 pub fn SetDlgItemTextW(
2633 hDlg: HWND,
2634 nIDDlgItem: c_int,
2635 lpString: LPCWSTR,
2636 ) -> BOOL;
2637 pub fn GetDlgItemTextA(
2638 hDlg: HWND,
2639 nIDDlgItem: c_int,
2640 lpString: LPSTR,
2641 nMaxCount: c_int,
2642 ) -> UINT;
2643 pub fn GetDlgItemTextW(
2644 hDlg: HWND,
2645 nIDDlgItem: c_int,
2646 lpString: LPWSTR,
2647 nMaxCount: c_int,
2648 ) -> UINT;
2649 pub fn CheckDlgButton(
2650 hDlg: HWND,
2651 nIDButton: c_int,
2652 uCheck: UINT,
2653 ) -> BOOL;
2654 pub fn CheckRadioButton(
2655 hDlg: HWND,
2656 nIDFirstButton: c_int,
2657 nIDLasatButton: c_int,
2658 nIDCheckButton: c_int,
2659 ) -> BOOL;
2660 pub fn IsDlgButtonChecked(
2661 hDlg: HWND,
2662 nIDButton: c_int,
2663 ) -> UINT;
2664 pub fn SendDlgItemMessageA(
2665 hDlg: HWND,
2666 nIDDlgItem: c_int,
2667 Msg: UINT,
2668 wParam: WPARAM,
2669 lParam: LPARAM,
2670 ) -> LRESULT;
2671 pub fn SendDlgItemMessageW(
2672 hDlg: HWND,
2673 nIDDlgItem: c_int,
2674 Msg: UINT,
2675 wParam: WPARAM,
2676 lParam: LPARAM,
2677 ) -> LRESULT;
2678 pub fn GetNextDlgGroupItem(
2679 hDlg: HWND,
2680 hCtl: HWND,
2681 bPrevious: BOOL,
2682 ) -> HWND;
2683 pub fn GetNextDlgTabItem(
2684 hDlg: HWND,
2685 hCtl: HWND,
2686 bPrevious: BOOL,
2687 ) -> HWND;
2688 pub fn GetDlgCtrlID(
2689 hwnd: HWND,
2690 ) -> c_int;
2691 pub fn GetDialogBaseUnits() -> LONG;
2692 pub fn DefDlgProcA(
2693 hDlg: HWND,
2694 msg: UINT,
2695 wParam: WPARAM,
2696 lParam: LPARAM,
2697 ) -> LRESULT;
2698 pub fn DefDlgProcW(
2699 hDlg: HWND,
2700 msg: UINT,
2701 wParam: WPARAM,
2702 lParam: LPARAM,
2703 ) -> LRESULT;
60c5eb7d
XL
2704}
2705ENUM!{enum DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS {
2706 DCDC_DEFAULT = 0x0000,
2707 DCDC_DISABLE_FONT_UPDATE = 0x0001,
2708 DCDC_DISABLE_RELAYOUT = 0x0002,
2709}}
2710extern "system" {
2711 pub fn SetDialogControlDpiChangeBehavior(
2712 hwnd: HWND,
2713 mask: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS,
2714 values: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS,
2715 ) -> BOOL;
2716 pub fn GetDialogControlDpiChangeBehavior(
2717 hwnd: HWND,
2718 ) -> DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS;
2719}
2720ENUM!{enum DIALOG_DPI_CHANGE_BEHAVIORS {
2721 DDC_DEFAULT = 0x0000,
2722 DDC_DISABLE_ALL = 0x0001,
2723 DDC_DISABLE_RESIZE = 0x0002,
2724 DDC_DISABLE_CONTROL_RELAYOUT = 0x0004,
2725}}
2726extern "system" {
2727 pub fn SetDialogDpiChangeBehavior(
2728 hDlg: HWND,
2729 mask: DIALOG_DPI_CHANGE_BEHAVIORS,
2730 values: DIALOG_DPI_CHANGE_BEHAVIORS,
2731 ) -> BOOL;
2732 pub fn GetDialogDpiChangeBehavior(
2733 hDlg: HWND,
2734 ) -> DIALOG_DPI_CHANGE_BEHAVIORS;
ff7c6d11
XL
2735 pub fn CallMsgFilterA(
2736 lpMsg: LPMSG,
2737 nCode: c_int,
2738 ) -> BOOL;
2739 pub fn CallMsgFilterW(
2740 lpMsg: LPMSG,
2741 nCode: c_int,
2742 ) -> BOOL;
2743 pub fn OpenClipboard(
2744 hWnd: HWND,
2745 ) -> BOOL;
2746 pub fn CloseClipboard() -> BOOL;
2747 pub fn GetClipboardSequenceNumber() -> DWORD;
2748 pub fn GetClipboardOwner() -> HWND;
2749 pub fn SetClipboardViewer(
2750 hWndNewViewer: HWND,
2751 ) -> HWND;
2752 pub fn GetClipboardViewer() -> HWND;
2753 pub fn ChangeClipboardChain(
2754 hwndRemove: HWND,
2755 hwndNewNext: HWND,
2756 ) -> BOOL;
2757 pub fn SetClipboardData(
2758 uFormat: UINT,
2759 hMem: HANDLE,
2760 ) -> HANDLE;
2761 pub fn GetClipboardData(
2762 uFormat: UINT,
2763 ) -> HANDLE;
2764 pub fn RegisterClipboardFormatA(
2765 lpszFormat: LPCSTR,
2766 ) -> UINT;
2767 pub fn RegisterClipboardFormatW(
2768 lpszFormat: LPCWSTR,
2769 ) -> UINT;
2770 pub fn CountClipboardFormats() -> c_int;
2771 pub fn EnumClipboardFormats(
2772 format: UINT,
2773 ) -> UINT;
2774 pub fn GetClipboardFormatNameA(
2775 format: UINT,
2776 lpszFormatName: LPSTR,
2777 cchMaxCount: c_int,
2778 ) -> c_int;
2779 pub fn GetClipboardFormatNameW(
2780 format: UINT,
2781 lpszFormatName: LPWSTR,
2782 cchMaxCount: c_int,
2783 ) -> c_int;
2784 pub fn EmptyClipboard() -> BOOL;
2785 pub fn IsClipboardFormatAvailable(
2786 format: UINT,
2787 ) -> BOOL;
2788 pub fn GetPriorityClipboardFormat(
2789 paFormatPriorityList: *mut UINT,
2790 cFormats: c_int,
2791 ) -> c_int;
2792 pub fn GetOpenClipboardWindow() -> HWND;
2793 pub fn AddClipboardFormatListener(
2794 hWnd: HWND,
2795 ) -> BOOL;
2796 pub fn RemoveClipboardFormatListener(
2797 hWnd: HWND,
2798 ) -> BOOL;
2799 pub fn GetUpdatedClipboardFormats(
2800 lpuiFormats: PUINT,
2801 cFormats: UINT,
2802 pcFormatsOUT: PUINT,
2803 ) -> BOOL;
2804 pub fn CharToOemA(
2805 pSrc: LPCSTR,
2806 pDst: LPSTR,
2807 ) -> BOOL;
2808 pub fn CharToOemW(
2809 pSrc: LPCWSTR,
2810 pDst: LPSTR,
2811 ) -> BOOL;
2812 pub fn OemToCharA(
2813 pSrc: LPCSTR,
2814 pDst: LPSTR,
2815 ) -> BOOL;
2816 pub fn OemToCharW(
2817 pSrc: LPCSTR,
2818 pDst: LPWSTR,
2819 ) -> BOOL;
2820 pub fn CharToOemBuffA(
2821 lpszSrc: LPCSTR,
2822 lpszDst: LPSTR,
2823 cchDstLength: DWORD,
2824 ) -> BOOL;
2825 pub fn CharToOemBuffW(
2826 lpszSrc: LPCWSTR,
2827 lpszDst: LPSTR,
2828 cchDstLength: DWORD,
2829 ) -> BOOL;
2830 pub fn OemToCharBuffA(
2831 lpszSrc: LPCSTR,
2832 lpszDst: LPSTR,
2833 cchDstLength: DWORD,
2834 ) -> BOOL;
2835 pub fn OemToCharBuffW(
2836 lpszSrc: LPCSTR,
2837 lpszDst: LPWSTR,
2838 cchDstLength: DWORD,
2839 ) -> BOOL;
2840 pub fn CharUpperA(
2841 lpsz: LPSTR,
2842 ) -> LPSTR;
2843 pub fn CharUpperW(
2844 lpsz: LPWSTR,
2845 ) -> LPWSTR;
2846 pub fn CharUpperBuffA(
2847 lpsz: LPSTR,
2848 cchLength: DWORD,
2849 ) -> DWORD;
2850 pub fn CharUpperBuffW(
2851 lpsz: LPWSTR,
2852 cchLength: DWORD,
2853 ) -> DWORD;
2854 pub fn CharLowerA(
2855 lpsz: LPSTR,
2856 ) -> LPSTR;
2857 pub fn CharLowerW(
2858 lpsz: LPWSTR,
2859 ) -> LPWSTR;
2860 pub fn CharLowerBuffA(
2861 lpsz: LPSTR,
2862 cchLength: DWORD,
2863 ) -> DWORD;
2864 pub fn CharLowerBuffW(
2865 lpsz: LPWSTR,
2866 cchLength: DWORD,
2867 ) -> DWORD;
2868 pub fn CharNextA(
2869 lpsz: LPCSTR,
2870 ) -> LPSTR;
2871 pub fn CharNextW(
2872 lpsz: LPCWSTR,
2873 ) -> LPWSTR;
2874 pub fn CharPrevA(
2875 lpszStart: LPCSTR,
2876 lpszCurrent: LPCSTR,
2877 ) -> LPSTR;
2878 pub fn CharPrevW(
2879 lpszStart: LPCWSTR,
2880 lpszCurrent: LPCWSTR,
2881 ) -> LPWSTR;
2882 pub fn CharNextExA(
2883 codePage: WORD,
2884 lpCurrentChar: LPSTR,
2885 dwFlags: DWORD,
2886 ) -> LPSTR;
2887 pub fn CharPrevExA(
2888 codePage: WORD,
2889 lpStart: LPCSTR,
2890 lpCurrentChar: LPCSTR,
2891 dwFlags: DWORD,
2892 ) -> LPSTR;
2893}
2894// AnsiToOem
2895// OemToAnsi
2896// AnsiToOemBuff
2897// OemToAnsiBuff
2898// AnsiUpper
2899// AnsiUpperBuff
2900// AnsiLower
2901// AnsiLowerBuff
2902// AnsiNext
2903// AnsiPrev
2904extern "system" {
2905 pub fn IsCharAlphaA(
2906 ch: CHAR,
2907 ) -> BOOL;
2908 pub fn IsCharAlphaW(
2909 ch: WCHAR,
2910 ) -> BOOL;
2911 pub fn IsCharAlphaNumericA(
2912 ch: CHAR,
2913 ) -> BOOL;
2914 pub fn IsCharAlphaNumericW(
2915 ch: WCHAR,
2916 ) -> BOOL;
2917 pub fn IsCharUpperA(
2918 ch: CHAR,
2919 ) -> BOOL;
2920 pub fn IsCharUpperW(
2921 ch: WCHAR,
2922 ) -> BOOL;
2923 pub fn IsCharLowerA(
2924 ch: CHAR,
2925 ) -> BOOL;
2926 pub fn IsCharLowerW(
2927 ch: WCHAR,
2928 ) -> BOOL;
2929 pub fn SetFocus(
2930 hWnd: HWND,
2931 ) -> HWND;
2932 pub fn GetActiveWindow() -> HWND;
2933 pub fn GetFocus() -> HWND;
2934 pub fn GetKBCodePage() -> UINT;
2935 pub fn GetKeyState(
2936 nVirtKey: c_int,
2937 ) -> SHORT;
2938 pub fn GetAsyncKeyState(
2939 vKey: c_int,
2940 ) -> SHORT;
2941 pub fn GetKeyboardState(
2942 lpKeyState: PBYTE,
2943 ) -> BOOL;
2944 pub fn SetKeyboardState(
2945 lpKeyState: LPBYTE,
2946 ) -> BOOL;
2947 pub fn GetKeyNameTextA(
2948 lparam: LONG,
2949 lpString: LPSTR,
2950 cchSize: c_int,
2951 ) -> c_int;
2952 pub fn GetKeyNameTextW(
2953 lParam: LONG,
2954 lpString: LPWSTR,
2955 cchSize: c_int,
2956 ) -> c_int;
2957 pub fn GetKeyboardType(
2958 nTypeFlag: c_int,
2959 ) -> c_int;
2960 pub fn ToAscii(
2961 uVirtKey: UINT,
2962 uScanCode: UINT,
2963 lpKeyState: *const BYTE,
2964 lpChar: LPWORD,
2965 uFlags: UINT,
2966 ) -> c_int;
2967 pub fn ToAsciiEx(
2968 uVirtKey: UINT,
2969 uScanCode: UINT,
2970 lpKeyState: *const BYTE,
2971 lpChar: LPWORD,
2972 uFlags: UINT,
2973 dwhkl: HKL,
2974 ) -> c_int;
2975 pub fn ToUnicode(
2976 wVirtKey: UINT,
2977 wScanCode: UINT,
2978 lpKeyState: *const BYTE,
2979 lwszBuff: LPWSTR,
2980 cchBuff: c_int,
2981 wFlags: UINT,
2982 ) -> c_int;
2983 pub fn OemKeyScan(
2984 wOemChar: WORD,
2985 ) -> DWORD;
2986 pub fn VkKeyScanA(
2987 ch: CHAR,
2988 ) -> SHORT;
2989 pub fn VkKeyScanW(
2990 ch: WCHAR,
2991 ) -> SHORT;
2992 pub fn VkKeyScanExA(
2993 ch: CHAR,
2994 dwhkl: HKL,
2995 ) -> SHORT;
2996 pub fn VkKeyScanExW(
2997 ch: WCHAR,
2998 dwhkl: HKL,
2999 ) -> SHORT;
3000}
3001pub const KEYEVENTF_EXTENDEDKEY: DWORD = 0x0001;
3002pub const KEYEVENTF_KEYUP: DWORD = 0x0002;
3003pub const KEYEVENTF_UNICODE: DWORD = 0x0004;
3004pub const KEYEVENTF_SCANCODE: DWORD = 0x0008;
3005extern "system" {
3006 pub fn keybd_event(
3007 bVk: BYTE,
3008 bScan: BYTE,
3009 dwFlags: DWORD,
3010 dwExtraInfo: ULONG_PTR,
3011 );
3012}
3013pub const MOUSEEVENTF_MOVE: DWORD = 0x0001;
3014pub const MOUSEEVENTF_LEFTDOWN: DWORD = 0x0002;
3015pub const MOUSEEVENTF_LEFTUP: DWORD = 0x0004;
3016pub const MOUSEEVENTF_RIGHTDOWN: DWORD = 0x0008;
3017pub const MOUSEEVENTF_RIGHTUP: DWORD = 0x0010;
3018pub const MOUSEEVENTF_MIDDLEDOWN: DWORD = 0x0020;
3019pub const MOUSEEVENTF_MIDDLEUP: DWORD = 0x0040;
3020pub const MOUSEEVENTF_XDOWN: DWORD = 0x0080;
3021pub const MOUSEEVENTF_XUP: DWORD = 0x0100;
3022pub const MOUSEEVENTF_WHEEL: DWORD = 0x0800;
3023pub const MOUSEEVENTF_HWHEEL: DWORD = 0x01000;
3024pub const MOUSEEVENTF_MOVE_NOCOALESCE: DWORD = 0x2000;
3025pub const MOUSEEVENTF_VIRTUALDESK: DWORD = 0x4000;
3026pub const MOUSEEVENTF_ABSOLUTE: DWORD = 0x8000;
3027extern "system" {
3028 pub fn mouse_event(
3029 dwFlags: DWORD,
3030 dx: DWORD,
3031 dy: DWORD,
3032 dwData: DWORD,
3033 dwExtraInfo: ULONG_PTR,
3034 );
3035}
3036STRUCT!{struct MOUSEINPUT {
3037 dx: LONG,
3038 dy: LONG,
3039 mouseData: DWORD,
3040 dwFlags: DWORD,
3041 time: DWORD,
3042 dwExtraInfo: ULONG_PTR,
3043}}
3044pub type PMOUSEINPUT = *mut MOUSEINPUT;
3045pub type LPMOUSEINPUT = *mut MOUSEINPUT;
3046STRUCT!{struct KEYBDINPUT {
3047 wVk: WORD,
3048 wScan: WORD,
3049 dwFlags: DWORD,
3050 time: DWORD,
3051 dwExtraInfo: ULONG_PTR,
3052}}
3053pub type PKEYBDINPUT = *mut KEYBDINPUT;
3054pub type LPKEYBDINPUT = *mut KEYBDINPUT;
3055STRUCT!{struct HARDWAREINPUT {
3056 uMsg: DWORD,
3057 wParamL: WORD,
3058 wParamH: WORD,
3059}}
3060pub type PHARDWAREINPUT = *mut HARDWAREINPUT;
3061pub type LPHARDWAREINPUT= *mut HARDWAREINPUT;
3062pub const INPUT_MOUSE: DWORD = 0;
3063pub const INPUT_KEYBOARD: DWORD = 1;
3064pub const INPUT_HARDWARE: DWORD = 2;
3065UNION!{union INPUT_u {
3066 [u32; 6] [u64; 4],
3067 mi mi_mut: MOUSEINPUT,
3068 ki ki_mut: KEYBDINPUT,
3069 hi hi_mut: HARDWAREINPUT,
3070}}
3071STRUCT!{struct INPUT {
3072 type_: DWORD,
3073 u: INPUT_u,
3074}}
3075pub type PINPUT = *mut INPUT;
3076pub type LPINPUT = *mut INPUT;
3077extern "system" {
3078 pub fn SendInput(
3079 cInputs: UINT,
3080 pInputs: LPINPUT,
3081 cbSize: c_int,
3082 ) -> UINT;
3083}
0bf4aa26 3084DECLARE_HANDLE!{HTOUCHINPUT, HTOUCHINPUT__}
ff7c6d11
XL
3085STRUCT!{struct TOUCHINPUT {
3086 x: LONG,
3087 y: LONG,
3088 hSource: HANDLE,
3089 dwID: DWORD,
3090 dwFlags: DWORD,
3091 dwMask: DWORD,
3092 dwTime: DWORD,
3093 dwExtraInfo: ULONG_PTR,
3094 cxContact: DWORD,
3095 cyContact: DWORD,
3096}}
3097pub type PTOUCHINPUT = *mut TOUCHINPUT;
3098pub type PCTOUCHINPUT = *const TOUCHINPUT;
3099// TOUCH_COORD_TO_PIXEL
3100pub const TOUCHEVENTF_MOVE: DWORD = 0x0001;
3101pub const TOUCHEVENTF_DOWN: DWORD = 0x0002;
3102pub const TOUCHEVENTF_UP: DWORD = 0x0004;
3103pub const TOUCHEVENTF_INRANGE: DWORD = 0x0008;
3104pub const TOUCHEVENTF_PRIMARY: DWORD = 0x0010;
3105pub const TOUCHEVENTF_NOCOALESCE: DWORD = 0x0020;
3106pub const TOUCHEVENTF_PEN: DWORD = 0x0040;
3107pub const TOUCHEVENTF_PALM: DWORD = 0x0080;
3108pub const TOUCHINPUTMASKF_TIMEFROMSYSTEM: DWORD = 0x0001;
3109pub const TOUCHINPUTMASKF_EXTRAINFO: DWORD = 0x0002;
3110pub const TOUCHINPUTMASKF_CONTACTAREA: DWORD = 0x0004;
3111extern "system" {
3112 pub fn GetTouchInputInfo(
3113 hTouchInput: HTOUCHINPUT,
3114 cInputs: c_uint,
3115 pInputs: PTOUCHINPUT,
3116 cbSize: c_int,
3117 ) -> BOOL;
3118 pub fn CloseTouchInputHandle(
3119 hTouchInput: HTOUCHINPUT,
3120 ) -> BOOL;
3121}
3122pub const TWF_FINETOUCH: DWORD = 0x00000001;
3123pub const TWF_WANTPALM: DWORD = 0x00000002;
3124extern "system" {
3125 pub fn RegisterTouchWindow(
3126 hWnd: HWND,
3127 flags: ULONG,
3128 ) -> BOOL;
3129 pub fn UnregisterTouchWindow(
3130 hwnd: HWND,
3131 ) -> BOOL;
3132 pub fn IsTouchWindow(
3133 hwnd: HWND,
3134 pulFlags: PULONG,
3135 ) -> BOOL;
3136}
3137ENUM!{enum POINTER_INPUT_TYPE {
3138 PT_POINTER = 0x00000001,
3139 PT_TOUCH = 0x00000002,
3140 PT_PEN = 0x00000003,
3141 PT_MOUSE = 0x00000004,
3142 PT_TOUCHPAD = 0x00000005,
3143}}
3144ENUM!{enum POINTER_FLAGS {
3145 POINTER_FLAG_NONE = 0x00000000,
3146 POINTER_FLAG_NEW = 0x00000001,
3147 POINTER_FLAG_INRANGE = 0x00000002,
3148 POINTER_FLAG_INCONTACT = 0x00000004,
3149 POINTER_FLAG_FIRSTBUTTON = 0x00000010,
3150 POINTER_FLAG_SECONDBUTTON = 0x00000020,
3151 POINTER_FLAG_THIRDBUTTON = 0x00000040,
3152 POINTER_FLAG_FOURTHBUTTON = 0x00000080,
3153 POINTER_FLAG_FIFTHBUTTON = 0x00000100,
3154 POINTER_FLAG_PRIMARY = 0x00002000,
3155 POINTER_FLAG_CONFIDENCE = 0x00004000,
3156 POINTER_FLAG_CANCELED = 0x00008000,
3157 POINTER_FLAG_DOWN = 0x00010000,
3158 POINTER_FLAG_UPDATE = 0x00020000,
3159 POINTER_FLAG_UP = 0x00040000,
3160 POINTER_FLAG_WHEEL = 0x00080000,
3161 POINTER_FLAG_HWHEEL = 0x00100000,
3162 POINTER_FLAG_CAPTURECHANGED = 0x00200000,
3163 POINTER_FLAG_HASTRANSFORM = 0x00400000,
3164}}
3165pub const POINTER_MOD_SHIFT: DWORD = 0x0004;
3166pub const POINTER_MOD_CTRL: DWORD = 0x0008;
3167ENUM!{enum POINTER_BUTTON_CHANGE_TYPE {
3168 POINTER_CHANGE_NONE,
3169 POINTER_CHANGE_FIRSTBUTTON_DOWN,
3170 POINTER_CHANGE_FIRSTBUTTON_UP,
3171 POINTER_CHANGE_SECONDBUTTON_DOWN,
3172 POINTER_CHANGE_SECONDBUTTON_UP,
3173 POINTER_CHANGE_THIRDBUTTON_DOWN,
3174 POINTER_CHANGE_THIRDBUTTON_UP,
3175 POINTER_CHANGE_FOURTHBUTTON_DOWN,
3176 POINTER_CHANGE_FOURTHBUTTON_UP,
3177 POINTER_CHANGE_FIFTHBUTTON_DOWN,
3178 POINTER_CHANGE_FIFTHBUTTON_UP,
3179}}
3180STRUCT!{struct POINTER_INFO {
3181 pointerType: POINTER_INPUT_TYPE,
3182 pointerId: UINT32,
3183 frameId: UINT32,
3184 pointerFlags: POINTER_FLAGS,
3185 sourceDevice: HANDLE,
3186 hwndTarget: HWND,
3187 ptPixelLocation: POINT,
3188 ptHimetricLocation: POINT,
3189 ptPixelLocationRaw: POINT,
3190 ptHimetricLocationRaw: POINT,
3191 dwTime: DWORD,
3192 historyCount: UINT32,
3193 InputData: INT32,
3194 dwKeyStates: DWORD,
3195 PerformanceCount: UINT64,
3196 ButtonChangeType: POINTER_BUTTON_CHANGE_TYPE,
3197}}
3198ENUM!{enum TOUCH_FLAGS {
3199 TOUCH_FLAG_NONE = 0x00000000,
3200}}
3201ENUM!{enum TOUCH_MASK {
3202 TOUCH_MASK_NONE = 0x00000000,
3203 TOUCH_MASK_CONTACTAREA = 0x00000001,
3204 TOUCH_MASK_ORIENTATION = 0x00000002,
3205 TOUCH_MASK_PRESSURE = 0x00000004,
3206}}
3207STRUCT!{struct POINTER_TOUCH_INFO {
3208 pointerInfo: POINTER_INFO,
3209 touchFlags: TOUCH_FLAGS,
3210 touchMask: TOUCH_MASK,
3211 rcContact: RECT,
3212 rcContactRaw: RECT,
3213 orientation: UINT32,
3214 pressure: UINT32,
3215}}
3216ENUM!{enum PEN_FLAGS {
3217 PEN_FLAG_NONE = 0x00000000,
3218 PEN_FLAG_BARREL = 0x00000001,
3219 PEN_FLAG_INVERTED = 0x00000002,
3220 PEN_FLAG_ERASER = 0x00000004,
3221}}
3222ENUM!{enum PEN_MASK {
3223 PEN_MASK_NONE = 0x00000000,
3224 PEN_MASK_PRESSURE = 0x00000001,
3225 PEN_MASK_ROTATION = 0x00000002,
3226 PEN_MASK_TILT_X = 0x00000004,
3227 PEN_MASK_TILT_Y = 0x00000008,
3228}}
3229STRUCT!{struct POINTER_PEN_INFO {
3230 pointerInfo: POINTER_INFO,
3231 penFlags: PEN_FLAGS,
3232 penMask: PEN_MASK,
3233 pressure: UINT32,
3234 rotation: UINT32,
3235 tiltX: INT32,
3236 tiltY: INT32,
3237}}
3238pub const POINTER_MESSAGE_FLAG_NEW: DWORD = 0x00000001;
3239pub const POINTER_MESSAGE_FLAG_INRANGE: DWORD = 0x00000002;
3240pub const POINTER_MESSAGE_FLAG_INCONTACT: DWORD = 0x00000004;
3241pub const POINTER_MESSAGE_FLAG_FIRSTBUTTON: DWORD = 0x00000010;
3242pub const POINTER_MESSAGE_FLAG_SECONDBUTTON: DWORD = 0x00000020;
3243pub const POINTER_MESSAGE_FLAG_THIRDBUTTON: DWORD = 0x00000040;
3244pub const POINTER_MESSAGE_FLAG_FOURTHBUTTON: DWORD = 0x00000080;
3245pub const POINTER_MESSAGE_FLAG_FIFTHBUTTON: DWORD = 0x00000100;
3246pub const POINTER_MESSAGE_FLAG_PRIMARY: DWORD = 0x00002000;
3247pub const POINTER_MESSAGE_FLAG_CONFIDENCE: DWORD = 0x00004000;
3248pub const POINTER_MESSAGE_FLAG_CANCELED: DWORD = 0x00008000;
3249pub const PA_ACTIVATE: UINT = MA_ACTIVATE;
3250pub const PA_NOACTIVATE: UINT = MA_NOACTIVATE;
3251pub const MAX_TOUCH_COUNT: UINT32 = 256;
3252pub const TOUCH_FEEDBACK_DEFAULT: DWORD = 0x1;
3253pub const TOUCH_FEEDBACK_INDIRECT: DWORD = 0x2;
3254pub const TOUCH_FEEDBACK_NONE: DWORD = 0x3;
3255extern "system" {
3256 pub fn InitializeTouchInjection(
3257 maxCount: UINT32,
3258 dwMode: DWORD,
3259 ) -> BOOL;
3260 pub fn InjectTouchInput(
3261 count: UINT32,
3262 contacts: *const POINTER_TOUCH_INFO,
3263 ) -> BOOL;
3264}
3265STRUCT!{struct USAGE_PROPERTIES {
3266 level: USHORT,
3267 page: USHORT,
3268 usage: USHORT,
3269 logicalMinimum: INT32,
3270 logicalMaximum: INT32,
3271 unit: USHORT,
3272 exponent: USHORT,
3273 count: BYTE,
3274 physicalMinimum: INT32,
3275 physicalMaximum: INT32,
3276}}
3277pub type PUSAGE_PROPERTIES = *mut USAGE_PROPERTIES;
3278UNION!{union POINTER_TYPE_INFO_u {
3279 [u64; 17] [u64; 18],
3280 touchInfo touchInfo_mut: POINTER_TOUCH_INFO,
3281 penInfo penInfo_mut: POINTER_PEN_INFO,
3282}}
3283STRUCT!{struct POINTER_TYPE_INFO {
3284 type_: POINTER_INPUT_TYPE,
3285 u: POINTER_TYPE_INFO_u,
3286}}
3287pub type PPOINTER_TYPE_INFO = *mut POINTER_TYPE_INFO;
3288STRUCT!{struct INPUT_INJECTION_VALUE {
3289 page: USHORT,
3290 usage: USHORT,
3291 value: INT32,
3292 index: USHORT,
3293}}
3294pub type PINPUT_INJECTION_VALUE = *mut INPUT_INJECTION_VALUE;
3295extern "system" {
3296 pub fn GetPointerType(
3297 pointerId: UINT32,
3298 pointerType: *mut POINTER_INPUT_TYPE,
3299 ) -> BOOL;
3300 pub fn GetPointerCursorId(
3301 pointerId: UINT32,
3302 cursorId: *mut UINT32,
3303 ) -> BOOL;
3304 pub fn GetPointerInfo(
3305 pointerId: UINT32,
3306 pointerInfo: *mut POINTER_INFO,
3307 ) -> BOOL;
3308 pub fn GetPointerInfoHistory(
3309 pointerId: UINT32,
3310 entriesCount: *mut UINT32,
3311 pointerInfo: *mut POINTER_INFO,
3312 ) -> BOOL;
3313 pub fn GetPointerFrameInfo(
3314 pointerId: UINT32,
3315 pointerCount: *mut UINT32,
3316 pointerInfo: *mut POINTER_INFO,
3317 ) -> BOOL;
3318 pub fn GetPointerFrameInfoHistory(
3319 pointerId: UINT32,
3320 entriesCount: *mut UINT32,
3321 pointerCount: *mut UINT32,
3322 pointerInfo: *mut POINTER_INFO,
3323 ) -> BOOL;
3324 pub fn GetPointerTouchInfo(
3325 pointerId: UINT32,
3326 touchInfo: *mut POINTER_TOUCH_INFO,
3327 ) -> BOOL;
3328 pub fn GetPointerTouchInfoHistory(
3329 pointerId: UINT32,
3330 entriesCount: *mut UINT32,
3331 touchInfo: *mut POINTER_TOUCH_INFO,
3332 ) -> BOOL;
3333 pub fn GetPointerFrameTouchInfo(
3334 pointerId: UINT32,
3335 pointerCount: *mut UINT32,
3336 touchInfo: *mut POINTER_TOUCH_INFO,
3337 ) -> BOOL;
3338 pub fn GetPointerFrameTouchInfoHistory(
3339 pointerId: UINT32,
3340 entriesCount: *mut UINT32,
3341 pointerCount: *mut UINT32,
3342 touchInfo: *mut POINTER_TOUCH_INFO,
3343 ) -> BOOL;
3344 pub fn GetPointerPenInfo(
3345 pointerId: UINT32,
3346 penInfo: *mut POINTER_PEN_INFO,
3347 ) -> BOOL;
3348 pub fn GetPointerPenInfoHistory(
3349 pointerId: UINT32,
3350 entriesCount: *mut UINT32,
3351 penInfo: *mut POINTER_PEN_INFO,
3352 ) -> BOOL;
3353 pub fn GetPointerFramePenInfo(
3354 pointerId: UINT32,
3355 pointerCount: *mut UINT32,
3356 penInfo: *mut POINTER_PEN_INFO,
3357 ) -> BOOL;
3358 pub fn GetPointerFramePenInfoHistory(
3359 pointerId: UINT32,
3360 entriesCount: *mut UINT32,
3361 pointerCount: *mut UINT32,
3362 penInfo: *mut POINTER_PEN_INFO,
3363 ) -> BOOL;
3364 pub fn SkipPointerFrameMessages(
3365 pointerId: UINT32,
3366 ) -> BOOL;
3367 pub fn RegisterPointerInputTarget(
3368 hwnd: HWND,
3369 pointerType: POINTER_INPUT_TYPE,
3370 ) -> BOOL;
3371 pub fn UnregisterPointerInputTarget(
3372 hwnd: HWND,
3373 pointerType: POINTER_INPUT_TYPE,
3374 ) -> BOOL;
3375 pub fn RegisterPointerInputTargetEx(
3376 hwnd: HWND,
3377 pointerType: POINTER_INPUT_TYPE,
3378 fObserve: BOOL,
3379 ) -> BOOL;
3380 pub fn UnregisterPointerInputTargetEx(
3381 hwnd: HWND,
3382 pointerType: POINTER_INPUT_TYPE,
3383 ) -> BOOL;
3384 pub fn EnableMouseInPointer(
3385 fEnable: BOOL,
3386 ) -> BOOL;
3387 pub fn IsMouseInPointerEnabled() -> BOOL;
3388}
3389pub const TOUCH_HIT_TESTING_DEFAULT: ULONG = 0x0;
3390pub const TOUCH_HIT_TESTING_CLIENT: ULONG = 0x1;
3391pub const TOUCH_HIT_TESTING_NONE: ULONG = 0x2;
3392extern "system" {
3393 pub fn RegisterTouchHitTestingWindow(
3394 hwnd: HWND,
3395 value: ULONG,
3396 ) -> BOOL;
3397}
3398STRUCT!{struct TOUCH_HIT_TESTING_PROXIMITY_EVALUATION {
3399 score: UINT16,
3400 adjustedPoint: POINT,
3401}}
3402pub type PTOUCH_HIT_TESTING_PROXIMITY_EVALUATION = *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION;
3403STRUCT!{struct TOUCH_HIT_TESTING_INPUT {
3404 pointerId: UINT32,
3405 point: POINT,
3406 boundingBox: RECT,
3407 nonOccludedBoundingBox: RECT,
3408 orientation: UINT32,
3409}}
3410pub type PTOUCH_HIT_TESTING_INPUT = *mut TOUCH_HIT_TESTING_INPUT;
3411pub const TOUCH_HIT_TESTING_PROXIMITY_CLOSEST: UINT16 = 0x0;
3412pub const TOUCH_HIT_TESTING_PROXIMITY_FARTHEST: UINT16 = 0xFFF;
3413extern "system" {
3414 pub fn EvaluateProximityToRect(
3415 controlBoundingBox: *const RECT,
3416 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3417 pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3418 ) -> BOOL;
3419 pub fn EvaluateProximityToPolygon(
3420 numVertices: UINT32,
3421 controlPolygon: *const POINT,
3422 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3423 pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3424 ) -> BOOL;
3425 pub fn PackTouchHitTestingProximityEvaluation(
3426 pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT,
3427 pProximityEval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION,
3428 ) -> LRESULT;
3429}
3430ENUM!{enum FEEDBACK_TYPE {
3431 FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1,
3432 FEEDBACK_PEN_BARRELVISUALIZATION = 2,
3433 FEEDBACK_PEN_TAP = 3,
3434 FEEDBACK_PEN_DOUBLETAP = 4,
3435 FEEDBACK_PEN_PRESSANDHOLD = 5,
3436 FEEDBACK_PEN_RIGHTTAP = 6,
3437 FEEDBACK_TOUCH_TAP = 7,
3438 FEEDBACK_TOUCH_DOUBLETAP = 8,
3439 FEEDBACK_TOUCH_PRESSANDHOLD = 9,
3440 FEEDBACK_TOUCH_RIGHTTAP = 10,
3441 FEEDBACK_GESTURE_PRESSANDTAP = 11,
3442 FEEDBACK_MAX = 0xFFFFFFFF,
3443}}
3444pub const GWFS_INCLUDE_ANCESTORS: DWORD = 0x00000001;
3445extern "system" {
3446 pub fn GetWindowFeedbackSetting(
3447 hwnd: HWND,
3448 feedback: FEEDBACK_TYPE,
3449 dwFlags: DWORD,
3450 pSize: *mut UINT32,
3451 config: *mut VOID,
3452 ) -> BOOL;
3453 pub fn SetWindowFeedbackSetting(
3454 hwnd: HWND,
3455 feedback: FEEDBACK_TYPE,
3456 dwFlags: DWORD,
3457 size: UINT32,
3458 configuration: *const VOID,
3459 ) -> BOOL;
3460}
3461STRUCT!{struct INPUT_TRANSFORM {
3462 m: [[f32; 4]; 4],
3463}}
3464extern "system" {
3465 pub fn GetPointerInputTransform(
3466 pointerId: UINT32,
3467 historyCount: UINT32,
3468 inputTransform: *mut INPUT_TRANSFORM,
3469 ) -> BOOL;
3470}
3471STRUCT!{struct LASTINPUTINFO {
3472 cbSize: UINT,
3473 dwTime: DWORD,
3474}}
3475pub type PLASTINPUTINFO = *mut LASTINPUTINFO;
3476extern "system" {
3477 pub fn GetLastInputInfo(
3478 plii: PLASTINPUTINFO,
3479 ) -> BOOL;
3480 pub fn MapVirtualKeyA(
3481 nCode: UINT,
3482 uMapType: UINT,
3483 ) -> UINT;
3484 pub fn MapVirtualKeyW(
3485 nCode: UINT,
3486 uMapType: UINT,
3487 ) -> UINT;
3488 pub fn MapVirtualKeyExA(
3489 nCode: UINT,
3490 uMapType: UINT,
3491 dwhkl: HKL,
3492 ) -> UINT;
3493 pub fn MapVirtualKeyExW(
3494 nCode: UINT,
3495 uMapType: UINT,
3496 dwhkl: HKL,
3497 ) -> UINT;
3498}
3499pub const MAPVK_VK_TO_VSC: UINT = 0;
3500pub const MAPVK_VSC_TO_VK: UINT = 1;
3501pub const MAPVK_VK_TO_CHAR: UINT = 2;
3502pub const MAPVK_VSC_TO_VK_EX: UINT = 3;
3503pub const MAPVK_VK_TO_VSC_EX: UINT = 4;
3504extern "system" {
3505 pub fn GetInputState() -> BOOL;
3506 pub fn GetQueueStatus(
3507 flags: UINT,
3508 ) -> DWORD;
3509 pub fn GetCapture() -> HWND;
3510 pub fn SetCapture(
3511 hWnd: HWND,
3512 ) -> HWND;
3513 pub fn ReleaseCapture() -> BOOL;
3514 pub fn MsgWaitForMultipleObjects(
3515 nCount: DWORD,
3516 pHandles: *const HANDLE,
3517 fWaitAll: BOOL,
3518 dwMilliseconds: DWORD,
3519 dwWakeMask: DWORD,
3520 ) -> DWORD;
3521 pub fn MsgWaitForMultipleObjectsEx(
3522 nCount: DWORD,
3523 pHandles: *const HANDLE,
3524 dwMilliseconds: DWORD,
3525 dwWakeMask: DWORD,
3526 dwFlags: DWORD,
3527 ) -> DWORD;
3528}
3529pub const MWMO_WAITALL: UINT = 0x0001;
3530pub const MWMO_ALERTABLE: UINT = 0x0002;
3531pub const MWMO_INPUTAVAILABLE: UINT = 0x0004;
3532pub const QS_KEY: UINT = 0x0001;
3533pub const QS_MOUSEMOVE: UINT = 0x0002;
3534pub const QS_MOUSEBUTTON: UINT = 0x0004;
3535pub const QS_POSTMESSAGE: UINT = 0x0008;
3536pub const QS_TIMER: UINT = 0x0010;
3537pub const QS_PAINT: UINT = 0x0020;
3538pub const QS_SENDMESSAGE: UINT = 0x0040;
3539pub const QS_HOTKEY: UINT = 0x0080;
3540pub const QS_ALLPOSTMESSAGE: UINT = 0x0100;
3541pub const QS_RAWINPUT: UINT = 0x0400;
3542pub const QS_TOUCH: UINT = 0x0800;
3543pub const QS_POINTER: UINT = 0x1000;
3544pub const QS_MOUSE: UINT = QS_MOUSEMOVE | QS_MOUSEBUTTON;
3545pub const QS_INPUT: UINT = QS_MOUSE | QS_KEY | QS_RAWINPUT | QS_TOUCH | QS_POINTER;
3546pub const QS_ALLEVENTS: UINT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY;
3547pub const QS_ALLINPUT: UINT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY
3548 | QS_SENDMESSAGE;
3549pub const USER_TIMER_MAXIMUM: UINT = 0x7FFFFFFF;
3550pub const USER_TIMER_MINIMUM: UINT = 0x0000000A;
3551extern "system" {
3552 pub fn SetTimer(
3553 hWnd: HWND,
3554 nIDEvent: UINT_PTR,
3555 uElapse: UINT,
3556 lpTimerFunc: TIMERPROC,
3557 ) -> UINT_PTR;
3558}
3559pub const TIMERV_DEFAULT_COALESCING: ULONG = 0;
3560pub const TIMERV_NO_COALESCING: ULONG = 0xFFFFFFFF;
3561pub const TIMERV_COALESCING_MIN: ULONG = 1;
3562pub const TIMERV_COALESCING_MAX: ULONG = 0x7FFFFFF5;
3563extern "system" {
3564 pub fn SetCoalescableTimer(
3565 hWnd: HWND,
3566 nIDEvent: UINT_PTR,
3567 uElapse: UINT,
3568 lpTimerFunc: TIMERPROC,
3569 uToleranceDelay: ULONG,
3570 ) -> UINT_PTR;
3571 pub fn KillTimer(
3572 hWnd: HWND,
3573 uIDEvent: UINT_PTR,
3574 ) -> BOOL;
3575 pub fn IsWindowUnicode(
3576 hWnd: HWND,
3577 ) -> BOOL;
3578 pub fn EnableWindow(
3579 hWnd: HWND,
3580 bEnable: BOOL,
3581 ) -> BOOL;
3582 pub fn IsWindowEnabled(
3583 hWnd: HWND,
3584 ) -> BOOL;
3585 pub fn LoadAcceleratorsA(
3586 hInstance: HINSTANCE,
3587 lpTableName: LPCSTR,
3588 ) -> HACCEL;
3589 pub fn LoadAcceleratorsW(
3590 hInstance: HINSTANCE,
3591 lpTableName: LPCWSTR,
3592 ) -> HACCEL;
3593 pub fn CreateAcceleratorTableA(
3594 paccel: LPACCEL,
3595 cAccel: c_int,
3596 ) -> HACCEL;
3597 pub fn CreateAcceleratorTableW(
3598 paccel: LPACCEL,
3599 cAccel: c_int,
3600 ) -> HACCEL;
3601 pub fn DestroyAcceleratorTable(
3602 hAccel: HACCEL,
3603 ) -> BOOL;
3604 pub fn CopyAcceleratorTableA(
3605 hAccelSrc: HACCEL,
3606 lpAccelDst: LPACCEL,
3607 cAccelEntries: c_int,
3608 ) -> c_int;
3609 pub fn CopyAcceleratorTableW(
3610 hAccelSrc: HACCEL,
3611 lpAccelDst: LPACCEL,
3612 cAccelEntries: c_int,
3613 ) -> c_int;
3614 pub fn TranslateAcceleratorA(
3615 hWnd: HWND,
3616 hAccTable: HACCEL,
3617 lpMsg: LPMSG,
3618 ) -> c_int;
3619 pub fn TranslateAcceleratorW(
3620 hWnd: HWND,
3621 hAccTable: HACCEL,
3622 lpMsg: LPMSG,
3623 ) -> c_int;
3624}
3625pub const SM_CXSCREEN: c_int = 0;
3626pub const SM_CYSCREEN: c_int = 1;
3627pub const SM_CXVSCROLL: c_int = 2;
3628pub const SM_CYHSCROLL: c_int = 3;
3629pub const SM_CYCAPTION: c_int = 4;
3630pub const SM_CXBORDER: c_int = 5;
3631pub const SM_CYBORDER: c_int = 6;
3632pub const SM_CXDLGFRAME: c_int = 7;
3633pub const SM_CYDLGFRAME: c_int = 8;
3634pub const SM_CYVTHUMB: c_int = 9;
3635pub const SM_CXHTHUMB: c_int = 10;
3636pub const SM_CXICON: c_int = 11;
3637pub const SM_CYICON: c_int = 12;
3638pub const SM_CXCURSOR: c_int = 13;
3639pub const SM_CYCURSOR: c_int = 14;
3640pub const SM_CYMENU: c_int = 15;
3641pub const SM_CXFULLSCREEN: c_int = 16;
3642pub const SM_CYFULLSCREEN: c_int = 17;
3643pub const SM_CYKANJIWINDOW: c_int = 18;
3644pub const SM_MOUSEPRESENT: c_int = 19;
3645pub const SM_CYVSCROLL: c_int = 20;
3646pub const SM_CXHSCROLL: c_int = 21;
3647pub const SM_DEBUG: c_int = 22;
3648pub const SM_SWAPBUTTON: c_int = 23;
3649pub const SM_RESERVED1: c_int = 24;
3650pub const SM_RESERVED2: c_int = 25;
3651pub const SM_RESERVED3: c_int = 26;
3652pub const SM_RESERVED4: c_int = 27;
3653pub const SM_CXMIN: c_int = 28;
3654pub const SM_CYMIN: c_int = 29;
3655pub const SM_CXSIZE: c_int = 30;
3656pub const SM_CYSIZE: c_int = 31;
3657pub const SM_CXFRAME: c_int = 32;
3658pub const SM_CYFRAME: c_int = 33;
3659pub const SM_CXMINTRACK: c_int = 34;
3660pub const SM_CYMINTRACK: c_int = 35;
3661pub const SM_CXDOUBLECLK: c_int = 36;
3662pub const SM_CYDOUBLECLK: c_int = 37;
3663pub const SM_CXICONSPACING: c_int = 38;
3664pub const SM_CYICONSPACING: c_int = 39;
3665pub const SM_MENUDROPALIGNMENT: c_int = 40;
3666pub const SM_PENWINDOWS: c_int = 41;
3667pub const SM_DBCSENABLED: c_int = 42;
3668pub const SM_CMOUSEBUTTONS: c_int = 43;
3669pub const SM_CXFIXEDFRAME: c_int = SM_CXDLGFRAME;
3670pub const SM_CYFIXEDFRAME: c_int = SM_CYDLGFRAME;
3671pub const SM_CXSIZEFRAME: c_int = SM_CXFRAME;
3672pub const SM_CYSIZEFRAME: c_int = SM_CYFRAME;
3673pub const SM_SECURE: c_int = 44;
3674pub const SM_CXEDGE: c_int = 45;
3675pub const SM_CYEDGE: c_int = 46;
3676pub const SM_CXMINSPACING: c_int = 47;
3677pub const SM_CYMINSPACING: c_int = 48;
3678pub const SM_CXSMICON: c_int = 49;
3679pub const SM_CYSMICON: c_int = 50;
3680pub const SM_CYSMCAPTION: c_int = 51;
3681pub const SM_CXSMSIZE: c_int = 52;
3682pub const SM_CYSMSIZE: c_int = 53;
3683pub const SM_CXMENUSIZE: c_int = 54;
3684pub const SM_CYMENUSIZE: c_int = 55;
3685pub const SM_ARRANGE: c_int = 56;
3686pub const SM_CXMINIMIZED: c_int = 57;
3687pub const SM_CYMINIMIZED: c_int = 58;
3688pub const SM_CXMAXTRACK: c_int = 59;
3689pub const SM_CYMAXTRACK: c_int = 60;
3690pub const SM_CXMAXIMIZED: c_int = 61;
3691pub const SM_CYMAXIMIZED: c_int = 62;
3692pub const SM_NETWORK: c_int = 63;
3693pub const SM_CLEANBOOT: c_int = 67;
3694pub const SM_CXDRAG: c_int = 68;
3695pub const SM_CYDRAG: c_int = 69;
3696pub const SM_SHOWSOUNDS: c_int = 70;
3697pub const SM_CXMENUCHECK: c_int = 71;
3698pub const SM_CYMENUCHECK: c_int = 72;
3699pub const SM_SLOWMACHINE: c_int = 73;
3700pub const SM_MIDEASTENABLED: c_int = 74;
3701pub const SM_MOUSEWHEELPRESENT: c_int = 75;
3702pub const SM_XVIRTUALSCREEN: c_int = 76;
3703pub const SM_YVIRTUALSCREEN: c_int = 77;
3704pub const SM_CXVIRTUALSCREEN: c_int = 78;
3705pub const SM_CYVIRTUALSCREEN: c_int = 79;
3706pub const SM_CMONITORS: c_int = 80;
3707pub const SM_SAMEDISPLAYFORMAT: c_int = 81;
3708pub const SM_IMMENABLED: c_int = 82;
3709pub const SM_CXFOCUSBORDER: c_int = 83;
3710pub const SM_CYFOCUSBORDER: c_int = 84;
3711pub const SM_TABLETPC: c_int = 86;
3712pub const SM_MEDIACENTER: c_int = 87;
3713pub const SM_STARTER: c_int = 88;
3714pub const SM_SERVERR2: c_int = 89;
3715pub const SM_MOUSEHORIZONTALWHEELPRESENT: c_int = 91;
3716pub const SM_CXPADDEDBORDER: c_int = 92;
3717pub const SM_DIGITIZER: c_int = 94;
3718pub const SM_MAXIMUMTOUCHES: c_int = 95;
3719pub const SM_CMETRICS: c_int = 97;
3720pub const SM_REMOTESESSION: c_int = 0x1000;
3721pub const SM_SHUTTINGDOWN: c_int = 0x2000;
3722pub const SM_REMOTECONTROL: c_int = 0x2001;
3723pub const SM_CARETBLINKINGENABLED: c_int = 0x2002;
3724pub const SM_CONVERTIBLESLATEMODE: c_int = 0x2003;
3725pub const SM_SYSTEMDOCKED: c_int = 0x2004;
3726extern "system" {
3727 pub fn GetSystemMetrics(
3728 nIndex: c_int,
3729 ) -> c_int;
3730 pub fn GetSystemMetricsForDpi(
3731 nIndex: c_int,
3732 dpi: UINT,
3733 ) -> c_int;
3734 pub fn LoadMenuA(
3735 hInstance: HINSTANCE,
3736 lpMenuName: LPCSTR,
3737 ) -> HMENU;
3738 pub fn LoadMenuW(
3739 hInstance: HINSTANCE,
3740 lpMenuName: LPCWSTR,
3741 ) -> HMENU;
3742 pub fn LoadMenuIndirectA(
3743 lpMenuTemplate: *const MENUTEMPLATEA,
3744 ) -> HMENU;
3745 pub fn LoadMenuIndirectW(
3746 lpMenuTemplate: *const MENUTEMPLATEW,
3747 ) -> HMENU;
3748 pub fn GetMenu(
3749 hWnd: HWND,
3750 ) -> HMENU;
3751 pub fn SetMenu(
3752 hWnd: HWND,
3753 hMenu: HMENU,
3754 ) -> BOOL;
3755 pub fn ChangeMenuA(
3756 hMenu: HMENU,
3757 cmd: UINT,
3758 lpszNewItem: LPCSTR,
3759 cmdInsert: UINT,
3760 flags: UINT,
3761 ) -> BOOL;
3762 pub fn ChangeMenuW(
3763 hMenu: HMENU,
3764 cmd: UINT,
3765 lpszNewItem: LPCWSTR,
3766 cmdInsert: UINT,
3767 flags: UINT,
3768 ) -> BOOL;
3769 pub fn HiliteMenuItem(
3770 hWnd: HWND,
3771 hMenu: HMENU,
3772 uIDHiliteItem: UINT,
3773 uHilite: UINT,
3774 ) -> BOOL;
3775 pub fn GetMenuStringA(
3776 hMenu: HMENU,
3777 uIDItem: UINT,
3778 lpString: LPSTR,
3779 cchMax: c_int,
3780 flags: UINT,
3781 ) -> c_int;
3782 pub fn GetMenuStringW(
3783 hMenu: HMENU,
3784 uIDItem: UINT,
3785 lpString: LPWSTR,
3786 cchMax: c_int,
3787 flags: UINT,
3788 ) -> c_int;
3789 pub fn GetMenuState(
3790 hMenu: HMENU,
3791 uId: UINT,
3792 uFlags: UINT,
3793 ) -> UINT;
3794 pub fn DrawMenuBar(
3795 hwnd: HWND,
3796 ) -> BOOL;
3797}
3798pub const PMB_ACTIVE: DWORD = 0x00000001;
3799extern "system" {
3800 pub fn GetSystemMenu(
3801 hWnd: HWND,
3802 bRevert: BOOL,
3803 ) -> HMENU;
3804 pub fn CreateMenu() -> HMENU;
3805 pub fn CreatePopupMenu() ->HMENU;
3806 pub fn DestroyMenu(
3807 hMenu: HMENU,
3808 ) -> BOOL;
3809 pub fn CheckMenuItem(
3810 hMenu: HMENU,
3811 uIDCheckItem: UINT,
3812 uCheck: UINT,
3813 ) -> DWORD;
3814 pub fn EnableMenuItem(
3815 hMenu: HMENU,
3816 uIDEnableItem: UINT,
3817 uEnable: UINT,
3818 ) -> BOOL;
3819 pub fn GetSubMenu(
3820 hMenu: HMENU,
3821 nPos: c_int,
3822 ) -> HMENU;
3823 pub fn GetMenuItemID(
3824 hMenu: HMENU,
3825 nPos: c_int,
3826 ) -> UINT;
3827 pub fn GetMenuItemCount(
3828 hMenu: HMENU,
3829 ) -> c_int;
3830 pub fn InsertMenuA(
3831 hMenu: HMENU,
3832 uPosition: UINT,
3833 uFlags: UINT,
3834 uIDNewItem: UINT_PTR,
3835 lpNewItem: LPCSTR,
3836 ) -> BOOL;
3837 pub fn InsertMenuW(
3838 hMenu: HMENU,
3839 uPosition: UINT,
3840 uFlags: UINT,
3841 uIDNewItem: UINT_PTR,
3842 lpNewItem: LPCWSTR,
3843 ) -> BOOL;
3844 pub fn AppendMenuA(
3845 hMenu: HMENU,
3846 uFlags: UINT,
3847 uIDNewItem: UINT_PTR,
3848 lpNewItem: LPCSTR,
3849 ) -> BOOL;
3850 pub fn AppendMenuW(
3851 hMenu: HMENU,
3852 uFlags: UINT,
3853 uIDNewItem: UINT_PTR,
3854 lpNewItem: LPCWSTR,
3855 ) -> BOOL;
3856 pub fn ModifyMenuA(
3857 hMnu: HMENU,
3858 uPosition: UINT,
3859 uFlags: UINT,
3860 uIDNewItem: UINT_PTR,
3861 lpNewItem: LPCSTR,
3862 ) -> BOOL;
3863 pub fn ModifyMenuW(
3864 hMnu: HMENU,
3865 uPosition: UINT,
3866 uFlags: UINT,
3867 uIDNewItem: UINT_PTR,
3868 lpNewItem: LPCWSTR,
3869 ) -> BOOL;
3870 pub fn RemoveMenu(
3871 hMenu: HMENU,
3872 uPosition: UINT,
3873 uFlags: UINT,
3874 ) -> BOOL;
3875 pub fn DeleteMenu(
3876 hMenu: HMENU,
3877 uPosition: UINT,
3878 uFlags: UINT,
3879 ) -> BOOL;
3880 pub fn SetMenuItemBitmaps(
3881 hMenu: HMENU,
3882 uPosition: UINT,
3883 uFlags: UINT,
3884 hBitmapUnchecked: HBITMAP,
3885 hBitmapChecked: HBITMAP,
3886 ) -> BOOL;
3887 pub fn GetMenuCheckMarkDimensions() -> LONG;
3888 pub fn TrackPopupMenu(
3889 hMenu: HMENU,
3890 uFlags: UINT,
3891 x: c_int,
3892 y: c_int,
3893 nReserved: c_int,
3894 hWnd: HWND,
3895 prcRect: *const RECT,
3896 ) -> BOOL;
3897}
3898pub const MNC_IGNORE: DWORD = 0;
3899pub const MNC_CLOSE: DWORD = 1;
3900pub const MNC_EXECUTE: DWORD = 2;
3901pub const MNC_SELECT: DWORD = 3;
3902STRUCT!{struct TPMPARAMS {
3903 cbSize: UINT,
3904 rcExclude: RECT,
3905}}
3906pub type LPTPMPARAMS = *mut TPMPARAMS;
3907extern "system" {
3908 pub fn TrackPopupMenuEx(
3909 hMenu: HMENU,
3910 uFlags: UINT,
3911 x: INT,
3912 y: INT,
3913 hwnd: HWND,
3914 lptpm: LPTPMPARAMS,
3915 ) -> BOOL;
3916 pub fn CalculatePopupWindowPosition(
3917 anchorPoint: *const POINT,
3918 windowSize: *const SIZE,
3919 flags: UINT,
3920 excludeRect: *mut RECT,
3921 popupWindowPosition: *mut RECT,
3922 ) -> BOOL;
3923}
3924pub const MNS_NOCHECK: DWORD = 0x80000000;
3925pub const MNS_MODELESS: DWORD = 0x40000000;
3926pub const MNS_DRAGDROP: DWORD = 0x20000000;
3927pub const MNS_AUTODISMISS: DWORD = 0x10000000;
3928pub const MNS_NOTIFYBYPOS: DWORD = 0x08000000;
3929pub const MNS_CHECKORBMP: DWORD = 0x04000000;
3930pub const MIM_MAXHEIGHT: DWORD = 0x00000001;
3931pub const MIM_BACKGROUND: DWORD = 0x00000002;
3932pub const MIM_HELPID: DWORD = 0x00000004;
3933pub const MIM_MENUDATA: DWORD = 0x00000008;
3934pub const MIM_STYLE: DWORD = 0x00000010;
3935pub const MIM_APPLYTOSUBMENUS: DWORD = 0x80000000;
3936STRUCT!{struct MENUINFO {
3937 cbSize: DWORD,
3938 fMask: DWORD,
3939 dwStyle: DWORD,
3940 cyMax: UINT,
3941 hbrBack: HBRUSH,
3942 dwContextHelpID: DWORD,
3943 dwMenuData: ULONG_PTR,
3944}}
3945pub type LPMENUINFO = *mut MENUINFO;
3946pub type LPCMENUINFO = *const MENUINFO;
3947extern "system" {
3948 pub fn GetMenuInfo(
3949 hMenu: HMENU,
3950 lpcmi: LPMENUINFO,
3951 ) -> BOOL;
3952 pub fn SetMenuInfo(
3953 hMenu: HMENU,
3954 lpcmi: LPCMENUINFO,
3955 ) -> BOOL;
3956 pub fn EndMenu(
3957 hMenu: HMENU,
3958 uFlags: UINT,
3959 uIDNewItem: UINT_PTR,
3960 lpNewItem: LPCSTR,
3961 ) -> BOOL;
3962}
3963pub const MND_CONTINUE: DWORD = 0;
3964pub const MND_ENDMENU: DWORD = 1;
3965STRUCT!{struct MENUGETOBJECTINFO {
3966 dwFlags: DWORD,
3967 uPos: UINT,
3968 hmenu: HMENU,
3969 riid: PVOID,
3970 pvObj: PVOID,
3971}}
3972pub type PMENUGETOBJECTINFO = *mut MENUGETOBJECTINFO;
3973pub const MNGOF_TOPGAP: DWORD = 0x00000001;
3974pub const MNGOF_BOTTOMGAP: DWORD = 0x00000002;
3975pub const MNGO_NOINTERFACE: DWORD = 0x00000000;
3976pub const MNGO_NOERROR: DWORD = 0x00000001;
3977pub const MIIM_STATE: DWORD = 0x00000001;
3978pub const MIIM_ID: DWORD = 0x00000002;
3979pub const MIIM_SUBMENU: DWORD = 0x00000004;
3980pub const MIIM_CHECKMARKS: DWORD = 0x00000008;
3981pub const MIIM_TYPE: DWORD = 0x00000010;
3982pub const MIIM_DATA: DWORD = 0x00000020;
3983pub const MIIM_STRING: DWORD = 0x00000040;
3984pub const MIIM_BITMAP: DWORD = 0x00000080;
3985pub const MIIM_FTYPE: DWORD = 0x00000100;
3986pub const HBMMENU_CALLBACK: HBITMAP = -1isize as HBITMAP;
3987pub const HBMMENU_SYSTEM: HBITMAP = 1 as HBITMAP;
3988pub const HBMMENU_MBAR_RESTORE: HBITMAP = 2 as HBITMAP;
3989pub const HBMMENU_MBAR_MINIMIZE: HBITMAP = 3 as HBITMAP;
3990pub const HBMMENU_MBAR_CLOSE: HBITMAP = 5 as HBITMAP;
3991pub const HBMMENU_MBAR_CLOSE_D: HBITMAP = 6 as HBITMAP;
3992pub const HBMMENU_MBAR_MINIMIZE_D: HBITMAP = 7 as HBITMAP;
3993pub const HBMMENU_POPUP_CLOSE: HBITMAP = 8 as HBITMAP;
3994pub const HBMMENU_POPUP_RESTORE: HBITMAP = 9 as HBITMAP;
3995pub const HBMMENU_POPUP_MAXIMIZE: HBITMAP = 10 as HBITMAP;
3996pub const HBMMENU_POPUP_MINIMIZE: HBITMAP = 11 as HBITMAP;
3997STRUCT!{struct MENUITEMINFOA {
3998 cbSize: UINT,
3999 fMask: UINT,
4000 fType: UINT,
4001 fState: UINT,
4002 wID: UINT,
4003 hSubMenu: HMENU,
4004 hbmpChecked: HBITMAP,
4005 hbmpUnchecked: HBITMAP,
4006 dwItemData: ULONG_PTR,
4007 dwTypeData: LPSTR,
4008 cch: UINT,
4009 hbmpItem: HBITMAP,
4010}}
4011pub type LPMENUITEMINFOA = *mut MENUITEMINFOA;
4012pub type LPCMENUITEMINFOA = *const MENUITEMINFOA;
4013STRUCT!{struct MENUITEMINFOW {
4014 cbSize: UINT,
4015 fMask: UINT,
4016 fType: UINT,
4017 fState: UINT,
4018 wID: UINT,
4019 hSubMenu: HMENU,
4020 hbmpChecked: HBITMAP,
4021 hbmpUnchecked: HBITMAP,
4022 dwItemData: ULONG_PTR,
4023 dwTypeData: LPWSTR,
4024 cch: UINT,
4025 hbmpItem: HBITMAP,
4026}}
4027pub type LPMENUITEMINFOW = *mut MENUITEMINFOW;
4028pub type LPCMENUITEMINFOW = *const MENUITEMINFOW;
4029extern "system" {
4030 pub fn InsertMenuItemA(
4031 hmenu: HMENU,
4032 item: UINT,
4033 fByPosition: BOOL,
4034 lpmi: LPCMENUITEMINFOA,
4035 ) -> BOOL;
4036 pub fn InsertMenuItemW(
4037 hmenu: HMENU,
4038 item: UINT,
4039 fByPosition: BOOL,
4040 lpmi: LPCMENUITEMINFOW,
4041 ) -> BOOL;
4042 pub fn GetMenuItemInfoA(
4043 hMenu: HMENU,
4044 uItem: UINT,
4045 fByPosition: BOOL,
60c5eb7d 4046 lpmii: LPMENUITEMINFOA,
ff7c6d11
XL
4047 ) -> BOOL;
4048 pub fn GetMenuItemInfoW(
4049 hMenu: HMENU,
4050 uItem: UINT,
4051 fByPosition: BOOL,
60c5eb7d 4052 lpmii: LPMENUITEMINFOW,
ff7c6d11
XL
4053 ) -> BOOL;
4054 pub fn SetMenuItemInfoA(
4055 hmenu: HMENU,
4056 item: UINT,
4057 fByPositon: BOOL,
4058 lpmii: LPCMENUITEMINFOA,
4059 ) -> BOOL;
4060 pub fn SetMenuItemInfoW(
4061 hmenu: HMENU,
4062 item: UINT,
4063 fByPositon: BOOL,
4064 lpmii: LPCMENUITEMINFOW,
4065 ) -> BOOL;
4066}
4067pub const GMDI_USEDISABLED: DWORD = 0x0001;
4068pub const GMDI_GOINTOPOPUPS: DWORD = 0x0002;
4069extern "system" {
4070 pub fn GetMenuDefaultItem(
4071 hMenu: HMENU,
4072 fByPos: UINT,
4073 gmdiFlags: UINT,
4074 ) -> UINT;
4075 pub fn SetMenuDefaultItem(
4076 hMenu: HMENU,
4077 uItem: UINT,
4078 fByPos: UINT,
4079 ) -> BOOL;
4080 pub fn GetMenuItemRect(
4081 hWnd: HWND,
4082 hMenu: HMENU,
4083 uItem: UINT,
4084 lprcItem: LPRECT,
4085 ) -> BOOL;
4086 pub fn MenuItemFromPoint(
4087 hWnd: HWND,
4088 hMenu: HMENU,
4089 ptScreen: POINT,
4090 ) -> c_int;
4091}
4092pub const TPM_LEFTBUTTON: UINT = 0x0000;
4093pub const TPM_RIGHTBUTTON: UINT = 0x0002;
4094pub const TPM_LEFTALIGN: UINT = 0x0000;
4095pub const TPM_CENTERALIGN: UINT = 0x0004;
4096pub const TPM_RIGHTALIGN: UINT = 0x0008;
4097pub const TPM_TOPALIGN: UINT = 0x0000;
4098pub const TPM_VCENTERALIGN: UINT = 0x0010;
4099pub const TPM_BOTTOMALIGN: UINT = 0x0020;
4100pub const TPM_HORIZONTAL: UINT = 0x0000;
4101pub const TPM_VERTICAL: UINT = 0x0040;
4102pub const TPM_NONOTIFY: UINT = 0x0080;
4103pub const TPM_RETURNCMD: UINT = 0x0100;
4104pub const TPM_RECURSE: UINT = 0x0001;
4105pub const TPM_HORPOSANIMATION: UINT = 0x0400;
4106pub const TPM_HORNEGANIMATION: UINT = 0x0800;
4107pub const TPM_VERPOSANIMATION: UINT = 0x1000;
4108pub const TPM_VERNEGANIMATION: UINT = 0x2000;
4109pub const TPM_NOANIMATION: UINT = 0x4000;
4110pub const TPM_LAYOUTRTL: UINT = 0x8000;
4111pub const TPM_WORKAREA: UINT = 0x10000;
4112STRUCT!{struct DROPSTRUCT {
4113 hwndSource: HWND,
4114 hwndSink: HWND,
4115 wFmt: DWORD,
4116 dwData: ULONG_PTR,
4117 ptDrop: POINT,
4118 dwControlData: DWORD,
4119}}
4120pub type PDROPSTRUCT = *mut DROPSTRUCT;
4121pub type LPDROPSTRUCT = *mut DROPSTRUCT;
4122pub const DOF_EXECUTABLE: DWORD = 0x8001;
4123pub const DOF_DOCUMENT: DWORD = 0x8002;
4124pub const DOF_DIRECTORY: DWORD = 0x8003;
4125pub const DOF_MULTIPLE: DWORD = 0x8004;
4126pub const DOF_PROGMAN: DWORD = 0x0001;
4127pub const DOF_SHELLDATA: DWORD = 0x0002;
4128pub const DO_DROPFILE: DWORD = 0x454C4946;
4129pub const DO_PRINTFILE: DWORD = 0x544E5250;
4130extern "system" {
4131 pub fn DragObject(
4132 hwndParent: HWND,
4133 hwndFrom: HWND,
4134 fmt: UINT,
4135 data: ULONG_PTR,
4136 hcur: HCURSOR,
4137 ) -> DWORD;
4138 pub fn DragDetect(
4139 hwnd: HWND,
4140 pt: POINT,
4141 ) -> BOOL;
4142 pub fn DrawIcon(
4143 hDC: HDC,
4144 x: c_int,
4145 y: c_int,
4146 hIcon: HICON,
4147 ) -> BOOL;
4148}
4149pub const DT_TOP: UINT = 0x00000000;
4150pub const DT_LEFT: UINT = 0x00000000;
4151pub const DT_CENTER: UINT = 0x00000001;
4152pub const DT_RIGHT: UINT = 0x00000002;
4153pub const DT_VCENTER: UINT = 0x00000004;
4154pub const DT_BOTTOM: UINT = 0x00000008;
4155pub const DT_WORDBREAK: UINT = 0x00000010;
4156pub const DT_SINGLELINE: UINT = 0x00000020;
4157pub const DT_EXPANDTABS: UINT = 0x00000040;
4158pub const DT_TABSTOP: UINT = 0x00000080;
4159pub const DT_NOCLIP: UINT = 0x00000100;
4160pub const DT_EXTERNALLEADING: UINT = 0x00000200;
4161pub const DT_CALCRECT: UINT = 0x00000400;
4162pub const DT_NOPREFIX: UINT = 0x00000800;
4163pub const DT_INTERNAL: UINT = 0x00001000;
4164pub const DT_EDITCONTROL: UINT = 0x00002000;
4165pub const DT_PATH_ELLIPSIS: UINT = 0x00004000;
4166pub const DT_END_ELLIPSIS: UINT = 0x00008000;
4167pub const DT_MODIFYSTRING: UINT = 0x00010000;
4168pub const DT_RTLREADING: UINT = 0x00020000;
4169pub const DT_WORD_ELLIPSIS: UINT = 0x00040000;
4170pub const DT_NOFULLWIDTHCHARBREAK: UINT = 0x00080000;
4171pub const DT_HIDEPREFIX: UINT = 0x00100000;
4172pub const DT_PREFIXONLY: UINT = 0x00200000;
4173STRUCT!{struct DRAWTEXTPARAMS {
4174 cbSize: UINT,
4175 iTabLength: c_int,
4176 iLeftMargin: c_int,
4177 iRightMargin: c_int,
4178 uiLengthDrawn: UINT,
4179}}
4180pub type LPDRAWTEXTPARAMS = *mut DRAWTEXTPARAMS;
4181extern "system" {
4182 pub fn DrawTextA(
4183 hdc: HDC,
4184 lpchText: LPCSTR,
4185 cchText: c_int,
4186 lprc: LPRECT,
4187 format: UINT,
4188 ) -> c_int;
4189 pub fn DrawTextW(
4190 hdc: HDC,
4191 lpchText: LPCWSTR,
4192 cchText: c_int,
4193 lprc: LPRECT,
4194 format: UINT,
4195 ) -> c_int;
4196 pub fn DrawTextExA(
4197 hdc: HDC,
4198 lpchText: LPCSTR,
4199 cchText: c_int,
4200 lprc: LPRECT,
4201 format: UINT,
4202 lpdtp: LPDRAWTEXTPARAMS,
4203 ) -> c_int;
4204 pub fn DrawTextExW(
4205 hdc: HDC,
4206 lpchText: LPCWSTR,
4207 cchText: c_int,
4208 lprc: LPRECT,
4209 format: UINT,
4210 lpdtp: LPDRAWTEXTPARAMS,
4211 ) -> c_int;
4212 pub fn GrayStringA(
4213 hDC: HDC,
4214 hBrush: HBRUSH,
4215 lpOutputFunc: GRAYSTRINGPROC,
4216 lpData: LPARAM,
4217 nCount: c_int,
4218 X: c_int,
4219 Y: c_int,
4220 nWidth: c_int,
4221 nHeight: c_int,
4222 ) -> BOOL;
4223 pub fn GrayStringW(
4224 hDC: HDC,
4225 hBrush: HBRUSH,
4226 lpOutputFunc: GRAYSTRINGPROC,
4227 lpData: LPARAM,
4228 nCount: c_int,
4229 X: c_int,
4230 Y: c_int,
4231 nWidth: c_int,
4232 nHeight: c_int,
4233 ) -> BOOL;
4234}
4235pub const DST_COMPLEX: UINT = 0x0000;
4236pub const DST_TEXT: UINT = 0x0001;
4237pub const DST_PREFIXTEXT: UINT = 0x0002;
4238pub const DST_ICON: UINT = 0x0003;
4239pub const DST_BITMAP: UINT = 0x0004;
4240pub const DSS_NORMAL: UINT = 0x0000;
4241pub const DSS_UNION: UINT = 0x0010;
4242pub const DSS_DISABLED: UINT = 0x0020;
4243pub const DSS_MONO: UINT = 0x0080;
4244pub const DSS_HIDEPREFIX: UINT = 0x0200;
4245pub const DSS_PREFIXONLY: UINT = 0x0400;
4246pub const DSS_RIGHT: UINT = 0x8000;
4247extern "system" {
4248 pub fn DrawStateA(
4249 hdc: HDC,
4250 hbrFore: HBRUSH,
4251 qfnCallBack: DRAWSTATEPROC,
4252 lData: LPARAM,
4253 wData: WPARAM,
4254 x: c_int,
4255 y: c_int,
4256 cx: c_int,
4257 cy: c_int,
4258 uFlags: UINT,
4259 ) -> BOOL;
4260 pub fn DrawStateW(
4261 hdc: HDC,
4262 hbrFore: HBRUSH,
4263 qfnCallBack: DRAWSTATEPROC,
4264 lData: LPARAM,
4265 wData: WPARAM,
4266 x: c_int,
4267 y: c_int,
4268 cx: c_int,
4269 cy: c_int,
4270 uFlags: UINT,
4271 ) -> BOOL;
4272 pub fn TabbedTextOutA(
4273 hdc: HDC,
4274 x: c_int,
4275 y: c_int,
4276 lpString: LPCSTR,
4277 chCount: c_int,
4278 nTabPositions: c_int,
4279 lpnTabStopPositions: *const INT,
4280 nTabOrigin: c_int,
4281 ) -> LONG;
4282 pub fn TabbedTextOutW(
4283 hdc: HDC,
4284 x: c_int,
4285 y: c_int,
4286 lpString: LPCWSTR,
4287 chCount: c_int,
4288 nTabPositions: c_int,
4289 lpnTabStopPositions: *const INT,
4290 nTabOrigin: c_int,
4291 ) -> LONG;
4292 pub fn GetTabbedTextExtentA(
4293 hdc: HDC,
4294 lpString: LPCSTR,
4295 chCount: c_int,
4296 nTabPositions: c_int,
4297 lpnTabStopPositions: *const INT,
4298 ) -> DWORD;
4299 pub fn GetTabbedTextExtentW(
4300 hdc: HDC,
4301 lpString: LPCWSTR,
4302 chCount: c_int,
4303 nTabPositions: c_int,
4304 lpnTabStopPositions: *const INT,
4305 ) -> DWORD;
4306 pub fn UpdateWindow(
4307 hWnd: HWND,
4308 ) -> BOOL;
4309 pub fn SetActiveWindow(
4310 hWnd: HWND,
4311 ) -> HWND;
4312 pub fn GetForegroundWindow() -> HWND;
4313 pub fn PaintDesktop(
4314 hdc: HDC,
4315 ) -> BOOL;
4316 pub fn SwitchToThisWindow(
4317 hwnd: HWND,
4318 fUnknown: BOOL,
4319 );
4320 pub fn SetForegroundWindow(
4321 hWnd: HWND,
4322 ) -> BOOL;
4323 pub fn AllowSetForegroundWindow(
4324 dwProcessId: DWORD,
4325 ) -> BOOL;
4326}
4327pub const ASFW_ANY: DWORD = -1i32 as u32;
4328extern "system" {
4329 pub fn LockSetForegroundWindow(
4330 uLockCode: UINT,
4331 ) -> BOOL;
4332}
4333pub const LSFW_LOCK: UINT = 1;
4334pub const LSFW_UNLOCK: UINT = 2;
4335extern "system" {
4336 pub fn WindowFromDC(
4337 hDC: HDC,
4338 ) -> HWND;
4339 pub fn GetDC(
4340 hWnd: HWND,
4341 ) -> HDC;
4342 pub fn GetDCEx(
4343 hWnd: HWND,
4344 hrgnClip: HRGN,
4345 flags: DWORD,
4346 ) -> HDC;
4347}
4348pub const DCX_WINDOW: DWORD = 0x00000001;
4349pub const DCX_CACHE: DWORD = 0x00000002;
4350pub const DCX_NORESETATTRS: DWORD = 0x00000004;
4351pub const DCX_CLIPCHILDREN: DWORD = 0x00000008;
4352pub const DCX_CLIPSIBLINGS: DWORD = 0x00000010;
4353pub const DCX_PARENTCLIP: DWORD = 0x00000020;
4354pub const DCX_EXCLUDERGN: DWORD = 0x00000040;
4355pub const DCX_INTERSECTRGN: DWORD = 0x00000080;
4356pub const DCX_EXCLUDEUPDATE: DWORD = 0x00000100;
4357pub const DCX_INTERSECTUPDATE: DWORD = 0x00000200;
4358pub const DCX_LOCKWINDOWUPDATE: DWORD = 0x00000400;
4359pub const DCX_VALIDATE: DWORD = 0x00200000;
4360extern "system" {
4361 pub fn GetWindowDC(
4362 hWnd: HWND,
4363 ) -> HDC;
4364 pub fn ReleaseDC(
4365 hWnd: HWND,
4366 hDC: HDC,
4367 ) -> c_int;
4368 pub fn BeginPaint(
4369 hwnd: HWND,
4370 lpPaint: LPPAINTSTRUCT,
4371 ) -> HDC;
4372 pub fn EndPaint(
4373 hWnd: HWND,
4374 lpPaint: *const PAINTSTRUCT,
4375 ) -> BOOL;
4376 pub fn GetUpdateRect(
4377 hWnd: HWND,
4378 lpRect: LPRECT,
4379 bErase: BOOL,
4380 ) -> BOOL;
4381 pub fn GetUpdateRgn(
4382 hWnd: HWND,
4383 hRgn: HRGN,
4384 bErase: BOOL,
4385 ) -> c_int;
4386 pub fn SetWindowRgn(
4387 hWnd: HWND,
4388 hRgn: HRGN,
4389 bRedraw: BOOL,
4390 ) -> c_int;
4391 pub fn GetWindowRgn(
4392 hWnd: HWND,
4393 hRgn: HRGN,
4394 ) -> c_int;
4395 pub fn GetWindowRgnBox(
4396 hWnd: HWND,
4397 lprc: LPRECT,
4398 ) -> c_int;
4399 pub fn ExcludeUpdateRgn(
4400 hDC: HDC,
4401 hWnd: HWND,
4402 ) -> c_int;
4403 pub fn InvalidateRect(
4404 hWnd: HWND,
4405 lpRect: *const RECT,
4406 bErase: BOOL,
4407 ) -> BOOL;
4408 pub fn ValidateRect(
4409 hWnd: HWND,
4410 lpRect: *const RECT,
4411 ) -> BOOL;
4412 pub fn InvalidateRgn(
4413 hWnd: HWND,
4414 hRgn: HRGN,
4415 bErase: BOOL,
4416 ) -> BOOL;
4417 pub fn ValidateRgn(
4418 hWnd: HWND,
4419 hRgn: HRGN,
4420 ) -> BOOL;
4421 pub fn RedrawWindow(
4422 hwnd: HWND,
4423 lprcUpdate: *const RECT,
4424 hrgnUpdate: HRGN,
4425 flags: UINT,
4426 ) -> BOOL;
4427}
4428pub const RDW_INVALIDATE: UINT = 0x0001;
4429pub const RDW_INTERNALPAINT: UINT = 0x0002;
4430pub const RDW_ERASE: UINT = 0x0004;
4431pub const RDW_VALIDATE: UINT = 0x0008;
4432pub const RDW_NOINTERNALPAINT: UINT = 0x0010;
4433pub const RDW_NOERASE: UINT = 0x0020;
4434pub const RDW_NOCHILDREN: UINT = 0x0040;
4435pub const RDW_ALLCHILDREN: UINT = 0x0080;
4436pub const RDW_UPDATENOW: UINT = 0x0100;
4437pub const RDW_ERASENOW: UINT = 0x0200;
4438pub const RDW_FRAME: UINT = 0x0400;
4439pub const RDW_NOFRAME: UINT = 0x0800;
4440extern "system" {
4441 pub fn LockWindowUpdate(
4442 hWndLock: HWND,
4443 ) -> BOOL;
4444 pub fn ScrollWindow(
4445 hWnd: HWND,
4446 xAmount: c_int,
4447 yAmount: c_int,
4448 lpRect: *const RECT,
4449 lpClipRect: *const RECT,
4450 ) -> BOOL;
4451 pub fn ScrollDC(
4452 hDC: HDC,
4453 dx: c_int,
4454 dy: c_int,
4455 lprcScroll: *const RECT,
4456 lprcClip: *const RECT,
4457 hrgnUpdate: HRGN,
4458 lprcUpdate: LPRECT,
4459 ) -> BOOL;
4460 pub fn ScrollWindowEx(
4461 hWnd: HWND,
4462 dx: c_int,
4463 dy: c_int,
4464 prcScroll: *const RECT,
4465 prcClip: *const RECT,
4466 hrgnUpdate: HRGN,
4467 prcUpdate: LPRECT,
4468 flags: UINT,
4469 ) -> c_int;
4470}
4471pub const SW_SCROLLCHILDREN: UINT = 0x0001;
4472pub const SW_INVALIDATE: UINT = 0x0002;
4473pub const SW_ERASE: UINT = 0x0004;
4474pub const SW_SMOOTHSCROLL: UINT = 0x0010;
4475extern "system" {
4476 pub fn SetScrollPos(
4477 hWnd: HWND,
4478 nBar: c_int,
4479 nPos: c_int,
4480 bRedraw: BOOL,
4481 ) -> c_int;
4482 pub fn GetScrollPos(
4483 hWnd: HWND,
4484 nBar: c_int,
4485 ) -> c_int;
4486 pub fn SetScrollRange(
4487 hWnd: HWND,
4488 nBar: c_int,
4489 nMinPos: c_int,
4490 nMaxPos: c_int,
4491 bRedraw: BOOL,
4492 ) -> BOOL;
4493 pub fn GetScrollRange(
4494 hWnd: HWND,
4495 nBar: c_int,
4496 lpMinPos: LPINT,
4497 lpMaxPos: LPINT,
4498 ) -> BOOL;
4499 pub fn ShowScrollBar(
4500 hWnd: HWND,
4501 wBar: c_int,
4502 bShow: BOOL,
4503 ) -> BOOL;
4504 pub fn EnableScrollBar(
4505 hWnd: HWND,
4506 wSBflags: UINT,
4507 wArrows: UINT,
4508 ) -> BOOL;
4509}
4510pub const ESB_ENABLE_BOTH: UINT = 0x0000;
4511pub const ESB_DISABLE_BOTH: UINT = 0x0003;
4512pub const ESB_DISABLE_LEFT: UINT = 0x0001;
4513pub const ESB_DISABLE_RIGHT: UINT = 0x0002;
4514pub const ESB_DISABLE_UP: UINT = 0x0001;
4515pub const ESB_DISABLE_DOWN: UINT = 0x0002;
4516pub const ESB_DISABLE_LTUP: UINT = ESB_DISABLE_LEFT;
4517pub const ESB_DISABLE_RTDN: UINT = ESB_DISABLE_RIGHT;
4518extern "system" {
4519 pub fn SetPropA(
4520 hWnd: HWND,
4521 lpString: LPCSTR,
4522 hData: HANDLE,
4523 ) -> BOOL;
4524 pub fn SetPropW(
4525 hWnd: HWND,
4526 lpString: LPCWSTR,
4527 hData: HANDLE,
4528 ) -> BOOL;
4529 pub fn GetPropA(
4530 hwnd: HWND,
4531 lpString: LPCSTR,
4532 ) -> HANDLE;
4533 pub fn GetPropW(
4534 hwnd: HWND,
4535 lpString: LPCWSTR,
4536 ) -> HANDLE;
4537 pub fn RemovePropA(
4538 hWnd: HWND,
4539 lpStr: LPCSTR,
4540 ) -> HANDLE;
4541 pub fn RemovePropW(
4542 hWnd: HWND,
4543 lpStr: LPCWSTR,
4544 ) -> HANDLE;
4545 pub fn EnumPropsExA(
4546 hWnd: HWND,
4547 lpEnumFunc: PROPENUMPROCA,
4548 lParam: LPARAM,
4549 ) -> c_int;
4550 pub fn EnumPropsExW(
4551 hWnd: HWND,
4552 lpEnumFunc: PROPENUMPROCW,
4553 lParam: LPARAM,
4554 ) -> c_int;
4555 pub fn EnumPropsA(
4556 hWnd: HWND,
4557 lpEnumFunc: PROPENUMPROCA,
4558 ) -> c_int;
4559 pub fn EnumPropsW(
4560 hWnd: HWND,
4561 lpEnumFunc: PROPENUMPROCW,
4562 ) -> c_int;
4563 pub fn SetWindowTextA(
4564 hWnd: HWND,
4565 lpString: LPCSTR,
4566 ) -> BOOL;
4567 pub fn SetWindowTextW(
4568 hWnd: HWND,
4569 lpString: LPCWSTR,
4570 ) -> BOOL;
4571 pub fn GetWindowTextA(
4572 hWnd: HWND,
4573 lpString: LPSTR,
4574 nMaxCount: c_int,
4575 ) -> c_int;
4576 pub fn GetWindowTextW(
4577 hWnd: HWND,
4578 lpString: LPWSTR,
4579 nMaxCount: c_int,
4580 ) -> c_int;
4581 pub fn GetWindowTextLengthA(
4582 hWnd: HWND,
4583 ) -> c_int;
4584 pub fn GetWindowTextLengthW(
4585 hWnd: HWND,
4586 ) -> c_int;
4587 pub fn GetClientRect(
4588 hWnd: HWND,
4589 lpRect: LPRECT,
4590 ) -> BOOL;
4591 pub fn GetWindowRect(
4592 hWnd: HWND,
4593 lpRect: LPRECT,
4594 ) -> BOOL;
4595 pub fn AdjustWindowRect(
4596 lpRect: LPRECT,
4597 dwStyle: DWORD,
4598 bMenu: BOOL,
4599 ) -> BOOL;
4600 pub fn AdjustWindowRectEx(
4601 lpRect: LPRECT,
4602 dwStyle: DWORD,
4603 bMenu: BOOL,
4604 dwExStyle: DWORD,
4605 ) -> BOOL;
4606 pub fn AdjustWindowRectExForDpi(
4607 lpRect: LPRECT,
4608 dwStyle: DWORD,
4609 bMenu: BOOL,
4610 dwExStyle: DWORD,
4611 dpi: UINT,
4612 ) -> BOOL;
4613}
4614pub const HELPINFO_WINDOW: UINT = 0x0001;
4615pub const HELPINFO_MENUITEM: UINT = 0x0002;
4616STRUCT!{struct HELPINFO {
4617 cbSize: UINT,
4618 iContextType: c_int,
4619 iCtrlId: c_int,
4620 hItemHandle: HANDLE,
4621 dwContextId: DWORD,
4622 MousePos: POINT,
4623}}
4624pub type LPHELPINFO = *mut HELPINFO;
4625extern "system" {
4626 pub fn SetWindowContextHelpId(
4627 _: HWND,
4628 _: DWORD,
4629 ) -> BOOL;
4630 pub fn GetWindowContextHelpId(
4631 _: HWND,
4632 ) -> DWORD;
4633 pub fn SetMenuContextHelpId(
4634 _: HMENU,
4635 _: DWORD,
4636 ) -> BOOL;
4637 pub fn GetMenuContextHelpId(
4638 _: HMENU,
4639 ) -> DWORD;
4640}
4641pub const MB_OK: UINT = 0x00000000;
4642pub const MB_OKCANCEL: UINT = 0x00000001;
4643pub const MB_ABORTRETRYIGNORE: UINT = 0x00000002;
4644pub const MB_YESNOCANCEL: UINT = 0x00000003;
4645pub const MB_YESNO: UINT = 0x00000004;
4646pub const MB_RETRYCANCEL: UINT = 0x00000005;
4647pub const MB_CANCELTRYCONTINUE: UINT = 0x00000006;
4648pub const MB_ICONHAND: UINT = 0x00000010;
4649pub const MB_ICONQUESTION: UINT = 0x00000020;
4650pub const MB_ICONEXCLAMATION: UINT = 0x00000030;
4651pub const MB_ICONASTERISK: UINT = 0x00000040;
4652pub const MB_USERICON: UINT = 0x00000080;
4653pub const MB_ICONWARNING: UINT = MB_ICONEXCLAMATION;
4654pub const MB_ICONERROR: UINT = MB_ICONHAND;
4655pub const MB_ICONINFORMATION: UINT = MB_ICONASTERISK;
4656pub const MB_ICONSTOP: UINT = MB_ICONHAND;
4657pub const MB_DEFBUTTON1: UINT = 0x00000000;
4658pub const MB_DEFBUTTON2: UINT = 0x00000100;
4659pub const MB_DEFBUTTON3: UINT = 0x00000200;
4660pub const MB_DEFBUTTON4: UINT = 0x00000300;
4661pub const MB_APPLMODAL: UINT = 0x00000000;
4662pub const MB_SYSTEMMODAL: UINT = 0x00001000;
4663pub const MB_TASKMODAL: UINT = 0x00002000;
4664pub const MB_HELP: UINT = 0x00004000;
4665pub const MB_NOFOCUS: UINT = 0x00008000;
4666pub const MB_SETFOREGROUND: UINT = 0x00010000;
4667pub const MB_DEFAULT_DESKTOP_ONLY: UINT = 0x00020000;
4668pub const MB_TOPMOST: UINT = 0x00040000;
4669pub const MB_RIGHT: UINT = 0x00080000;
4670pub const MB_RTLREADING: UINT = 0x00100000;
4671pub const MB_SERVICE_NOTIFICATION: UINT = 0x00200000;
4672pub const MB_SERVICE_NOTIFICATION_NT3X: UINT = 0x00040000;
4673pub const MB_TYPEMASK: UINT = 0x0000000F;
4674pub const MB_ICONMASK: UINT = 0x000000F0;
4675pub const MB_DEFMASK: UINT = 0x00000F00;
4676pub const MB_MODEMASK: UINT = 0x00003000;
4677pub const MB_MISCMASK: UINT = 0x0000C000;
4678extern "system" {
4679 pub fn MessageBoxA(
4680 hWnd: HWND,
4681 lpText: LPCSTR,
4682 lpCaption: LPCSTR,
4683 uType: UINT,
4684 ) -> c_int;
4685 pub fn MessageBoxW(
4686 hWnd: HWND,
4687 lpText: LPCWSTR,
4688 lpCaption: LPCWSTR,
4689 uType: UINT,
4690 ) -> c_int;
4691 pub fn MessageBoxExA(
4692 hWnd: HWND,
4693 lpText: LPCSTR,
4694 lpCaption: LPCSTR,
4695 uType: UINT,
4696 wLanguageId: WORD,
4697 ) -> c_int;
4698 pub fn MessageBoxExW(
4699 hWnd: HWND,
4700 lpText: LPCWSTR,
4701 lpCaption: LPCWSTR,
4702 uType: UINT,
4703 wLanguageId: WORD,
4704 ) -> c_int;
4705}
60c5eb7d
XL
4706FN!{stdcall MSGBOXCALLBACK(
4707 LPHELPINFO,
4708) -> ()}
ff7c6d11
XL
4709STRUCT!{struct MSGBOXPARAMSA {
4710 cbSize: UINT,
4711 hwndOwner: HWND,
4712 hInstance: HINSTANCE,
4713 lpszText: LPCSTR,
4714 lpszCaption: LPCSTR,
4715 dwStyle: DWORD,
4716 lpszIcon: LPCSTR,
4717 dwContextHelpId: DWORD_PTR,
4718 lpfnMsgBoxCallback: MSGBOXCALLBACK,
4719 dwLanguageId: DWORD,
4720}}
4721pub type PMSGBOXPARAMSA = *mut MSGBOXPARAMSA;
4722pub type LPMSGBOXPARAMSA = *mut MSGBOXPARAMSA;
4723STRUCT!{struct MSGBOXPARAMSW {
4724 cbSize: UINT,
4725 hwndOwner: HWND,
4726 hInstance: HINSTANCE,
4727 lpszText: LPCWSTR,
4728 lpszCaption: LPCWSTR,
4729 dwStyle: DWORD,
4730 lpszIcon: LPCWSTR,
4731 dwContextHelpId: DWORD_PTR,
4732 lpfnMsgBoxCallback: MSGBOXCALLBACK,
4733 dwLanguageId: DWORD,
4734}}
4735pub type PMSGBOXPARAMSW = *mut MSGBOXPARAMSW;
4736pub type LPMSGBOXPARAMSW = *mut MSGBOXPARAMSW;
4737extern "system" {
4738 pub fn MessageBoxIndirectA(
4739 lpmbp: *const MSGBOXPARAMSA,
4740 ) -> c_int;
4741 pub fn MessageBoxIndirectW(
4742 lpmbp: *const MSGBOXPARAMSW,
4743 ) -> c_int;
4744 pub fn MessageBeep(
4745 uType: UINT,
4746 ) -> BOOL;
4747 pub fn ShowCursor(
4748 bShow: BOOL,
4749 ) -> c_int;
4750 pub fn SetCursorPos(
4751 X: c_int,
4752 Y: c_int,
4753 ) -> BOOL;
4754 pub fn SetPhysicalCursorPos(
4755 X: c_int,
4756 Y: c_int,
4757 ) -> BOOL;
4758 pub fn SetCursor(
4759 hCursor: HCURSOR,
4760 ) -> HCURSOR;
4761 pub fn GetCursorPos(
4762 lpPoint: LPPOINT,
4763 ) -> BOOL;
4764 pub fn GetPhysicalCursorPos(
4765 lpPoint: LPPOINT,
4766 ) -> BOOL;
4767 pub fn GetClipCursor(
4768 lpRect: LPRECT,
4769 ) -> BOOL;
4770 pub fn GetCursor() -> HCURSOR;
4771 pub fn CreateCaret(
4772 hWnd: HWND,
4773 hBitmap: HBITMAP,
4774 nWidth: c_int,
4775 nHeight: c_int,
4776 ) -> BOOL;
4777 pub fn GetCaretBlinkTime() -> UINT;
4778 pub fn SetCaretBlinkTime(
4779 uMSeconds: UINT,
4780 ) -> BOOL;
4781 pub fn DestroyCaret() -> BOOL;
4782 pub fn HideCaret(
4783 hWnd: HWND,
4784 ) -> BOOL;
4785 pub fn ShowCaret(
4786 hWnd: HWND,
4787 ) -> BOOL;
4788 pub fn SetCaretPos(
4789 X: c_int,
4790 Y: c_int,
4791 ) -> BOOL;
4792 pub fn GetCaretPos(
4793 lpPoint: LPPOINT,
4794 ) -> BOOL;
4795 pub fn ClientToScreen(
4796 hWnd: HWND,
4797 lpPoint: LPPOINT,
4798 ) -> BOOL;
4799 pub fn ScreenToClient(
4800 hWnd: HWND,
4801 lpPoint: LPPOINT,
4802 ) -> BOOL;
4803 pub fn LogicalToPhysicalPoint(
4804 hWnd: HWND,
4805 lpPoint: LPPOINT,
4806 ) -> BOOL;
4807 pub fn PhysicalToLogicalPoint(
4808 hWnd: HWND,
4809 lpPoint: LPPOINT,
4810 ) -> BOOL;
4811 pub fn LogicalToPhysicalPointForPerMonitorDPI(
4812 hWnd: HWND,
4813 lpPoint: LPPOINT,
4814 ) -> BOOL;
4815 pub fn PhysicalToLogicalPointForPerMonitorDPI(
4816 hWnd: HWND,
4817 lpPoint: LPPOINT,
4818 ) -> BOOL;
4819 pub fn MapWindowPoints(
4820 hWndFrom: HWND,
4821 hWndTo: HWND,
4822 lpPoints: LPPOINT,
4823 cPoints: UINT,
4824 ) -> c_int;
4825 pub fn WindowFromPoint(
4826 Point: POINT,
4827 ) -> HWND;
4828 pub fn WindowFromPhysicalPoint(
4829 Point: POINT,
4830 ) -> HWND;
4831 pub fn ChildWindowFromPoint(
4832 hWndParent: HWND,
4833 point: POINT,
4834 ) -> HWND;
4835 pub fn ClipCursor(
4836 lpRect: *const RECT,
4837 ) -> BOOL;
4838}
4839pub const CWP_ALL: UINT = 0x0000;
4840pub const CWP_SKIPINVISIBLE: UINT = 0x0001;
4841pub const CWP_SKIPDISABLED: UINT = 0x0002;
4842pub const CWP_SKIPTRANSPARENT: UINT = 0x0004;
4843extern "system" {
4844 pub fn ChildWindowFromPointEx(
4845 hwnd: HWND,
4846 pt: POINT,
4847 flags: UINT,
4848 ) -> HWND;
4849}
4850pub const CTLCOLOR_MSGBOX: c_int = 0;
4851pub const CTLCOLOR_EDIT: c_int = 1;
4852pub const CTLCOLOR_LISTBOX: c_int = 2;
4853pub const CTLCOLOR_BTN: c_int = 3;
4854pub const CTLCOLOR_DLG: c_int = 4;
4855pub const CTLCOLOR_SCROLLBAR: c_int = 5;
4856pub const CTLCOLOR_STATIC: c_int = 6;
4857pub const CTLCOLOR_MAX: c_int = 7;
4858pub const COLOR_SCROLLBAR: c_int = 0;
4859pub const COLOR_BACKGROUND: c_int = 1;
4860pub const COLOR_ACTIVECAPTION: c_int = 2;
4861pub const COLOR_INACTIVECAPTION: c_int = 3;
4862pub const COLOR_MENU: c_int = 4;
4863pub const COLOR_WINDOW: c_int = 5;
4864pub const COLOR_WINDOWFRAME: c_int = 6;
4865pub const COLOR_MENUTEXT: c_int = 7;
4866pub const COLOR_WINDOWTEXT: c_int = 8;
4867pub const COLOR_CAPTIONTEXT: c_int = 9;
4868pub const COLOR_ACTIVEBORDER: c_int = 10;
4869pub const COLOR_INACTIVEBORDER: c_int = 11;
4870pub const COLOR_APPWORKSPACE: c_int = 12;
4871pub const COLOR_HIGHLIGHT: c_int = 13;
4872pub const COLOR_HIGHLIGHTTEXT: c_int = 14;
4873pub const COLOR_BTNFACE: c_int = 15;
4874pub const COLOR_BTNSHADOW: c_int = 16;
4875pub const COLOR_GRAYTEXT: c_int = 17;
4876pub const COLOR_BTNTEXT: c_int = 18;
4877pub const COLOR_INACTIVECAPTIONTEXT: c_int = 19;
4878pub const COLOR_BTNHIGHLIGHT: c_int = 20;
4879pub const COLOR_3DDKSHADOW: c_int = 21;
4880pub const COLOR_3DLIGHT: c_int = 22;
4881pub const COLOR_INFOTEXT: c_int = 23;
4882pub const COLOR_INFOBK: c_int = 24;
4883pub const COLOR_HOTLIGHT: c_int = 26;
4884pub const COLOR_GRADIENTACTIVECAPTION: c_int = 27;
4885pub const COLOR_GRADIENTINACTIVECAPTION: c_int = 28;
4886pub const COLOR_MENUHILIGHT: c_int = 29;
4887pub const COLOR_MENUBAR: c_int = 30;
4888pub const COLOR_DESKTOP: c_int = COLOR_BACKGROUND;
4889pub const COLOR_3DFACE: c_int = COLOR_BTNFACE;
4890pub const COLOR_3DSHADOW: c_int = COLOR_BTNSHADOW;
4891pub const COLOR_3DHIGHLIGHT: c_int = COLOR_BTNHIGHLIGHT;
4892pub const COLOR_3DHILIGHT: c_int = COLOR_BTNHIGHLIGHT;
4893pub const COLOR_BTNHILIGHT: c_int = COLOR_BTNHIGHLIGHT;
4894extern "system" {
4895 pub fn GetSysColor(
4896 nIndex: c_int,
4897 ) -> DWORD;
4898 pub fn GetSysColorBrush(
4899 nIndex: c_int,
4900 ) -> HBRUSH;
4901 pub fn SetSysColors(
4902 cElements: c_int,
4903 lpaElements: *const INT,
4904 lpaRgbValues: *const COLORREF,
4905 ) -> BOOL;
4906 pub fn DrawFocusRect(
4907 hDC: HDC,
4908 lprc: *const RECT,
4909 ) -> BOOL;
4910 pub fn FillRect(
4911 hDC: HDC,
4912 lprc: *const RECT,
4913 hbr: HBRUSH,
4914 ) -> c_int;
4915 pub fn FrameRect(
4916 hDC: HDC,
4917 lprc: *const RECT,
4918 hbr: HBRUSH,
4919 ) -> c_int;
4920 pub fn InvertRect(
4921 hDC: HDC,
4922 lprc: *const RECT,
4923 ) -> BOOL;
4924 pub fn SetRect(
4925 lprc: LPRECT,
4926 xLeft: c_int,
4927 yTop: c_int,
4928 xRight: c_int,
4929 yBottom: c_int,
4930 ) -> BOOL;
4931 pub fn SetRectEmpty(
4932 lprc: LPRECT,
4933 ) -> BOOL;
4934 pub fn CopyRect(
4935 lprcDst: LPRECT,
4936 lprcSrc: *const RECT,
4937 ) -> BOOL;
4938 pub fn InflateRect(
4939 lprc: LPRECT,
4940 dx: c_int,
4941 dy: c_int,
4942 ) -> BOOL;
4943 pub fn IntersectRect(
4944 lprcDst: LPRECT,
4945 lprcSrc1: *const RECT,
4946 lprcSrc2: *const RECT,
4947 ) -> BOOL;
4948 pub fn UnionRect(
4949 lprcDst: LPRECT,
4950 lprcSrc1: *const RECT,
4951 lprcSrc2: *const RECT,
4952 ) -> BOOL;
4953 pub fn SubtractRect(
4954 lprcDst: LPRECT,
4955 lprcSrc1: *const RECT,
4956 lprcSrc2: *const RECT,
4957 ) -> BOOL;
4958 pub fn OffsetRect(
4959 lprc: LPRECT,
4960 dx: c_int,
4961 dy: c_int,
4962 ) -> BOOL;
4963 pub fn IsRectEmpty(
4964 lprc: *const RECT,
4965 ) -> BOOL;
4966 pub fn EqualRect(
4967 lprc1: *const RECT,
4968 lprc2: *const RECT,
4969 ) -> BOOL;
4970 pub fn PtInRect(
4971 lprc: *const RECT,
4972 pt: POINT,
4973 ) -> BOOL;
4974 pub fn GetWindowWord(
4975 hWnd: HWND,
4976 nIndex: c_int,
4977 ) -> WORD;
4978 pub fn SetWindowWord(
4979 hwnd: HWND,
4980 nIndex: c_int,
4981 wNewWord: WORD,
4982 ) -> WORD;
4983 pub fn GetWindowLongA(
4984 hWnd: HWND,
4985 nIndex: c_int,
4986 ) -> LONG;
4987 pub fn GetWindowLongW(
4988 hWnd: HWND,
4989 nIndex: c_int,
4990 ) -> LONG;
4991 pub fn SetWindowLongA(
4992 hWnd: HWND,
4993 nIndex: c_int,
4994 dwNewLong: LONG,
4995 ) -> LONG;
4996 pub fn SetWindowLongW(
4997 hWnd: HWND,
4998 nIndex: c_int,
4999 dwNewLong: LONG,
5000 ) -> LONG;
60c5eb7d 5001 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5002 pub fn GetWindowLongPtrA(
5003 hWnd: HWND,
5004 nIndex: c_int,
5005 ) -> LONG_PTR;
60c5eb7d 5006 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5007 pub fn GetWindowLongPtrW(
5008 hWnd: HWND,
5009 nIndex: c_int,
5010 ) -> LONG_PTR;
60c5eb7d 5011 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5012 pub fn SetWindowLongPtrA(
5013 hWnd: HWND,
5014 nIndex: c_int,
5015 dwNewLong: LONG_PTR,
5016 ) -> LONG_PTR;
60c5eb7d 5017 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5018 pub fn SetWindowLongPtrW(
5019 hWnd: HWND,
5020 nIndex: c_int,
5021 dwNewLong: LONG_PTR,
5022 ) -> LONG_PTR;
5023}
60c5eb7d 5024#[cfg(target_pointer_width = "32")]
ff7c6d11 5025pub use self::GetWindowLongA as GetWindowLongPtrA;
60c5eb7d 5026#[cfg(target_pointer_width = "32")]
ff7c6d11 5027pub use self::GetWindowLongW as GetWindowLongPtrW;
60c5eb7d 5028#[cfg(target_pointer_width = "32")]
ff7c6d11 5029pub use self::SetWindowLongA as SetWindowLongPtrA;
60c5eb7d 5030#[cfg(target_pointer_width = "32")]
ff7c6d11
XL
5031pub use self::SetWindowLongW as SetWindowLongPtrW;
5032extern "system" {
5033 pub fn GetClassWord(
5034 hWnd: HWND,
5035 nIndex: c_int,
5036 ) -> WORD;
5037 pub fn SetClassWord(
5038 hWnd: HWND,
5039 nIndex: c_int,
5040 wNewWord: WORD,
5041 ) -> WORD;
5042 pub fn GetClassLongA(
5043 hWnd: HWND,
5044 nIndex: c_int,
5045 ) -> DWORD;
5046 pub fn GetClassLongW(
5047 hWnd: HWND,
5048 nIndex: c_int,
5049 ) -> DWORD;
5050 pub fn SetClassLongA(
5051 hWnd: HWND,
5052 nIndex: c_int,
5053 dwNewLong: LONG,
5054 ) -> DWORD;
5055 pub fn SetClassLongW(
5056 hWnd: HWND,
5057 nIndex: c_int,
5058 dwNewLong: LONG,
5059 ) -> DWORD;
60c5eb7d 5060 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5061 pub fn GetClassLongPtrA(
5062 hWnd: HWND,
5063 nIndex: c_int,
5064 ) -> ULONG_PTR;
60c5eb7d 5065 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5066 pub fn GetClassLongPtrW(
5067 hWnd: HWND,
5068 nIndex: c_int,
5069 ) -> ULONG_PTR;
60c5eb7d 5070 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5071 pub fn SetClassLongPtrA(
5072 hWnd: HWND,
5073 nIndex: c_int,
5074 dwNewLong: LONG_PTR,
5075 ) -> ULONG_PTR;
60c5eb7d 5076 #[cfg(target_pointer_width = "64")]
ff7c6d11
XL
5077 pub fn SetClassLongPtrW(
5078 hWnd: HWND,
5079 nIndex: c_int,
5080 dwNewLong: LONG_PTR,
5081 ) -> ULONG_PTR;
5082}
60c5eb7d 5083#[cfg(target_pointer_width = "32")]
ff7c6d11 5084pub use self::GetClassLongA as GetClassLongPtrA;
60c5eb7d 5085#[cfg(target_pointer_width = "32")]
ff7c6d11 5086pub use self::GetClassLongW as GetClassLongPtrW;
60c5eb7d 5087#[cfg(target_pointer_width = "32")]
ff7c6d11 5088pub use self::SetClassLongA as SetClassLongPtrA;
60c5eb7d 5089#[cfg(target_pointer_width = "32")]
ff7c6d11
XL
5090pub use self::SetClassLongW as SetClassLongPtrW;
5091extern "system" {
5092 pub fn GetProcessDefaultLayout(
5093 pdwDefaultLayout: *mut DWORD,
5094 ) -> BOOL;
5095 pub fn SetProcessDefaultLayout(
5096 dwDefaultLayout: DWORD,
5097 ) -> BOOL;
5098 pub fn GetDesktopWindow() -> HWND;
5099 pub fn GetParent(
5100 hWnd: HWND,
5101 ) -> HWND;
5102 pub fn SetParent(
5103 hWndChild: HWND,
5104 hWndNewParent: HWND,
5105 ) -> HWND;
5106 pub fn EnumChildWindows(
5107 hWndParent: HWND,
5108 lpEnumFunc: WNDENUMPROC,
5109 lParam: LPARAM,
5110 ) -> BOOL;
5111 pub fn FindWindowA(
5112 lpClassName: LPCSTR,
5113 lpWindowName: LPCSTR,
5114 ) -> HWND;
5115 pub fn FindWindowW(
5116 lpClassName: LPCWSTR,
5117 lpWindowName: LPCWSTR,
5118 ) -> HWND;
5119 pub fn FindWindowExA(
5120 hWndParent: HWND,
5121 hWndChildAfter: HWND,
5122 lpszClass: LPCSTR,
5123 lpszWindow: LPCSTR,
5124 ) -> HWND;
5125 pub fn FindWindowExW(
5126 hWndParent: HWND,
5127 hWndChildAfter: HWND,
5128 lpszClass: LPCWSTR,
5129 lpszWindow: LPCWSTR,
5130 ) -> HWND;
5131 pub fn GetShellWindow() -> HWND;
5132 pub fn RegisterShellHookWindow(
5133 hwnd: HWND,
5134 ) -> BOOL;
5135 pub fn DeregisterShellHookWindow(
5136 hwnd: HWND,
5137 ) -> BOOL;
5138 pub fn EnumWindows(
5139 lpEnumFunc: WNDENUMPROC,
5140 lParam: LPARAM,
5141 ) -> BOOL;
5142 pub fn EnumThreadWindows(
5143 dwThreadId: DWORD,
5144 lpfn: WNDENUMPROC,
5145 lParam: LPARAM,
5146 ) -> BOOL;
5147}
5148// EnumTaskWindows
5149extern "system" {
5150 pub fn GetClassNameA(
5151 hWnd: HWND,
5152 lpClassName: LPCSTR,
5153 nMaxCount: c_int,
5154 ) -> c_int;
5155 pub fn GetClassNameW(
5156 hWnd: HWND,
5157 lpClassName: LPCWSTR,
5158 nMaxCount: c_int,
5159 ) -> c_int;
5160 pub fn GetTopWindow(
5161 hWnd: HWND,
5162 ) -> HWND;
5163}
5164// GetNextWindow
5165// GetSysModalWindow
5166// SetSysModalWindow
5167extern "system" {
5168 pub fn GetWindowThreadProcessId(
5169 hWnd: HWND,
5170 lpdwProcessId: LPDWORD,
5171 ) -> DWORD;
5172 pub fn IsGUIThread(
5173 bConvert: BOOL,
5174 ) -> BOOL;
5175 pub fn GetLastActivePopup(
5176 hWnd: HWND,
5177 ) -> HWND;
5178}
5179pub const GW_HWNDFIRST: UINT = 0;
5180pub const GW_HWNDLAST: UINT = 1;
5181pub const GW_HWNDNEXT: UINT = 2;
5182pub const GW_HWNDPREV: UINT = 3;
5183pub const GW_OWNER: UINT = 4;
5184pub const GW_CHILD: UINT = 5;
5185pub const GW_ENABLEDPOPUP: UINT = 6;
5186pub const GW_MAX: UINT = 6;
5187extern "system" {
5188 pub fn GetWindow(
5189 hWnd: HWND,
5190 uCmd: UINT,
5191 ) -> HWND;
5192 pub fn SetWindowsHookA(
5193 nFilterType: c_int,
5194 pfnFilterProc: HOOKPROC,
5195 ) -> HHOOK;
5196 pub fn SetWindowsHookW(
5197 nFilterType: c_int,
5198 pfnFilterProc: HOOKPROC,
5199 ) -> HHOOK;
5200 pub fn UnhookWindowsHook(
5201 nFilterType: c_int,
5202 pfnFilterProc: HOOKPROC,
5203 ) -> BOOL;
5204 pub fn SetWindowsHookExA(
5205 idHook: c_int,
5206 lpfn: HOOKPROC,
5207 hmod: HINSTANCE,
5208 dwThreadId: DWORD,
5209 ) -> HHOOK;
5210 pub fn SetWindowsHookExW(
5211 idHook: c_int,
5212 lpfn: HOOKPROC,
5213 hmod: HINSTANCE,
5214 dwThreadId: DWORD,
5215 ) -> HHOOK;
5216 pub fn UnhookWindowsHookEx(
5217 hhk: HHOOK,
5218 ) -> BOOL;
5219 pub fn CallNextHookEx(
5220 hhk: HHOOK,
5221 nCode: c_int,
5222 wParam: WPARAM,
5223 lParam: LPARAM,
5224 ) -> LRESULT;
5225}
5226// DefHookProc
5227pub const MF_INSERT: UINT = 0x00000000;
5228pub const MF_CHANGE: UINT = 0x00000080;
5229pub const MF_APPEND: UINT = 0x00000100;
5230pub const MF_DELETE: UINT = 0x00000200;
5231pub const MF_REMOVE: UINT = 0x00001000;
5232pub const MF_BYCOMMAND: UINT = 0x00000000;
5233pub const MF_BYPOSITION: UINT = 0x00000400;
5234pub const MF_SEPARATOR: UINT = 0x00000800;
5235pub const MF_ENABLED: UINT = 0x00000000;
5236pub const MF_GRAYED: UINT = 0x00000001;
5237pub const MF_DISABLED: UINT = 0x00000002;
5238pub const MF_UNCHECKED: UINT = 0x00000000;
5239pub const MF_CHECKED: UINT = 0x00000008;
5240pub const MF_USECHECKBITMAPS: UINT = 0x00000200;
5241pub const MF_STRING: UINT = 0x00000000;
5242pub const MF_BITMAP: UINT = 0x00000004;
5243pub const MF_OWNERDRAW: UINT = 0x00000100;
5244pub const MF_POPUP: UINT = 0x00000010;
5245pub const MF_MENUBARBREAK: UINT = 0x00000020;
5246pub const MF_MENUBREAK: UINT = 0x00000040;
5247pub const MF_UNHILITE: UINT = 0x00000000;
5248pub const MF_HILITE: UINT = 0x00000080;
5249pub const MF_DEFAULT: UINT = 0x00001000;
5250pub const MF_SYSMENU: UINT = 0x00002000;
5251pub const MF_HELP: UINT = 0x00004000;
5252pub const MF_RIGHTJUSTIFY: UINT = 0x00004000;
5253pub const MF_MOUSESELECT: UINT = 0x00008000;
5254pub const MF_END: UINT = 0x00000080;
5255pub const MFT_STRING: UINT = MF_STRING;
5256pub const MFT_BITMAP: UINT = MF_BITMAP;
5257pub const MFT_MENUBARBREAK: UINT = MF_MENUBARBREAK;
5258pub const MFT_MENUBREAK: UINT = MF_MENUBREAK;
5259pub const MFT_OWNERDRAW: UINT = MF_OWNERDRAW;
5260pub const MFT_RADIOCHECK: UINT = 0x00000200;
5261pub const MFT_SEPARATOR: UINT = MF_SEPARATOR;
5262pub const MFT_RIGHTORDER: UINT = 0x00002000;
5263pub const MFT_RIGHTJUSTIFY: UINT = MF_RIGHTJUSTIFY;
5264pub const MFS_GRAYED: UINT = 0x00000003;
5265pub const MFS_DISABLED: UINT = MFS_GRAYED;
5266pub const MFS_CHECKED: UINT = MF_CHECKED;
5267pub const MFS_HILITE: UINT = MF_HILITE;
5268pub const MFS_ENABLED: UINT = MF_ENABLED;
5269pub const MFS_UNCHECKED: UINT = MF_UNCHECKED;
5270pub const MFS_UNHILITE: UINT = MF_UNHILITE;
5271pub const MFS_DEFAULT: UINT = MF_DEFAULT;
5272extern "system" {
5273 pub fn CheckMenuRadioItem(
5274 hMenu: HMENU,
5275 first: UINT,
5276 last: UINT,
5277 check: UINT,
5278 flags: UINT,
5279 ) -> BOOL;
5280}
60c5eb7d
XL
5281//10225
5282pub const SC_SIZE: WPARAM = 0xF000;
5283pub const SC_MOVE: WPARAM = 0xF010;
5284pub const SC_MINIMIZE: WPARAM = 0xF020;
5285pub const SC_MAXIMIZE: WPARAM = 0xF030;
5286pub const SC_NEXTWINDOW: WPARAM = 0xF040;
5287pub const SC_PREVWINDOW: WPARAM = 0xF050;
5288pub const SC_CLOSE: WPARAM = 0xF060;
5289pub const SC_VSCROLL: WPARAM = 0xF070;
5290pub const SC_HSCROLL: WPARAM = 0xF080;
5291pub const SC_MOUSEMENU: WPARAM = 0xF090;
5292pub const SC_KEYMENU: WPARAM = 0xF100;
5293pub const SC_ARRANGE: WPARAM = 0xF110;
5294pub const SC_RESTORE: WPARAM = 0xF120;
5295pub const SC_TASKLIST: WPARAM = 0xF130;
5296pub const SC_SCREENSAVE: WPARAM = 0xF140;
5297pub const SC_HOTKEY: WPARAM = 0xF150;
5298pub const SC_DEFAULT: WPARAM = 0xF160;
5299pub const SC_MONITORPOWER: WPARAM = 0xF170;
5300pub const SC_CONTEXTHELP: WPARAM = 0xF180;
5301pub const SC_SEPARATOR: WPARAM = 0xF00F;
5302//10269
5303extern "system" {
5304 pub fn LoadBitmapA(
5305 hInstance: HINSTANCE,
5306 lpBitmapName: LPCSTR,
5307 ) -> HBITMAP;
5308 pub fn LoadBitmapW(
5309 hInstance: HINSTANCE,
5310 lpBitmapName: LPCWSTR,
5311 ) -> HBITMAP;
5312 pub fn LoadCursorA(
5313 hInstance: HINSTANCE,
5314 lpCursorName: LPCSTR,
5315 ) -> HCURSOR;
5316 pub fn LoadCursorW(
5317 hInstance: HINSTANCE,
5318 lpCursorName: LPCWSTR,
5319 ) -> HCURSOR;
5320 pub fn LoadCursorFromFileA(
5321 lpFileName: LPCSTR,
5322 ) -> HCURSOR;
5323 pub fn LoadCursorFromFileW(
5324 lpFileName: LPCWSTR,
5325 ) -> HCURSOR;
5326 pub fn CreateCursor(
5327 hInst: HINSTANCE,
5328 xHotSpot: c_int,
5329 yHotSpot: c_int,
5330 nWidth: c_int,
5331 nHeight: c_int,
5332 pvAndPlane: *const VOID,
5333 pvXORPlane: *const VOID,
5334 ) -> HCURSOR;
5335 pub fn DestroyCursor(
5336 hCursor: HCURSOR,
5337 ) -> BOOL;
5338}
5339//10355
5340pub const IDC_ARROW: LPCWSTR = 32512 as LPCWSTR;
5341pub const IDC_IBEAM: LPCWSTR = 32513 as LPCWSTR;
5342pub const IDC_WAIT: LPCWSTR = 32514 as LPCWSTR;
5343pub const IDC_CROSS: LPCWSTR = 32515 as LPCWSTR;
5344pub const IDC_UPARROW: LPCWSTR = 32516 as LPCWSTR;
5345pub const IDC_SIZE: LPCWSTR = 32640 as LPCWSTR;
5346pub const IDC_ICON: LPCWSTR = 32641 as LPCWSTR;
5347pub const IDC_SIZENWSE: LPCWSTR = 32642 as LPCWSTR;
5348pub const IDC_SIZENESW: LPCWSTR = 32643 as LPCWSTR;
5349pub const IDC_SIZEWE: LPCWSTR = 32644 as LPCWSTR;
5350pub const IDC_SIZENS: LPCWSTR = 32645 as LPCWSTR;
5351pub const IDC_SIZEALL: LPCWSTR = 32646 as LPCWSTR;
5352pub const IDC_NO: LPCWSTR = 32648 as LPCWSTR;
5353pub const IDC_HAND: LPCWSTR = 32649 as LPCWSTR;
5354pub const IDC_APPSTARTING: LPCWSTR = 32650 as LPCWSTR;
5355pub const IDC_HELP: LPCWSTR = 32651 as LPCWSTR;
5356extern "system" {
5357 pub fn SetSystemCursor(
5358 hcur: HCURSOR,
5359 id: DWORD,
5360 ) -> BOOL;
5361}
5362STRUCT!{struct ICONINFO {
5363 fIcon: BOOL,
5364 xHotspot: DWORD,
5365 yHotspot: DWORD,
5366 hbmMask: HBITMAP,
5367 hbmColor: HBITMAP,
5368}}
5369pub type PICONINFO = *mut ICONINFO;
5370extern "system" {
5371 pub fn LoadIconA(
5372 hInstance: HINSTANCE,
5373 lpIconName: LPCSTR,
5374 ) -> HICON;
5375 pub fn LoadIconW(
5376 hInstance: HINSTANCE,
5377 lpIconName: LPCWSTR,
5378 ) -> HICON;
5379}
5380//10449
5381extern "system" {
5382 pub fn CreateIcon(
5383 hInstance: HINSTANCE,
5384 nWidth: c_int,
5385 nHeight: c_int,
5386 cPlanes: BYTE,
5387 cBitsPixel: BYTE,
5388 lpbANDbits: *const BYTE,
5389 lpbXORbits: *const BYTE,
5390 ) -> HICON;
5391 pub fn DestroyIcon(
5392 hIcon: HICON,
5393 ) -> BOOL;
5394 pub fn LookupIconIdFromDirectory(
5395 presbits: PBYTE,
5396 fIcon: BOOL,
5397 ) -> c_int;
5398 pub fn LookupIconIdFromDirectoryEx(
5399 presbits: PBYTE,
5400 fIcon: BOOL,
5401 cxDesired: c_int,
5402 cyDesired: c_int,
5403 Flags: UINT,
5404 ) -> c_int;
5405 pub fn CreateIconFromResource(
5406 presbits: PBYTE,
5407 dwResSize: DWORD,
5408 fIcon: BOOL,
5409 dwVer: DWORD,
5410 ) -> HICON;
5411 pub fn CreateIconFromResourceEx(
5412 presbits: PBYTE,
5413 dwResSize: DWORD,
5414 fIcon: BOOL,
5415 dwVer: DWORD,
5416 cxDesired: c_int,
5417 cyDesired: c_int,
5418 Flags: UINT,
5419 ) -> HICON;
5420}
5421//10524
5422pub const IMAGE_BITMAP: UINT = 0;
5423pub const IMAGE_ICON: UINT = 1;
5424pub const IMAGE_CURSOR: UINT = 2;
5425pub const IMAGE_ENHMETAFILE: UINT = 3;
5426pub const LR_DEFAULTCOLOR: UINT = 0x00000000;
5427pub const LR_MONOCHROME: UINT = 0x00000001;
5428pub const LR_COLOR: UINT = 0x00000002;
5429pub const LR_COPYRETURNORG: UINT = 0x00000004;
5430pub const LR_COPYDELETEORG: UINT = 0x00000008;
5431pub const LR_LOADFROMFILE: UINT = 0x00000010;
5432pub const LR_LOADTRANSPARENT: UINT = 0x00000020;
5433pub const LR_DEFAULTSIZE: UINT = 0x00000040;
5434pub const LR_VGACOLOR: UINT = 0x00000080;
5435pub const LR_LOADMAP3DCOLORS: UINT = 0x00001000;
5436pub const LR_CREATEDIBSECTION: UINT = 0x00002000;
5437pub const LR_COPYFROMRESOURCE: UINT = 0x00004000;
5438pub const LR_SHARED: UINT = 0x00008000;
5439extern "system" {
5440 pub fn LoadImageA(
5441 hInst: HINSTANCE,
5442 name: LPCSTR,
5443 type_: UINT,
5444 cx: c_int,
5445 cy: c_int,
5446 fuLoad: UINT,
5447 ) -> HANDLE;
5448 pub fn LoadImageW(
5449 hInst: HINSTANCE,
5450 name: LPCWSTR,
5451 type_: UINT,
5452 cx: c_int,
5453 cy: c_int,
5454 fuLoad: UINT,
5455 ) -> HANDLE;
5456 pub fn CopyImage(
5457 h: HANDLE,
5458 type_: UINT,
5459 cx: c_int,
5460 cy: c_int,
5461 flags: UINT,
5462 ) -> HANDLE;
5463}
5464//10592
5465extern "system" {
5466 pub fn DrawIconEx(
5467 hdc: HDC,
5468 xLeft: c_int,
5469 yTop: c_int,
5470 hIcon: HICON,
5471 cxWidth: c_int,
5472 cyWidth: c_int,
5473 istepIfAniCur: UINT,
5474 hbrFlickerFreeDraw: HBRUSH,
5475 diFlags: UINT,
5476 ) -> BOOL;
5477 pub fn CreateIconIndirect(
5478 piconinfo: PICONINFO,
5479 ) -> HICON;
5480 pub fn CopyIcon(
5481 hIcon: HICON,
5482 ) -> HICON;
5483 pub fn GetIconInfo(
5484 hIcon: HICON,
5485 piconinfo: PICONINFO,
5486 ) -> BOOL;
5487}
5488//10781
5489pub const IDI_APPLICATION: LPCWSTR = 32512 as LPCWSTR;
5490pub const IDI_HAND: LPCWSTR = 32513 as LPCWSTR;
5491pub const IDI_QUESTION: LPCWSTR = 32514 as LPCWSTR;
5492pub const IDI_EXCLAMATION: LPCWSTR = 32515 as LPCWSTR;
5493pub const IDI_ASTERISK: LPCWSTR = 32516 as LPCWSTR;
5494pub const IDI_WINLOGO: LPCWSTR = 32517 as LPCWSTR;
5495pub const IDI_SHIELD: LPCWSTR = 32518 as LPCWSTR;
5496pub const IDI_WARNING: LPCWSTR = IDI_EXCLAMATION;
5497pub const IDI_ERROR: LPCWSTR = IDI_HAND;
5498pub const IDI_INFORMATION: LPCWSTR = IDI_ASTERISK;
5499//10853
ff7c6d11
XL
5500pub const IDOK: c_int = 1;
5501pub const IDCANCEL: c_int = 2;
5502pub const IDABORT: c_int = 3;
5503pub const IDRETRY: c_int = 4;
5504pub const IDIGNORE: c_int = 5;
5505pub const IDYES: c_int = 6;
5506pub const IDNO: c_int = 7;
5507pub const IDCLOSE: c_int = 8;
5508pub const IDHELP: c_int = 9;
5509pub const IDTRYAGAIN: c_int = 10;
5510pub const IDCONTINUE: c_int = 11;
5511pub const IDTIMEOUT: c_int = 32000;
ff7c6d11
XL
5512pub const ES_LEFT: DWORD = 0x0000;
5513pub const ES_CENTER: DWORD = 0x0001;
5514pub const ES_RIGHT: DWORD = 0x0002;
5515pub const ES_MULTILINE: DWORD = 0x0004;
5516pub const ES_UPPERCASE: DWORD = 0x0008;
5517pub const ES_LOWERCASE: DWORD = 0x0010;
5518pub const ES_PASSWORD: DWORD = 0x0020;
5519pub const ES_AUTOVSCROLL: DWORD = 0x0040;
5520pub const ES_AUTOHSCROLL: DWORD = 0x0080;
5521pub const ES_NOHIDESEL: DWORD = 0x0100;
5522pub const ES_OEMCONVERT: DWORD = 0x0400;
5523pub const ES_READONLY: DWORD = 0x0800;
5524pub const ES_WANTRETURN: DWORD = 0x1000;
5525pub const ES_NUMBER: DWORD = 0x2000;
ff7c6d11
XL
5526pub const EN_SETFOCUS: WORD = 0x0100;
5527pub const EN_KILLFOCUS: WORD = 0x0200;
5528pub const EN_CHANGE: WORD = 0x0300;
5529pub const EN_UPDATE: WORD = 0x0400;
5530pub const EN_ERRSPACE: WORD = 0x0500;
5531pub const EN_MAXTEXT: WORD = 0x0501;
5532pub const EN_HSCROLL: WORD = 0x0601;
5533pub const EN_VSCROLL: WORD = 0x0602;
5534pub const EN_ALIGN_LTR_EC: WORD = 0x0700;
5535pub const EN_ALIGN_RTL_EC: WORD = 0x0701;
ff7c6d11
XL
5536pub const EC_LEFTMARGIN: WORD = 0x0001;
5537pub const EC_RIGHTMARGIN: WORD = 0x0002;
5538pub const EC_USEFONTINFO: WORD = 0xffff;
ff7c6d11 5539pub const EMSIS_COMPOSITIONSTRING: WORD = 0x0001;
ff7c6d11
XL
5540pub const EIMES_GETCOMPSTRATONCE: WORD = 0x0001;
5541pub const EIMES_CANCELCOMPSTRINFOCUS: WORD = 0x0002;
5542pub const EIMES_COMPLETECOMPSTRKILLFOCUS: WORD = 0x0004;
ff7c6d11
XL
5543pub const EM_GETSEL: WORD = 0x00B0;
5544pub const EM_SETSEL: WORD = 0x00B1;
5545pub const EM_GETRECT: WORD = 0x00B2;
5546pub const EM_SETRECT: WORD = 0x00B3;
5547pub const EM_SETRECTNP: WORD = 0x00B4;
5548pub const EM_SCROLL: WORD = 0x00B5;
5549pub const EM_LINESCROLL: WORD = 0x00B6;
5550pub const EM_SCROLLCARET: WORD = 0x00B7;
5551pub const EM_GETMODIFY: WORD = 0x00B8;
5552pub const EM_SETMODIFY: WORD = 0x00B9;
5553pub const EM_GETLINECOUNT: WORD = 0x00BA;
5554pub const EM_LINEINDEX: WORD = 0x00BB;
5555pub const EM_SETHANDLE: WORD = 0x00BC;
5556pub const EM_GETHANDLE: WORD = 0x00BD;
5557pub const EM_GETTHUMB: WORD = 0x00BE;
5558pub const EM_LINELENGTH: WORD = 0x00C1;
5559pub const EM_REPLACESEL: WORD = 0x00C2;
5560pub const EM_GETLINE: WORD = 0x00C4;
5561pub const EM_LIMITTEXT: WORD = 0x00C5;
5562pub const EM_CANUNDO: WORD = 0x00C6;
5563pub const EM_UNDO: WORD = 0x00C7;
5564pub const EM_FMTLINES: WORD = 0x00C8;
5565pub const EM_LINEFROMCHAR: WORD = 0x00C9;
5566pub const EM_SETTABSTOPS: WORD = 0x00CB;
5567pub const EM_SETPASSWORDCHAR: WORD = 0x00CC;
5568pub const EM_EMPTYUNDOBUFFER: WORD = 0x00CD;
5569pub const EM_GETFIRSTVISIBLELINE: WORD = 0x00CE;
5570pub const EM_SETREADONLY: WORD = 0x00CF;
5571pub const EM_SETWORDBREAKPROC: WORD = 0x00D0;
5572pub const EM_GETWORDBREAKPROC: WORD = 0x00D1;
5573pub const EM_GETPASSWORDCHAR: WORD = 0x00D2;
5574pub const EM_SETMARGINS: WORD = 0x00D3;
5575pub const EM_GETMARGINS: WORD = 0x00D4;
5576pub const EM_SETLIMITTEXT: WORD = EM_LIMITTEXT;
5577pub const EM_GETLIMITTEXT: WORD = 0x00D5;
5578pub const EM_POSFROMCHAR: WORD = 0x00D6;
5579pub const EM_CHARFROMPOS: WORD = 0x00D7;
5580pub const EM_SETIMESTATUS: WORD = 0x00D8;
5581pub const EM_GETIMESTATUS: WORD = 0x00D9;
ff7c6d11
XL
5582pub const WB_LEFT: WORD = 0;
5583pub const WB_RIGHT: WORD = 1;
5584pub const WB_ISDELIMITER: WORD = 2;
5585pub const BN_CLICKED: WORD = 0;
5586pub const BN_PAINT: WORD = 1;
5587pub const BN_HILITE: WORD = 2;
5588pub const BN_UNHILITE: WORD = 3;
5589pub const BN_DISABLE: WORD = 4;
5590pub const BN_DOUBLECLICKED: WORD = 5;
5591pub const BN_PUSHED: WORD = BN_HILITE;
5592pub const BN_UNPUSHED: WORD = BN_UNHILITE;
5593pub const BN_DBLCLK: WORD = BN_DOUBLECLICKED;
5594pub const BN_SETFOCUS: WORD = 6;
5595pub const BN_KILLFOCUS: WORD = 7;
5596pub const BS_PUSHBUTTON: DWORD = 0x00000000;
5597pub const BS_DEFPUSHBUTTON: DWORD = 0x00000001;
5598pub const BS_CHECKBOX: DWORD = 0x00000002;
5599pub const BS_AUTOCHECKBOX: DWORD = 0x00000003;
5600pub const BS_RADIOBUTTON: DWORD = 0x00000004;
5601pub const BS_3STATE: DWORD = 0x00000005;
5602pub const BS_AUTO3STATE: DWORD = 0x00000006;
5603pub const BS_GROUPBOX: DWORD = 0x00000007;
5604pub const BS_USERBUTTON: DWORD = 0x00000008;
5605pub const BS_AUTORADIOBUTTON: DWORD = 0x00000009;
5606pub const BS_PUSHBOX: DWORD = 0x0000000A;
5607pub const BS_OWNERDRAW: DWORD = 0x0000000B;
5608pub const BS_TYPEMASK: DWORD = 0x0000000F;
5609pub const BS_LEFTTEXT: DWORD = 0x00000020;
5610pub const BS_TEXT: DWORD = 0x00000000;
5611pub const BS_ICON: DWORD = 0x00000040;
5612pub const BS_BITMAP: DWORD = 0x00000080;
5613pub const BS_LEFT: DWORD = 0x00000100;
5614pub const BS_RIGHT: DWORD = 0x00000200;
5615pub const BS_CENTER: DWORD = 0x00000300;
5616pub const BS_TOP: DWORD = 0x00000400;
5617pub const BS_BOTTOM: DWORD = 0x00000800;
5618pub const BS_VCENTER: DWORD = 0x00000C00;
5619pub const BS_PUSHLIKE: DWORD = 0x00001000;
5620pub const BS_MULTILINE: DWORD = 0x00002000;
5621pub const BS_NOTIFY: DWORD = 0x00004000;
5622pub const BS_FLAT: DWORD = 0x00008000;
5623pub const BS_RIGHTBUTTON: DWORD = BS_LEFTTEXT;
5624pub const BM_GETCHECK: UINT = 0x00F0;
5625pub const BM_SETCHECK: UINT = 0x00F1;
5626pub const BM_GETSTATE: UINT = 0x00F2;
5627pub const BM_SETSTATE: UINT = 0x00F3;
5628pub const BM_SETSTYLE: UINT = 0x00F4;
5629pub const BM_CLICK: UINT = 0x00F5;
5630pub const BM_GETIMAGE: UINT = 0x00F6;
5631pub const BM_SETIMAGE: UINT = 0x00F7;
5632pub const BM_SETDONTCLICK: UINT = 0x00F8;
5633pub const BST_UNCHECKED: WPARAM = 0x0000;
5634pub const BST_CHECKED: WPARAM = 0x0001;
5635pub const BST_INDETERMINATE: WPARAM = 0x0002;
5636pub const BST_PUSHED: LRESULT = 0x0004;
5637pub const BST_FOCUS: LRESULT = 0x0008;
5638pub const SS_LEFT: DWORD = 0x00000000;
5639pub const SS_CENTER: DWORD = 0x00000001;
5640pub const SS_RIGHT: DWORD = 0x00000002;
5641pub const SS_ICON: DWORD = 0x00000003;
5642pub const SS_BLACKRECT: DWORD = 0x00000004;
5643pub const SS_GRAYRECT: DWORD = 0x00000005;
5644pub const SS_WHITERECT: DWORD = 0x00000006;
5645pub const SS_BLACKFRAME: DWORD = 0x00000007;
5646pub const SS_GRAYFRAME: DWORD = 0x00000008;
5647pub const SS_WHITEFRAME: DWORD = 0x00000009;
5648pub const SS_USERITEM: DWORD = 0x0000000A;
5649pub const SS_SIMPLE: DWORD = 0x0000000B;
5650pub const SS_LEFTNOWORDWRAP: DWORD = 0x0000000C;
5651pub const SS_OWNERDRAW: DWORD = 0x0000000D;
5652pub const SS_BITMAP: DWORD = 0x0000000E;
5653pub const SS_ENHMETAFILE: DWORD = 0x0000000F;
5654pub const SS_ETCHEDHORZ: DWORD = 0x00000010;
5655pub const SS_ETCHEDVERT: DWORD = 0x00000011;
5656pub const SS_ETCHEDFRAME: DWORD = 0x00000012;
5657pub const SS_TYPEMASK: DWORD = 0x0000001F;
5658pub const SS_REALSIZECONTROL: DWORD = 0x00000040;
5659pub const SS_NOPREFIX: DWORD = 0x00000080;
5660pub const SS_NOTIFY: DWORD = 0x00000100;
5661pub const SS_CENTERIMAGE: DWORD = 0x00000200;
5662pub const SS_RIGHTJUST: DWORD = 0x00000400;
5663pub const SS_REALSIZEIMAGE: DWORD = 0x00000800;
5664pub const SS_SUNKEN: DWORD = 0x00001000;
5665pub const SS_EDITCONTROL: DWORD = 0x00002000;
5666pub const SS_ENDELLIPSIS: DWORD = 0x00004000;
5667pub const SS_PATHELLIPSIS: DWORD = 0x00008000;
5668pub const SS_WORDELLIPSIS: DWORD = 0x0000C000;
5669pub const SS_ELLIPSISMASK: DWORD = 0x0000C000;
5670pub const STM_SETICON: UINT = 0x0170;
5671pub const STM_GETICON: UINT = 0x0171;
5672pub const STM_SETIMAGE: UINT = 0x0172;
5673pub const STM_GETIMAGE: UINT = 0x0173;
5674pub const STN_CLICKED: WORD = 0;
5675pub const STN_DBLCLK: WORD = 1;
5676pub const STN_ENABLE: WORD = 2;
5677pub const STN_DISABLE: WORD = 3;
5678pub const STM_MSGMAX: WORD = 0x0174;
60c5eb7d 5679//11194
ff7c6d11
XL
5680extern "system" {
5681 pub fn IsDialogMessageA(
5682 hDlg: HWND,
5683 lpMsg: LPMSG,
5684 ) -> BOOL;
5685 pub fn IsDialogMessageW(
5686 hDlg: HWND,
5687 lpMsg: LPMSG,
5688 ) -> BOOL;
5689 pub fn MapDialogRect(
5690 hDlg: HWND,
5691 lpRect: LPRECT,
5692 ) -> BOOL;
5693 pub fn DlgDirListA(
5694 hDlg: HWND,
5695 lpPathSpec: LPSTR,
5696 nIDListBox: c_int,
5697 nIDStaticPath: c_int,
5698 uFileType: UINT,
5699 ) -> c_int;
5700 pub fn DlgDirListW(
5701 hDlg: HWND,
5702 lpPathSpec: LPWSTR,
5703 nIDListBox: c_int,
5704 nIDStaticPath: c_int,
5705 uFileType: UINT,
5706 ) -> c_int;
60c5eb7d
XL
5707}
5708//11265
5709extern "system" {
ff7c6d11
XL
5710 pub fn DlgDirSelectExA(
5711 hwndDlg: HWND,
5712 lpString: LPSTR,
5713 chCount: c_int,
5714 idListBox: c_int,
5715 ) -> BOOL;
5716 pub fn DlgDirSelectExW(
5717 hwndDlg: HWND,
5718 lpString: LPWSTR,
5719 chCount: c_int,
5720 idListBox: c_int,
5721 ) -> BOOL;
5722 pub fn DlgDirListComboBoxA(
5723 hDlg: HWND,
5724 lpPathSpec: LPSTR,
5725 nIDComboBox: c_int,
5726 nIDStaticPath: c_int,
5727 uFiletype: UINT,
5728 ) -> c_int;
5729 pub fn DlgDirListComboBoxW(
5730 hDlg: HWND,
5731 lpPathSpec: LPWSTR,
5732 nIDComboBox: c_int,
5733 nIDStaticPath: c_int,
5734 uFiletype: UINT,
5735 ) -> c_int;
5736 pub fn DlgDirSelectComboBoxExA(
5737 hwndDlg: HWND,
5738 lpString: LPSTR,
5739 cchOut: c_int,
5740 idComboBox: c_int,
5741 ) -> BOOL;
5742 pub fn DlgDirSelectComboBoxExW(
5743 hwndDlg: HWND,
5744 lpString: LPWSTR,
5745 cchOut: c_int,
5746 idComboBox: c_int,
5747 ) -> BOOL;
5748}
5749pub const DS_ABSALIGN: DWORD = 0x01;
5750pub const DS_SYSMODAL: DWORD = 0x02;
5751pub const DS_LOCALEDIT: DWORD = 0x20;
5752pub const DS_SETFONT: DWORD = 0x40;
5753pub const DS_MODALFRAME: DWORD = 0x80;
5754pub const DS_NOIDLEMSG: DWORD = 0x100;
5755pub const DS_SETFOREGROUND: DWORD = 0x200;
5756pub const DS_3DLOOK: DWORD = 0x0004;
5757pub const DS_FIXEDSYS: DWORD = 0x0008;
5758pub const DS_NOFAILCREATE: DWORD = 0x0010;
5759pub const DS_CONTROL: DWORD = 0x0400;
5760pub const DS_CENTER: DWORD = 0x0800;
5761pub const DS_CENTERMOUSE: DWORD = 0x1000;
5762pub const DS_CONTEXTHELP: DWORD = 0x2000;
5763pub const DS_SHELLFONT: DWORD = DS_SETFONT | DS_FIXEDSYS;
5764pub const DS_USEPIXELS: DWORD = 0x8000;
5765pub const DM_GETDEFID: UINT = WM_USER + 0;
5766pub const DM_SETDEFID: UINT = WM_USER + 1;
5767pub const DM_REPOSITION: UINT = WM_USER + 2;
5768pub const DC_HASDEFID: WORD = 0x534B;
5769pub const DLGC_WANTARROWS: LRESULT = 0x0001;
5770pub const DLGC_WANTTAB: LRESULT = 0x0002;
5771pub const DLGC_WANTALLKEYS: LRESULT = 0x0004;
5772pub const DLGC_WANTMESSAGE: LRESULT = 0x0004;
5773pub const DLGC_HASSETSEL: LRESULT = 0x0008;
5774pub const DLGC_DEFPUSHBUTTON: LRESULT = 0x0010;
5775pub const DLGC_UNDEFPUSHBUTTON: LRESULT = 0x0020;
5776pub const DLGC_RADIOBUTTON: LRESULT = 0x0040;
5777pub const DLGC_WANTCHARS: LRESULT = 0x0080;
5778pub const DLGC_STATIC: LRESULT = 0x0100;
5779pub const DLGC_BUTTON: LRESULT = 0x2000;
5780pub const LB_OKAY: LRESULT = 0;
5781pub const LB_ERR: LRESULT = -1;
5782pub const LB_ERRSPACE: LRESULT = -2;
5783pub const LBN_ERRSPACE: WORD = -2i16 as u16;
5784pub const LBN_SELCHANGE: WORD = 1;
5785pub const LBN_DBLCLK: WORD = 2;
5786pub const LBN_SELCANCEL: WORD = 3;
5787pub const LBN_SETFOCUS: WORD = 4;
5788pub const LBN_KILLFOCUS: WORD = 5;
5789pub const LB_ADDSTRING: UINT = 0x0180;
5790pub const LB_INSERTSTRING: UINT = 0x0181;
5791pub const LB_DELETESTRING: UINT = 0x0182;
5792pub const LB_SELITEMRANGEEX: UINT = 0x0183;
5793pub const LB_RESETCONTENT: UINT = 0x0184;
5794pub const LB_SETSEL: UINT = 0x0185;
5795pub const LB_SETCURSEL: UINT = 0x0186;
5796pub const LB_GETSEL: UINT = 0x0187;
5797pub const LB_GETCURSEL: UINT = 0x0188;
5798pub const LB_GETTEXT: UINT = 0x0189;
5799pub const LB_GETTEXTLEN: UINT = 0x018A;
5800pub const LB_GETCOUNT: UINT = 0x018B;
5801pub const LB_SELECTSTRING: UINT = 0x018C;
5802pub const LB_DIR: UINT = 0x018D;
5803pub const LB_GETTOPINDEX: UINT = 0x018E;
5804pub const LB_FINDSTRING: UINT = 0x018F;
5805pub const LB_GETSELCOUNT: UINT = 0x0190;
5806pub const LB_GETSELITEMS: UINT = 0x0191;
5807pub const LB_SETTABSTOPS: UINT = 0x0192;
5808pub const LB_GETHORIZONTALEXTENT: UINT = 0x0193;
5809pub const LB_SETHORIZONTALEXTENT: UINT = 0x0194;
5810pub const LB_SETCOLUMNWIDTH: UINT = 0x0195;
5811pub const LB_ADDFILE: UINT = 0x0196;
5812pub const LB_SETTOPINDEX: UINT = 0x0197;
5813pub const LB_GETITEMRECT: UINT = 0x0198;
5814pub const LB_GETITEMDATA: UINT = 0x0199;
5815pub const LB_SETITEMDATA: UINT = 0x019A;
5816pub const LB_SELITEMRANGE: UINT = 0x019B;
5817pub const LB_SETANCHORINDEX: UINT = 0x019C;
5818pub const LB_GETANCHORINDEX: UINT = 0x019D;
5819pub const LB_SETCARETINDEX: UINT = 0x019E;
5820pub const LB_GETCARETINDEX: UINT = 0x019F;
5821pub const LB_SETITEMHEIGHT: UINT = 0x01A0;
5822pub const LB_GETITEMHEIGHT: UINT = 0x01A1;
5823pub const LB_FINDSTRINGEXACT: UINT = 0x01A2;
5824pub const LB_SETLOCALE: UINT = 0x01A5;
5825pub const LB_GETLOCALE: UINT = 0x01A6;
5826pub const LB_SETCOUNT: UINT = 0x01A7;
5827pub const LB_INITSTORAGE: UINT = 0x01A8;
5828pub const LB_ITEMFROMPOINT: UINT = 0x01A9;
5829pub const LB_MULTIPLEADDSTRING: UINT = 0x01B1;
5830pub const LB_GETLISTBOXINFO: UINT = 0x01B2;
5831pub const LB_MSGMAX: UINT = 0x01B3;
5832pub const LBS_NOTIFY: DWORD = 0x0001;
5833pub const LBS_SORT: DWORD = 0x0002;
5834pub const LBS_NOREDRAW: DWORD = 0x0004;
5835pub const LBS_MULTIPLESEL: DWORD = 0x0008;
5836pub const LBS_OWNERDRAWFIXED: DWORD = 0x0010;
5837pub const LBS_OWNERDRAWVARIABLE: DWORD = 0x0020;
5838pub const LBS_HASSTRINGS: DWORD = 0x0040;
5839pub const LBS_USETABSTOPS: DWORD = 0x0080;
5840pub const LBS_NOINTEGRALHEIGHT: DWORD = 0x0100;
5841pub const LBS_MULTICOLUMN: DWORD = 0x0200;
5842pub const LBS_WANTKEYBOARDINPUT: DWORD = 0x0400;
5843pub const LBS_EXTENDEDSEL: DWORD = 0x0800;
5844pub const LBS_DISABLENOSCROLL: DWORD = 0x1000;
5845pub const LBS_NODATA: DWORD = 0x2000;
5846pub const LBS_NOSEL: DWORD = 0x4000;
5847pub const LBS_COMBOBOX: DWORD = 0x8000;
5848pub const LBS_STANDARD: DWORD = LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER;
5849pub const CB_OKAY: LRESULT = 0;
5850pub const CB_ERR: LRESULT = -1;
5851pub const CB_ERRSPACE: LRESULT = -2;
5852pub const CBN_ERRSPACE: WORD = -1i16 as u16;
5853pub const CBN_SELCHANGE: WORD = 1;
5854pub const CBN_DBLCLK: WORD = 2;
5855pub const CBN_SETFOCUS: WORD = 3;
5856pub const CBN_KILLFOCUS: WORD = 4;
5857pub const CBN_EDITCHANGE: WORD = 5;
5858pub const CBN_EDITUPDATE: WORD = 6;
5859pub const CBN_DROPDOWN: WORD = 7;
5860pub const CBN_CLOSEUP: WORD = 8;
5861pub const CBN_SELENDOK: WORD = 9;
5862pub const CBN_SELENDCANCEL: WORD = 10;
5863pub const CBS_SIMPLE: DWORD = 0x0001;
5864pub const CBS_DROPDOWN: DWORD = 0x0002;
5865pub const CBS_DROPDOWNLIST: DWORD = 0x0003;
5866pub const CBS_OWNERDRAWFIXED: DWORD = 0x0010;
5867pub const CBS_OWNERDRAWVARIABLE: DWORD = 0x0020;
5868pub const CBS_AUTOHSCROLL: DWORD = 0x0040;
5869pub const CBS_OEMCONVERT: DWORD = 0x0080;
5870pub const CBS_SORT: DWORD = 0x0100;
5871pub const CBS_HASSTRINGS: DWORD = 0x0200;
5872pub const CBS_NOINTEGRALHEIGHT: DWORD = 0x0400;
5873pub const CBS_DISABLENOSCROLL: DWORD = 0x0800;
5874pub const CBS_UPPERCASE: DWORD = 0x2000;
5875pub const CBS_LOWERCASE: DWORD = 0x4000;
60c5eb7d
XL
5876//11571
5877pub const CB_GETEDITSEL: UINT = 0x0140;
5878pub const CB_LIMITTEXT: UINT = 0x0141;
5879pub const CB_SETEDITSEL: UINT = 0x0142;
5880pub const CB_ADDSTRING: UINT = 0x0143;
5881pub const CB_DELETESTRING: UINT = 0x0144;
5882pub const CB_DIR: UINT = 0x0145;
5883pub const CB_GETCOUNT: UINT = 0x0146;
5884pub const CB_GETCURSEL: UINT = 0x0147;
5885pub const CB_GETLBTEXT: UINT = 0x0148;
5886pub const CB_GETLBTEXTLEN: UINT = 0x0149;
5887pub const CB_INSERTSTRING: UINT = 0x014A;
5888pub const CB_RESETCONTENT: UINT = 0x014B;
5889pub const CB_FINDSTRING: UINT = 0x014C;
5890pub const CB_SELECTSTRING: UINT = 0x014D;
5891pub const CB_SETCURSEL: UINT = 0x014E;
5892pub const CB_SHOWDROPDOWN: UINT = 0x014F;
5893pub const CB_GETITEMDATA: UINT = 0x0150;
5894pub const CB_SETITEMDATA: UINT = 0x0151;
5895pub const CB_GETDROPPEDCONTROLRECT: UINT = 0x0152;
5896pub const CB_SETITEMHEIGHT: UINT = 0x0153;
5897pub const CB_GETITEMHEIGHT: UINT = 0x0154;
5898pub const CB_SETEXTENDEDUI: UINT = 0x0155;
5899pub const CB_GETEXTENDEDUI: UINT = 0x0156;
5900pub const CB_GETDROPPEDSTATE: UINT = 0x0157;
5901pub const CB_FINDSTRINGEXACT: UINT = 0x0158;
5902pub const CB_SETLOCALE: UINT = 0x0159;
5903pub const CB_GETLOCALE: UINT = 0x015A;
5904pub const CB_GETTOPINDEX: UINT = 0x015b;
5905pub const CB_SETTOPINDEX: UINT = 0x015c;
5906pub const CB_GETHORIZONTALEXTENT: UINT = 0x015d;
5907pub const CB_SETHORIZONTALEXTENT: UINT = 0x015e;
5908pub const CB_GETDROPPEDWIDTH: UINT = 0x015f;
5909pub const CB_SETDROPPEDWIDTH: UINT = 0x0160;
5910pub const CB_INITSTORAGE: UINT = 0x0161;
5911pub const CB_MULTIPLEADDSTRING: UINT = 0x0163;
5912pub const CB_GETCOMBOBOXINFO: UINT = 0x0164;
5913pub const CB_MSGMAX: UINT = 0x0165;
5914pub const SBS_HORZ: DWORD = 0x0000;
5915pub const SBS_VERT: DWORD = 0x0001;
5916pub const SBS_TOPALIGN: DWORD = 0x0002;
5917pub const SBS_LEFTALIGN: DWORD = 0x0002;
5918pub const SBS_BOTTOMALIGN: DWORD = 0x0004;
5919pub const SBS_RIGHTALIGN: DWORD = 0x0004;
5920pub const SBS_SIZEBOXTOPLEFTALIGN: DWORD = 0x0002;
5921pub const SBS_SIZEBOXBOTTOMRIGHTALIGN: DWORD = 0x0004;
5922pub const SBS_SIZEBOX: DWORD = 0x0008;
5923pub const SBS_SIZEGRIP: DWORD = 0x0010;
5924pub const SBM_SETPOS: UINT = 0x00E0;
5925pub const SBM_GETPOS: UINT = 0x00E1;
5926pub const SBM_SETRANGE: UINT = 0x00E2;
5927pub const SBM_SETRANGEREDRAW: UINT = 0x00E6;
5928pub const SBM_GETRANGE: UINT = 0x00E3;
ff7c6d11
XL
5929pub const SBM_ENABLE_ARROWS: UINT = 0x00E4;
5930pub const SBM_SETSCROLLINFO: UINT = 0x00E9;
5931pub const SBM_GETSCROLLINFO: UINT = 0x00EA;
5932pub const SBM_GETSCROLLBARINFO: UINT = 0x00EB;
5933pub const SIF_RANGE: UINT = 0x0001;
5934pub const SIF_PAGE: UINT = 0x0002;
5935pub const SIF_POS: UINT = 0x0004;
5936pub const SIF_DISABLENOSCROLL: UINT = 0x0008;
5937pub const SIF_TRACKPOS: UINT = 0x0010;
5938pub const SIF_ALL: UINT = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS;
5939STRUCT!{struct SCROLLINFO {
5940 cbSize: UINT,
5941 fMask: UINT,
5942 nMin: c_int,
5943 nMax: c_int,
5944 nPage: UINT,
5945 nPos: c_int,
5946 nTrackPos: c_int,
5947}}
5948pub type LPSCROLLINFO = *mut SCROLLINFO;
5949pub type LPCSCROLLINFO = *const SCROLLINFO;
5950extern "system" {
5951 pub fn SetScrollInfo(
5952 hwnd: HWND,
5953 nBar: c_int,
5954 lpsi: *const SCROLLINFO,
5955 redraw: BOOL,
5956 ) -> c_int;
5957 pub fn GetScrollInfo(
5958 hwnd: HWND,
5959 nBar: c_int,
5960 lpsi: *mut SCROLLINFO,
5961 ) -> BOOL;
5962}
ff7c6d11
XL
5963pub const MDITILE_VERTICAL: UINT = 0x0000;
5964pub const MDITILE_HORIZONTAL: UINT = 0x0001;
5965pub const MDITILE_SKIPDISABLED: UINT = 0x0002;
5966pub const MDITILE_ZORDER: UINT = 0x0004;
60c5eb7d 5967//11776
ff7c6d11
XL
5968extern "system" {
5969 pub fn DefFrameProcA(
5970 hwnd: HWND,
5971 hwndMDIClient: HWND,
5972 uMsg: UINT,
5973 wParam: WPARAM,
5974 lParam: LPARAM,
5975 ) -> LRESULT;
5976 pub fn DefFrameProcW(
5977 hwnd: HWND,
5978 hwndMDIClient: HWND,
5979 uMsg: UINT,
5980 wParam: WPARAM,
5981 lParam: LPARAM,
5982 ) -> LRESULT;
5983 pub fn DefMDIChildProcA(
5984 hwnd: HWND,
5985 uMsg: UINT,
5986 wParam: WPARAM,
5987 lParam: LPARAM,
5988 ) -> LRESULT;
5989 pub fn DefMDIChildProcW(
5990 hwnd: HWND,
5991 uMsg: UINT,
5992 wParam: WPARAM,
5993 lParam: LPARAM,
5994 ) -> LRESULT;
5995 pub fn ArrangeIconicWindows(
5996 hWnd: HWND,
5997 ) -> UINT;
5998 pub fn CreateMDIWindowA(
5999 lpClassName: LPCSTR,
6000 lpWindowName: LPCSTR,
6001 dwStyle: DWORD,
6002 X: c_int,
6003 Y: c_int,
6004 nWidth: c_int,
6005 nHeight: c_int,
6006 hWndParent: HWND,
6007 hInstance: HINSTANCE,
6008 lParam: LPARAM,
6009 ) -> HWND;
6010 pub fn CreateMDIWindowW(
6011 lpClassName: LPCWSTR,
6012 lpWindowName: LPCWSTR,
6013 dwStyle: DWORD,
6014 X: c_int,
6015 Y: c_int,
6016 nWidth: c_int,
6017 nHeight: c_int,
6018 hWndParent: HWND,
6019 hInstance: HINSTANCE,
6020 lParam: LPARAM,
6021 ) -> HWND;
6022 pub fn CascadeWindows(
6023 hwndParent: HWND,
6024 wHow: UINT,
6025 lpRect: *const RECT,
6026 cKids: UINT,
6027 lpKids: *const HWND,
6028 ) -> WORD;
6029}
60c5eb7d 6030//12016
ff7c6d11
XL
6031extern "system" {
6032 pub fn WinHelpA(
6033 hWndMain: HWND,
6034 lpszHelp: LPCSTR,
6035 uCommand: UINT,
6036 dwData: ULONG_PTR,
6037 ) -> BOOL;
6038 pub fn WinHelpW(
6039 hWndMain: HWND,
6040 lpszHelp: LPCWSTR,
6041 uCommand: UINT,
6042 dwData: ULONG_PTR,
6043 ) -> BOOL;
ff7c6d11 6044}
60c5eb7d 6045//12083
ff7c6d11
XL
6046pub const SPI_GETBEEP: UINT = 0x0001;
6047pub const SPI_SETBEEP: UINT = 0x0002;
6048pub const SPI_GETMOUSE: UINT = 0x0003;
6049pub const SPI_SETMOUSE: UINT = 0x0004;
6050pub const SPI_GETBORDER: UINT = 0x0005;
6051pub const SPI_SETBORDER: UINT = 0x0006;
6052pub const SPI_GETKEYBOARDSPEED: UINT = 0x000A;
6053pub const SPI_SETKEYBOARDSPEED: UINT = 0x000B;
6054pub const SPI_LANGDRIVER: UINT = 0x000C;
6055pub const SPI_ICONHORIZONTALSPACING: UINT = 0x000D;
6056pub const SPI_GETSCREENSAVETIMEOUT: UINT = 0x000E;
6057pub const SPI_SETSCREENSAVETIMEOUT: UINT = 0x000F;
6058pub const SPI_GETSCREENSAVEACTIVE: UINT = 0x0010;
6059pub const SPI_SETSCREENSAVEACTIVE: UINT = 0x0011;
6060pub const SPI_GETGRIDGRANULARITY: UINT = 0x0012;
6061pub const SPI_SETGRIDGRANULARITY: UINT = 0x0013;
6062pub const SPI_SETDESKWALLPAPER: UINT = 0x0014;
6063pub const SPI_SETDESKPATTERN: UINT = 0x0015;
6064pub const SPI_GETKEYBOARDDELAY: UINT = 0x0016;
6065pub const SPI_SETKEYBOARDDELAY: UINT = 0x0017;
6066pub const SPI_ICONVERTICALSPACING: UINT = 0x0018;
6067pub const SPI_GETICONTITLEWRAP: UINT = 0x0019;
6068pub const SPI_SETICONTITLEWRAP: UINT = 0x001A;
6069pub const SPI_GETMENUDROPALIGNMENT: UINT = 0x001B;
6070pub const SPI_SETMENUDROPALIGNMENT: UINT = 0x001C;
6071pub const SPI_SETDOUBLECLKWIDTH: UINT = 0x001D;
6072pub const SPI_SETDOUBLECLKHEIGHT: UINT = 0x001E;
6073pub const SPI_GETICONTITLELOGFONT: UINT = 0x001F;
6074pub const SPI_SETDOUBLECLICKTIME: UINT = 0x0020;
6075pub const SPI_SETMOUSEBUTTONSWAP: UINT = 0x0021;
6076pub const SPI_SETICONTITLELOGFONT: UINT = 0x0022;
6077pub const SPI_GETFASTTASKSWITCH: UINT = 0x0023;
6078pub const SPI_SETFASTTASKSWITCH: UINT = 0x0024;
6079pub const SPI_SETDRAGFULLWINDOWS: UINT = 0x0025;
6080pub const SPI_GETDRAGFULLWINDOWS: UINT = 0x0026;
6081pub const SPI_GETNONCLIENTMETRICS: UINT = 0x0029;
6082pub const SPI_SETNONCLIENTMETRICS: UINT = 0x002A;
6083pub const SPI_GETMINIMIZEDMETRICS: UINT = 0x002B;
6084pub const SPI_SETMINIMIZEDMETRICS: UINT = 0x002C;
6085pub const SPI_GETICONMETRICS: UINT = 0x002D;
6086pub const SPI_SETICONMETRICS: UINT = 0x002E;
6087pub const SPI_SETWORKAREA: UINT = 0x002F;
6088pub const SPI_GETWORKAREA: UINT = 0x0030;
6089pub const SPI_SETPENWINDOWS: UINT = 0x0031;
6090pub const SPI_GETHIGHCONTRAST: UINT = 0x0042;
6091pub const SPI_SETHIGHCONTRAST: UINT = 0x0043;
6092pub const SPI_GETKEYBOARDPREF: UINT = 0x0044;
6093pub const SPI_SETKEYBOARDPREF: UINT = 0x0045;
6094pub const SPI_GETSCREENREADER: UINT = 0x0046;
6095pub const SPI_SETSCREENREADER: UINT = 0x0047;
6096pub const SPI_GETANIMATION: UINT = 0x0048;
6097pub const SPI_SETANIMATION: UINT = 0x0049;
6098pub const SPI_GETFONTSMOOTHING: UINT = 0x004A;
6099pub const SPI_SETFONTSMOOTHING: UINT = 0x004B;
6100pub const SPI_SETDRAGWIDTH: UINT = 0x004C;
6101pub const SPI_SETDRAGHEIGHT: UINT = 0x004D;
6102pub const SPI_SETHANDHELD: UINT = 0x004E;
6103pub const SPI_GETLOWPOWERTIMEOUT: UINT = 0x004F;
6104pub const SPI_GETPOWEROFFTIMEOUT: UINT = 0x0050;
6105pub const SPI_SETLOWPOWERTIMEOUT: UINT = 0x0051;
6106pub const SPI_SETPOWEROFFTIMEOUT: UINT = 0x0052;
6107pub const SPI_GETLOWPOWERACTIVE: UINT = 0x0053;
6108pub const SPI_GETPOWEROFFACTIVE: UINT = 0x0054;
6109pub const SPI_SETLOWPOWERACTIVE: UINT = 0x0055;
6110pub const SPI_SETPOWEROFFACTIVE: UINT = 0x0056;
6111pub const SPI_SETCURSORS: UINT = 0x0057;
6112pub const SPI_SETICONS: UINT = 0x0058;
6113pub const SPI_GETDEFAULTINPUTLANG: UINT = 0x0059;
6114pub const SPI_SETDEFAULTINPUTLANG: UINT = 0x005A;
6115pub const SPI_SETLANGTOGGLE: UINT = 0x005B;
6116pub const SPI_GETWINDOWSEXTENSION: UINT = 0x005C;
6117pub const SPI_SETMOUSETRAILS: UINT = 0x005D;
6118pub const SPI_GETMOUSETRAILS: UINT = 0x005E;
6119pub const SPI_SETSCREENSAVERRUNNING: UINT = 0x0061;
6120pub const SPI_SCREENSAVERRUNNING: UINT = SPI_SETSCREENSAVERRUNNING;
6121pub const SPI_GETFILTERKEYS: UINT = 0x0032;
6122pub const SPI_SETFILTERKEYS: UINT = 0x0033;
6123pub const SPI_GETTOGGLEKEYS: UINT = 0x0034;
6124pub const SPI_SETTOGGLEKEYS: UINT = 0x0035;
6125pub const SPI_GETMOUSEKEYS: UINT = 0x0036;
6126pub const SPI_SETMOUSEKEYS: UINT = 0x0037;
6127pub const SPI_GETSHOWSOUNDS: UINT = 0x0038;
6128pub const SPI_SETSHOWSOUNDS: UINT = 0x0039;
6129pub const SPI_GETSTICKYKEYS: UINT = 0x003A;
6130pub const SPI_SETSTICKYKEYS: UINT = 0x003B;
6131pub const SPI_GETACCESSTIMEOUT: UINT = 0x003C;
6132pub const SPI_SETACCESSTIMEOUT: UINT = 0x003D;
6133pub const SPI_GETSERIALKEYS: UINT = 0x003E;
6134pub const SPI_SETSERIALKEYS: UINT = 0x003F;
6135pub const SPI_GETSOUNDSENTRY: UINT = 0x0040;
6136pub const SPI_SETSOUNDSENTRY: UINT = 0x0041;
6137pub const SPI_GETSNAPTODEFBUTTON: UINT = 0x005F;
6138pub const SPI_SETSNAPTODEFBUTTON: UINT = 0x0060;
6139pub const SPI_GETMOUSEHOVERWIDTH: UINT = 0x0062;
6140pub const SPI_SETMOUSEHOVERWIDTH: UINT = 0x0063;
6141pub const SPI_GETMOUSEHOVERHEIGHT: UINT = 0x0064;
6142pub const SPI_SETMOUSEHOVERHEIGHT: UINT = 0x0065;
6143pub const SPI_GETMOUSEHOVERTIME: UINT = 0x0066;
6144pub const SPI_SETMOUSEHOVERTIME: UINT = 0x0067;
6145pub const SPI_GETWHEELSCROLLLINES: UINT = 0x0068;
6146pub const SPI_SETWHEELSCROLLLINES: UINT = 0x0069;
6147pub const SPI_GETMENUSHOWDELAY: UINT = 0x006A;
6148pub const SPI_SETMENUSHOWDELAY: UINT = 0x006B;
6149pub const SPI_GETWHEELSCROLLCHARS: UINT = 0x006C;
6150pub const SPI_SETWHEELSCROLLCHARS: UINT = 0x006D;
6151pub const SPI_GETSHOWIMEUI: UINT = 0x006E;
6152pub const SPI_SETSHOWIMEUI: UINT = 0x006F;
6153pub const SPI_GETMOUSESPEED: UINT = 0x0070;
6154pub const SPI_SETMOUSESPEED: UINT = 0x0071;
6155pub const SPI_GETSCREENSAVERRUNNING: UINT = 0x0072;
6156pub const SPI_GETDESKWALLPAPER: UINT = 0x0073;
6157pub const SPI_GETAUDIODESCRIPTION: UINT = 0x0074;
6158pub const SPI_SETAUDIODESCRIPTION: UINT = 0x0075;
6159pub const SPI_GETSCREENSAVESECURE: UINT = 0x0076;
6160pub const SPI_SETSCREENSAVESECURE: UINT = 0x0077;
6161pub const SPI_GETHUNGAPPTIMEOUT: UINT = 0x0078;
6162pub const SPI_SETHUNGAPPTIMEOUT: UINT = 0x0079;
6163pub const SPI_GETWAITTOKILLTIMEOUT: UINT = 0x007A;
6164pub const SPI_SETWAITTOKILLTIMEOUT: UINT = 0x007B;
6165pub const SPI_GETWAITTOKILLSERVICETIMEOUT: UINT = 0x007C;
6166pub const SPI_SETWAITTOKILLSERVICETIMEOUT: UINT = 0x007D;
6167pub const SPI_GETMOUSEDOCKTHRESHOLD: UINT = 0x007E;
6168pub const SPI_SETMOUSEDOCKTHRESHOLD: UINT = 0x007F;
6169pub const SPI_GETPENDOCKTHRESHOLD: UINT = 0x0080;
6170pub const SPI_SETPENDOCKTHRESHOLD: UINT = 0x0081;
6171pub const SPI_GETWINARRANGING: UINT = 0x0082;
6172pub const SPI_SETWINARRANGING: UINT = 0x0083;
6173pub const SPI_GETMOUSEDRAGOUTTHRESHOLD: UINT = 0x0084;
6174pub const SPI_SETMOUSEDRAGOUTTHRESHOLD: UINT = 0x0085;
6175pub const SPI_GETPENDRAGOUTTHRESHOLD: UINT = 0x0086;
6176pub const SPI_SETPENDRAGOUTTHRESHOLD: UINT = 0x0087;
6177pub const SPI_GETMOUSESIDEMOVETHRESHOLD: UINT = 0x0088;
6178pub const SPI_SETMOUSESIDEMOVETHRESHOLD: UINT = 0x0089;
6179pub const SPI_GETPENSIDEMOVETHRESHOLD: UINT = 0x008A;
6180pub const SPI_SETPENSIDEMOVETHRESHOLD: UINT = 0x008B;
6181pub const SPI_GETDRAGFROMMAXIMIZE: UINT = 0x008C;
6182pub const SPI_SETDRAGFROMMAXIMIZE: UINT = 0x008D;
6183pub const SPI_GETSNAPSIZING: UINT = 0x008E;
6184pub const SPI_SETSNAPSIZING: UINT = 0x008F;
6185pub const SPI_GETDOCKMOVING: UINT = 0x0090;
6186pub const SPI_SETDOCKMOVING: UINT = 0x0091;
6187pub const SPI_GETACTIVEWINDOWTRACKING: UINT = 0x1000;
6188pub const SPI_SETACTIVEWINDOWTRACKING: UINT = 0x1001;
6189pub const SPI_GETMENUANIMATION: UINT = 0x1002;
6190pub const SPI_SETMENUANIMATION: UINT = 0x1003;
6191pub const SPI_GETCOMBOBOXANIMATION: UINT = 0x1004;
6192pub const SPI_SETCOMBOBOXANIMATION: UINT = 0x1005;
6193pub const SPI_GETLISTBOXSMOOTHSCROLLING: UINT = 0x1006;
6194pub const SPI_SETLISTBOXSMOOTHSCROLLING: UINT = 0x1007;
6195pub const SPI_GETGRADIENTCAPTIONS: UINT = 0x1008;
6196pub const SPI_SETGRADIENTCAPTIONS: UINT = 0x1009;
6197pub const SPI_GETKEYBOARDCUES: UINT = 0x100A;
6198pub const SPI_SETKEYBOARDCUES: UINT = 0x100B;
6199pub const SPI_GETMENUUNDERLINES: UINT = SPI_GETKEYBOARDCUES;
6200pub const SPI_SETMENUUNDERLINES: UINT = SPI_SETKEYBOARDCUES;
6201pub const SPI_GETACTIVEWNDTRKZORDER: UINT = 0x100C;
6202pub const SPI_SETACTIVEWNDTRKZORDER: UINT = 0x100D;
6203pub const SPI_GETHOTTRACKING: UINT = 0x100E;
6204pub const SPI_SETHOTTRACKING: UINT = 0x100F;
6205pub const SPI_GETMENUFADE: UINT = 0x1012;
6206pub const SPI_SETMENUFADE: UINT = 0x1013;
6207pub const SPI_GETSELECTIONFADE: UINT = 0x1014;
6208pub const SPI_SETSELECTIONFADE: UINT = 0x1015;
6209pub const SPI_GETTOOLTIPANIMATION: UINT = 0x1016;
6210pub const SPI_SETTOOLTIPANIMATION: UINT = 0x1017;
6211pub const SPI_GETTOOLTIPFADE: UINT = 0x1018;
6212pub const SPI_SETTOOLTIPFADE: UINT = 0x1019;
6213pub const SPI_GETCURSORSHADOW: UINT = 0x101A;
6214pub const SPI_SETCURSORSHADOW: UINT = 0x101B;
6215pub const SPI_GETMOUSESONAR: UINT = 0x101C;
6216pub const SPI_SETMOUSESONAR: UINT = 0x101D;
6217pub const SPI_GETMOUSECLICKLOCK: UINT = 0x101E;
6218pub const SPI_SETMOUSECLICKLOCK: UINT = 0x101F;
6219pub const SPI_GETMOUSEVANISH: UINT = 0x1020;
6220pub const SPI_SETMOUSEVANISH: UINT = 0x1021;
6221pub const SPI_GETFLATMENU: UINT = 0x1022;
6222pub const SPI_SETFLATMENU: UINT = 0x1023;
6223pub const SPI_GETDROPSHADOW: UINT = 0x1024;
6224pub const SPI_SETDROPSHADOW: UINT = 0x1025;
6225pub const SPI_GETBLOCKSENDINPUTRESETS: UINT = 0x1026;
6226pub const SPI_SETBLOCKSENDINPUTRESETS: UINT = 0x1027;
6227pub const SPI_GETUIEFFECTS: UINT = 0x103E;
6228pub const SPI_SETUIEFFECTS: UINT = 0x103F;
6229pub const SPI_GETDISABLEOVERLAPPEDCONTENT: UINT = 0x1040;
6230pub const SPI_SETDISABLEOVERLAPPEDCONTENT: UINT = 0x1041;
6231pub const SPI_GETCLIENTAREAANIMATION: UINT = 0x1042;
6232pub const SPI_SETCLIENTAREAANIMATION: UINT = 0x1043;
6233pub const SPI_GETCLEARTYPE: UINT = 0x1048;
6234pub const SPI_SETCLEARTYPE: UINT = 0x1049;
6235pub const SPI_GETSPEECHRECOGNITION: UINT = 0x104A;
6236pub const SPI_SETSPEECHRECOGNITION: UINT = 0x104B;
6237pub const SPI_GETFOREGROUNDLOCKTIMEOUT: UINT = 0x2000;
6238pub const SPI_SETFOREGROUNDLOCKTIMEOUT: UINT = 0x2001;
6239pub const SPI_GETACTIVEWNDTRKTIMEOUT: UINT = 0x2002;
6240pub const SPI_SETACTIVEWNDTRKTIMEOUT: UINT = 0x2003;
6241pub const SPI_GETFOREGROUNDFLASHCOUNT: UINT = 0x2004;
6242pub const SPI_SETFOREGROUNDFLASHCOUNT: UINT = 0x2005;
6243pub const SPI_GETCARETWIDTH: UINT = 0x2006;
6244pub const SPI_SETCARETWIDTH: UINT = 0x2007;
6245pub const SPI_GETMOUSECLICKLOCKTIME: UINT = 0x2008;
6246pub const SPI_SETMOUSECLICKLOCKTIME: UINT = 0x2009;
60c5eb7d
XL
6247pub const SPI_GETFONTSMOOTHINGTYPE: UINT = 0x200A;
6248pub const SPI_SETFONTSMOOTHINGTYPE: UINT = 0x200B;
6249pub const FE_FONTSMOOTHINGSTANDARD: UINT = 0x0001;
6250pub const FE_FONTSMOOTHINGCLEARTYPE: UINT = 0x0002;
6251pub const SPI_GETFONTSMOOTHINGCONTRAST: UINT = 0x200C;
6252pub const SPI_SETFONTSMOOTHINGCONTRAST: UINT = 0x200D;
6253pub const SPI_GETFOCUSBORDERWIDTH: UINT = 0x200E;
6254pub const SPI_SETFOCUSBORDERWIDTH: UINT = 0x200F;
6255pub const SPI_GETFOCUSBORDERHEIGHT: UINT = 0x2010;
6256pub const SPI_SETFOCUSBORDERHEIGHT: UINT = 0x2011;
6257pub const SPI_GETFONTSMOOTHINGORIENTATION: UINT = 0x2012;
6258pub const SPI_SETFONTSMOOTHINGORIENTATION: UINT = 0x2013;
6259pub const FE_FONTSMOOTHINGORIENTATIONBGR: UINT = 0x0000;
6260pub const FE_FONTSMOOTHINGORIENTATIONRGB: UINT = 0x0001;
6261pub const SPI_GETMINIMUMHITRADIUS: UINT = 0x2014;
6262pub const SPI_SETMINIMUMHITRADIUS: UINT = 0x2015;
6263pub const SPI_GETMESSAGEDURATION: UINT = 0x2016;
6264pub const SPI_SETMESSAGEDURATION: UINT = 0x2017;
6265//12472
6266pub const SPIF_UPDATEINIFILE: UINT = 0x0001;
6267pub const SPIF_SENDWININICHANGE: UINT = 0x0002;
6268pub const SPIF_SENDCHANGE: UINT = SPIF_SENDWININICHANGE;
6269//12484
ff7c6d11
XL
6270STRUCT!{struct NONCLIENTMETRICSA {
6271 cbSize: UINT,
6272 iBorderWidth: c_int,
6273 iScrollWidth: c_int,
6274 iScrollHeight: c_int,
6275 iCaptionWidth: c_int,
6276 iCaptionHeight: c_int,
6277 lfCaptionFont: LOGFONTA,
6278 iSmCaptionWidth: c_int,
6279 iSmCaptionHeight: c_int,
6280 lfSmCaptionFont: LOGFONTA,
6281 iMenuWidth: c_int,
6282 iMenuHeight: c_int,
6283 lfMenuFont: LOGFONTA,
6284 lfStatusFont: LOGFONTA,
6285 lfMessageFont: LOGFONTA,
6286 iPaddedBorderWidth: c_int,
6287}}
6288pub type LPNONCLIENTMETRICSA = *mut NONCLIENTMETRICSA;
6289STRUCT!{struct NONCLIENTMETRICSW {
6290 cbSize: UINT,
6291 iBorderWidth: c_int,
6292 iScrollWidth: c_int,
6293 iScrollHeight: c_int,
6294 iCaptionWidth: c_int,
6295 iCaptionHeight: c_int,
6296 lfCaptionFont: LOGFONTW,
6297 iSmCaptionWidth: c_int,
6298 iSmCaptionHeight: c_int,
6299 lfSmCaptionFont: LOGFONTW,
6300 iMenuWidth: c_int,
6301 iMenuHeight: c_int,
6302 lfMenuFont: LOGFONTW,
6303 lfStatusFont: LOGFONTW,
6304 lfMessageFont: LOGFONTW,
6305 iPaddedBorderWidth: c_int,
6306}}
6307pub type LPNONCLIENTMETRICSW = *mut NONCLIENTMETRICSW;
60c5eb7d
XL
6308//12598
6309STRUCT!{struct ANIMATIONINFO {
6310 cbSize: UINT,
6311 iMinAnimate: c_int,
6312}}
6313pub type LPANIMATIONINFO = *mut ANIMATIONINFO;
6314//12672
6315pub const CDS_UPDATEREGISTRY: DWORD = 0x00000001;
6316pub const CDS_TEST: DWORD = 0x00000002;
6317pub const CDS_FULLSCREEN: DWORD = 0x00000004;
6318pub const CDS_GLOBAL: DWORD = 0x00000008;
6319pub const CDS_SET_PRIMARY: DWORD = 0x00000010;
6320pub const CDS_VIDEOPARAMETERS: DWORD = 0x00000020;
6321pub const CDS_ENABLE_UNSAFE_MODES: DWORD = 0x00000100;
6322pub const CDS_DISABLE_UNSAFE_MODES: DWORD = 0x00000200;
6323pub const CDS_RESET: DWORD = 0x40000000;
6324pub const CDS_RESET_EX: DWORD = 0x20000000;
6325pub const CDS_NORESET: DWORD = 0x10000000;
6326pub const DISP_CHANGE_SUCCESSFUL: LONG = 0;
6327pub const DISP_CHANGE_RESTART: LONG = 1;
6328pub const DISP_CHANGE_FAILED: LONG = -1;
6329pub const DISP_CHANGE_BADMODE: LONG = -2;
6330pub const DISP_CHANGE_NOTUPDATED: LONG = -3;
6331pub const DISP_CHANGE_BADFLAGS: LONG = -4;
6332pub const DISP_CHANGE_BADPARAM: LONG = -5;
6333pub const DISP_CHANGE_BADDUALVIEW: LONG = -6;
6334extern "system" {
6335 pub fn ChangeDisplaySettingsA(
6336 lpDevMode: *mut DEVMODEA,
6337 dwFlags: DWORD,
6338 ) -> LONG;
6339 pub fn ChangeDisplaySettingsW(
6340 lpDevMode: *mut DEVMODEW,
6341 dwFlags: DWORD,
6342 ) -> LONG;
6343 pub fn ChangeDisplaySettingsExA(
6344 lpszDeviceName: LPCSTR,
6345 lpDevMode: *mut DEVMODEA,
6346 hwnd: HWND,
6347 dwFlags: DWORD,
6348 lParam: LPVOID,
6349 ) -> LONG;
6350 pub fn ChangeDisplaySettingsExW(
6351 lpszDeviceName: LPCWSTR,
6352 lpDevMode: *mut DEVMODEW,
6353 hwnd: HWND,
6354 dwFlags: DWORD,
6355 lParam: LPVOID,
6356 ) -> LONG;
6357}
6358pub const ENUM_CURRENT_SETTINGS: DWORD = 0xFFFFFFFF;
6359pub const ENUM_REGISTRY_SETTINGS: DWORD = 0xFFFFFFFE;
6360extern "system" {
6361 pub fn EnumDisplaySettingsA(
6362 lpszDeviceName: LPCSTR,
6363 iModeNum: DWORD,
6364 lpDevMode: *mut DEVMODEA,
6365 ) -> BOOL;
6366 pub fn EnumDisplaySettingsW(
6367 lpszDeviceName: LPCWSTR,
6368 iModeNum: DWORD,
6369 lpDevMode: *mut DEVMODEW,
6370 ) -> BOOL;
6371 pub fn EnumDisplaySettingsExA(
6372 lpszDeviceName: LPCSTR,
6373 iModeNum: DWORD,
6374 lpDevMode: *mut DEVMODEA,
6375 dwFlags: DWORD,
6376 ) -> BOOL;
6377 pub fn EnumDisplaySettingsExW(
6378 lpszDeviceName: LPCWSTR,
6379 iModeNum: DWORD,
6380 lpDevMode: *mut DEVMODEW,
6381 dwFlags: DWORD,
6382 ) -> BOOL;
6383}
6384pub const EDS_RAWMODE: DWORD = 0x00000002;
6385pub const EDS_ROTATEDMODE: DWORD = 0x00000004;
6386extern "system" {
6387 pub fn EnumDisplayDevicesA(
6388 lpDevice: LPCSTR,
6389 iDevNum: DWORD,
6390 lpDisplayDevice: PDISPLAY_DEVICEA,
6391 dwFlags: DWORD,
6392 ) -> BOOL;
6393 pub fn EnumDisplayDevicesW(
6394 lpDevice: LPCWSTR,
6395 iDevNum: DWORD,
6396 lpDisplayDevice: PDISPLAY_DEVICEW,
6397 dwFlags: DWORD,
6398 ) -> BOOL;
6399}
6400pub const EDD_GET_DEVICE_INTERFACE_NAME: DWORD = 0x00000001;
6401extern "system" {
6402 pub fn SystemParametersInfoA(
6403 uiAction: UINT,
6404 uiParam: UINT,
6405 pvParam: PVOID,
6406 fWinIni: UINT,
6407 ) -> BOOL;
6408 pub fn SystemParametersInfoW(
6409 uiAction: UINT,
6410 uiParam: UINT,
6411 pvParam: PVOID,
6412 fWinIni: UINT,
6413 ) -> BOOL;
6414 pub fn SystemParametersInfoForDpi(
6415 uiAction: UINT,
6416 uiParam: UINT,
6417 pvParam: PVOID,
6418 fWinIni: UINT,
6419 dpi: UINT,
6420 ) -> BOOL;
6421}
6422//13191
ff7c6d11
XL
6423extern "system" {
6424 pub fn SetLastErrorEx(
6425 dwErrCode: DWORD,
6426 dwType: DWORD,
6427 );
6428 pub fn InternalGetWindowText(
6429 hWnd: HWND,
6430 pString: LPWSTR,
6431 cchMaxCount: c_int,
6432 ) -> c_int;
6433 pub fn EndTask(
6434 hWnd: HWND,
6435 fShutDown: BOOL,
6436 fForce: BOOL,
6437 ) -> BOOL;
6438 pub fn CancelShutdown() -> BOOL;
6439}
6440pub const MONITOR_DEFAULTTONULL: DWORD = 0x00000000;
6441pub const MONITOR_DEFAULTTOPRIMARY: DWORD = 0x00000001;
6442pub const MONITOR_DEFAULTTONEAREST: DWORD = 0x00000002;
ff7c6d11
XL
6443extern "system" {
6444 pub fn MonitorFromPoint(
6445 pt: POINT,
6446 dwFlags: DWORD,
6447 ) -> HMONITOR;
6448 pub fn MonitorFromRect(
6449 lprc: LPCRECT,
6450 dwFlags: DWORD,
6451 ) -> HMONITOR;
6452 pub fn MonitorFromWindow(
6453 hwnd: HWND,
6454 dwFlags: DWORD,
6455 ) -> HMONITOR;
6456}
6457pub const MONITORINFOF_PRIMARY: DWORD = 1;
6458pub const CCHDEVICENAME: usize = 32;
6459STRUCT!{struct MONITORINFO {
6460 cbSize: DWORD,
6461 rcMonitor: RECT,
6462 rcWork: RECT,
6463 dwFlags: DWORD,
6464}}
6465pub type LPMONITORINFO = *mut MONITORINFO;
6466STRUCT!{struct MONITORINFOEXA {
6467 cbSize: DWORD,
6468 rcMonitor: RECT,
6469 rcWork: RECT,
6470 dwFlags: DWORD,
6471 szDevice: [CHAR; CCHDEVICENAME],
6472}}
6473pub type LPMONITORINFOEXA = *mut MONITORINFOEXA;
6474STRUCT!{struct MONITORINFOEXW {
6475 cbSize: DWORD,
6476 rcMonitor: RECT,
6477 rcWork: RECT,
6478 dwFlags: DWORD,
6479 szDevice: [WCHAR; CCHDEVICENAME],
6480}}
6481pub type LPMONITORINFOEXW = *mut MONITORINFOEXW;
ff7c6d11
XL
6482extern "system" {
6483 pub fn GetMonitorInfoA(
6484 hMonitor: HMONITOR,
6485 lpmi: LPMONITORINFO,
6486 ) -> BOOL;
6487 pub fn GetMonitorInfoW(
6488 hMonitor: HMONITOR,
6489 lpmi: LPMONITORINFO,
6490 ) -> BOOL;
6491}
6492FN!{stdcall MONITORENUMPROC(
6493 HMONITOR,
6494 HDC,
6495 LPRECT,
6496 LPARAM,
6497) -> BOOL}
6498extern "system" {
6499 pub fn EnumDisplayMonitors(
6500 hdc: HDC,
6501 lprcClip: LPCRECT,
6502 lpfnEnum: MONITORENUMPROC,
6503 dwData: LPARAM,
6504 ) -> BOOL;
6505 pub fn NotifyWinEvent(
6506 event: DWORD,
6507 hwnd: HWND,
6508 idObject: LONG,
6509 idChild: LONG,
6510 );
60c5eb7d
XL
6511}
6512FN!{stdcall WINEVENTPROC(
6513 HWINEVENTHOOK,
6514 DWORD,
6515 HWND,
6516 LONG,
6517 LONG,
6518 DWORD,
6519 DWORD,
6520) -> ()}
6521extern "system" {
ff7c6d11
XL
6522 pub fn SetWinEventHook(
6523 eventMin: DWORD,
6524 eventMax: DWORD,
6525 hmodWinEventProc: HMODULE,
6526 pfnWinEventProc: WINEVENTPROC,
6527 idProcess: DWORD,
6528 idThread: DWORD,
6529 dwFlags: DWORD,
6530 ) -> HWINEVENTHOOK;
6531 pub fn IsWinEventHookInstalled(
6532 event: DWORD,
6533 ) -> BOOL;
0bf4aa26
XL
6534}
6535pub const WINEVENT_OUTOFCONTEXT: UINT = 0x0000;
6536pub const WINEVENT_SKIPOWNTHREAD: UINT = 0x0001;
6537pub const WINEVENT_SKIPOWNPROCESS: UINT = 0x0002;
6538pub const WINEVENT_INCONTEXT: UINT = 0x0004;
6539extern "system" {
ff7c6d11
XL
6540 pub fn UnhookWinEvent(
6541 hWinEventHook: HWINEVENTHOOK,
6542 ) -> BOOL;
0bf4aa26
XL
6543}
6544pub const CHILDID_SELF: LONG = 0;
6545pub const INDEXID_OBJECT: LONG = 0;
6546pub const INDEXID_CONTAINER: LONG = 0;
6547pub const OBJID_WINDOW: LONG = 0x0000;
6548pub const OBJID_SYSMENU: LONG = 0xFFFFFFFF;
6549pub const OBJID_TITLEBAR: LONG = 0xFFFFFFFE;
6550pub const OBJID_MENU: LONG = 0xFFFFFFFD;
6551pub const OBJID_CLIENT: LONG = 0xFFFFFFFC;
6552pub const OBJID_VSCROLL: LONG = 0xFFFFFFFB;
6553pub const OBJID_HSCROLL: LONG = 0xFFFFFFFA;
6554pub const OBJID_SIZEGRIP: LONG = 0xFFFFFFF9;
6555pub const OBJID_CARET: LONG = 0xFFFFFFF8;
6556pub const OBJID_CURSOR: LONG = 0xFFFFFFF7;
6557pub const OBJID_ALERT: LONG = 0xFFFFFFF6;
6558pub const OBJID_SOUND: LONG = 0xFFFFFFF5;
6559pub const OBJID_QUERYCLASSNAMEIDX: LONG = 0xFFFFFFF4;
6560pub const OBJID_NATIVEOM: LONG = 0xFFFFFFF0;
6561pub const EVENT_MIN: UINT = 0x0001;
6562pub const EVENT_MAX: UINT = 0x7FFFFFFF;
6563pub const EVENT_SYSTEM_SOUND: UINT = 0x0001;
6564pub const EVENT_SYSTEM_ALERT: UINT = 0x0002;
6565pub const EVENT_SYSTEM_FOREGROUND: UINT = 0x0003;
6566pub const EVENT_SYSTEM_MENUSTART: UINT = 0x0004;
6567pub const EVENT_SYSTEM_MENUEND: UINT = 0x0005;
6568pub const EVENT_SYSTEM_MENUPOPUPSTART: UINT = 0x0006;
6569pub const EVENT_SYSTEM_MENUPOPUPEND: UINT = 0x0007;
6570pub const EVENT_SYSTEM_CAPTURESTART: UINT = 0x0008;
6571pub const EVENT_SYSTEM_CAPTUREEND: UINT = 0x0009;
6572pub const EVENT_SYSTEM_MOVESIZESTART: UINT = 0x000A;
6573pub const EVENT_SYSTEM_MOVESIZEEND: UINT = 0x000B;
6574pub const EVENT_SYSTEM_CONTEXTHELPSTART: UINT = 0x000C;
6575pub const EVENT_SYSTEM_CONTEXTHELPEND: UINT = 0x000D;
6576pub const EVENT_SYSTEM_DRAGDROPSTART: UINT = 0x000E;
6577pub const EVENT_SYSTEM_DRAGDROPEND: UINT = 0x000F;
6578pub const EVENT_SYSTEM_DIALOGSTART: UINT = 0x0010;
6579pub const EVENT_SYSTEM_DIALOGEND: UINT = 0x0011;
6580pub const EVENT_SYSTEM_SCROLLINGSTART: UINT = 0x0012;
6581pub const EVENT_SYSTEM_SCROLLINGEND: UINT = 0x0013;
6582pub const EVENT_SYSTEM_SWITCHSTART: UINT = 0x0014;
6583pub const EVENT_SYSTEM_SWITCHEND: UINT = 0x0015;
6584pub const EVENT_SYSTEM_MINIMIZESTART: UINT = 0x0016;
6585pub const EVENT_SYSTEM_MINIMIZEEND: UINT = 0x0017;
6586pub const EVENT_SYSTEM_DESKTOPSWITCH: UINT = 0x0020;
6587pub const EVENT_SYSTEM_SWITCHER_APPGRABBED: UINT = 0x0024;
6588pub const EVENT_SYSTEM_SWITCHER_APPOVERTARGET: UINT = 0x0025;
6589pub const EVENT_SYSTEM_SWITCHER_APPDROPPED: UINT = 0x0026;
6590pub const EVENT_SYSTEM_SWITCHER_CANCELLED: UINT = 0x0027;
6591pub const EVENT_SYSTEM_IME_KEY_NOTIFICATION: UINT = 0x0029;
6592pub const EVENT_SYSTEM_END: UINT = 0x00FF;
6593pub const EVENT_OEM_DEFINED_START: UINT = 0x0101;
6594pub const EVENT_OEM_DEFINED_END: UINT = 0x01FF;
6595pub const EVENT_UIA_EVENTID_START: UINT = 0x4E00;
6596pub const EVENT_UIA_EVENTID_END: UINT = 0x4EFF;
6597pub const EVENT_UIA_PROPID_START: UINT = 0x7500;
6598pub const EVENT_UIA_PROPID_END: UINT = 0x75FF;
6599pub const EVENT_CONSOLE_CARET: UINT = 0x4001;
6600pub const EVENT_CONSOLE_UPDATE_REGION: UINT = 0x4002;
6601pub const EVENT_CONSOLE_UPDATE_SIMPLE: UINT = 0x4003;
6602pub const EVENT_CONSOLE_UPDATE_SCROLL: UINT = 0x4004;
6603pub const EVENT_CONSOLE_LAYOUT: UINT = 0x4005;
6604pub const EVENT_CONSOLE_START_APPLICATION: UINT = 0x4006;
6605pub const EVENT_CONSOLE_END_APPLICATION: UINT = 0x4007;
60c5eb7d 6606#[cfg(target_pointer_width = "64")]
0bf4aa26 6607pub const CONSOLE_APPLICATION_16BIT: LONG = 0x0000;
60c5eb7d 6608#[cfg(target_pointer_width = "32")]
0bf4aa26
XL
6609pub const CONSOLE_APPLICATION_16BIT: LONG = 0x0001;
6610pub const CONSOLE_CARET_SELECTION: LONG = 0x0001;
6611pub const CONSOLE_CARET_VISIBLE: LONG = 0x0002;
6612pub const EVENT_CONSOLE_END: UINT = 0x40FF;
6613pub const EVENT_OBJECT_CREATE: UINT = 0x8000;
6614pub const EVENT_OBJECT_DESTROY: UINT = 0x8001;
6615pub const EVENT_OBJECT_SHOW: UINT = 0x8002;
6616pub const EVENT_OBJECT_HIDE: UINT = 0x8003;
6617pub const EVENT_OBJECT_REORDER: UINT = 0x8004;
6618pub const EVENT_OBJECT_FOCUS: UINT = 0x8005;
6619pub const EVENT_OBJECT_SELECTION: UINT = 0x8006;
6620pub const EVENT_OBJECT_SELECTIONADD: UINT = 0x8007;
6621pub const EVENT_OBJECT_SELECTIONREMOVE: UINT = 0x8008;
6622pub const EVENT_OBJECT_SELECTIONWITHIN: UINT = 0x8009;
6623pub const EVENT_OBJECT_STATECHANGE: UINT = 0x800A;
6624pub const EVENT_OBJECT_LOCATIONCHANGE: UINT = 0x800B;
6625pub const EVENT_OBJECT_NAMECHANGE: UINT = 0x800C;
6626pub const EVENT_OBJECT_DESCRIPTIONCHANGE: UINT = 0x800D;
6627pub const EVENT_OBJECT_VALUECHANGE: UINT = 0x800E;
6628pub const EVENT_OBJECT_PARENTCHANGE: UINT = 0x800F;
6629pub const EVENT_OBJECT_HELPCHANGE: UINT = 0x8010;
6630pub const EVENT_OBJECT_DEFACTIONCHANGE: UINT = 0x8011;
6631pub const EVENT_OBJECT_ACCELERATORCHANGE: UINT = 0x8012;
6632pub const EVENT_OBJECT_INVOKED: UINT = 0x8013;
6633pub const EVENT_OBJECT_TEXTSELECTIONCHANGED: UINT = 0x8014;
6634pub const EVENT_OBJECT_CONTENTSCROLLED: UINT = 0x8015;
6635pub const EVENT_SYSTEM_ARRANGMENTPREVIEW: UINT = 0x8016;
6636pub const EVENT_OBJECT_CLOAKED: UINT = 0x8017;
6637pub const EVENT_OBJECT_UNCLOAKED: UINT = 0x8018;
6638pub const EVENT_OBJECT_LIVEREGIONCHANGED: UINT = 0x8019;
6639pub const EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED: UINT = 0x8020;
6640pub const EVENT_OBJECT_DRAGSTART: UINT = 0x8021;
6641pub const EVENT_OBJECT_DRAGCANCEL: UINT = 0x8022;
6642pub const EVENT_OBJECT_DRAGCOMPLETE: UINT = 0x8023;
6643pub const EVENT_OBJECT_DRAGENTER: UINT = 0x8024;
6644pub const EVENT_OBJECT_DRAGLEAVE: UINT = 0x8025;
6645pub const EVENT_OBJECT_DRAGDROPPED: UINT = 0x8026;
6646pub const EVENT_OBJECT_IME_SHOW: UINT = 0x8027;
6647pub const EVENT_OBJECT_IME_HIDE: UINT = 0x8028;
6648pub const EVENT_OBJECT_IME_CHANGE: UINT = 0x8029;
6649pub const EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED: UINT = 0x8030;
6650pub const EVENT_OBJECT_END: UINT = 0x80FF;
6651pub const EVENT_AIA_START: UINT = 0xA000;
6652pub const EVENT_AIA_END: UINT = 0xAFFF;
6653pub const ALERT_SYSTEM_INFORMATIONAL: LONG = 1;
6654pub const ALERT_SYSTEM_WARNING: LONG = 2;
6655pub const ALERT_SYSTEM_ERROR: LONG = 3;
6656pub const ALERT_SYSTEM_QUERY: LONG = 4;
6657pub const ALERT_SYSTEM_CRITICAL: LONG = 5;
6658pub const CALERT_SYSTEM: LONG = 6;
60c5eb7d
XL
6659STRUCT!{struct GUITHREADINFO {
6660 cbSize: DWORD,
6661 flags: DWORD,
6662 hwndActive: HWND,
6663 hwndFocus: HWND,
6664 hwndCapture: HWND,
6665 hwndMenuOwner: HWND,
6666 hwndMoveSize: HWND,
6667 hwndCaret: HWND,
6668 rcCaret: RECT,
6669}}
6670pub type PGUITHREADINFO = *mut GUITHREADINFO;
6671pub type LPGUITHREADINFO = *mut GUITHREADINFO;
6672pub const GUI_CARETBLINKING: DWORD = 0x00000001;
6673pub const GUI_INMOVESIZE: DWORD = 0x00000002;
6674pub const GUI_INMENUMODE: DWORD = 0x00000004;
6675pub const GUI_SYSTEMMENUMODE: DWORD = 0x00000008;
6676pub const GUI_POPUPMENUMODE: DWORD = 0x00000010;
6677#[cfg(target_arch = "x86_64")]
6678pub const GUI_16BITTASK: DWORD = 0x00000000;
6679#[cfg(target_arch = "x86")]
6680pub const GUI_16BITTASK: DWORD = 0x00000020;
0bf4aa26 6681extern "system" {
60c5eb7d
XL
6682 pub fn GetGUIThreadInfo(
6683 idThread: DWORD,
6684 pgui: PGUITHREADINFO,
6685 ) -> BOOL;
ff7c6d11
XL
6686 pub fn BlockInput(
6687 fBlockIt: BOOL,
6688 ) -> BOOL;
60c5eb7d
XL
6689}
6690pub const USER_DEFAULT_SCREEN_DPI: LONG = 96;
6691extern "system" {
6692 pub fn SetProcessDPIAware() -> BOOL;
ff7c6d11 6693 pub fn IsProcessDPIAware() -> BOOL;
60c5eb7d
XL
6694 pub fn SetThreadDpiAwarenessContext(
6695 dpiContext: DPI_AWARENESS_CONTEXT,
6696 ) -> DPI_AWARENESS_CONTEXT;
6697 pub fn GetThreadDpiAwarenessContext() -> DPI_AWARENESS_CONTEXT;
6698 pub fn GetWindowDpiAwarenessContext(
6699 hwnd: HWND,
6700 ) -> DPI_AWARENESS_CONTEXT;
6701 pub fn GetAwarenessFromDpiAwarenessContext(
6702 value: DPI_AWARENESS_CONTEXT,
6703 ) -> DPI_AWARENESS;
6704 pub fn GetDpiFromDpiAwarenessContext(
6705 value: DPI_AWARENESS_CONTEXT,
6706 ) -> UINT;
6707 pub fn AreDpiAwarenessContextsEqual(
6708 dpiContextA: DPI_AWARENESS_CONTEXT,
6709 dpiContextB: DPI_AWARENESS_CONTEXT,
6710 ) -> BOOL;
6711 pub fn IsValidDpiAwarenessContext(
6712 value: DPI_AWARENESS_CONTEXT,
6713 ) -> BOOL;
6714 pub fn GetDpiForWindow(
6715 hwnd: HWND,
6716 ) -> UINT;
6717 pub fn GetDpiForSystem() -> UINT;
6718 pub fn GetSystemDpiForProcess(
6719 hProcess: HANDLE,
6720 ) -> UINT;
6721 pub fn EnableNonClientDpiScaling(
6722 hwnd: HWND,
6723 ) -> BOOL;
6724 pub fn SetProcessDpiAwarenessContext(
6725 value: DPI_AWARENESS_CONTEXT,
6726 ) -> BOOL;
6727 pub fn SetThreadDpiHostingBehavior(
6728 value: DPI_HOSTING_BEHAVIOR,
6729 ) -> DPI_HOSTING_BEHAVIOR;
6730 pub fn GetThreadDpiHostingBehavior() -> DPI_HOSTING_BEHAVIOR;
6731 pub fn GetWindowDpiHostingBehavior(
6732 hwnd: HWND,
6733 ) -> DPI_HOSTING_BEHAVIOR;
ff7c6d11
XL
6734 pub fn GetWindowModuleFileNameA(
6735 hWnd: HWND,
6736 lpszFileName: LPCSTR,
6737 cchFileNameMax: UINT,
6738 ) -> UINT;
6739 pub fn GetWindowModuleFileNameW(
6740 hWnd: HWND,
6741 lpszFileName: LPWSTR,
6742 cchFileNameMax: UINT,
6743 ) -> UINT;
60c5eb7d
XL
6744}
6745pub const STATE_SYSTEM_UNAVAILABLE: DWORD = 0x00000001;
6746pub const STATE_SYSTEM_SELECTED: DWORD = 0x00000002;
6747pub const STATE_SYSTEM_FOCUSED: DWORD = 0x00000004;
6748pub const STATE_SYSTEM_PRESSED: DWORD = 0x00000008;
6749pub const STATE_SYSTEM_CHECKED: DWORD = 0x00000010;
6750pub const STATE_SYSTEM_MIXED: DWORD = 0x00000020;
6751pub const STATE_SYSTEM_INDETERMINATE: DWORD = STATE_SYSTEM_MIXED;
6752pub const STATE_SYSTEM_READONLY: DWORD = 0x00000040;
6753pub const STATE_SYSTEM_HOTTRACKED: DWORD = 0x00000080;
6754pub const STATE_SYSTEM_DEFAULT: DWORD = 0x00000100;
6755pub const STATE_SYSTEM_EXPANDED: DWORD = 0x00000200;
6756pub const STATE_SYSTEM_COLLAPSED: DWORD = 0x00000400;
6757pub const STATE_SYSTEM_BUSY: DWORD = 0x00000800;
6758pub const STATE_SYSTEM_FLOATING: DWORD = 0x00001000;
6759pub const STATE_SYSTEM_MARQUEED: DWORD = 0x00002000;
6760pub const STATE_SYSTEM_ANIMATED: DWORD = 0x00004000;
6761pub const STATE_SYSTEM_INVISIBLE: DWORD = 0x00008000;
6762pub const STATE_SYSTEM_OFFSCREEN: DWORD = 0x00010000;
6763pub const STATE_SYSTEM_SIZEABLE: DWORD = 0x00020000;
6764pub const STATE_SYSTEM_MOVEABLE: DWORD = 0x00040000;
6765pub const STATE_SYSTEM_SELFVOICING: DWORD = 0x00080000;
6766pub const STATE_SYSTEM_FOCUSABLE: DWORD = 0x00100000;
6767pub const STATE_SYSTEM_SELECTABLE: DWORD = 0x00200000;
6768pub const STATE_SYSTEM_LINKED: DWORD = 0x00400000;
6769pub const STATE_SYSTEM_TRAVERSED: DWORD = 0x00800000;
6770pub const STATE_SYSTEM_MULTISELECTABLE: DWORD = 0x01000000;
6771pub const STATE_SYSTEM_EXTSELECTABLE: DWORD = 0x02000000;
6772pub const STATE_SYSTEM_ALERT_LOW: DWORD = 0x04000000;
6773pub const STATE_SYSTEM_ALERT_MEDIUM: DWORD = 0x08000000;
6774pub const STATE_SYSTEM_ALERT_HIGH: DWORD = 0x10000000;
6775pub const STATE_SYSTEM_PROTECTED: DWORD = 0x20000000;
6776pub const STATE_SYSTEM_VALID: DWORD = 0x3fffffff;
6777pub const CCHILDREN_TITLEBAR: usize = 5;
6778pub const CCHILDREN_SCROLLBAR: usize = 5;
6779STRUCT!{struct CURSORINFO {
6780 cbSize: DWORD,
6781 flags: DWORD,
6782 hCursor: HCURSOR,
6783 ptScreenPos: POINT,
6784}}
6785pub type PCURSORINFO = *mut CURSORINFO;
6786pub type LPCURSORINFO = *mut CURSORINFO;
6787pub const CURSOR_SHOWING: DWORD = 0x00000001;
6788pub const CURSOR_SUPPRESSED: DWORD = 0x00000002;
6789extern "system" {
6790 pub fn GetCursorInfo(
6791 pci: PCURSORINFO,
6792 ) -> BOOL;
6793}
6794STRUCT!{struct WINDOWINFO {
6795 cbSize: DWORD,
6796 rcWindow: RECT,
6797 rcClient: RECT,
6798 dwStyle: DWORD,
6799 dwExStyle: DWORD,
6800 dwWindowStatus: DWORD,
6801 cxWindowBorders: UINT,
6802 cyWindowBorders: UINT,
6803 atomWindowType: ATOM,
6804 wCreatorVersion: WORD,
6805}}
6806pub type PWINDOWINFO = *mut WINDOWINFO;
6807pub type LPWINDOWINFO = *mut WINDOWINFO;
6808pub const WS_ACTIVECAPTION: DWORD = 0x0001;
6809extern "system" {
6810 pub fn GetWindowInfo(
6811 hwnd: HWND,
6812 pwi: PWINDOWINFO,
6813 ) -> BOOL;
6814}
6815STRUCT!{struct TITLEBARINFO {
6816 cbSize: DWORD,
6817 rcTitleBar: RECT,
6818 rgstate: [DWORD; CCHILDREN_TITLEBAR + 1],
6819}}
6820pub type PTITLEBARINFO = *mut TITLEBARINFO;
6821pub type LPTITLEBARINFO = *mut TITLEBARINFO;
6822extern "system" {
6823 pub fn GetTitleBarInfo(
6824 hwnd: HWND,
6825 pti: PTITLEBARINFO,
6826 ) -> BOOL;
6827}
6828STRUCT!{struct TITLEBARINFOEX {
6829 cbSize: DWORD,
6830 rcTitleBar: RECT,
6831 rgstate: [DWORD; CCHILDREN_TITLEBAR + 1],
6832 rgrect: [RECT; CCHILDREN_TITLEBAR + 1],
6833}}
6834pub type PTITLEBARINFOEX = *mut TITLEBARINFOEX;
6835pub type LPTITLEBARINFOEX = *mut TITLEBARINFOEX;
6836STRUCT!{struct MENUBARINFO {
6837 cbSize: DWORD,
6838 rcBar: RECT,
6839 hMenu: HMENU,
6840 hwndMenu: HWND,
6841 BitFields: BOOL,
6842}}
6843BITFIELD!{MENUBARINFO BitFields: BOOL [
6844 fBarFocused set_fBarFocused[0..1],
6845 fFocused set_fFocused[1..2],
6846]}
6847pub type PMENUBARINFO = *mut MENUBARINFO;
6848pub type LPMENUBARINFO = *mut MENUBARINFO;
6849extern "system" {
6850 pub fn GetMenuBarInfo(
6851 hwnd: HWND,
6852 idObject: LONG,
6853 idItem: LONG,
6854 pmbi: PMENUBARINFO,
6855 ) -> BOOL;
6856}
6857STRUCT!{struct SCROLLBARINFO {
6858 cbSize: DWORD,
6859 rcScrollBar: RECT,
6860 dxyLineButton: c_int,
6861 xyThumbTop: c_int,
6862 xyThumbBottom: c_int,
6863 reserved: c_int,
6864 rgstate: [DWORD; CCHILDREN_SCROLLBAR + 1],
6865}}
6866pub type PSCROLLBARINFO = *mut SCROLLBARINFO;
6867pub type LPSCROLLBARINFO = *mut SCROLLBARINFO;
6868extern "system" {
6869 pub fn GetScrollBarInfo(
6870 hwnd: HWND,
6871 idObject: LONG,
6872 psbi: PSCROLLBARINFO,
6873 ) -> BOOL;
6874}
6875STRUCT!{struct COMBOBOXINFO {
6876 cbSize: DWORD,
6877 rcItem: RECT,
6878 rcButton: RECT,
6879 stateButton: DWORD,
6880 hwndCombo: HWND,
6881 hwndItem: HWND,
6882 hwndList: HWND,
6883}}
6884pub type PCOMBOBOXINFO = *mut COMBOBOXINFO;
6885pub type LPCOMBOBOXINFO = *mut COMBOBOXINFO;
6886extern "system" {
6887 pub fn GetComboBoxInfo(
6888 hwndCombo: HWND,
6889 pcbi: PCOMBOBOXINFO,
6890 ) -> BOOL;
6891}
6892pub const GA_PARENT: UINT = 1;
6893pub const GA_ROOT: UINT = 2;
6894pub const GA_ROOTOWNER: UINT = 3;
6895extern "system" {
ff7c6d11
XL
6896 pub fn GetAncestor(
6897 hWnd: HWND,
6898 gaFlags: UINT,
6899 ) -> HWND;
6900 pub fn RealChildWindowFromPoint(
6901 hwndParent: HWND,
6902 ptParentClientCoords: POINT,
6903 ) -> HWND;
6904 pub fn RealGetWindowClassA(
6905 hwnd: HWND,
6906 ptszClassName: LPSTR,
6907 cchClassNameMax: UINT,
6908 ) -> UINT;
6909 pub fn RealGetWindowClassW(
6910 hwnd: HWND,
6911 ptszClassName: LPWSTR,
6912 cchClassNameMax: UINT,
6913 ) -> UINT;
60c5eb7d
XL
6914}
6915STRUCT!{struct ALTTABINFO {
6916 cbSize: DWORD,
6917 cItems: c_int,
6918 cColumns: c_int,
6919 cRows: c_int,
6920 iColFocus: c_int,
6921 iRowFocus: c_int,
6922 cxItem: c_int,
6923 cyItem: c_int,
6924 ptStart: POINT,
6925}}
6926pub type PALTTABINFO = *mut ALTTABINFO;
6927pub type LPALTTABINFO = *mut ALTTABINFO;
6928extern "system" {
6929 pub fn GetAltTabInfoA(
6930 hwnd: HWND,
6931 iItem: c_int,
6932 pati: PALTTABINFO,
6933 pszItemText: LPSTR,
6934 cchItemText: UINT,
6935 ) -> BOOL;
6936 pub fn GetAltTabInfoW(
6937 hwnd: HWND,
6938 iItem: c_int,
6939 pati: PALTTABINFO,
6940 pszItemText: LPWSTR,
6941 cchItemText: UINT,
6942 ) -> BOOL;
6943 pub fn GetListBoxInfo(
6944 hwnd: HWND,
6945 ) -> DWORD;
ff7c6d11
XL
6946 pub fn LockWorkStation() -> BOOL;
6947 pub fn UserHandleGrantAccess(
6948 hUserHandle: HANDLE,
6949 hJob: HANDLE,
6950 bGrant: BOOL,
6951 ) -> BOOL;
6952}
0bf4aa26 6953DECLARE_HANDLE!{HRAWINPUT, HRAWINPUT__}
ff7c6d11
XL
6954#[inline]
6955pub fn GET_RAWINPUT_CODE_WPARAM(wParam: WPARAM) -> WPARAM { wParam & 0xff }
6956pub const RIM_INPUT: WPARAM = 0;
6957pub const RIM_INPUTSINK: WPARAM = 1;
6958STRUCT!{struct RAWINPUTHEADER {
6959 dwType: DWORD,
6960 dwSize: DWORD,
6961 hDevice: HANDLE,
6962 wParam: WPARAM,
6963}}
6964pub type PRAWINPUTHEADER = *mut RAWINPUTHEADER;
6965pub type LPRAWINPUTHEADER = *mut RAWINPUTHEADER;
6966pub const RIM_TYPEMOUSE: DWORD = 0;
6967pub const RIM_TYPEKEYBOARD: DWORD = 1;
6968pub const RIM_TYPEHID: DWORD = 2;
6969STRUCT!{struct RAWMOUSE {
6970 usFlags: USHORT,
6971 memory_padding: USHORT, // 16bit Padding for 32bit align in following union
6972 usButtonFlags: USHORT,
6973 usButtonData: USHORT,
6974 ulRawButtons: ULONG,
6975 lLastX: LONG,
6976 lLastY: LONG,
6977 ulExtraInformation: ULONG,
6978}}
6979pub type PRAWMOUSE = *mut RAWMOUSE;
6980pub type LPRAWMOUSE = *mut RAWMOUSE;
6981pub const RI_MOUSE_LEFT_BUTTON_DOWN: USHORT = 0x0001;
6982pub const RI_MOUSE_LEFT_BUTTON_UP: USHORT = 0x0002;
6983pub const RI_MOUSE_RIGHT_BUTTON_DOWN: USHORT = 0x0004;
6984pub const RI_MOUSE_RIGHT_BUTTON_UP: USHORT = 0x0008;
6985pub const RI_MOUSE_MIDDLE_BUTTON_DOWN: USHORT = 0x0010;
6986pub const RI_MOUSE_MIDDLE_BUTTON_UP: USHORT = 0x0020;
6987pub const RI_MOUSE_BUTTON_1_DOWN: USHORT = RI_MOUSE_LEFT_BUTTON_DOWN;
6988pub const RI_MOUSE_BUTTON_1_UP: USHORT = RI_MOUSE_LEFT_BUTTON_UP;
6989pub const RI_MOUSE_BUTTON_2_DOWN: USHORT = RI_MOUSE_RIGHT_BUTTON_DOWN;
6990pub const RI_MOUSE_BUTTON_2_UP: USHORT = RI_MOUSE_RIGHT_BUTTON_UP;
6991pub const RI_MOUSE_BUTTON_3_DOWN: USHORT = RI_MOUSE_MIDDLE_BUTTON_DOWN;
6992pub const RI_MOUSE_BUTTON_3_UP: USHORT = RI_MOUSE_MIDDLE_BUTTON_UP;
6993pub const RI_MOUSE_BUTTON_4_DOWN: USHORT = 0x0040;
6994pub const RI_MOUSE_BUTTON_4_UP: USHORT = 0x0080;
6995pub const RI_MOUSE_BUTTON_5_DOWN: USHORT = 0x0100;
6996pub const RI_MOUSE_BUTTON_5_UP: USHORT = 0x0200;
6997pub const RI_MOUSE_WHEEL: USHORT = 0x0400;
6998pub const MOUSE_MOVE_RELATIVE: USHORT = 0;
6999pub const MOUSE_MOVE_ABSOLUTE: USHORT = 1;
7000pub const MOUSE_VIRTUAL_DESKTOP: USHORT = 0x02;
7001pub const MOUSE_ATTRIBUTES_CHANGED: USHORT = 0x04;
7002pub const MOUSE_MOVE_NOCOALESCE: USHORT = 0x08;
7003STRUCT!{struct RAWKEYBOARD {
7004 MakeCode: USHORT,
7005 Flags: USHORT,
7006 Reserved: USHORT,
7007 VKey: USHORT,
7008 Message: UINT,
7009 ExtraInformation: ULONG,
7010}}
7011pub type PRAWKEYBOARD = *mut RAWKEYBOARD;
7012pub type LPRAWKEYBOARD = *mut RAWKEYBOARD;
7013pub const KEYBOARD_OVERRUN_MAKE_CODE: DWORD = 0xFF;
7014pub const RI_KEY_MAKE: DWORD = 0;
7015pub const RI_KEY_BREAK: DWORD = 1;
7016pub const RI_KEY_E0: DWORD = 2;
7017pub const RI_KEY_E1: DWORD = 4;
7018pub const RI_KEY_TERMSRV_SET_LED: DWORD = 8;
7019pub const RI_KEY_TERMSRV_SHADOW: DWORD = 0x10;
7020STRUCT!{struct RAWHID {
7021 dwSizeHid: DWORD,
7022 dwCount: DWORD,
8faf50e0 7023 bRawData: [BYTE; 1],
ff7c6d11
XL
7024}}
7025pub type PRAWHID = *mut RAWHID;
7026pub type LPRAWHID = *mut RAWHID;
7027UNION!{union RAWINPUT_data {
7028 [u32; 6],
7029 mouse mouse_mut: RAWMOUSE,
7030 keyboard keyboard_mut: RAWKEYBOARD,
7031 hid hid_mut: RAWHID,
7032}}
7033STRUCT!{struct RAWINPUT {
7034 header: RAWINPUTHEADER,
7035 data: RAWINPUT_data,
7036}}
7037pub type PRAWINPUT = *mut RAWINPUT;
7038pub type LPRAWINPUT = *mut RAWINPUT;
7039pub const RID_INPUT: DWORD = 0x10000003;
7040pub const RID_HEADER: DWORD = 0x10000005;
7041extern "system" {
7042 pub fn GetRawInputData(
7043 hRawInput: HRAWINPUT,
7044 uiCommand: UINT,
7045 pData: LPVOID,
7046 pcbSize: PUINT,
7047 cbSizeHeader: UINT,
7048 ) -> UINT;
7049}
7050pub const RIDI_PREPARSEDDATA: DWORD = 0x20000005;
7051pub const RIDI_DEVICENAME: DWORD = 0x20000007;
7052pub const RIDI_DEVICEINFO: DWORD = 0x2000000b;
7053STRUCT!{struct RID_DEVICE_INFO_MOUSE {
7054 dwId: DWORD,
7055 dwNumberOfButtons: DWORD,
7056 dwSampleRate: DWORD,
7057 fHasHorizontalWheel: BOOL,
7058}}
7059pub type PRID_DEVICE_INFO_MOUSE = *mut RID_DEVICE_INFO_MOUSE;
7060STRUCT!{struct RID_DEVICE_INFO_KEYBOARD {
7061 dwType: DWORD,
7062 dwSubType: DWORD,
7063 dwKeyboardMode: DWORD,
7064 dwNumberOfFunctionKeys: DWORD,
7065 dwNumberOfIndicators: DWORD,
7066 dwNumberOfKeysTotal: DWORD,
7067}}
7068pub type PRID_DEVICE_INFO_KEYBOARD = *mut RID_DEVICE_INFO_KEYBOARD;
7069STRUCT!{struct RID_DEVICE_INFO_HID {
7070 dwVendorId: DWORD,
7071 dwProductId: DWORD,
7072 dwVersionNumber: DWORD,
7073 usUsagePage: USHORT,
7074 usUsage: USHORT,
7075}}
7076pub type PRID_DEVICE_INFO_HID = *mut RID_DEVICE_INFO_HID;
7077UNION!{union RID_DEVICE_INFO_u {
7078 [u32; 6],
7079 mouse mouse_mut: RID_DEVICE_INFO_MOUSE,
7080 keyboard keyboard_mut: RID_DEVICE_INFO_KEYBOARD,
7081 hid hid_mut: RID_DEVICE_INFO_HID,
7082}}
7083STRUCT!{struct RID_DEVICE_INFO {
7084 cbSize: DWORD,
7085 dwType: DWORD,
7086 u: RID_DEVICE_INFO_u,
7087}}
7088pub type PRID_DEVICE_INFO = *mut RID_DEVICE_INFO;
7089pub type LPRID_DEVICE_INFO = *mut RID_DEVICE_INFO;
7090extern "system" {
7091 pub fn GetRawInputDeviceInfoA(
7092 hDevice: HANDLE,
7093 uiCommand: UINT,
7094 pData: LPVOID,
7095 pcbSize: PUINT,
7096 ) -> UINT;
7097 pub fn GetRawInputDeviceInfoW(
7098 hDevice: HANDLE,
7099 uiCommand: UINT,
7100 pData: LPVOID,
7101 pcbSize: PUINT,
7102 ) -> UINT;
7103 pub fn GetRawInputBuffer(
7104 pData: PRAWINPUT,
7105 pcbSize: PUINT,
7106 cbSizeHeader: UINT,
7107 ) -> UINT;
7108}
7109STRUCT!{struct RAWINPUTDEVICE {
7110 usUsagePage: USHORT,
7111 usUsage: USHORT,
7112 dwFlags: DWORD,
7113 hwndTarget: HWND,
7114}}
7115pub type PRAWINPUTDEVICE = *mut RAWINPUTDEVICE;
7116pub type LPRAWINPUTDEVICE = *mut RAWINPUTDEVICE;
7117pub type PCRAWINPUTDEVICE = *const RAWINPUTDEVICE;
7118pub const RIDEV_REMOVE: DWORD = 0x00000001;
7119pub const RIDEV_EXCLUDE: DWORD = 0x00000010;
7120pub const RIDEV_PAGEONLY: DWORD = 0x00000020;
7121pub const RIDEV_NOLEGACY: DWORD = 0x00000030;
7122pub const RIDEV_INPUTSINK: DWORD = 0x00000100;
7123pub const RIDEV_CAPTUREMOUSE: DWORD = 0x00000200;
7124pub const RIDEV_NOHOTKEYS: DWORD = 0x00000200;
7125pub const RIDEV_APPKEYS: DWORD = 0x00000400;
7126pub const RIDEV_EXINPUTSINK: DWORD = 0x00001000;
7127pub const RIDEV_DEVNOTIFY: DWORD = 0x00002000;
7128pub const RIDEV_EXMODEMASK: DWORD = 0x000000F0;
7129pub const GIDC_ARRIVAL: DWORD = 1;
7130pub const GIDC_REMOVAL: DWORD = 2;
7131extern "system" {
7132 pub fn RegisterRawInputDevices(
7133 pRawInputDevices: PCRAWINPUTDEVICE,
7134 uiNumDevices: UINT,
7135 cbSize: UINT,
7136 ) -> BOOL;
7137 pub fn GetRegisteredRawInputDevices(
7138 pRawInputDevices: PRAWINPUTDEVICE,
7139 puiNumDevices: PUINT,
7140 cbSize: UINT,
7141 ) -> UINT;
7142}
7143STRUCT!{struct RAWINPUTDEVICELIST {
7144 hDevice: HANDLE,
7145 dwType: DWORD,
7146}}
7147pub type PRAWINPUTDEVICELIST = *mut RAWINPUTDEVICELIST;
7148extern "system" {
7149 pub fn GetRawInputDeviceList(
7150 pRawInputDeviceList: PRAWINPUTDEVICELIST,
7151 puiNumDevices: PUINT,
7152 cbSize: UINT,
7153 ) -> UINT;
7154 pub fn DefRawInputProc(
7155 paRawInput: *mut PRAWINPUT,
7156 nInput: INT,
7157 cbSizeHeader: UINT,
7158 ) -> LRESULT;
7159 pub fn ChangeWindowMessageFilter(
7160 message: UINT,
7161 dwFlag: DWORD,
7162 ) -> BOOL;
7163}
60c5eb7d 7164//15165
ff7c6d11
XL
7165STRUCT!{struct CHANGEFILTERSTRUCT {
7166 cbSize: DWORD,
7167 ExtStatus: DWORD,
7168}}
7169extern "system" {
7170 pub fn ChangeWindowMessageFilterEx(
7171 hwnd: HWND,
7172 message: UINT,
7173 action: DWORD,
7174 pChangeFilterStruct: PCHANGEFILTERSTRUCT,
7175 ) -> BOOL;
7176}
7177pub type PCHANGEFILTERSTRUCT = *mut CHANGEFILTERSTRUCT;
60c5eb7d 7178//15427
ff7c6d11
XL
7179pub const NID_INTEGRATED_TOUCH: UINT = 0x00000001;
7180pub const NID_EXTERNAL_TOUCH: UINT = 0x00000002;
7181pub const NID_INTEGRATED_PEN: UINT = 0x00000004;
7182pub const NID_EXTERNAL_PEN: UINT = 0x00000008;
7183pub const NID_MULTI_INPUT: UINT = 0x00000040;
7184pub const NID_READY: UINT = 0x00000080;
60c5eb7d
XL
7185pub const MAX_STR_BLOCKREASON: usize = 256;
7186extern "system" {
7187 pub fn ShutdownBlockReasonCreate(
7188 hWnd: HWND,
7189 pwszReason: LPCWSTR,
7190 ) -> BOOL;
7191 pub fn ShutdownBlockReasonQuery(
7192 hWnd: HWND,
7193 pwszBuff: LPWSTR,
7194 pcchBuff: *mut DWORD,
7195 ) -> BOOL;
7196 pub fn ShutdownBlockReasonDestroy(
7197 hWnd: HWND,
7198 ) -> BOOL;
7199}
7200//15615
ff7c6d11 7201extern "system" {
ff7c6d11
XL
7202 pub fn IsImmersiveProcess(
7203 hProcess: HANDLE,
7204 ) -> BOOL;
7205}