authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-27 23:39:06-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-28 13:16:47-04:00
logd817a3c5173a4f9e41c5872e58733287c9686018
tree3a5f260b2198728c43c4833058e4802487266d19
parente69fd4d696b7e24c66a50adb3bf3fe011ee1a626

delete std.os.windows.user32

This is progress towards #4426 Closes #17417

3 files changed, 1 insertions(+), 1593 deletions(-)

lib/std/os/windows.zig-1
......@@ -24,7 +24,6 @@ pub const ntdll = @import("windows/ntdll.zig");
2424pub const ole32 = @import("windows/ole32.zig");
2525pub const psapi = @import("windows/psapi.zig");
2626pub const shell32 = @import("windows/shell32.zig");
27pub const user32 = @import("windows/user32.zig");
2827pub const ws2_32 = @import("windows/ws2_32.zig");
2928pub const gdi32 = @import("windows/gdi32.zig");
3029pub const winmm = @import("windows/winmm.zig");
lib/std/os/windows/user32.zig deleted-1591
......@@ -1,1591 +0,0 @@
1const std = @import("../../std.zig");
2const builtin = @import("builtin");
3const assert = std.debug.assert;
4
5const windows = std.os.windows;
6const GetLastError = windows.kernel32.GetLastError;
7const SetLastError = windows.kernel32.SetLastError;
8const unexpectedError = windows.unexpectedError;
9const HWND = windows.HWND;
10const UINT = windows.UINT;
11const HDC = windows.HDC;
12const LONG = windows.LONG;
13const LONG_PTR = windows.LONG_PTR;
14const WINAPI = windows.WINAPI;
15const RECT = windows.RECT;
16const DWORD = windows.DWORD;
17const BOOL = windows.BOOL;
18const TRUE = windows.TRUE;
19const HMENU = windows.HMENU;
20const HINSTANCE = windows.HINSTANCE;
21const LPVOID = windows.LPVOID;
22const ATOM = windows.ATOM;
23const WPARAM = windows.WPARAM;
24const LRESULT = windows.LRESULT;
25const HICON = windows.HICON;
26const LPARAM = windows.LPARAM;
27const POINT = windows.POINT;
28const HCURSOR = windows.HCURSOR;
29const HBRUSH = windows.HBRUSH;
30
31inline fn selectSymbol(comptime function_static: anytype, function_dynamic: *const @TypeOf(function_static), comptime os: std.Target.Os.WindowsVersion) *const @TypeOf(function_static) {
32 const sym_ok = comptime builtin.os.isAtLeast(.windows, os);
33 if (sym_ok == true) return function_static;
34 if (sym_ok == null) return function_dynamic;
35 if (sym_ok == false) @compileError("Target OS range does not support function, at least " ++ @tagName(os) ++ " is required");
36}
37
38// === Messages ===
39
40pub const WNDPROC = *const fn (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;
41
42pub const MSG = extern struct {
43 hWnd: ?HWND,
44 message: UINT,
45 wParam: WPARAM,
46 lParam: LPARAM,
47 time: DWORD,
48 pt: POINT,
49 lPrivate: DWORD,
50};
51
52// Compiled by the WINE team @ https://wiki.winehq.org/List_Of_Windows_Messages
53pub const WM_NULL = 0x0000;
54pub const WM_CREATE = 0x0001;
55pub const WM_DESTROY = 0x0002;
56pub const WM_MOVE = 0x0003;
57pub const WM_SIZE = 0x0005;
58pub const WM_ACTIVATE = 0x0006;
59pub const WM_SETFOCUS = 0x0007;
60pub const WM_KILLFOCUS = 0x0008;
61pub const WM_ENABLE = 0x000A;
62pub const WM_SETREDRAW = 0x000B;
63pub const WM_SETTEXT = 0x000C;
64pub const WM_GETTEXT = 0x000D;
65pub const WM_GETTEXTLENGTH = 0x000E;
66pub const WM_PAINT = 0x000F;
67pub const WM_CLOSE = 0x0010;
68pub const WM_QUERYENDSESSION = 0x0011;
69pub const WM_QUIT = 0x0012;
70pub const WM_QUERYOPEN = 0x0013;
71pub const WM_ERASEBKGND = 0x0014;
72pub const WM_SYSCOLORCHANGE = 0x0015;
73pub const WM_ENDSESSION = 0x0016;
74pub const WM_SHOWWINDOW = 0x0018;
75pub const WM_CTLCOLOR = 0x0019;
76pub const WM_WININICHANGE = 0x001A;
77pub const WM_DEVMODECHANGE = 0x001B;
78pub const WM_ACTIVATEAPP = 0x001C;
79pub const WM_FONTCHANGE = 0x001D;
80pub const WM_TIMECHANGE = 0x001E;
81pub const WM_CANCELMODE = 0x001F;
82pub const WM_SETCURSOR = 0x0020;
83pub const WM_MOUSEACTIVATE = 0x0021;
84pub const WM_CHILDACTIVATE = 0x0022;
85pub const WM_QUEUESYNC = 0x0023;
86pub const WM_GETMINMAXINFO = 0x0024;
87pub const WM_PAINTICON = 0x0026;
88pub const WM_ICONERASEBKGND = 0x0027;
89pub const WM_NEXTDLGCTL = 0x0028;
90pub const WM_SPOOLERSTATUS = 0x002A;
91pub const WM_DRAWITEM = 0x002B;
92pub const WM_MEASUREITEM = 0x002C;
93pub const WM_DELETEITEM = 0x002D;
94pub const WM_VKEYTOITEM = 0x002E;
95pub const WM_CHARTOITEM = 0x002F;
96pub const WM_SETFONT = 0x0030;
97pub const WM_GETFONT = 0x0031;
98pub const WM_SETHOTKEY = 0x0032;
99pub const WM_GETHOTKEY = 0x0033;
100pub const WM_QUERYDRAGICON = 0x0037;
101pub const WM_COMPAREITEM = 0x0039;
102pub const WM_GETOBJECT = 0x003D;
103pub const WM_COMPACTING = 0x0041;
104pub const WM_COMMNOTIFY = 0x0044;
105pub const WM_WINDOWPOSCHANGING = 0x0046;
106pub const WM_WINDOWPOSCHANGED = 0x0047;
107pub const WM_POWER = 0x0048;
108pub const WM_COPYGLOBALDATA = 0x0049;
109pub const WM_COPYDATA = 0x004A;
110pub const WM_CANCELJOURNAL = 0x004B;
111pub const WM_NOTIFY = 0x004E;
112pub const WM_INPUTLANGCHANGEREQUEST = 0x0050;
113pub const WM_INPUTLANGCHANGE = 0x0051;
114pub const WM_TCARD = 0x0052;
115pub const WM_HELP = 0x0053;
116pub const WM_USERCHANGED = 0x0054;
117pub const WM_NOTIFYFORMAT = 0x0055;
118pub const WM_CONTEXTMENU = 0x007B;
119pub const WM_STYLECHANGING = 0x007C;
120pub const WM_STYLECHANGED = 0x007D;
121pub const WM_DISPLAYCHANGE = 0x007E;
122pub const WM_GETICON = 0x007F;
123pub const WM_SETICON = 0x0080;
124pub const WM_NCCREATE = 0x0081;
125pub const WM_NCDESTROY = 0x0082;
126pub const WM_NCCALCSIZE = 0x0083;
127pub const WM_NCHITTEST = 0x0084;
128pub const WM_NCPAINT = 0x0085;
129pub const WM_NCACTIVATE = 0x0086;
130pub const WM_GETDLGCODE = 0x0087;
131pub const WM_SYNCPAINT = 0x0088;
132pub const WM_NCMOUSEMOVE = 0x00A0;
133pub const WM_NCLBUTTONDOWN = 0x00A1;
134pub const WM_NCLBUTTONUP = 0x00A2;
135pub const WM_NCLBUTTONDBLCLK = 0x00A3;
136pub const WM_NCRBUTTONDOWN = 0x00A4;
137pub const WM_NCRBUTTONUP = 0x00A5;
138pub const WM_NCRBUTTONDBLCLK = 0x00A6;
139pub const WM_NCMBUTTONDOWN = 0x00A7;
140pub const WM_NCMBUTTONUP = 0x00A8;
141pub const WM_NCMBUTTONDBLCLK = 0x00A9;
142pub const WM_NCXBUTTONDOWN = 0x00AB;
143pub const WM_NCXBUTTONUP = 0x00AC;
144pub const WM_NCXBUTTONDBLCLK = 0x00AD;
145pub const EM_GETSEL = 0x00B0;
146pub const EM_SETSEL = 0x00B1;
147pub const EM_GETRECT = 0x00B2;
148pub const EM_SETRECT = 0x00B3;
149pub const EM_SETRECTNP = 0x00B4;
150pub const EM_SCROLL = 0x00B5;
151pub const EM_LINESCROLL = 0x00B6;
152pub const EM_SCROLLCARET = 0x00B7;
153pub const EM_GETMODIFY = 0x00B8;
154pub const EM_SETMODIFY = 0x00B9;
155pub const EM_GETLINECOUNT = 0x00BA;
156pub const EM_LINEINDEX = 0x00BB;
157pub const EM_SETHANDLE = 0x00BC;
158pub const EM_GETHANDLE = 0x00BD;
159pub const EM_GETTHUMB = 0x00BE;
160pub const EM_LINELENGTH = 0x00C1;
161pub const EM_REPLACESEL = 0x00C2;
162pub const EM_SETFONT = 0x00C3;
163pub const EM_GETLINE = 0x00C4;
164pub const EM_LIMITTEXT = 0x00C5;
165pub const EM_SETLIMITTEXT = 0x00C5;
166pub const EM_CANUNDO = 0x00C6;
167pub const EM_UNDO = 0x00C7;
168pub const EM_FMTLINES = 0x00C8;
169pub const EM_LINEFROMCHAR = 0x00C9;
170pub const EM_SETWORDBREAK = 0x00CA;
171pub const EM_SETTABSTOPS = 0x00CB;
172pub const EM_SETPASSWORDCHAR = 0x00CC;
173pub const EM_EMPTYUNDOBUFFER = 0x00CD;
174pub const EM_GETFIRSTVISIBLELINE = 0x00CE;
175pub const EM_SETREADONLY = 0x00CF;
176pub const EM_SETWORDBREAKPROC = 0x00D0;
177pub const EM_GETWORDBREAKPROC = 0x00D1;
178pub const EM_GETPASSWORDCHAR = 0x00D2;
179pub const EM_SETMARGINS = 0x00D3;
180pub const EM_GETMARGINS = 0x00D4;
181pub const EM_GETLIMITTEXT = 0x00D5;
182pub const EM_POSFROMCHAR = 0x00D6;
183pub const EM_CHARFROMPOS = 0x00D7;
184pub const EM_SETIMESTATUS = 0x00D8;
185pub const EM_GETIMESTATUS = 0x00D9;
186pub const SBM_SETPOS = 0x00E0;
187pub const SBM_GETPOS = 0x00E1;
188pub const SBM_SETRANGE = 0x00E2;
189pub const SBM_GETRANGE = 0x00E3;
190pub const SBM_ENABLE_ARROWS = 0x00E4;
191pub const SBM_SETRANGEREDRAW = 0x00E6;
192pub const SBM_SETSCROLLINFO = 0x00E9;
193pub const SBM_GETSCROLLINFO = 0x00EA;
194pub const SBM_GETSCROLLBARINFO = 0x00EB;
195pub const BM_GETCHECK = 0x00F0;
196pub const BM_SETCHECK = 0x00F1;
197pub const BM_GETSTATE = 0x00F2;
198pub const BM_SETSTATE = 0x00F3;
199pub const BM_SETSTYLE = 0x00F4;
200pub const BM_CLICK = 0x00F5;
201pub const BM_GETIMAGE = 0x00F6;
202pub const BM_SETIMAGE = 0x00F7;
203pub const BM_SETDONTCLICK = 0x00F8;
204pub const WM_INPUT = 0x00FF;
205pub const WM_KEYDOWN = 0x0100;
206pub const WM_KEYUP = 0x0101;
207pub const WM_CHAR = 0x0102;
208pub const WM_DEADCHAR = 0x0103;
209pub const WM_SYSKEYDOWN = 0x0104;
210pub const WM_SYSKEYUP = 0x0105;
211pub const WM_SYSCHAR = 0x0106;
212pub const WM_SYSDEADCHAR = 0x0107;
213pub const WM_UNICHAR = 0x0109;
214pub const WM_WNT_CONVERTREQUESTEX = 0x0109;
215pub const WM_CONVERTREQUEST = 0x010A;
216pub const WM_CONVERTRESULT = 0x010B;
217pub const WM_INTERIM = 0x010C;
218pub const WM_IME_STARTCOMPOSITION = 0x010D;
219pub const WM_IME_ENDCOMPOSITION = 0x010E;
220pub const WM_IME_COMPOSITION = 0x010F;
221pub const WM_INITDIALOG = 0x0110;
222pub const WM_COMMAND = 0x0111;
223pub const WM_SYSCOMMAND = 0x0112;
224pub const WM_TIMER = 0x0113;
225pub const WM_HSCROLL = 0x0114;
226pub const WM_VSCROLL = 0x0115;
227pub const WM_INITMENU = 0x0116;
228pub const WM_INITMENUPOPUP = 0x0117;
229pub const WM_SYSTIMER = 0x0118;
230pub const WM_MENUSELECT = 0x011F;
231pub const WM_MENUCHAR = 0x0120;
232pub const WM_ENTERIDLE = 0x0121;
233pub const WM_MENURBUTTONUP = 0x0122;
234pub const WM_MENUDRAG = 0x0123;
235pub const WM_MENUGETOBJECT = 0x0124;
236pub const WM_UNINITMENUPOPUP = 0x0125;
237pub const WM_MENUCOMMAND = 0x0126;
238pub const WM_CHANGEUISTATE = 0x0127;
239pub const WM_UPDATEUISTATE = 0x0128;
240pub const WM_QUERYUISTATE = 0x0129;
241pub const WM_CTLCOLORMSGBOX = 0x0132;
242pub const WM_CTLCOLOREDIT = 0x0133;
243pub const WM_CTLCOLORLISTBOX = 0x0134;
244pub const WM_CTLCOLORBTN = 0x0135;
245pub const WM_CTLCOLORDLG = 0x0136;
246pub const WM_CTLCOLORSCROLLBAR = 0x0137;
247pub const WM_CTLCOLORSTATIC = 0x0138;
248pub const WM_MOUSEMOVE = 0x0200;
249pub const WM_LBUTTONDOWN = 0x0201;
250pub const WM_LBUTTONUP = 0x0202;
251pub const WM_LBUTTONDBLCLK = 0x0203;
252pub const WM_RBUTTONDOWN = 0x0204;
253pub const WM_RBUTTONUP = 0x0205;
254pub const WM_RBUTTONDBLCLK = 0x0206;
255pub const WM_MBUTTONDOWN = 0x0207;
256pub const WM_MBUTTONUP = 0x0208;
257pub const WM_MBUTTONDBLCLK = 0x0209;
258pub const WM_MOUSEWHEEL = 0x020A;
259pub const WM_XBUTTONDOWN = 0x020B;
260pub const WM_XBUTTONUP = 0x020C;
261pub const WM_XBUTTONDBLCLK = 0x020D;
262pub const WM_MOUSEHWHEEL = 0x020E;
263pub const WM_PARENTNOTIFY = 0x0210;
264pub const WM_ENTERMENULOOP = 0x0211;
265pub const WM_EXITMENULOOP = 0x0212;
266pub const WM_NEXTMENU = 0x0213;
267pub const WM_SIZING = 0x0214;
268pub const WM_CAPTURECHANGED = 0x0215;
269pub const WM_MOVING = 0x0216;
270pub const WM_POWERBROADCAST = 0x0218;
271pub const WM_DEVICECHANGE = 0x0219;
272pub const WM_MDICREATE = 0x0220;
273pub const WM_MDIDESTROY = 0x0221;
274pub const WM_MDIACTIVATE = 0x0222;
275pub const WM_MDIRESTORE = 0x0223;
276pub const WM_MDINEXT = 0x0224;
277pub const WM_MDIMAXIMIZE = 0x0225;
278pub const WM_MDITILE = 0x0226;
279pub const WM_MDICASCADE = 0x0227;
280pub const WM_MDIICONARRANGE = 0x0228;
281pub const WM_MDIGETACTIVE = 0x0229;
282pub const WM_MDISETMENU = 0x0230;
283pub const WM_ENTERSIZEMOVE = 0x0231;
284pub const WM_EXITSIZEMOVE = 0x0232;
285pub const WM_DROPFILES = 0x0233;
286pub const WM_MDIREFRESHMENU = 0x0234;
287pub const WM_IME_REPORT = 0x0280;
288pub const WM_IME_SETCONTEXT = 0x0281;
289pub const WM_IME_NOTIFY = 0x0282;
290pub const WM_IME_CONTROL = 0x0283;
291pub const WM_IME_COMPOSITIONFULL = 0x0284;
292pub const WM_IME_SELECT = 0x0285;
293pub const WM_IME_CHAR = 0x0286;
294pub const WM_IME_REQUEST = 0x0288;
295pub const WM_IMEKEYDOWN = 0x0290;
296pub const WM_IME_KEYDOWN = 0x0290;
297pub const WM_IMEKEYUP = 0x0291;
298pub const WM_IME_KEYUP = 0x0291;
299pub const WM_NCMOUSEHOVER = 0x02A0;
300pub const WM_MOUSEHOVER = 0x02A1;
301pub const WM_NCMOUSELEAVE = 0x02A2;
302pub const WM_MOUSELEAVE = 0x02A3;
303pub const WM_CUT = 0x0300;
304pub const WM_COPY = 0x0301;
305pub const WM_PASTE = 0x0302;
306pub const WM_CLEAR = 0x0303;
307pub const WM_UNDO = 0x0304;
308pub const WM_RENDERFORMAT = 0x0305;
309pub const WM_RENDERALLFORMATS = 0x0306;
310pub const WM_DESTROYCLIPBOARD = 0x0307;
311pub const WM_DRAWCLIPBOARD = 0x0308;
312pub const WM_PAINTCLIPBOARD = 0x0309;
313pub const WM_VSCROLLCLIPBOARD = 0x030A;
314pub const WM_SIZECLIPBOARD = 0x030B;
315pub const WM_ASKCBFORMATNAME = 0x030C;
316pub const WM_CHANGECBCHAIN = 0x030D;
317pub const WM_HSCROLLCLIPBOARD = 0x030E;
318pub const WM_QUERYNEWPALETTE = 0x030F;
319pub const WM_PALETTEISCHANGING = 0x0310;
320pub const WM_PALETTECHANGED = 0x0311;
321pub const WM_HOTKEY = 0x0312;
322pub const WM_PRINT = 0x0317;
323pub const WM_PRINTCLIENT = 0x0318;
324pub const WM_APPCOMMAND = 0x0319;
325pub const WM_RCRESULT = 0x0381;
326pub const WM_HOOKRCRESULT = 0x0382;
327pub const WM_GLOBALRCCHANGE = 0x0383;
328pub const WM_PENMISCINFO = 0x0383;
329pub const WM_SKB = 0x0384;
330pub const WM_HEDITCTL = 0x0385;
331pub const WM_PENCTL = 0x0385;
332pub const WM_PENMISC = 0x0386;
333pub const WM_CTLINIT = 0x0387;
334pub const WM_PENEVENT = 0x0388;
335pub const WM_CARET_CREATE = 0x03E0;
336pub const WM_CARET_DESTROY = 0x03E1;
337pub const WM_CARET_BLINK = 0x03E2;
338pub const WM_FDINPUT = 0x03F0;
339pub const WM_FDOUTPUT = 0x03F1;
340pub const WM_FDEXCEPT = 0x03F2;
341pub const DDM_SETFMT = 0x0400;
342pub const DM_GETDEFID = 0x0400;
343pub const NIN_SELECT = 0x0400;
344pub const TBM_GETPOS = 0x0400;
345pub const WM_PSD_PAGESETUPDLG = 0x0400;
346pub const WM_USER = 0x0400;
347pub const CBEM_INSERTITEMA = 0x0401;
348pub const DDM_DRAW = 0x0401;
349pub const DM_SETDEFID = 0x0401;
350pub const HKM_SETHOTKEY = 0x0401;
351pub const PBM_SETRANGE = 0x0401;
352pub const RB_INSERTBANDA = 0x0401;
353pub const SB_SETTEXTA = 0x0401;
354pub const TB_ENABLEBUTTON = 0x0401;
355pub const TBM_GETRANGEMIN = 0x0401;
356pub const TTM_ACTIVATE = 0x0401;
357pub const WM_CHOOSEFONT_GETLOGFONT = 0x0401;
358pub const WM_PSD_FULLPAGERECT = 0x0401;
359pub const CBEM_SETIMAGELIST = 0x0402;
360pub const DDM_CLOSE = 0x0402;
361pub const DM_REPOSITION = 0x0402;
362pub const HKM_GETHOTKEY = 0x0402;
363pub const PBM_SETPOS = 0x0402;
364pub const RB_DELETEBAND = 0x0402;
365pub const SB_GETTEXTA = 0x0402;
366pub const TB_CHECKBUTTON = 0x0402;
367pub const TBM_GETRANGEMAX = 0x0402;
368pub const WM_PSD_MINMARGINRECT = 0x0402;
369pub const CBEM_GETIMAGELIST = 0x0403;
370pub const DDM_BEGIN = 0x0403;
371pub const HKM_SETRULES = 0x0403;
372pub const PBM_DELTAPOS = 0x0403;
373pub const RB_GETBARINFO = 0x0403;
374pub const SB_GETTEXTLENGTHA = 0x0403;
375pub const TBM_GETTIC = 0x0403;
376pub const TB_PRESSBUTTON = 0x0403;
377pub const TTM_SETDELAYTIME = 0x0403;
378pub const WM_PSD_MARGINRECT = 0x0403;
379pub const CBEM_GETITEMA = 0x0404;
380pub const DDM_END = 0x0404;
381pub const PBM_SETSTEP = 0x0404;
382pub const RB_SETBARINFO = 0x0404;
383pub const SB_SETPARTS = 0x0404;
384pub const TB_HIDEBUTTON = 0x0404;
385pub const TBM_SETTIC = 0x0404;
386pub const TTM_ADDTOOLA = 0x0404;
387pub const WM_PSD_GREEKTEXTRECT = 0x0404;
388pub const CBEM_SETITEMA = 0x0405;
389pub const PBM_STEPIT = 0x0405;
390pub const TB_INDETERMINATE = 0x0405;
391pub const TBM_SETPOS = 0x0405;
392pub const TTM_DELTOOLA = 0x0405;
393pub const WM_PSD_ENVSTAMPRECT = 0x0405;
394pub const CBEM_GETCOMBOCONTROL = 0x0406;
395pub const PBM_SETRANGE32 = 0x0406;
396pub const RB_SETBANDINFOA = 0x0406;
397pub const SB_GETPARTS = 0x0406;
398pub const TB_MARKBUTTON = 0x0406;
399pub const TBM_SETRANGE = 0x0406;
400pub const TTM_NEWTOOLRECTA = 0x0406;
401pub const WM_PSD_YAFULLPAGERECT = 0x0406;
402pub const CBEM_GETEDITCONTROL = 0x0407;
403pub const PBM_GETRANGE = 0x0407;
404pub const RB_SETPARENT = 0x0407;
405pub const SB_GETBORDERS = 0x0407;
406pub const TBM_SETRANGEMIN = 0x0407;
407pub const TTM_RELAYEVENT = 0x0407;
408pub const CBEM_SETEXSTYLE = 0x0408;
409pub const PBM_GETPOS = 0x0408;
410pub const RB_HITTEST = 0x0408;
411pub const SB_SETMINHEIGHT = 0x0408;
412pub const TBM_SETRANGEMAX = 0x0408;
413pub const TTM_GETTOOLINFOA = 0x0408;
414pub const CBEM_GETEXSTYLE = 0x0409;
415pub const CBEM_GETEXTENDEDSTYLE = 0x0409;
416pub const PBM_SETBARCOLOR = 0x0409;
417pub const RB_GETRECT = 0x0409;
418pub const SB_SIMPLE = 0x0409;
419pub const TB_ISBUTTONENABLED = 0x0409;
420pub const TBM_CLEARTICS = 0x0409;
421pub const TTM_SETTOOLINFOA = 0x0409;
422pub const CBEM_HASEDITCHANGED = 0x040A;
423pub const RB_INSERTBANDW = 0x040A;
424pub const SB_GETRECT = 0x040A;
425pub const TB_ISBUTTONCHECKED = 0x040A;
426pub const TBM_SETSEL = 0x040A;
427pub const TTM_HITTESTA = 0x040A;
428pub const WIZ_QUERYNUMPAGES = 0x040A;
429pub const CBEM_INSERTITEMW = 0x040B;
430pub const RB_SETBANDINFOW = 0x040B;
431pub const SB_SETTEXTW = 0x040B;
432pub const TB_ISBUTTONPRESSED = 0x040B;
433pub const TBM_SETSELSTART = 0x040B;
434pub const TTM_GETTEXTA = 0x040B;
435pub const WIZ_NEXT = 0x040B;
436pub const CBEM_SETITEMW = 0x040C;
437pub const RB_GETBANDCOUNT = 0x040C;
438pub const SB_GETTEXTLENGTHW = 0x040C;
439pub const TB_ISBUTTONHIDDEN = 0x040C;
440pub const TBM_SETSELEND = 0x040C;
441pub const TTM_UPDATETIPTEXTA = 0x040C;
442pub const WIZ_PREV = 0x040C;
443pub const CBEM_GETITEMW = 0x040D;
444pub const RB_GETROWCOUNT = 0x040D;
445pub const SB_GETTEXTW = 0x040D;
446pub const TB_ISBUTTONINDETERMINATE = 0x040D;
447pub const TTM_GETTOOLCOUNT = 0x040D;
448pub const CBEM_SETEXTENDEDSTYLE = 0x040E;
449pub const RB_GETROWHEIGHT = 0x040E;
450pub const SB_ISSIMPLE = 0x040E;
451pub const TB_ISBUTTONHIGHLIGHTED = 0x040E;
452pub const TBM_GETPTICS = 0x040E;
453pub const TTM_ENUMTOOLSA = 0x040E;
454pub const SB_SETICON = 0x040F;
455pub const TBM_GETTICPOS = 0x040F;
456pub const TTM_GETCURRENTTOOLA = 0x040F;
457pub const RB_IDTOINDEX = 0x0410;
458pub const SB_SETTIPTEXTA = 0x0410;
459pub const TBM_GETNUMTICS = 0x0410;
460pub const TTM_WINDOWFROMPOINT = 0x0410;
461pub const RB_GETTOOLTIPS = 0x0411;
462pub const SB_SETTIPTEXTW = 0x0411;
463pub const TBM_GETSELSTART = 0x0411;
464pub const TB_SETSTATE = 0x0411;
465pub const TTM_TRACKACTIVATE = 0x0411;
466pub const RB_SETTOOLTIPS = 0x0412;
467pub const SB_GETTIPTEXTA = 0x0412;
468pub const TB_GETSTATE = 0x0412;
469pub const TBM_GETSELEND = 0x0412;
470pub const TTM_TRACKPOSITION = 0x0412;
471pub const RB_SETBKCOLOR = 0x0413;
472pub const SB_GETTIPTEXTW = 0x0413;
473pub const TB_ADDBITMAP = 0x0413;
474pub const TBM_CLEARSEL = 0x0413;
475pub const TTM_SETTIPBKCOLOR = 0x0413;
476pub const RB_GETBKCOLOR = 0x0414;
477pub const SB_GETICON = 0x0414;
478pub const TB_ADDBUTTONSA = 0x0414;
479pub const TBM_SETTICFREQ = 0x0414;
480pub const TTM_SETTIPTEXTCOLOR = 0x0414;
481pub const RB_SETTEXTCOLOR = 0x0415;
482pub const TB_INSERTBUTTONA = 0x0415;
483pub const TBM_SETPAGESIZE = 0x0415;
484pub const TTM_GETDELAYTIME = 0x0415;
485pub const RB_GETTEXTCOLOR = 0x0416;
486pub const TB_DELETEBUTTON = 0x0416;
487pub const TBM_GETPAGESIZE = 0x0416;
488pub const TTM_GETTIPBKCOLOR = 0x0416;
489pub const RB_SIZETORECT = 0x0417;
490pub const TB_GETBUTTON = 0x0417;
491pub const TBM_SETLINESIZE = 0x0417;
492pub const TTM_GETTIPTEXTCOLOR = 0x0417;
493pub const RB_BEGINDRAG = 0x0418;
494pub const TB_BUTTONCOUNT = 0x0418;
495pub const TBM_GETLINESIZE = 0x0418;
496pub const TTM_SETMAXTIPWIDTH = 0x0418;
497pub const RB_ENDDRAG = 0x0419;
498pub const TB_COMMANDTOINDEX = 0x0419;
499pub const TBM_GETTHUMBRECT = 0x0419;
500pub const TTM_GETMAXTIPWIDTH = 0x0419;
501pub const RB_DRAGMOVE = 0x041A;
502pub const TBM_GETCHANNELRECT = 0x041A;
503pub const TB_SAVERESTOREA = 0x041A;
504pub const TTM_SETMARGIN = 0x041A;
505pub const RB_GETBARHEIGHT = 0x041B;
506pub const TB_CUSTOMIZE = 0x041B;
507pub const TBM_SETTHUMBLENGTH = 0x041B;
508pub const TTM_GETMARGIN = 0x041B;
509pub const RB_GETBANDINFOW = 0x041C;
510pub const TB_ADDSTRINGA = 0x041C;
511pub const TBM_GETTHUMBLENGTH = 0x041C;
512pub const TTM_POP = 0x041C;
513pub const RB_GETBANDINFOA = 0x041D;
514pub const TB_GETITEMRECT = 0x041D;
515pub const TBM_SETTOOLTIPS = 0x041D;
516pub const TTM_UPDATE = 0x041D;
517pub const RB_MINIMIZEBAND = 0x041E;
518pub const TB_BUTTONSTRUCTSIZE = 0x041E;
519pub const TBM_GETTOOLTIPS = 0x041E;
520pub const TTM_GETBUBBLESIZE = 0x041E;
521pub const RB_MAXIMIZEBAND = 0x041F;
522pub const TBM_SETTIPSIDE = 0x041F;
523pub const TB_SETBUTTONSIZE = 0x041F;
524pub const TTM_ADJUSTRECT = 0x041F;
525pub const TBM_SETBUDDY = 0x0420;
526pub const TB_SETBITMAPSIZE = 0x0420;
527pub const TTM_SETTITLEA = 0x0420;
528pub const MSG_FTS_JUMP_VA = 0x0421;
529pub const TB_AUTOSIZE = 0x0421;
530pub const TBM_GETBUDDY = 0x0421;
531pub const TTM_SETTITLEW = 0x0421;
532pub const RB_GETBANDBORDERS = 0x0422;
533pub const MSG_FTS_JUMP_QWORD = 0x0423;
534pub const RB_SHOWBAND = 0x0423;
535pub const TB_GETTOOLTIPS = 0x0423;
536pub const MSG_REINDEX_REQUEST = 0x0424;
537pub const TB_SETTOOLTIPS = 0x0424;
538pub const MSG_FTS_WHERE_IS_IT = 0x0425;
539pub const RB_SETPALETTE = 0x0425;
540pub const TB_SETPARENT = 0x0425;
541pub const RB_GETPALETTE = 0x0426;
542pub const RB_MOVEBAND = 0x0427;
543pub const TB_SETROWS = 0x0427;
544pub const TB_GETROWS = 0x0428;
545pub const TB_GETBITMAPFLAGS = 0x0429;
546pub const TB_SETCMDID = 0x042A;
547pub const RB_PUSHCHEVRON = 0x042B;
548pub const TB_CHANGEBITMAP = 0x042B;
549pub const TB_GETBITMAP = 0x042C;
550pub const MSG_GET_DEFFONT = 0x042D;
551pub const TB_GETBUTTONTEXTA = 0x042D;
552pub const TB_REPLACEBITMAP = 0x042E;
553pub const TB_SETINDENT = 0x042F;
554pub const TB_SETIMAGELIST = 0x0430;
555pub const TB_GETIMAGELIST = 0x0431;
556pub const TB_LOADIMAGES = 0x0432;
557pub const EM_CANPASTE = 0x0432;
558pub const TTM_ADDTOOLW = 0x0432;
559pub const EM_DISPLAYBAND = 0x0433;
560pub const TB_GETRECT = 0x0433;
561pub const TTM_DELTOOLW = 0x0433;
562pub const EM_EXGETSEL = 0x0434;
563pub const TB_SETHOTIMAGELIST = 0x0434;
564pub const TTM_NEWTOOLRECTW = 0x0434;
565pub const EM_EXLIMITTEXT = 0x0435;
566pub const TB_GETHOTIMAGELIST = 0x0435;
567pub const TTM_GETTOOLINFOW = 0x0435;
568pub const EM_EXLINEFROMCHAR = 0x0436;
569pub const TB_SETDISABLEDIMAGELIST = 0x0436;
570pub const TTM_SETTOOLINFOW = 0x0436;
571pub const EM_EXSETSEL = 0x0437;
572pub const TB_GETDISABLEDIMAGELIST = 0x0437;
573pub const TTM_HITTESTW = 0x0437;
574pub const EM_FINDTEXT = 0x0438;
575pub const TB_SETSTYLE = 0x0438;
576pub const TTM_GETTEXTW = 0x0438;
577pub const EM_FORMATRANGE = 0x0439;
578pub const TB_GETSTYLE = 0x0439;
579pub const TTM_UPDATETIPTEXTW = 0x0439;
580pub const EM_GETCHARFORMAT = 0x043A;
581pub const TB_GETBUTTONSIZE = 0x043A;
582pub const TTM_ENUMTOOLSW = 0x043A;
583pub const EM_GETEVENTMASK = 0x043B;
584pub const TB_SETBUTTONWIDTH = 0x043B;
585pub const TTM_GETCURRENTTOOLW = 0x043B;
586pub const EM_GETOLEINTERFACE = 0x043C;
587pub const TB_SETMAXTEXTROWS = 0x043C;
588pub const EM_GETPARAFORMAT = 0x043D;
589pub const TB_GETTEXTROWS = 0x043D;
590pub const EM_GETSELTEXT = 0x043E;
591pub const TB_GETOBJECT = 0x043E;
592pub const EM_HIDESELECTION = 0x043F;
593pub const TB_GETBUTTONINFOW = 0x043F;
594pub const EM_PASTESPECIAL = 0x0440;
595pub const TB_SETBUTTONINFOW = 0x0440;
596pub const EM_REQUESTRESIZE = 0x0441;
597pub const TB_GETBUTTONINFOA = 0x0441;
598pub const EM_SELECTIONTYPE = 0x0442;
599pub const TB_SETBUTTONINFOA = 0x0442;
600pub const EM_SETBKGNDCOLOR = 0x0443;
601pub const TB_INSERTBUTTONW = 0x0443;
602pub const EM_SETCHARFORMAT = 0x0444;
603pub const TB_ADDBUTTONSW = 0x0444;
604pub const EM_SETEVENTMASK = 0x0445;
605pub const TB_HITTEST = 0x0445;
606pub const EM_SETOLECALLBACK = 0x0446;
607pub const TB_SETDRAWTEXTFLAGS = 0x0446;
608pub const EM_SETPARAFORMAT = 0x0447;
609pub const TB_GETHOTITEM = 0x0447;
610pub const EM_SETTARGETDEVICE = 0x0448;
611pub const TB_SETHOTITEM = 0x0448;
612pub const EM_STREAMIN = 0x0449;
613pub const TB_SETANCHORHIGHLIGHT = 0x0449;
614pub const EM_STREAMOUT = 0x044A;
615pub const TB_GETANCHORHIGHLIGHT = 0x044A;
616pub const EM_GETTEXTRANGE = 0x044B;
617pub const TB_GETBUTTONTEXTW = 0x044B;
618pub const EM_FINDWORDBREAK = 0x044C;
619pub const TB_SAVERESTOREW = 0x044C;
620pub const EM_SETOPTIONS = 0x044D;
621pub const TB_ADDSTRINGW = 0x044D;
622pub const EM_GETOPTIONS = 0x044E;
623pub const TB_MAPACCELERATORA = 0x044E;
624pub const EM_FINDTEXTEX = 0x044F;
625pub const TB_GETINSERTMARK = 0x044F;
626pub const EM_GETWORDBREAKPROCEX = 0x0450;
627pub const TB_SETINSERTMARK = 0x0450;
628pub const EM_SETWORDBREAKPROCEX = 0x0451;
629pub const TB_INSERTMARKHITTEST = 0x0451;
630pub const EM_SETUNDOLIMIT = 0x0452;
631pub const TB_MOVEBUTTON = 0x0452;
632pub const TB_GETMAXSIZE = 0x0453;
633pub const EM_REDO = 0x0454;
634pub const TB_SETEXTENDEDSTYLE = 0x0454;
635pub const EM_CANREDO = 0x0455;
636pub const TB_GETEXTENDEDSTYLE = 0x0455;
637pub const EM_GETUNDONAME = 0x0456;
638pub const TB_GETPADDING = 0x0456;
639pub const EM_GETREDONAME = 0x0457;
640pub const TB_SETPADDING = 0x0457;
641pub const EM_STOPGROUPTYPING = 0x0458;
642pub const TB_SETINSERTMARKCOLOR = 0x0458;
643pub const EM_SETTEXTMODE = 0x0459;
644pub const TB_GETINSERTMARKCOLOR = 0x0459;
645pub const EM_GETTEXTMODE = 0x045A;
646pub const TB_MAPACCELERATORW = 0x045A;
647pub const EM_AUTOURLDETECT = 0x045B;
648pub const TB_GETSTRINGW = 0x045B;
649pub const EM_GETAUTOURLDETECT = 0x045C;
650pub const TB_GETSTRINGA = 0x045C;
651pub const EM_SETPALETTE = 0x045D;
652pub const EM_GETTEXTEX = 0x045E;
653pub const EM_GETTEXTLENGTHEX = 0x045F;
654pub const EM_SHOWSCROLLBAR = 0x0460;
655pub const EM_SETTEXTEX = 0x0461;
656pub const TAPI_REPLY = 0x0463;
657pub const ACM_OPENA = 0x0464;
658pub const BFFM_SETSTATUSTEXTA = 0x0464;
659pub const CDM_GETSPEC = 0x0464;
660pub const EM_SETPUNCTUATION = 0x0464;
661pub const IPM_CLEARADDRESS = 0x0464;
662pub const WM_CAP_UNICODE_START = 0x0464;
663pub const ACM_PLAY = 0x0465;
664pub const BFFM_ENABLEOK = 0x0465;
665pub const CDM_GETFILEPATH = 0x0465;
666pub const EM_GETPUNCTUATION = 0x0465;
667pub const IPM_SETADDRESS = 0x0465;
668pub const PSM_SETCURSEL = 0x0465;
669pub const UDM_SETRANGE = 0x0465;
670pub const WM_CHOOSEFONT_SETLOGFONT = 0x0465;
671pub const ACM_STOP = 0x0466;
672pub const BFFM_SETSELECTIONA = 0x0466;
673pub const CDM_GETFOLDERPATH = 0x0466;
674pub const EM_SETWORDWRAPMODE = 0x0466;
675pub const IPM_GETADDRESS = 0x0466;
676pub const PSM_REMOVEPAGE = 0x0466;
677pub const UDM_GETRANGE = 0x0466;
678pub const WM_CAP_SET_CALLBACK_ERRORW = 0x0466;
679pub const WM_CHOOSEFONT_SETFLAGS = 0x0466;
680pub const ACM_OPENW = 0x0467;
681pub const BFFM_SETSELECTIONW = 0x0467;
682pub const CDM_GETFOLDERIDLIST = 0x0467;
683pub const EM_GETWORDWRAPMODE = 0x0467;
684pub const IPM_SETRANGE = 0x0467;
685pub const PSM_ADDPAGE = 0x0467;
686pub const UDM_SETPOS = 0x0467;
687pub const WM_CAP_SET_CALLBACK_STATUSW = 0x0467;
688pub const BFFM_SETSTATUSTEXTW = 0x0468;
689pub const CDM_SETCONTROLTEXT = 0x0468;
690pub const EM_SETIMECOLOR = 0x0468;
691pub const IPM_SETFOCUS = 0x0468;
692pub const PSM_CHANGED = 0x0468;
693pub const UDM_GETPOS = 0x0468;
694pub const CDM_HIDECONTROL = 0x0469;
695pub const EM_GETIMECOLOR = 0x0469;
696pub const IPM_ISBLANK = 0x0469;
697pub const PSM_RESTARTWINDOWS = 0x0469;
698pub const UDM_SETBUDDY = 0x0469;
699pub const CDM_SETDEFEXT = 0x046A;
700pub const EM_SETIMEOPTIONS = 0x046A;
701pub const PSM_REBOOTSYSTEM = 0x046A;
702pub const UDM_GETBUDDY = 0x046A;
703pub const EM_GETIMEOPTIONS = 0x046B;
704pub const PSM_CANCELTOCLOSE = 0x046B;
705pub const UDM_SETACCEL = 0x046B;
706pub const EM_CONVPOSITION = 0x046C;
707pub const PSM_QUERYSIBLINGS = 0x046C;
708pub const UDM_GETACCEL = 0x046C;
709pub const MCIWNDM_GETZOOM = 0x046D;
710pub const PSM_UNCHANGED = 0x046D;
711pub const UDM_SETBASE = 0x046D;
712pub const PSM_APPLY = 0x046E;
713pub const UDM_GETBASE = 0x046E;
714pub const PSM_SETTITLEA = 0x046F;
715pub const UDM_SETRANGE32 = 0x046F;
716pub const PSM_SETWIZBUTTONS = 0x0470;
717pub const UDM_GETRANGE32 = 0x0470;
718pub const WM_CAP_DRIVER_GET_NAMEW = 0x0470;
719pub const PSM_PRESSBUTTON = 0x0471;
720pub const UDM_SETPOS32 = 0x0471;
721pub const WM_CAP_DRIVER_GET_VERSIONW = 0x0471;
722pub const PSM_SETCURSELID = 0x0472;
723pub const UDM_GETPOS32 = 0x0472;
724pub const PSM_SETFINISHTEXTA = 0x0473;
725pub const PSM_GETTABCONTROL = 0x0474;
726pub const PSM_ISDIALOGMESSAGE = 0x0475;
727pub const MCIWNDM_REALIZE = 0x0476;
728pub const PSM_GETCURRENTPAGEHWND = 0x0476;
729pub const MCIWNDM_SETTIMEFORMATA = 0x0477;
730pub const PSM_INSERTPAGE = 0x0477;
731pub const EM_SETLANGOPTIONS = 0x0478;
732pub const MCIWNDM_GETTIMEFORMATA = 0x0478;
733pub const PSM_SETTITLEW = 0x0478;
734pub const WM_CAP_FILE_SET_CAPTURE_FILEW = 0x0478;
735pub const EM_GETLANGOPTIONS = 0x0479;
736pub const MCIWNDM_VALIDATEMEDIA = 0x0479;
737pub const PSM_SETFINISHTEXTW = 0x0479;
738pub const WM_CAP_FILE_GET_CAPTURE_FILEW = 0x0479;
739pub const EM_GETIMECOMPMODE = 0x047A;
740pub const EM_FINDTEXTW = 0x047B;
741pub const MCIWNDM_PLAYTO = 0x047B;
742pub const WM_CAP_FILE_SAVEASW = 0x047B;
743pub const EM_FINDTEXTEXW = 0x047C;
744pub const MCIWNDM_GETFILENAMEA = 0x047C;
745pub const EM_RECONVERSION = 0x047D;
746pub const MCIWNDM_GETDEVICEA = 0x047D;
747pub const PSM_SETHEADERTITLEA = 0x047D;
748pub const WM_CAP_FILE_SAVEDIBW = 0x047D;
749pub const EM_SETIMEMODEBIAS = 0x047E;
750pub const MCIWNDM_GETPALETTE = 0x047E;
751pub const PSM_SETHEADERTITLEW = 0x047E;
752pub const EM_GETIMEMODEBIAS = 0x047F;
753pub const MCIWNDM_SETPALETTE = 0x047F;
754pub const PSM_SETHEADERSUBTITLEA = 0x047F;
755pub const MCIWNDM_GETERRORA = 0x0480;
756pub const PSM_SETHEADERSUBTITLEW = 0x0480;
757pub const PSM_HWNDTOINDEX = 0x0481;
758pub const PSM_INDEXTOHWND = 0x0482;
759pub const MCIWNDM_SETINACTIVETIMER = 0x0483;
760pub const PSM_PAGETOINDEX = 0x0483;
761pub const PSM_INDEXTOPAGE = 0x0484;
762pub const DL_BEGINDRAG = 0x0485;
763pub const MCIWNDM_GETINACTIVETIMER = 0x0485;
764pub const PSM_IDTOINDEX = 0x0485;
765pub const DL_DRAGGING = 0x0486;
766pub const PSM_INDEXTOID = 0x0486;
767pub const DL_DROPPED = 0x0487;
768pub const PSM_GETRESULT = 0x0487;
769pub const DL_CANCELDRAG = 0x0488;
770pub const PSM_RECALCPAGESIZES = 0x0488;
771pub const MCIWNDM_GET_SOURCE = 0x048C;
772pub const MCIWNDM_PUT_SOURCE = 0x048D;
773pub const MCIWNDM_GET_DEST = 0x048E;
774pub const MCIWNDM_PUT_DEST = 0x048F;
775pub const MCIWNDM_CAN_PLAY = 0x0490;
776pub const MCIWNDM_CAN_WINDOW = 0x0491;
777pub const MCIWNDM_CAN_RECORD = 0x0492;
778pub const MCIWNDM_CAN_SAVE = 0x0493;
779pub const MCIWNDM_CAN_EJECT = 0x0494;
780pub const MCIWNDM_CAN_CONFIG = 0x0495;
781pub const IE_GETINK = 0x0496;
782pub const MCIWNDM_PALETTEKICK = 0x0496;
783pub const IE_SETINK = 0x0497;
784pub const IE_GETPENTIP = 0x0498;
785pub const IE_SETPENTIP = 0x0499;
786pub const IE_GETERASERTIP = 0x049A;
787pub const IE_SETERASERTIP = 0x049B;
788pub const IE_GETBKGND = 0x049C;
789pub const IE_SETBKGND = 0x049D;
790pub const IE_GETGRIDORIGIN = 0x049E;
791pub const IE_SETGRIDORIGIN = 0x049F;
792pub const IE_GETGRIDPEN = 0x04A0;
793pub const IE_SETGRIDPEN = 0x04A1;
794pub const IE_GETGRIDSIZE = 0x04A2;
795pub const IE_SETGRIDSIZE = 0x04A3;
796pub const IE_GETMODE = 0x04A4;
797pub const IE_SETMODE = 0x04A5;
798pub const IE_GETINKRECT = 0x04A6;
799pub const WM_CAP_SET_MCI_DEVICEW = 0x04A6;
800pub const WM_CAP_GET_MCI_DEVICEW = 0x04A7;
801pub const WM_CAP_PAL_OPENW = 0x04B4;
802pub const WM_CAP_PAL_SAVEW = 0x04B5;
803pub const IE_GETAPPDATA = 0x04B8;
804pub const IE_SETAPPDATA = 0x04B9;
805pub const IE_GETDRAWOPTS = 0x04BA;
806pub const IE_SETDRAWOPTS = 0x04BB;
807pub const IE_GETFORMAT = 0x04BC;
808pub const IE_SETFORMAT = 0x04BD;
809pub const IE_GETINKINPUT = 0x04BE;
810pub const IE_SETINKINPUT = 0x04BF;
811pub const IE_GETNOTIFY = 0x04C0;
812pub const IE_SETNOTIFY = 0x04C1;
813pub const IE_GETRECOG = 0x04C2;
814pub const IE_SETRECOG = 0x04C3;
815pub const IE_GETSECURITY = 0x04C4;
816pub const IE_SETSECURITY = 0x04C5;
817pub const IE_GETSEL = 0x04C6;
818pub const IE_SETSEL = 0x04C7;
819pub const EM_SETBIDIOPTIONS = 0x04C8;
820pub const IE_DOCOMMAND = 0x04C8;
821pub const MCIWNDM_NOTIFYMODE = 0x04C8;
822pub const EM_GETBIDIOPTIONS = 0x04C9;
823pub const IE_GETCOMMAND = 0x04C9;
824pub const EM_SETTYPOGRAPHYOPTIONS = 0x04CA;
825pub const IE_GETCOUNT = 0x04CA;
826pub const EM_GETTYPOGRAPHYOPTIONS = 0x04CB;
827pub const IE_GETGESTURE = 0x04CB;
828pub const MCIWNDM_NOTIFYMEDIA = 0x04CB;
829pub const EM_SETEDITSTYLE = 0x04CC;
830pub const IE_GETMENU = 0x04CC;
831pub const EM_GETEDITSTYLE = 0x04CD;
832pub const IE_GETPAINTDC = 0x04CD;
833pub const MCIWNDM_NOTIFYERROR = 0x04CD;
834pub const IE_GETPDEVENT = 0x04CE;
835pub const IE_GETSELCOUNT = 0x04CF;
836pub const IE_GETSELITEMS = 0x04D0;
837pub const IE_GETSTYLE = 0x04D1;
838pub const MCIWNDM_SETTIMEFORMATW = 0x04DB;
839pub const EM_OUTLINE = 0x04DC;
840pub const MCIWNDM_GETTIMEFORMATW = 0x04DC;
841pub const EM_GETSCROLLPOS = 0x04DD;
842pub const EM_SETSCROLLPOS = 0x04DE;
843pub const EM_SETFONTSIZE = 0x04DF;
844pub const EM_GETZOOM = 0x04E0;
845pub const MCIWNDM_GETFILENAMEW = 0x04E0;
846pub const EM_SETZOOM = 0x04E1;
847pub const MCIWNDM_GETDEVICEW = 0x04E1;
848pub const EM_GETVIEWKIND = 0x04E2;
849pub const EM_SETVIEWKIND = 0x04E3;
850pub const EM_GETPAGE = 0x04E4;
851pub const MCIWNDM_GETERRORW = 0x04E4;
852pub const EM_SETPAGE = 0x04E5;
853pub const EM_GETHYPHENATEINFO = 0x04E6;
854pub const EM_SETHYPHENATEINFO = 0x04E7;
855pub const EM_GETPAGEROTATE = 0x04EB;
856pub const EM_SETPAGEROTATE = 0x04EC;
857pub const EM_GETCTFMODEBIAS = 0x04ED;
858pub const EM_SETCTFMODEBIAS = 0x04EE;
859pub const EM_GETCTFOPENSTATUS = 0x04F0;
860pub const EM_SETCTFOPENSTATUS = 0x04F1;
861pub const EM_GETIMECOMPTEXT = 0x04F2;
862pub const EM_ISIME = 0x04F3;
863pub const EM_GETIMEPROPERTY = 0x04F4;
864pub const EM_GETQUERYRTFOBJ = 0x050D;
865pub const EM_SETQUERYRTFOBJ = 0x050E;
866pub const FM_GETFOCUS = 0x0600;
867pub const FM_GETDRIVEINFOA = 0x0601;
868pub const FM_GETSELCOUNT = 0x0602;
869pub const FM_GETSELCOUNTLFN = 0x0603;
870pub const FM_GETFILESELA = 0x0604;
871pub const FM_GETFILESELLFNA = 0x0605;
872pub const FM_REFRESH_WINDOWS = 0x0606;
873pub const FM_RELOAD_EXTENSIONS = 0x0607;
874pub const FM_GETDRIVEINFOW = 0x0611;
875pub const FM_GETFILESELW = 0x0614;
876pub const FM_GETFILESELLFNW = 0x0615;
877pub const WLX_WM_SAS = 0x0659;
878pub const SM_GETSELCOUNT = 0x07E8;
879pub const UM_GETSELCOUNT = 0x07E8;
880pub const WM_CPL_LAUNCH = 0x07E8;
881pub const SM_GETSERVERSELA = 0x07E9;
882pub const UM_GETUSERSELA = 0x07E9;
883pub const WM_CPL_LAUNCHED = 0x07E9;
884pub const SM_GETSERVERSELW = 0x07EA;
885pub const UM_GETUSERSELW = 0x07EA;
886pub const SM_GETCURFOCUSA = 0x07EB;
887pub const UM_GETGROUPSELA = 0x07EB;
888pub const SM_GETCURFOCUSW = 0x07EC;
889pub const UM_GETGROUPSELW = 0x07EC;
890pub const SM_GETOPTIONS = 0x07ED;
891pub const UM_GETCURFOCUSA = 0x07ED;
892pub const UM_GETCURFOCUSW = 0x07EE;
893pub const UM_GETOPTIONS = 0x07EF;
894pub const UM_GETOPTIONS2 = 0x07F0;
895pub const LVM_GETBKCOLOR = 0x1000;
896pub const LVM_SETBKCOLOR = 0x1001;
897pub const LVM_GETIMAGELIST = 0x1002;
898pub const LVM_SETIMAGELIST = 0x1003;
899pub const LVM_GETITEMCOUNT = 0x1004;
900pub const LVM_GETITEMA = 0x1005;
901pub const LVM_SETITEMA = 0x1006;
902pub const LVM_INSERTITEMA = 0x1007;
903pub const LVM_DELETEITEM = 0x1008;
904pub const LVM_DELETEALLITEMS = 0x1009;
905pub const LVM_GETCALLBACKMASK = 0x100A;
906pub const LVM_SETCALLBACKMASK = 0x100B;
907pub const LVM_GETNEXTITEM = 0x100C;
908pub const LVM_FINDITEMA = 0x100D;
909pub const LVM_GETITEMRECT = 0x100E;
910pub const LVM_SETITEMPOSITION = 0x100F;
911pub const LVM_GETITEMPOSITION = 0x1010;
912pub const LVM_GETSTRINGWIDTHA = 0x1011;
913pub const LVM_HITTEST = 0x1012;
914pub const LVM_ENSUREVISIBLE = 0x1013;
915pub const LVM_SCROLL = 0x1014;
916pub const LVM_REDRAWITEMS = 0x1015;
917pub const LVM_ARRANGE = 0x1016;
918pub const LVM_EDITLABELA = 0x1017;
919pub const LVM_GETEDITCONTROL = 0x1018;
920pub const LVM_GETCOLUMNA = 0x1019;
921pub const LVM_SETCOLUMNA = 0x101A;
922pub const LVM_INSERTCOLUMNA = 0x101B;
923pub const LVM_DELETECOLUMN = 0x101C;
924pub const LVM_GETCOLUMNWIDTH = 0x101D;
925pub const LVM_SETCOLUMNWIDTH = 0x101E;
926pub const LVM_GETHEADER = 0x101F;
927pub const LVM_CREATEDRAGIMAGE = 0x1021;
928pub const LVM_GETVIEWRECT = 0x1022;
929pub const LVM_GETTEXTCOLOR = 0x1023;
930pub const LVM_SETTEXTCOLOR = 0x1024;
931pub const LVM_GETTEXTBKCOLOR = 0x1025;
932pub const LVM_SETTEXTBKCOLOR = 0x1026;
933pub const LVM_GETTOPINDEX = 0x1027;
934pub const LVM_GETCOUNTPERPAGE = 0x1028;
935pub const LVM_GETORIGIN = 0x1029;
936pub const LVM_UPDATE = 0x102A;
937pub const LVM_SETITEMSTATE = 0x102B;
938pub const LVM_GETITEMSTATE = 0x102C;
939pub const LVM_GETITEMTEXTA = 0x102D;
940pub const LVM_SETITEMTEXTA = 0x102E;
941pub const LVM_SETITEMCOUNT = 0x102F;
942pub const LVM_SORTITEMS = 0x1030;
943pub const LVM_SETITEMPOSITION32 = 0x1031;
944pub const LVM_GETSELECTEDCOUNT = 0x1032;
945pub const LVM_GETITEMSPACING = 0x1033;
946pub const LVM_GETISEARCHSTRINGA = 0x1034;
947pub const LVM_SETICONSPACING = 0x1035;
948pub const LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036;
949pub const LVM_GETEXTENDEDLISTVIEWSTYLE = 0x1037;
950pub const LVM_GETSUBITEMRECT = 0x1038;
951pub const LVM_SUBITEMHITTEST = 0x1039;
952pub const LVM_SETCOLUMNORDERARRAY = 0x103A;
953pub const LVM_GETCOLUMNORDERARRAY = 0x103B;
954pub const LVM_SETHOTITEM = 0x103C;
955pub const LVM_GETHOTITEM = 0x103D;
956pub const LVM_SETHOTCURSOR = 0x103E;
957pub const LVM_GETHOTCURSOR = 0x103F;
958pub const LVM_APPROXIMATEVIEWRECT = 0x1040;
959pub const LVM_SETWORKAREAS = 0x1041;
960pub const LVM_GETSELECTIONMARK = 0x1042;
961pub const LVM_SETSELECTIONMARK = 0x1043;
962pub const LVM_SETBKIMAGEA = 0x1044;
963pub const LVM_GETBKIMAGEA = 0x1045;
964pub const LVM_GETWORKAREAS = 0x1046;
965pub const LVM_SETHOVERTIME = 0x1047;
966pub const LVM_GETHOVERTIME = 0x1048;
967pub const LVM_GETNUMBEROFWORKAREAS = 0x1049;
968pub const LVM_SETTOOLTIPS = 0x104A;
969pub const LVM_GETITEMW = 0x104B;
970pub const LVM_SETITEMW = 0x104C;
971pub const LVM_INSERTITEMW = 0x104D;
972pub const LVM_GETTOOLTIPS = 0x104E;
973pub const LVM_FINDITEMW = 0x1053;
974pub const LVM_GETSTRINGWIDTHW = 0x1057;
975pub const LVM_GETCOLUMNW = 0x105F;
976pub const LVM_SETCOLUMNW = 0x1060;
977pub const LVM_INSERTCOLUMNW = 0x1061;
978pub const LVM_GETITEMTEXTW = 0x1073;
979pub const LVM_SETITEMTEXTW = 0x1074;
980pub const LVM_GETISEARCHSTRINGW = 0x1075;
981pub const LVM_EDITLABELW = 0x1076;
982pub const LVM_GETBKIMAGEW = 0x108B;
983pub const LVM_SETSELECTEDCOLUMN = 0x108C;
984pub const LVM_SETTILEWIDTH = 0x108D;
985pub const LVM_SETVIEW = 0x108E;
986pub const LVM_GETVIEW = 0x108F;
987pub const LVM_INSERTGROUP = 0x1091;
988pub const LVM_SETGROUPINFO = 0x1093;
989pub const LVM_GETGROUPINFO = 0x1095;
990pub const LVM_REMOVEGROUP = 0x1096;
991pub const LVM_MOVEGROUP = 0x1097;
992pub const LVM_MOVEITEMTOGROUP = 0x109A;
993pub const LVM_SETGROUPMETRICS = 0x109B;
994pub const LVM_GETGROUPMETRICS = 0x109C;
995pub const LVM_ENABLEGROUPVIEW = 0x109D;
996pub const LVM_SORTGROUPS = 0x109E;
997pub const LVM_INSERTGROUPSORTED = 0x109F;
998pub const LVM_REMOVEALLGROUPS = 0x10A0;
999pub const LVM_HASGROUP = 0x10A1;
1000pub const LVM_SETTILEVIEWINFO = 0x10A2;
1001pub const LVM_GETTILEVIEWINFO = 0x10A3;
1002pub const LVM_SETTILEINFO = 0x10A4;
1003pub const LVM_GETTILEINFO = 0x10A5;
1004pub const LVM_SETINSERTMARK = 0x10A6;
1005pub const LVM_GETINSERTMARK = 0x10A7;
1006pub const LVM_INSERTMARKHITTEST = 0x10A8;
1007pub const LVM_GETINSERTMARKRECT = 0x10A9;
1008pub const LVM_SETINSERTMARKCOLOR = 0x10AA;
1009pub const LVM_GETINSERTMARKCOLOR = 0x10AB;
1010pub const LVM_SETINFOTIP = 0x10AD;
1011pub const LVM_GETSELECTEDCOLUMN = 0x10AE;
1012pub const LVM_ISGROUPVIEWENABLED = 0x10AF;
1013pub const LVM_GETOUTLINECOLOR = 0x10B0;
1014pub const LVM_SETOUTLINECOLOR = 0x10B1;
1015pub const LVM_CANCELEDITLABEL = 0x10B3;
1016pub const LVM_MAPINDEXTOID = 0x10B4;
1017pub const LVM_MAPIDTOINDEX = 0x10B5;
1018pub const LVM_ISITEMVISIBLE = 0x10B6;
1019pub const OCM__BASE = 0x2000;
1020pub const LVM_SETUNICODEFORMAT = 0x2005;
1021pub const LVM_GETUNICODEFORMAT = 0x2006;
1022pub const OCM_CTLCOLOR = 0x2019;
1023pub const OCM_DRAWITEM = 0x202B;
1024pub const OCM_MEASUREITEM = 0x202C;
1025pub const OCM_DELETEITEM = 0x202D;
1026pub const OCM_VKEYTOITEM = 0x202E;
1027pub const OCM_CHARTOITEM = 0x202F;
1028pub const OCM_COMPAREITEM = 0x2039;
1029pub const OCM_NOTIFY = 0x204E;
1030pub const OCM_COMMAND = 0x2111;
1031pub const OCM_HSCROLL = 0x2114;
1032pub const OCM_VSCROLL = 0x2115;
1033pub const OCM_CTLCOLORMSGBOX = 0x2132;
1034pub const OCM_CTLCOLOREDIT = 0x2133;
1035pub const OCM_CTLCOLORLISTBOX = 0x2134;
1036pub const OCM_CTLCOLORBTN = 0x2135;
1037pub const OCM_CTLCOLORDLG = 0x2136;
1038pub const OCM_CTLCOLORSCROLLBAR = 0x2137;
1039pub const OCM_CTLCOLORSTATIC = 0x2138;
1040pub const OCM_PARENTNOTIFY = 0x2210;
1041pub const WM_APP = 0x8000;
1042pub const WM_RASDIALEVENT = 0xCCCD;
1043
1044pub extern "user32" fn GetMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL;
1045pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void {
1046 const r = GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
1047 if (r == 0) return error.Quit;
1048 if (r != -1) return;
1049 switch (GetLastError()) {
1050 .INVALID_WINDOW_HANDLE => unreachable,
1051 .INVALID_PARAMETER => unreachable,
1052 else => |err| return windows.unexpectedError(err),
1053 }
1054}
1055
1056pub extern "user32" fn GetMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL;
1057pub var pfnGetMessageW: *const @TypeOf(GetMessageW) = undefined;
1058pub fn getMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void {
1059 const function = selectSymbol(GetMessageW, pfnGetMessageW, .win2k);
1060
1061 const r = function(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
1062 if (r == 0) return error.Quit;
1063 if (r != -1) return;
1064 switch (GetLastError()) {
1065 .INVALID_WINDOW_HANDLE => unreachable,
1066 .INVALID_PARAMETER => unreachable,
1067 else => |err| return windows.unexpectedError(err),
1068 }
1069}
1070
1071pub const PM_NOREMOVE = 0x0000;
1072pub const PM_REMOVE = 0x0001;
1073pub const PM_NOYIELD = 0x0002;
1074
1075pub extern "user32" fn PeekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) callconv(WINAPI) BOOL;
1076pub fn peekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool {
1077 const r = PeekMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
1078 if (r == 0) return false;
1079 if (r != -1) return true;
1080 switch (GetLastError()) {
1081 .INVALID_WINDOW_HANDLE => unreachable,
1082 .INVALID_PARAMETER => unreachable,
1083 else => |err| return windows.unexpectedError(err),
1084 }
1085}
1086
1087pub extern "user32" fn PeekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) callconv(WINAPI) BOOL;
1088pub var pfnPeekMessageW: *const @TypeOf(PeekMessageW) = undefined;
1089pub fn peekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool {
1090 const function = selectSymbol(PeekMessageW, pfnPeekMessageW, .win2k);
1091
1092 const r = function(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
1093 if (r == 0) return false;
1094 if (r != -1) return true;
1095 switch (GetLastError()) {
1096 .INVALID_WINDOW_HANDLE => unreachable,
1097 .INVALID_PARAMETER => unreachable,
1098 else => |err| return windows.unexpectedError(err),
1099 }
1100}
1101
1102pub extern "user32" fn TranslateMessage(lpMsg: *const MSG) callconv(WINAPI) BOOL;
1103pub fn translateMessage(lpMsg: *const MSG) bool {
1104 return if (TranslateMessage(lpMsg) == 0) false else true;
1105}
1106
1107pub extern "user32" fn DispatchMessageA(lpMsg: *const MSG) callconv(WINAPI) LRESULT;
1108pub fn dispatchMessageA(lpMsg: *const MSG) LRESULT {
1109 return DispatchMessageA(lpMsg);
1110}
1111
1112pub extern "user32" fn DispatchMessageW(lpMsg: *const MSG) callconv(WINAPI) LRESULT;
1113pub var pfnDispatchMessageW: *const @TypeOf(DispatchMessageW) = undefined;
1114pub fn dispatchMessageW(lpMsg: *const MSG) LRESULT {
1115 const function = selectSymbol(DispatchMessageW, pfnDispatchMessageW, .win2k);
1116 return function(lpMsg);
1117}
1118
1119pub extern "user32" fn PostQuitMessage(nExitCode: i32) callconv(WINAPI) void;
1120pub fn postQuitMessage(nExitCode: i32) void {
1121 PostQuitMessage(nExitCode);
1122}
1123
1124pub extern "user32" fn DefWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;
1125pub fn defWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT {
1126 return DefWindowProcA(hWnd, Msg, wParam, lParam);
1127}
1128
1129pub extern "user32" fn DefWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;
1130pub var pfnDefWindowProcW: *const @TypeOf(DefWindowProcW) = undefined;
1131pub fn defWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT {
1132 const function = selectSymbol(DefWindowProcW, pfnDefWindowProcW, .win2k);
1133 return function(hWnd, Msg, wParam, lParam);
1134}
1135
1136// === Windows ===
1137
1138pub const CS_VREDRAW = 0x0001;
1139pub const CS_HREDRAW = 0x0002;
1140pub const CS_DBLCLKS = 0x0008;
1141pub const CS_OWNDC = 0x0020;
1142pub const CS_CLASSDC = 0x0040;
1143pub const CS_PARENTDC = 0x0080;
1144pub const CS_NOCLOSE = 0x0200;
1145pub const CS_SAVEBITS = 0x0800;
1146pub const CS_BYTEALIGNCLIENT = 0x1000;
1147pub const CS_BYTEALIGNWINDOW = 0x2000;
1148pub const CS_GLOBALCLASS = 0x4000;
1149
1150pub const WNDCLASSEXA = extern struct {
1151 cbSize: UINT = @sizeOf(WNDCLASSEXA),
1152 style: UINT,
1153 lpfnWndProc: WNDPROC,
1154 cbClsExtra: i32 = 0,
1155 cbWndExtra: i32 = 0,
1156 hInstance: HINSTANCE,
1157 hIcon: ?HICON,
1158 hCursor: ?HCURSOR,
1159 hbrBackground: ?HBRUSH,
1160 lpszMenuName: ?[*:0]const u8,
1161 lpszClassName: [*:0]const u8,
1162 hIconSm: ?HICON,
1163};
1164
1165pub const WNDCLASSEXW = extern struct {
1166 cbSize: UINT = @sizeOf(WNDCLASSEXW),
1167 style: UINT,
1168 lpfnWndProc: WNDPROC,
1169 cbClsExtra: i32 = 0,
1170 cbWndExtra: i32 = 0,
1171 hInstance: HINSTANCE,
1172 hIcon: ?HICON,
1173 hCursor: ?HCURSOR,
1174 hbrBackground: ?HBRUSH,
1175 lpszMenuName: ?[*:0]const u16,
1176 lpszClassName: [*:0]const u16,
1177 hIconSm: ?HICON,
1178};
1179
1180pub extern "user32" fn RegisterClassExA(*const WNDCLASSEXA) callconv(WINAPI) ATOM;
1181pub fn registerClassExA(window_class: *const WNDCLASSEXA) !ATOM {
1182 const atom = RegisterClassExA(window_class);
1183 if (atom != 0) return atom;
1184 switch (GetLastError()) {
1185 .CLASS_ALREADY_EXISTS => return error.AlreadyExists,
1186 .INVALID_PARAMETER => unreachable,
1187 else => |err| return windows.unexpectedError(err),
1188 }
1189}
1190
1191pub extern "user32" fn RegisterClassExW(*const WNDCLASSEXW) callconv(WINAPI) ATOM;
1192pub var pfnRegisterClassExW: *const @TypeOf(RegisterClassExW) = undefined;
1193pub fn registerClassExW(window_class: *const WNDCLASSEXW) !ATOM {
1194 const function = selectSymbol(RegisterClassExW, pfnRegisterClassExW, .win2k);
1195 const atom = function(window_class);
1196 if (atom != 0) return atom;
1197 switch (GetLastError()) {
1198 .CLASS_ALREADY_EXISTS => return error.AlreadyExists,
1199 .CALL_NOT_IMPLEMENTED => unreachable,
1200 .INVALID_PARAMETER => unreachable,
1201 else => |err| return windows.unexpectedError(err),
1202 }
1203}
1204
1205pub extern "user32" fn UnregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) callconv(WINAPI) BOOL;
1206pub fn unregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) !void {
1207 if (UnregisterClassA(lpClassName, hInstance) == 0) {
1208 switch (GetLastError()) {
1209 .CLASS_DOES_NOT_EXIST => return error.ClassDoesNotExist,
1210 else => |err| return windows.unexpectedError(err),
1211 }
1212 }
1213}
1214
1215pub extern "user32" fn UnregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) callconv(WINAPI) BOOL;
1216pub var pfnUnregisterClassW: *const @TypeOf(UnregisterClassW) = undefined;
1217pub fn unregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) !void {
1218 const function = selectSymbol(UnregisterClassW, pfnUnregisterClassW, .win2k);
1219 if (function(lpClassName, hInstance) == 0) {
1220 switch (GetLastError()) {
1221 .CLASS_DOES_NOT_EXIST => return error.ClassDoesNotExist,
1222 else => |err| return windows.unexpectedError(err),
1223 }
1224 }
1225}
1226
1227pub const WS_OVERLAPPED = 0x00000000;
1228pub const WS_POPUP = 0x80000000;
1229pub const WS_CHILD = 0x40000000;
1230pub const WS_MINIMIZE = 0x20000000;
1231pub const WS_VISIBLE = 0x10000000;
1232pub const WS_DISABLED = 0x08000000;
1233pub const WS_CLIPSIBLINGS = 0x04000000;
1234pub const WS_CLIPCHILDREN = 0x02000000;
1235pub const WS_MAXIMIZE = 0x01000000;
1236pub const WS_CAPTION = WS_BORDER | WS_DLGFRAME;
1237pub const WS_BORDER = 0x00800000;
1238pub const WS_DLGFRAME = 0x00400000;
1239pub const WS_VSCROLL = 0x00200000;
1240pub const WS_HSCROLL = 0x00100000;
1241pub const WS_SYSMENU = 0x00080000;
1242pub const WS_THICKFRAME = 0x00040000;
1243pub const WS_GROUP = 0x00020000;
1244pub const WS_TABSTOP = 0x00010000;
1245pub const WS_MINIMIZEBOX = 0x00020000;
1246pub const WS_MAXIMIZEBOX = 0x00010000;
1247pub const WS_TILED = WS_OVERLAPPED;
1248pub const WS_ICONIC = WS_MINIMIZE;
1249pub const WS_SIZEBOX = WS_THICKFRAME;
1250pub const WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW;
1251pub const WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
1252pub const WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU;
1253pub const WS_CHILDWINDOW = WS_CHILD;
1254
1255pub const WS_EX_DLGMODALFRAME = 0x00000001;
1256pub const WS_EX_NOPARENTNOTIFY = 0x00000004;
1257pub const WS_EX_TOPMOST = 0x00000008;
1258pub const WS_EX_ACCEPTFILES = 0x00000010;
1259pub const WS_EX_TRANSPARENT = 0x00000020;
1260pub const WS_EX_MDICHILD = 0x00000040;
1261pub const WS_EX_TOOLWINDOW = 0x00000080;
1262pub const WS_EX_WINDOWEDGE = 0x00000100;
1263pub const WS_EX_CLIENTEDGE = 0x00000200;
1264pub const WS_EX_CONTEXTHELP = 0x00000400;
1265pub const WS_EX_RIGHT = 0x00001000;
1266pub const WS_EX_LEFT = 0x00000000;
1267pub const WS_EX_RTLREADING = 0x00002000;
1268pub const WS_EX_LTRREADING = 0x00000000;
1269pub const WS_EX_LEFTSCROLLBAR = 0x00004000;
1270pub const WS_EX_RIGHTSCROLLBAR = 0x00000000;
1271pub const WS_EX_CONTROLPARENT = 0x00010000;
1272pub const WS_EX_STATICEDGE = 0x00020000;
1273pub const WS_EX_APPWINDOW = 0x00040000;
1274pub const WS_EX_LAYERED = 0x00080000;
1275pub const WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE;
1276pub const WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
1277
1278pub const CW_USEDEFAULT: i32 = @bitCast(@as(u32, 0x80000000));
1279
1280pub extern "user32" fn CreateWindowExA(dwExStyle: DWORD, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND;
1281pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND {
1282 const window = CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam);
1283 if (window) |win| return win;
1284
1285 switch (GetLastError()) {
1286 .CLASS_DOES_NOT_EXIST => return error.ClassDoesNotExist,
1287 .INVALID_PARAMETER => unreachable,
1288 else => |err| return windows.unexpectedError(err),
1289 }
1290}
1291
1292pub extern "user32" fn CreateWindowExW(dwExStyle: DWORD, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND;
1293pub var pfnCreateWindowExW: *const @TypeOf(CreateWindowExW) = undefined;
1294pub fn createWindowExW(dwExStyle: u32, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND {
1295 const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k);
1296 const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam);
1297 if (window) |win| return win;
1298
1299 switch (GetLastError()) {
1300 .CLASS_DOES_NOT_EXIST => return error.ClassDoesNotExist,
1301 .INVALID_PARAMETER => unreachable,
1302 else => |err| return windows.unexpectedError(err),
1303 }
1304}
1305
1306pub extern "user32" fn DestroyWindow(hWnd: HWND) callconv(WINAPI) BOOL;
1307pub fn destroyWindow(hWnd: HWND) !void {
1308 if (DestroyWindow(hWnd) == 0) {
1309 switch (GetLastError()) {
1310 .INVALID_WINDOW_HANDLE => unreachable,
1311 .INVALID_PARAMETER => unreachable,
1312 else => |err| return windows.unexpectedError(err),
1313 }
1314 }
1315}
1316
1317pub const SW_HIDE = 0;
1318pub const SW_SHOWNORMAL = 1;
1319pub const SW_NORMAL = 1;
1320pub const SW_SHOWMINIMIZED = 2;
1321pub const SW_SHOWMAXIMIZED = 3;
1322pub const SW_MAXIMIZE = 3;
1323pub const SW_SHOWNOACTIVATE = 4;
1324pub const SW_SHOW = 5;
1325pub const SW_MINIMIZE = 6;
1326pub const SW_SHOWMINNOACTIVE = 7;
1327pub const SW_SHOWNA = 8;
1328pub const SW_RESTORE = 9;
1329pub const SW_SHOWDEFAULT = 10;
1330pub const SW_FORCEMINIMIZE = 11;
1331pub const SW_MAX = 11;
1332
1333pub extern "user32" fn ShowWindow(hWnd: HWND, nCmdShow: i32) callconv(WINAPI) BOOL;
1334pub fn showWindow(hWnd: HWND, nCmdShow: i32) bool {
1335 return (ShowWindow(hWnd, nCmdShow) == TRUE);
1336}
1337
1338pub extern "user32" fn UpdateWindow(hWnd: HWND) callconv(WINAPI) BOOL;
1339pub fn updateWindow(hWnd: HWND) !void {
1340 if (UpdateWindow(hWnd) == 0) {
1341 switch (GetLastError()) {
1342 .INVALID_WINDOW_HANDLE => unreachable,
1343 .INVALID_PARAMETER => unreachable,
1344 else => |err| return windows.unexpectedError(err),
1345 }
1346 }
1347}
1348
1349pub extern "user32" fn AdjustWindowRectEx(lpRect: *RECT, dwStyle: DWORD, bMenu: BOOL, dwExStyle: DWORD) callconv(WINAPI) BOOL;
1350pub fn adjustWindowRectEx(lpRect: *RECT, dwStyle: u32, bMenu: bool, dwExStyle: u32) !void {
1351 assert(dwStyle & WS_OVERLAPPED == 0);
1352
1353 if (AdjustWindowRectEx(lpRect, dwStyle, @intFromBool(bMenu), dwExStyle) == 0) {
1354 switch (GetLastError()) {
1355 .INVALID_PARAMETER => unreachable,
1356 else => |err| return windows.unexpectedError(err),
1357 }
1358 }
1359}
1360
1361pub const GWL_WNDPROC = -4;
1362pub const GWL_HINSTANCE = -6;
1363pub const GWL_HWNDPARENT = -8;
1364pub const GWL_STYLE = -16;
1365pub const GWL_EXSTYLE = -20;
1366pub const GWL_USERDATA = -21;
1367pub const GWL_ID = -12;
1368
1369pub extern "user32" fn GetWindowLongA(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG;
1370pub fn getWindowLongA(hWnd: HWND, nIndex: i32) !i32 {
1371 const value = GetWindowLongA(hWnd, nIndex);
1372 if (value != 0) return value;
1373
1374 switch (GetLastError()) {
1375 .SUCCESS => return 0,
1376 .INVALID_WINDOW_HANDLE => unreachable,
1377 .INVALID_PARAMETER => unreachable,
1378 else => |err| return windows.unexpectedError(err),
1379 }
1380}
1381
1382pub extern "user32" fn GetWindowLongW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG;
1383pub var pfnGetWindowLongW: *const @TypeOf(GetWindowLongW) = undefined;
1384pub fn getWindowLongW(hWnd: HWND, nIndex: i32) !i32 {
1385 const function = selectSymbol(GetWindowLongW, pfnGetWindowLongW, .win2k);
1386
1387 const value = function(hWnd, nIndex);
1388 if (value != 0) return value;
1389
1390 switch (GetLastError()) {
1391 .SUCCESS => return 0,
1392 .INVALID_WINDOW_HANDLE => unreachable,
1393 .INVALID_PARAMETER => unreachable,
1394 else => |err| return windows.unexpectedError(err),
1395 }
1396}
1397
1398pub extern "user32" fn GetWindowLongPtrA(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG_PTR;
1399pub fn getWindowLongPtrA(hWnd: HWND, nIndex: i32) !isize {
1400 // "When compiling for 32-bit Windows, GetWindowLongPtr is defined as a call to the GetWindowLong function."
1401 // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw
1402 if (@sizeOf(LONG_PTR) == 4) return getWindowLongA(hWnd, nIndex);
1403
1404 const value = GetWindowLongPtrA(hWnd, nIndex);
1405 if (value != 0) return value;
1406
1407 switch (GetLastError()) {
1408 .SUCCESS => return 0,
1409 .INVALID_WINDOW_HANDLE => unreachable,
1410 .INVALID_PARAMETER => unreachable,
1411 else => |err| return windows.unexpectedError(err),
1412 }
1413}
1414
1415pub extern "user32" fn GetWindowLongPtrW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG_PTR;
1416pub var pfnGetWindowLongPtrW: *const @TypeOf(GetWindowLongPtrW) = undefined;
1417pub fn getWindowLongPtrW(hWnd: HWND, nIndex: i32) !isize {
1418 if (@sizeOf(LONG_PTR) == 4) return getWindowLongW(hWnd, nIndex);
1419 const function = selectSymbol(GetWindowLongPtrW, pfnGetWindowLongPtrW, .win2k);
1420
1421 const value = function(hWnd, nIndex);
1422 if (value != 0) return value;
1423
1424 switch (GetLastError()) {
1425 .SUCCESS => return 0,
1426 .INVALID_WINDOW_HANDLE => unreachable,
1427 .INVALID_PARAMETER => unreachable,
1428 else => |err| return windows.unexpectedError(err),
1429 }
1430}
1431
1432pub extern "user32" fn SetWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: LONG) callconv(WINAPI) LONG;
1433pub fn setWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
1434 // [...] you should clear the last error information by calling SetLastError with 0 before calling SetWindowLong.
1435 // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowlonga
1436 SetLastError(.SUCCESS);
1437
1438 const value = SetWindowLongA(hWnd, nIndex, dwNewLong);
1439 if (value != 0) return value;
1440
1441 switch (GetLastError()) {
1442 .SUCCESS => return 0,
1443 .INVALID_WINDOW_HANDLE => unreachable,
1444 .INVALID_PARAMETER => unreachable,
1445 else => |err| return windows.unexpectedError(err),
1446 }
1447}
1448
1449pub extern "user32" fn SetWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: LONG) callconv(WINAPI) LONG;
1450pub var pfnSetWindowLongW: *const @TypeOf(SetWindowLongW) = undefined;
1451pub fn setWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
1452 const function = selectSymbol(SetWindowLongW, pfnSetWindowLongW, .win2k);
1453
1454 SetLastError(.SUCCESS);
1455 const value = function(hWnd, nIndex, dwNewLong);
1456 if (value != 0) return value;
1457
1458 switch (GetLastError()) {
1459 .SUCCESS => return 0,
1460 .INVALID_WINDOW_HANDLE => unreachable,
1461 .INVALID_PARAMETER => unreachable,
1462 else => |err| return windows.unexpectedError(err),
1463 }
1464}
1465
1466pub extern "user32" fn SetWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: LONG_PTR) callconv(WINAPI) LONG_PTR;
1467pub fn setWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
1468 // "When compiling for 32-bit Windows, GetWindowLongPtr is defined as a call to the GetWindowLong function."
1469 // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw
1470 if (@sizeOf(LONG_PTR) == 4) return setWindowLongA(hWnd, nIndex, dwNewLong);
1471
1472 SetLastError(.SUCCESS);
1473 const value = SetWindowLongPtrA(hWnd, nIndex, dwNewLong);
1474 if (value != 0) return value;
1475
1476 switch (GetLastError()) {
1477 .SUCCESS => return 0,
1478 .INVALID_WINDOW_HANDLE => unreachable,
1479 .INVALID_PARAMETER => unreachable,
1480 else => |err| return windows.unexpectedError(err),
1481 }
1482}
1483
1484pub extern "user32" fn SetWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: LONG_PTR) callconv(WINAPI) LONG_PTR;
1485pub var pfnSetWindowLongPtrW: *const @TypeOf(SetWindowLongPtrW) = undefined;
1486pub fn setWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
1487 if (@sizeOf(LONG_PTR) == 4) return setWindowLongW(hWnd, nIndex, dwNewLong);
1488 const function = selectSymbol(SetWindowLongPtrW, pfnSetWindowLongPtrW, .win2k);
1489
1490 SetLastError(.SUCCESS);
1491 const value = function(hWnd, nIndex, dwNewLong);
1492 if (value != 0) return value;
1493
1494 switch (GetLastError()) {
1495 .SUCCESS => return 0,
1496 .INVALID_WINDOW_HANDLE => unreachable,
1497 .INVALID_PARAMETER => unreachable,
1498 else => |err| return windows.unexpectedError(err),
1499 }
1500}
1501
1502pub extern "user32" fn GetDC(hWnd: ?HWND) callconv(WINAPI) ?HDC;
1503pub fn getDC(hWnd: ?HWND) !HDC {
1504 const hdc = GetDC(hWnd);
1505 if (hdc) |h| return h;
1506
1507 switch (GetLastError()) {
1508 .INVALID_WINDOW_HANDLE => unreachable,
1509 .INVALID_PARAMETER => unreachable,
1510 else => |err| return windows.unexpectedError(err),
1511 }
1512}
1513
1514pub extern "user32" fn ReleaseDC(hWnd: ?HWND, hDC: HDC) callconv(WINAPI) i32;
1515pub fn releaseDC(hWnd: ?HWND, hDC: HDC) bool {
1516 return if (ReleaseDC(hWnd, hDC) == 1) true else false;
1517}
1518
1519// === Modal dialogue boxes ===
1520
1521pub const MB_OK = 0x00000000;
1522pub const MB_OKCANCEL = 0x00000001;
1523pub const MB_ABORTRETRYIGNORE = 0x00000002;
1524pub const MB_YESNOCANCEL = 0x00000003;
1525pub const MB_YESNO = 0x00000004;
1526pub const MB_RETRYCANCEL = 0x00000005;
1527pub const MB_CANCELTRYCONTINUE = 0x00000006;
1528pub const MB_ICONHAND = 0x00000010;
1529pub const MB_ICONQUESTION = 0x00000020;
1530pub const MB_ICONEXCLAMATION = 0x00000030;
1531pub const MB_ICONASTERISK = 0x00000040;
1532pub const MB_USERICON = 0x00000080;
1533pub const MB_ICONWARNING = MB_ICONEXCLAMATION;
1534pub const MB_ICONERROR = MB_ICONHAND;
1535pub const MB_ICONINFORMATION = MB_ICONASTERISK;
1536pub const MB_ICONSTOP = MB_ICONHAND;
1537pub const MB_DEFBUTTON1 = 0x00000000;
1538pub const MB_DEFBUTTON2 = 0x00000100;
1539pub const MB_DEFBUTTON3 = 0x00000200;
1540pub const MB_DEFBUTTON4 = 0x00000300;
1541pub const MB_APPLMODAL = 0x00000000;
1542pub const MB_SYSTEMMODAL = 0x00001000;
1543pub const MB_TASKMODAL = 0x00002000;
1544pub const MB_HELP = 0x00004000;
1545pub const MB_NOFOCUS = 0x00008000;
1546pub const MB_SETFOREGROUND = 0x00010000;
1547pub const MB_DEFAULT_DESKTOP_ONLY = 0x00020000;
1548pub const MB_TOPMOST = 0x00040000;
1549pub const MB_RIGHT = 0x00080000;
1550pub const MB_RTLREADING = 0x00100000;
1551pub const MB_TYPEMASK = 0x0000000F;
1552pub const MB_ICONMASK = 0x000000F0;
1553pub const MB_DEFMASK = 0x00000F00;
1554pub const MB_MODEMASK = 0x00003000;
1555pub const MB_MISCMASK = 0x0000C000;
1556
1557pub const IDOK = 1;
1558pub const IDCANCEL = 2;
1559pub const IDABORT = 3;
1560pub const IDRETRY = 4;
1561pub const IDIGNORE = 5;
1562pub const IDYES = 6;
1563pub const IDNO = 7;
1564pub const IDCLOSE = 8;
1565pub const IDHELP = 9;
1566pub const IDTRYAGAIN = 10;
1567pub const IDCONTINUE = 11;
1568
1569pub extern "user32" fn MessageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8, uType: UINT) callconv(WINAPI) i32;
1570pub fn messageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8, uType: u32) !i32 {
1571 const value = MessageBoxA(hWnd, lpText, lpCaption, uType);
1572 if (value != 0) return value;
1573 switch (GetLastError()) {
1574 .INVALID_WINDOW_HANDLE => unreachable,
1575 .INVALID_PARAMETER => unreachable,
1576 else => |err| return windows.unexpectedError(err),
1577 }
1578}
1579
1580pub extern "user32" fn MessageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: ?[*:0]const u16, uType: UINT) callconv(WINAPI) i32;
1581pub var pfnMessageBoxW: *const @TypeOf(MessageBoxW) = undefined;
1582pub fn messageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: [*:0]const u16, uType: u32) !i32 {
1583 const function = selectSymbol(MessageBoxW, pfnMessageBoxW, .win2k);
1584 const value = function(hWnd, lpText, lpCaption, uType);
1585 if (value != 0) return value;
1586 switch (GetLastError()) {
1587 .INVALID_WINDOW_HANDLE => unreachable,
1588 .INVALID_PARAMETER => unreachable,
1589 else => |err| return windows.unexpectedError(err),
1590 }
1591}
lib/std/start.zig+1-1
......@@ -609,7 +609,7 @@ pub fn call_wWinMain() std.os.windows.INT {
609609
610610 // There's no (documented) way to get the nCmdShow parameter, so we're
611611 // using this fairly standard default.
612 const nCmdShow = std.os.windows.user32.SW_SHOW;
612 const nCmdShow = 5;
613613
614614 // second parameter hPrevInstance, MSDN: "This parameter is always NULL"
615615 return root.wWinMain(hInstance, null, lpCmdLine, nCmdShow);