1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7  * Source: $(DRUNTIMESRC core/sys/windows/_winuser.d)
8  */
9 module core.sys.windows.winuser;
10 version (Windows):
11 
12 version (ANSI) {} else version = Unicode;
13 pragma(lib, "user32");
14 
15 // Conversion Notes:
16 // The following macros were for win16 only, and are not included in this file:
17 //#define EnumTaskWindows(h, f, p) EnumThreadWindows((DWORD)h, f, p)
18 //#define PostAppMessageA(t, m, w, l) PostThreadMessageA((DWORD)t, m, w, l)
19 //#define PostAppMessageW(t, m, w, l) PostThreadMessageW((DWORD)t, m, w, l)
20 //#define GetSysModalWindow() (NULL)
21 //#define SetSysModalWindow(h) (NULL)
22 //#define GetWindowTask(hWnd) ((HANDLE)GetWindowThreadProcessId(hWnd, NULL))
23 //#define DefHookProc(c, p, lp, h) CallNextHookEx((HHOOK)*h, c, p, lp)
24 
25 import core.sys.windows.w32api, core.sys.windows.winbase, core.sys.windows.wingdi;
26 import core.sys.windows.windef; // for HMONITOR
27 
28 // FIXME: clean up Windows version support
29 
30 LPTSTR MAKEINTATOM_T()(int i) {
31     return cast(LPTSTR) i;
32 }
33 
34 enum LPTSTR WC_DIALOG = MAKEINTATOM_T(0x8002);
35 
36 enum {
37     FAPPCOMMAND_MOUSE = 0x8000,
38     FAPPCOMMAND_KEY   = 0,
39     FAPPCOMMAND_OEM   = 0x1000,
40     FAPPCOMMAND_MASK  = 0xF000
41 }
42 
43 enum {
44     MNGO_NOINTERFACE = 0,
45     MNGO_NOERROR,
46     MNGOF_TOPGAP     = 1,
47     MNGOF_BOTTOMGAP
48 }
49 
50 enum {
51     FVIRTKEY  = 1,
52     FNOINVERT = 2,
53     FSHIFT    = 4,
54     FCONTROL  = 8,
55     FALT      = 16
56 }
57 
58 enum {
59     ATF_TIMEOUTON     = 1,
60     ATF_ONOFFFEEDBACK = 2,
61     ATF_AVAILABLE     = 4 // May be obsolete. Not in recent MS docs.
62 }
63 
64 enum {
65     WH_MIN             = -1,
66     WH_MSGFILTER       = -1,
67     WH_JOURNALRECORD,
68     WH_JOURNALPLAYBACK,
69     WH_KEYBOARD,
70     WH_GETMESSAGE,
71     WH_CALLWNDPROC,
72     WH_CBT,
73     WH_SYSMSGFILTER,
74     WH_MOUSE,
75     WH_HARDWARE,
76     WH_DEBUG,
77     WH_SHELL,
78     WH_FOREGROUNDIDLE,
79     WH_CALLWNDPROCRET,
80     WH_KEYBOARD_LL,
81     WH_MOUSE_LL,    // = 14
82     WH_MAX             = 14,
83     WH_MINHOOK         = WH_MIN,
84     WH_MAXHOOK         = WH_MAX
85 }
86 
87 enum {
88     HC_ACTION       = 0,
89     HC_GETNEXT,
90     HC_SKIP,
91     HC_NOREMOVE, // = 3
92     HC_NOREM        = HC_NOREMOVE,
93     HC_SYSMODALON,
94     HC_SYSMODALOFF
95 }
96 
97 enum {
98     HCBT_MOVESIZE    = 0,
99     HCBT_MINMAX,
100     HCBT_QS,
101     HCBT_CREATEWND,
102     HCBT_DESTROYWND,
103     HCBT_ACTIVATE,
104     HCBT_CLICKSKIPPED,
105     HCBT_KEYSKIPPED,
106     HCBT_SYSCOMMAND,
107     HCBT_SETFOCUS // = 9
108 }
109 
110 enum {
111     CF_TEXT                = 0x0001,
112     CF_BITMAP,
113     CF_METAFILEPICT,
114     CF_SYLK,
115     CF_DIF,
116     CF_TIFF,
117     CF_OEMTEXT,
118     CF_DIB,
119     CF_PALETTE,
120     CF_PENDATA,
121     CF_RIFF,
122     CF_WAVE,
123     CF_UNICODETEXT,
124     CF_ENHMETAFILE,
125     CF_HDROP,
126     CF_LOCALE,
127     CF_DIBV5,
128     CF_MAX,             // = 0x0012
129     CF_OWNERDISPLAY        = 0x0080,
130     CF_DSPTEXT,
131     CF_DSPBITMAP,
132     CF_DSPMETAFILEPICT, // = 0x0083
133     CF_DSPENHMETAFILE      = 0x008E,
134     CF_PRIVATEFIRST        = 0x0200,
135     CF_PRIVATELAST         = 0x02FF,
136     CF_GDIOBJFIRST         = 0x0300,
137     CF_GDIOBJLAST          = 0x03FF
138 }
139 
140 enum HKL_PREV = 0;
141 enum HKL_NEXT = 1;
142 
143 enum KLF_ACTIVATE       = 1;
144 enum KLF_SUBSTITUTE_OK  = 2;
145 enum KLF_UNLOADPREVIOUS = 4;
146 enum KLF_REORDER        = 8;
147 enum KLF_REPLACELANG    = 16;
148 enum KLF_NOTELLSHELL    = 128;
149 enum KLF_SETFORPROCESS  = 256;
150 enum KL_NAMELENGTH      = 9;
151 
152 enum MF_ENABLED = 0;
153 enum MF_GRAYED = 1;
154 enum MF_DISABLED = 2;
155 enum MF_BITMAP = 4;
156 enum MF_CHECKED = 8;
157 enum MF_MENUBARBREAK = 32;
158 enum MF_MENUBREAK = 64;
159 enum MF_OWNERDRAW = 256;
160 enum MF_POPUP = 16;
161 enum MF_SEPARATOR = 0x800;
162 enum MF_STRING = 0;
163 enum MF_UNCHECKED = 0;
164 enum MF_DEFAULT = 4096;
165 enum MF_SYSMENU = 0x2000;
166 enum MF_HELP = 0x4000;
167 enum MF_END = 128;
168 enum MF_RIGHTJUSTIFY = 0x4000;
169 enum MF_MOUSESELECT = 0x8000;
170 enum MF_INSERT = 0;
171 enum MF_CHANGE = 128;
172 enum MF_APPEND = 256;
173 enum MF_DELETE = 512;
174 enum MF_REMOVE = 4096;
175 enum MF_USECHECKBITMAPS = 512;
176 enum MF_UNHILITE = 0;
177 enum MF_HILITE = 128;
178 
179 // Also defined in dbt.h
180 enum BSM_ALLCOMPONENTS      = 0;
181 enum BSM_VXDS               = 1;
182 enum BSM_NETDRIVER          = 2;
183 enum BSM_INSTALLABLEDRIVERS = 4;
184 enum BSM_APPLICATIONS       = 8;
185 enum BSM_ALLDESKTOPS        = 16;
186 
187 enum {
188     BSF_QUERY              = 0x0001,
189     BSF_IGNORECURRENTTASK  = 0x0002,
190     BSF_FLUSHDISK          = 0x0004,
191     BSF_NOHANG             = 0x0008,
192     BSF_POSTMESSAGE        = 0x0010,
193     BSF_FORCEIFHUNG        = 0x0020,
194     BSF_NOTIMEOUTIFNOTHUNG = 0x0040,
195     BSF_ALLOWSFW           = 0x0080,
196     BSF_SENDNOTIFYMESSAGE  = 0x0100
197 }
198 static if (_WIN32_WINNT >= 0x501) {
199     enum {
200         BSF_RETURNHDESK    = 0x0200,
201         BSF_LUID           = 0x0400
202     }
203 }
204 
205 enum BROADCAST_QUERY_DENY = 1112363332;
206 enum DWORD ENUM_CURRENT_SETTINGS  = -1;
207 enum DWORD ENUM_REGISTRY_SETTINGS = -2;
208 
209 enum CDS_UPDATEREGISTRY = 1;
210 enum CDS_TEST           = 2;
211 enum CDS_FULLSCREEN     = 4;
212 enum CDS_GLOBAL         = 8;
213 enum CDS_SET_PRIMARY    = 16;
214 enum CDS_NORESET        = 0x10000000;
215 enum CDS_SETRECT        = 0x20000000;
216 enum CDS_RESET          = 0x40000000;
217 
218 enum {
219     DISP_CHANGE_BADPARAM   = -5,
220     DISP_CHANGE_BADFLAGS,
221     DISP_CHANGE_NOTUPDATED,
222     DISP_CHANGE_BADMODE,
223     DISP_CHANGE_FAILED,
224     DISP_CHANGE_SUCCESSFUL,
225     DISP_CHANGE_RESTART // =  1
226 }
227 
228 enum BST_UNCHECKED     = 0;
229 enum BST_CHECKED       = 1;
230 enum BST_INDETERMINATE = 2;
231 enum BST_PUSHED        = 4;
232 enum BST_FOCUS         = 8;
233 
234 enum MF_BYCOMMAND  = 0;
235 enum MF_BYPOSITION = 1024;
236 // [Redefined] MF_UNCHECKED = 0
237 // [Redefined] MF_HILITE = 128
238 // [Redefined] MF_UNHILITE = 0
239 
240 enum CWP_ALL             = 0;
241 enum CWP_SKIPINVISIBLE   = 1;
242 enum CWP_SKIPDISABLED    = 2;
243 enum CWP_SKIPTRANSPARENT = 4;
244 
245 enum IMAGE_BITMAP = 0;
246 enum IMAGE_ICON = 1;
247 enum IMAGE_CURSOR = 2;
248 enum IMAGE_ENHMETAFILE = 3;
249 
250 enum DF_ALLOWOTHERACCOUNTHOOK = 1;
251 
252 enum DESKTOP_READOBJECTS     = 1;
253 enum DESKTOP_CREATEWINDOW    = 2;
254 enum DESKTOP_CREATEMENU      = 4;
255 enum DESKTOP_HOOKCONTROL     = 8;
256 enum DESKTOP_JOURNALRECORD   = 16;
257 enum DESKTOP_JOURNALPLAYBACK = 32;
258 enum DESKTOP_ENUMERATE       = 64;
259 enum DESKTOP_WRITEOBJECTS    = 128;
260 enum DESKTOP_SWITCHDESKTOP   = 256;
261 
262 enum int CW_USEDEFAULT = 0x80000000;
263 
264 enum {
265     WS_OVERLAPPED       = 0,
266     WS_TILED            = WS_OVERLAPPED,
267     WS_MAXIMIZEBOX      = 0x00010000,
268     WS_MINIMIZEBOX      = 0x00020000,
269     WS_TABSTOP          = 0x00010000,
270     WS_GROUP            = 0x00020000,
271     WS_THICKFRAME       = 0x00040000,
272     WS_SIZEBOX          = WS_THICKFRAME,
273     WS_SYSMENU          = 0x00080000,
274     WS_HSCROLL          = 0x00100000,
275     WS_VSCROLL          = 0x00200000,
276     WS_DLGFRAME         = 0x00400000,
277     WS_BORDER           = 0x00800000,
278     WS_CAPTION          = 0x00c00000,
279     WS_OVERLAPPEDWINDOW = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX,
280     WS_TILEDWINDOW      = WS_OVERLAPPEDWINDOW,
281     WS_MAXIMIZE         = 0x01000000,
282     WS_CLIPCHILDREN     = 0x02000000,
283     WS_CLIPSIBLINGS     = 0x04000000,
284     WS_DISABLED         = 0x08000000,
285     WS_VISIBLE          = 0x10000000,
286     WS_MINIMIZE         = 0x20000000,
287     WS_ICONIC           = WS_MINIMIZE,
288     WS_CHILD            = 0x40000000,
289     WS_CHILDWINDOW      = 0x40000000,
290     WS_POPUP            = 0x80000000,
291     WS_POPUPWINDOW      = WS_POPUP|WS_BORDER|WS_SYSMENU,
292 }
293 
294 enum MDIS_ALLCHILDSTYLES = 1;
295 
296 enum BS_3STATE = 5;
297 enum BS_AUTO3STATE = 6;
298 enum BS_AUTOCHECKBOX = 3;
299 enum BS_AUTORADIOBUTTON = 9;
300 enum BS_BITMAP = 128;
301 enum BS_BOTTOM = 0x800;
302 enum BS_CENTER = 0x300;
303 enum BS_CHECKBOX = 2;
304 enum BS_DEFPUSHBUTTON = 1;
305 enum BS_GROUPBOX = 7;
306 enum BS_ICON = 64;
307 enum BS_LEFT = 256;
308 enum BS_LEFTTEXT = 32;
309 enum BS_MULTILINE = 0x2000;
310 enum BS_NOTIFY = 0x4000;
311 enum BS_OWNERDRAW = 0xb;
312 enum BS_PUSHBUTTON = 0;
313 enum BS_PUSHLIKE = 4096;
314 enum BS_RADIOBUTTON = 4;
315 enum BS_RIGHT = 512;
316 enum BS_RIGHTBUTTON = 32;
317 enum BS_TEXT = 0;
318 enum BS_TOP = 0x400;
319 enum BS_USERBUTTON = 8;
320 enum BS_VCENTER = 0xc00;
321 enum BS_FLAT = 0x8000;
322 
323 enum CBS_AUTOHSCROLL = 64;
324 enum CBS_DISABLENOSCROLL = 0x800;
325 enum CBS_DROPDOWN = 2;
326 enum CBS_DROPDOWNLIST = 3;
327 enum CBS_HASSTRINGS = 512;
328 enum CBS_LOWERCASE = 0x4000;
329 enum CBS_NOINTEGRALHEIGHT = 0x400;
330 enum CBS_OEMCONVERT = 128;
331 enum CBS_OWNERDRAWFIXED = 16;
332 enum CBS_OWNERDRAWVARIABLE = 32;
333 enum CBS_SIMPLE = 1;
334 enum CBS_SORT = 256;
335 enum CBS_UPPERCASE = 0x2000;
336 
337 enum ES_AUTOHSCROLL = 128;
338 enum ES_AUTOVSCROLL = 64;
339 enum ES_CENTER = 1;
340 enum ES_LEFT = 0;
341 enum ES_LOWERCASE = 16;
342 enum ES_MULTILINE = 4;
343 enum ES_NOHIDESEL = 256;
344 enum ES_NUMBER = 0x2000;
345 enum ES_OEMCONVERT = 0x400;
346 enum ES_PASSWORD = 32;
347 enum ES_READONLY = 0x800;
348 enum ES_RIGHT = 2;
349 enum ES_UPPERCASE = 8;
350 enum ES_WANTRETURN = 4096;
351 
352 enum LBS_DISABLENOSCROLL = 4096;
353 enum LBS_EXTENDEDSEL = 0x800;
354 enum LBS_HASSTRINGS = 64;
355 enum LBS_MULTICOLUMN = 512;
356 enum LBS_MULTIPLESEL = 8;
357 enum LBS_NODATA = 0x2000;
358 enum LBS_NOINTEGRALHEIGHT = 256;
359 enum LBS_NOREDRAW = 4;
360 enum LBS_NOSEL = 0x4000;
361 enum LBS_NOTIFY = 1;
362 enum LBS_OWNERDRAWFIXED = 16;
363 enum LBS_OWNERDRAWVARIABLE = 32;
364 enum LBS_SORT = 2;
365 enum LBS_STANDARD = 0xa00003;
366 enum LBS_USETABSTOPS = 128;
367 enum LBS_WANTKEYBOARDINPUT = 0x400;
368 
369 enum SBS_BOTTOMALIGN = 4;
370 enum SBS_HORZ = 0;
371 enum SBS_LEFTALIGN = 2;
372 enum SBS_RIGHTALIGN = 4;
373 enum SBS_SIZEBOX = 8;
374 enum SBS_SIZEBOXBOTTOMRIGHTALIGN = 4;
375 enum SBS_SIZEBOXTOPLEFTALIGN = 2;
376 enum SBS_SIZEGRIP = 16;
377 enum SBS_TOPALIGN = 2;
378 enum SBS_VERT = 1;
379 
380 enum SS_BITMAP = 14;
381 enum SS_BLACKFRAME = 7;
382 enum SS_BLACKRECT = 4;
383 enum SS_CENTER = 1;
384 enum SS_CENTERIMAGE = 512;
385 enum SS_ENHMETAFILE = 15;
386 enum SS_ETCHEDFRAME = 18;
387 enum SS_ETCHEDHORZ = 16;
388 enum SS_ETCHEDVERT = 17;
389 enum SS_GRAYFRAME = 8;
390 enum SS_GRAYRECT = 5;
391 enum SS_ICON = 3;
392 enum SS_LEFT = 0;
393 enum SS_LEFTNOWORDWRAP = 0xc;
394 enum SS_NOPREFIX = 128;
395 enum SS_NOTIFY = 256;
396 enum SS_OWNERDRAW = 0xd;
397 enum SS_REALSIZEIMAGE = 0x800;
398 enum SS_RIGHT = 2;
399 enum SS_RIGHTJUST = 0x400;
400 enum SS_SIMPLE = 11;
401 enum SS_SUNKEN = 4096;
402 enum SS_WHITEFRAME = 9;
403 enum SS_WHITERECT = 6;
404 enum SS_USERITEM = 10;
405 enum SS_TYPEMASK = 0x0000001FL;
406 enum SS_ENDELLIPSIS = 0x00004000L;
407 enum SS_PATHELLIPSIS = 0x00008000L;
408 enum SS_WORDELLIPSIS = 0x0000C000L;
409 enum SS_ELLIPSISMASK = 0x0000C000L;
410 
411 enum DS_ABSALIGN      = 0x0001;
412 enum DS_3DLOOK        = 0x0004;
413 enum DS_SYSMODAL      = 0x0002;
414 enum DS_FIXEDSYS      = 0x0008;
415 enum DS_NOFAILCREATE  = 0x0010;
416 enum DS_LOCALEDIT     = 0x0020;
417 enum DS_SETFONT       = 0x0040;
418 enum DS_MODALFRAME    = 0x0080;
419 enum DS_NOIDLEMSG     = 0x0100;
420 enum DS_SETFOREGROUND = 0x0200;
421 enum DS_CONTROL       = 0x0400;
422 enum DS_CENTER        = 0x0800;
423 enum DS_CENTERMOUSE   = 0x1000;
424 enum DS_CONTEXTHELP   = 0x2000;
425 enum DS_SHELLFONT     = DS_SETFONT | DS_FIXEDSYS;
426 
427 enum WS_EX_ACCEPTFILES = 16;
428 enum WS_EX_APPWINDOW = 0x40000;
429 enum WS_EX_CLIENTEDGE = 512;
430 enum WS_EX_COMPOSITED = 0x2000000;  // XP
431 enum WS_EX_CONTEXTHELP = 0x400;
432 enum WS_EX_CONTROLPARENT = 0x10000;
433 enum WS_EX_DLGMODALFRAME = 1;
434 enum WS_EX_LAYERED = 0x80000;  // w2k
435 enum WS_EX_LAYOUTRTL = 0x400000;  // w98, w2k
436 enum WS_EX_LEFT = 0;
437 enum WS_EX_LEFTSCROLLBAR = 0x4000;
438 enum WS_EX_LTRREADING = 0;
439 enum WS_EX_MDICHILD = 64;
440 enum WS_EX_NOACTIVATE = 0x8000000;  // w2k
441 enum WS_EX_NOINHERITLAYOUT = 0x100000;  // w2k
442 enum WS_EX_NOPARENTNOTIFY = 4;
443 enum WS_EX_NOREDIRECTIONBITMAP = 0x00200000; // w8, s2012
444 enum WS_EX_OVERLAPPEDWINDOW = 0x300;
445 enum WS_EX_PALETTEWINDOW = 0x188;
446 enum WS_EX_RIGHT = 0x1000;
447 enum WS_EX_RIGHTSCROLLBAR = 0;
448 enum WS_EX_RTLREADING = 0x2000;
449 enum WS_EX_STATICEDGE = 0x20000;
450 enum WS_EX_TOOLWINDOW = 128;
451 enum WS_EX_TOPMOST = 8;
452 enum WS_EX_TRANSPARENT = 32;
453 enum WS_EX_WINDOWEDGE = 256;
454 
455 enum WINSTA_ENUMDESKTOPS      = 1;
456 enum WINSTA_READATTRIBUTES    = 2;
457 enum WINSTA_ACCESSCLIPBOARD   = 4;
458 enum WINSTA_CREATEDESKTOP     = 8;
459 enum WINSTA_WRITEATTRIBUTES   = 16;
460 enum WINSTA_ACCESSGLOBALATOMS = 32;
461 enum WINSTA_EXITWINDOWS       = 64;
462 enum WINSTA_ENUMERATE         = 256;
463 enum WINSTA_READSCREEN        = 512;
464 
465 enum DDL_READWRITE = 0;
466 enum DDL_READONLY  = 1;
467 enum DDL_HIDDEN    = 2;
468 enum DDL_SYSTEM    = 4;
469 enum DDL_DIRECTORY = 16;
470 enum DDL_ARCHIVE   = 32;
471 enum DDL_POSTMSGS  = 8192;
472 enum DDL_DRIVES    = 16384;
473 enum DDL_EXCLUSIVE = 32768;
474 
475 enum {
476     DC_ACTIVE       = 0x0001,
477     DC_SMALLCAP     = 0x0002,
478     DC_ICON         = 0x0004,
479     DC_TEXT         = 0x0008,
480     DC_INBUTTON     = 0x0010,
481     DC_GRADIENT     = 0x0020
482 }
483 static if (_WIN32_WINNT >= 0x501) {
484     enum DC_BUTTONS = 0x1000;
485 }
486 
487 // Where are these documented?
488 //enum DC_CAPTION = DC_ICON|DC_TEXT|DC_BUTTONS;
489 //enum DC_NC      = DC_CAPTION|DC_FRAME;
490 
491 enum BDR_RAISEDOUTER = 1;
492 enum BDR_SUNKENOUTER = 2;
493 enum BDR_RAISEDINNER = 4;
494 enum BDR_SUNKENINNER = 8;
495 enum BDR_OUTER       = 3;
496 enum BDR_INNER       = 0xc;
497 enum BDR_RAISED      = 5;
498 enum BDR_SUNKEN      = 10;
499 
500 enum EDGE_RAISED = BDR_RAISEDOUTER|BDR_RAISEDINNER;
501 enum EDGE_SUNKEN = BDR_SUNKENOUTER|BDR_SUNKENINNER;
502 enum EDGE_ETCHED = BDR_SUNKENOUTER|BDR_RAISEDINNER;
503 enum EDGE_BUMP   = BDR_RAISEDOUTER|BDR_SUNKENINNER;
504 
505 enum BF_LEFT                    = 1;
506 enum BF_TOP                     = 2;
507 enum BF_RIGHT                   = 4;
508 enum BF_BOTTOM                  = 8;
509 enum BF_TOPLEFT                 = BF_TOP|BF_LEFT;
510 enum BF_TOPRIGHT                = BF_TOP|BF_RIGHT;
511 enum BF_BOTTOMLEFT              = BF_BOTTOM|BF_LEFT;
512 enum BF_BOTTOMRIGHT             = BF_BOTTOM|BF_RIGHT;
513 enum BF_RECT                    = BF_LEFT|BF_TOP|BF_RIGHT|BF_BOTTOM ;
514 enum BF_DIAGONAL                = 16;
515 enum BF_DIAGONAL_ENDTOPRIGHT    = BF_DIAGONAL|BF_TOP|BF_RIGHT;
516 enum BF_DIAGONAL_ENDTOPLEFT     = BF_DIAGONAL|BF_TOP|BF_LEFT;
517 enum BF_DIAGONAL_ENDBOTTOMLEFT  = BF_DIAGONAL|BF_BOTTOM|BF_LEFT;
518 enum BF_DIAGONAL_ENDBOTTOMRIGHT = BF_DIAGONAL|BF_BOTTOM|BF_RIGHT;
519 enum BF_MIDDLE                  = 0x800;
520 enum BF_SOFT                    = 0x1000;
521 enum BF_ADJUST                  = 0x2000;
522 enum BF_FLAT                    = 0x4000;
523 enum BF_MONO                    = 0x8000;
524 
525 enum {
526     DFC_CAPTION      = 1,
527     DFC_MENU,
528     DFC_SCROLL,
529     DFC_BUTTON,
530     DFC_POPUPMENU // = 5
531 }
532 
533 enum {
534     DFCS_CAPTIONCLOSE,
535     DFCS_CAPTIONMIN,
536     DFCS_CAPTIONMAX,
537     DFCS_CAPTIONRESTORE,
538     DFCS_CAPTIONHELP // = 4
539 }
540 
541 enum {
542     DFCS_MENUARROW      = 0,
543     DFCS_MENUCHECK      = 1,
544     DFCS_MENUBULLET     = 2,
545     DFCS_MENUARROWRIGHT = 4
546 }
547 
548 enum {
549     DFCS_SCROLLUP            =  0,
550     DFCS_SCROLLDOWN          =  1,
551     DFCS_SCROLLLEFT          =  2,
552     DFCS_SCROLLRIGHT         =  3,
553     DFCS_SCROLLCOMBOBOX      =  5,
554     DFCS_SCROLLSIZEGRIP      =  8,
555     DFCS_SCROLLSIZEGRIPRIGHT = 16
556 }
557 
558 enum {
559     DFCS_BUTTONCHECK         = 0,
560     DFCS_BUTTONRADIOIMAGE    = 0x0001,
561     DFCS_BUTTONRADIOMASK     = 0x0002,
562     DFCS_BUTTONRADIO         = 0x0004,
563     DFCS_BUTTON3STATE        = 0x0008,
564     DFCS_BUTTONPUSH          = 0x0010,
565     DFCS_INACTIVE            = 0x0100,
566     DFCS_PUSHED              = 0x0200,
567     DFCS_CHECKED             = 0x0400,
568     DFCS_TRANSPARENT         = 0x0800,
569     DFCS_HOT                 = 0x1000,
570     DFCS_ADJUSTRECT          = 0x2000,
571     DFCS_FLAT                = 0x4000,
572     DFCS_MONO                = 0x8000
573 }
574 
575 enum {
576     DST_COMPLEX = 0,
577     DST_TEXT,
578     DST_PREFIXTEXT,
579     DST_ICON,
580     DST_BITMAP // = 4
581 }
582 
583 enum DSS_NORMAL = 0;
584 enum DSS_UNION = 16;
585 enum DSS_DISABLED = 32;
586 enum DSS_MONO = 128;
587 enum DSS_RIGHT = 0x8000;
588 
589 enum DT_BOTTOM = 8;
590 enum DT_CALCRECT = 1024;
591 enum DT_CENTER = 1;
592 enum DT_EDITCONTROL = 8192;
593 enum DT_END_ELLIPSIS = 32768;
594 enum DT_PATH_ELLIPSIS = 16384;
595 enum DT_WORD_ELLIPSIS = 0x40000;
596 enum DT_EXPANDTABS = 64;
597 enum DT_EXTERNALLEADING = 512;
598 enum DT_LEFT = 0;
599 enum DT_MODIFYSTRING = 65536;
600 enum DT_NOCLIP = 256;
601 enum DT_NOPREFIX = 2048;
602 enum DT_RIGHT = 2;
603 enum DT_RTLREADING = 131072;
604 enum DT_SINGLELINE = 32;
605 enum DT_TABSTOP = 128;
606 enum DT_TOP = 0;
607 enum DT_VCENTER = 4;
608 enum DT_WORDBREAK = 16;
609 enum DT_INTERNAL = 4096;
610 
611 enum WB_ISDELIMITER = 2;
612 enum WB_LEFT = 0;
613 enum WB_RIGHT = 1;
614 
615 enum SB_HORZ = 0;
616 enum SB_VERT = 1;
617 enum SB_CTL = 2;
618 enum SB_BOTH = 3;
619 
620 enum ESB_DISABLE_BOTH = 3;
621 enum ESB_DISABLE_DOWN = 2;
622 enum ESB_DISABLE_LEFT = 1;
623 enum ESB_DISABLE_LTUP = 1;
624 enum ESB_DISABLE_RIGHT = 2;
625 enum ESB_DISABLE_RTDN = 2;
626 enum ESB_DISABLE_UP = 1;
627 enum ESB_ENABLE_BOTH = 0;
628 
629 enum SB_LINEUP = 0;
630 enum SB_LINEDOWN = 1;
631 enum SB_LINELEFT = 0;
632 enum SB_LINERIGHT = 1;
633 enum SB_PAGEUP = 2;
634 enum SB_PAGEDOWN = 3;
635 enum SB_PAGELEFT = 2;
636 enum SB_PAGERIGHT = 3;
637 enum SB_THUMBPOSITION = 4;
638 enum SB_THUMBTRACK = 5;
639 enum SB_ENDSCROLL = 8;
640 enum SB_LEFT = 6;
641 enum SB_RIGHT = 7;
642 enum SB_BOTTOM = 7;
643 enum SB_TOP = 6;
644 
645 //MACRO #define IS_INTRESOURCE(i) (((ULONG_PTR)(i) >> 16) == 0)
646 
647 template MAKEINTRESOURCE_T(WORD i) {
648     enum LPTSTR MAKEINTRESOURCE_T = cast(LPTSTR)(i);
649 }
650 
651 nothrow @nogc {
652     LPSTR MAKEINTRESOURCEA(/*WORD*/uint i) {
653         return cast(LPSTR) i;
654     }
655 
656     LPWSTR MAKEINTRESOURCEW(/*WORD*/uint i) {
657         return cast(LPWSTR) i;
658     }
659 }
660 
661 enum RT_CURSOR       = MAKEINTRESOURCE_T!(1);
662 enum RT_BITMAP       = MAKEINTRESOURCE_T!(2);
663 enum RT_ICON         = MAKEINTRESOURCE_T!(3);
664 enum RT_MENU         = MAKEINTRESOURCE_T!(4);
665 enum RT_DIALOG       = MAKEINTRESOURCE_T!(5);
666 enum RT_STRING       = MAKEINTRESOURCE_T!(6);
667 enum RT_FONTDIR      = MAKEINTRESOURCE_T!(7);
668 enum RT_FONT         = MAKEINTRESOURCE_T!(8);
669 enum RT_ACCELERATOR  = MAKEINTRESOURCE_T!(9);
670 enum RT_RCDATA       = MAKEINTRESOURCE_T!(10);
671 enum RT_MESSAGETABLE = MAKEINTRESOURCE_T!(11);
672 
673 enum RT_GROUP_CURSOR = MAKEINTRESOURCE_T!(12);
674 enum RT_GROUP_ICON   = MAKEINTRESOURCE_T!(14);
675 enum RT_VERSION      = MAKEINTRESOURCE_T!(16);
676 enum RT_DLGINCLUDE   = MAKEINTRESOURCE_T!(17);
677 enum RT_PLUGPLAY     = MAKEINTRESOURCE_T!(19);
678 enum RT_VXD          = MAKEINTRESOURCE_T!(20);
679 enum RT_ANICURSOR    = MAKEINTRESOURCE_T!(21);
680 enum RT_ANIICON      = MAKEINTRESOURCE_T!(22);
681 enum RT_HTML         = MAKEINTRESOURCE_T!(23);
682 enum RT_MANIFEST     = MAKEINTRESOURCE_T!(24);
683 
684 enum CREATEPROCESS_MANIFEST_RESOURCE_ID                 = MAKEINTRESOURCE_T!(1);
685 enum ISOLATIONAWARE_MANIFEST_RESOURCE_ID                = MAKEINTRESOURCE_T!(2);
686 enum ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE_T!(3);
687 
688 enum {
689     EWX_LOGOFF      =  0,
690     EWX_SHUTDOWN    =  1,
691     EWX_REBOOT      =  2,
692     EWX_FORCE       =  4,
693     EWX_POWEROFF    =  8,
694     EWX_FORCEIFHUNG = 16
695 }
696 
697 enum CS_BYTEALIGNCLIENT = 4096;
698 enum CS_BYTEALIGNWINDOW = 8192;
699 enum CS_KEYCVTWINDOW = 4;
700 enum CS_NOKEYCVT = 256;
701 enum CS_CLASSDC = 64;
702 enum CS_DBLCLKS = 8;
703 enum CS_GLOBALCLASS = 16384;
704 enum CS_HREDRAW = 2;
705 enum CS_NOCLOSE = 512;
706 enum CS_OWNDC = 32;
707 enum CS_PARENTDC = 128;
708 enum CS_SAVEBITS = 2048;
709 enum CS_VREDRAW = 1;
710 enum CS_IME = 0x10000;
711 
712 enum GCW_ATOM = -32;
713 enum GCL_CBCLSEXTRA = -20;
714 enum GCL_CBWNDEXTRA = -18;
715 enum GCL_HBRBACKGROUND = -10;
716 enum GCL_HCURSOR = -12;
717 enum GCL_HICON = -14;
718 enum GCL_HICONSM = -34;
719 enum GCL_HMODULE = -16;
720 enum GCL_MENUNAME = -8;
721 enum GCL_STYLE = -26;
722 enum GCL_WNDPROC = -24;
723 
724 alias GCL_HICONSM GCLP_HICONSM;
725 alias GCL_HICON GCLP_HICON;
726 alias GCL_HCURSOR GCLP_HCURSOR;
727 alias GCL_HBRBACKGROUND GCLP_HBRBACKGROUND;
728 alias GCL_HMODULE  GCLP_HMODULE;
729 alias GCL_MENUNAME GCLP_MENUNAME;
730 alias GCL_WNDPROC  GCLP_WNDPROC;
731 
732 enum {
733     IDC_ARROW       = MAKEINTRESOURCE_T!(32512),
734     IDC_IBEAM       = MAKEINTRESOURCE_T!(32513),
735     IDC_WAIT        = MAKEINTRESOURCE_T!(32514),
736     IDC_CROSS       = MAKEINTRESOURCE_T!(32515),
737     IDC_UPARROW     = MAKEINTRESOURCE_T!(32516),
738     IDC_SIZE        = MAKEINTRESOURCE_T!(32640),
739     IDC_ICON        = MAKEINTRESOURCE_T!(32641),
740     IDC_SIZENWSE    = MAKEINTRESOURCE_T!(32642),
741     IDC_SIZENESW    = MAKEINTRESOURCE_T!(32643),
742     IDC_SIZEWE      = MAKEINTRESOURCE_T!(32644),
743     IDC_SIZENS      = MAKEINTRESOURCE_T!(32645),
744     IDC_SIZEALL     = MAKEINTRESOURCE_T!(32646),
745     IDC_NO          = MAKEINTRESOURCE_T!(32648),
746     IDC_HAND        = MAKEINTRESOURCE_T!(32649),
747     IDC_APPSTARTING = MAKEINTRESOURCE_T!(32650),
748     IDC_HELP        = MAKEINTRESOURCE_T!(32651),
749     IDI_APPLICATION = MAKEINTRESOURCE_T!(32512),
750     IDI_HAND        = MAKEINTRESOURCE_T!(32513),
751     IDI_QUESTION    = MAKEINTRESOURCE_T!(32514),
752     IDI_EXCLAMATION = MAKEINTRESOURCE_T!(32515),
753     IDI_ASTERISK    = MAKEINTRESOURCE_T!(32516),
754     IDI_WINLOGO     = MAKEINTRESOURCE_T!(32517),
755     IDI_WARNING     = IDI_EXCLAMATION,
756     IDI_ERROR       = IDI_HAND,
757     IDI_INFORMATION = IDI_ASTERISK
758 }
759 static if (_WIN32_WINNT >= 0x600) {
760     enum IDI_SHIELD = MAKEINTRESOURCE_T!(32518);
761 }
762 
763 enum {
764     MIIM_STATE      = 0x0001,
765     MIIM_ID         = 0x0002,
766     MIIM_SUBMENU    = 0x0004,
767     MIIM_CHECKMARKS = 0x0008,
768     MIIM_TYPE       = 0x0010,
769     MIIM_DATA       = 0x0020,
770     MIIM_STRING     = 0x0040,
771     MIIM_BITMAP     = 0x0080,
772     MIIM_FTYPE      = 0x0100
773 }
774 
775 enum {
776     MFT_BITMAP       = 0x0004,
777     MFT_MENUBARBREAK = 0x0020,
778     MFT_MENUBREAK    = 0x0040,
779     MFT_OWNERDRAW    = 0x0100,
780     MFT_RADIOCHECK   = 0x0200,
781     MFT_RIGHTJUSTIFY = 0x4000,
782     MFT_SEPARATOR    = 0x0800,
783     MFT_RIGHTORDER   = 0x2000,
784     MFT_STRING       = 0
785 }
786 
787 enum {
788     MFS_CHECKED   = 8,
789     MFS_DEFAULT   = 4096,
790     MFS_DISABLED  = 3,
791     MFS_ENABLED   = 0,
792     MFS_GRAYED    = 3,
793     MFS_HILITE    = 128,
794     MFS_UNCHECKED = 0,
795     MFS_UNHILITE  = 0
796 }
797 
798 enum {
799     GW_HWNDFIRST = 0,
800     GW_HWNDLAST,
801     GW_HWNDNEXT,
802     GW_HWNDPREV,
803     GW_OWNER,
804     GW_CHILD  // = 5
805 }
806 
807 enum {
808     SW_HIDE            =  0,
809     SW_NORMAL          =  1,
810     SW_SHOWNORMAL      =  1,
811     SW_SHOWMINIMIZED   =  2,
812     SW_MAXIMIZE        =  3,
813     SW_SHOWMAXIMIZED   =  3,
814     SW_SHOWNOACTIVATE  =  4,
815     SW_SHOW            =  5,
816     SW_MINIMIZE        =  6,
817     SW_SHOWMINNOACTIVE =  7,
818     SW_SHOWNA          =  8,
819     SW_RESTORE         =  9,
820     SW_SHOWDEFAULT     = 10,
821     SW_FORCEMINIMIZE   = 11,
822     SW_MAX             = 11
823 }
824 
825 enum {
826     SW_PARENTCLOSING  = 1,
827     SW_OTHERZOOM,
828     SW_PARENTOPENING,
829     SW_OTHERUNZOOM // = 4
830 }
831 
832 enum { // is this a different SW from the previous?
833     SW_SCROLLCHILDREN = 0x01,
834     SW_INVALIDATE     = 0x02,
835     SW_ERASE          = 0x04,
836     SW_SMOOTHSCROLL   = 0x10
837 }
838 
839 enum {
840     MB_OK                        = 0,
841     MB_OKCANCEL,
842     MB_ABORTRETRYIGNORE,
843     MB_YESNOCANCEL,
844     MB_YESNO,
845     MB_RETRYCANCEL,
846     MB_CANCELTRYCONTINUE,     // = 6
847     MB_TYPEMASK                  = 0x0000000F,
848     MB_ICONHAND                  = 0x00000010,
849     MB_ICONSTOP                  = MB_ICONHAND,
850     MB_ICONERROR                 = MB_ICONHAND,
851     MB_ICONQUESTION              = 0x00000020,
852     MB_ICONEXCLAMATION           = 0x00000030,
853     MB_ICONWARNING               = MB_ICONEXCLAMATION,
854     MB_ICONASTERISK              = 0x00000040,
855     MB_ICONINFORMATION           = MB_ICONASTERISK,
856     MB_USERICON                  = 0x00000080,
857     MB_ICONMASK                  = 0x000000F0,
858 
859     MB_DEFBUTTON1                = 0,
860     MB_DEFBUTTON2                = 0x00000100,
861     MB_DEFBUTTON3                = 0x00000200,
862     MB_DEFBUTTON4                = 0x00000300,
863     MB_DEFMASK                   = 0x00000F00,
864 
865     MB_APPLMODAL                 = 0,
866     MB_SYSTEMMODAL               = 0x00001000,
867     MB_TASKMODAL                 = 0x00002000,
868     MB_MODEMASK                  = 0x00003000,
869 
870     MB_HELP                      = 0x00004000,
871     MB_NOFOCUS                   = 0x00008000,
872     MB_MISCMASK                  = 0x0000C000,
873 
874     MB_SETFOREGROUND             = 0x00010000,
875     MB_DEFAULT_DESKTOP_ONLY      = 0x00020000,
876     MB_TOPMOST                   = 0x00040000,
877     MB_SERVICE_NOTIFICATION_NT3X = 0x00040000,
878     MB_RIGHT                     = 0x00080000,
879     MB_RTLREADING                = 0x00100000,
880     MB_SERVICE_NOTIFICATION      = 0x00200000
881 }
882 
883 enum {
884     IDOK          = 1,
885     IDCANCEL,
886     IDABORT,
887     IDRETRY,
888     IDIGNORE,
889     IDYES,
890     IDNO,
891     IDCLOSE,
892     IDHELP,
893     IDTRYAGAIN,
894     IDCONTINUE // = 11
895 }
896 
897 enum GWL_EXSTYLE = -20;
898 enum GWL_STYLE = -16;
899 enum GWL_WNDPROC = -4;
900 enum GWLP_WNDPROC = -4;
901 enum GWL_HINSTANCE = -6;
902 enum GWLP_HINSTANCE = -6;
903 enum GWL_HWNDPARENT = -8;
904 enum GWLP_HWNDPARENT = -8;
905 enum GWL_ID = -12;
906 enum GWLP_ID = -12;
907 enum GWL_USERDATA = -21;
908 enum GWLP_USERDATA = -21;
909 
910 enum DWL_DLGPROC = 4;
911 enum DWLP_DLGPROC = 4;
912 enum DWL_MSGRESULT = 0;
913 enum DWLP_MSGRESULT = 0;
914 enum DWL_USER = 8;
915 enum DWLP_USER = 8;
916 
917 enum QS_KEY            = 1;
918 enum QS_MOUSEMOVE      = 2;
919 enum QS_MOUSEBUTTON    = 4;
920 enum QS_MOUSE          = 6;
921 enum QS_POSTMESSAGE    = 8;
922 enum QS_TIMER          = 16;
923 enum QS_PAINT          = 32;
924 enum QS_SENDMESSAGE    = 64;
925 enum QS_HOTKEY         = 128;
926 enum QS_ALLPOSTMESSAGE = 256;
927 static if (_WIN32_WINNT >= 0x501) {
928 enum QS_RAWINPUT       = 1024;
929 enum QS_INPUT          = 1031;
930 enum QS_ALLEVENTS      = 1215;
931 enum QS_ALLINPUT       = 1279;
932 } else {
933 enum QS_INPUT          = 7;
934 enum QS_ALLEVENTS      = 191;
935 enum QS_ALLINPUT       = 255;
936 }
937 
938 enum MWMO_WAITALL        = 1;
939 enum MWMO_ALERTABLE      = 2;
940 enum MWMO_INPUTAVAILABLE = 4;
941 
942 enum COLOR_3DDKSHADOW = 21;
943 enum COLOR_3DFACE = 15;
944 enum COLOR_3DHILIGHT = 20;
945 enum COLOR_3DHIGHLIGHT = 20;
946 enum COLOR_3DLIGHT = 22;
947 enum COLOR_BTNHILIGHT = 20;
948 enum COLOR_3DSHADOW = 16;
949 enum COLOR_ACTIVEBORDER = 10;
950 enum COLOR_ACTIVECAPTION = 2;
951 enum COLOR_APPWORKSPACE = 12;
952 enum COLOR_BACKGROUND = 1;
953 enum COLOR_DESKTOP = 1;
954 enum COLOR_BTNFACE = 15;
955 enum COLOR_BTNHIGHLIGHT = 20;
956 enum COLOR_BTNSHADOW = 16;
957 enum COLOR_BTNTEXT = 18;
958 enum COLOR_CAPTIONTEXT = 9;
959 enum COLOR_GRAYTEXT = 17;
960 enum COLOR_HIGHLIGHT = 13;
961 enum COLOR_HIGHLIGHTTEXT = 14;
962 enum COLOR_INACTIVEBORDER = 11;
963 enum COLOR_INACTIVECAPTION = 3;
964 enum COLOR_INACTIVECAPTIONTEXT = 19;
965 enum COLOR_INFOBK = 24;
966 enum COLOR_INFOTEXT = 23;
967 enum COLOR_MENU = 4;
968 enum COLOR_MENUTEXT = 7;
969 enum COLOR_SCROLLBAR = 0;
970 enum COLOR_WINDOW = 5;
971 enum COLOR_WINDOWFRAME = 6;
972 enum COLOR_WINDOWTEXT = 8;
973 enum COLOR_HOTLIGHT = 26;
974 enum COLOR_GRADIENTACTIVECAPTION = 27;
975 enum COLOR_GRADIENTINACTIVECAPTION = 28;
976 
977 enum CTLCOLOR_MSGBOX = 0;
978 enum CTLCOLOR_EDIT = 1;
979 enum CTLCOLOR_LISTBOX = 2;
980 enum CTLCOLOR_BTN = 3;
981 enum CTLCOLOR_DLG = 4;
982 enum CTLCOLOR_SCROLLBAR = 5;
983 enum CTLCOLOR_STATIC = 6;
984 enum CTLCOLOR_MAX = 7;
985 
986 // For GetSystemMetrics()
987 enum : int {
988     SM_CXSCREEN = 0,
989     SM_CYSCREEN,
990     SM_CXVSCROLL,
991     SM_CYHSCROLL,
992     SM_CYCAPTION,
993     SM_CXBORDER,
994     SM_CYBORDER,
995     SM_CXDLGFRAME,    // = 7
996     SM_CXFIXEDFRAME      = SM_CXDLGFRAME,
997     SM_CYDLGFRAME,    // = 8
998     SM_CYFIXEDFRAME      = SM_CYDLGFRAME,
999     SM_CYVTHUMB,      // = 9
1000     SM_CXHTHUMB,
1001     SM_CXICON,
1002     SM_CYICON,
1003     SM_CXCURSOR,
1004     SM_CYCURSOR,
1005     SM_CYMENU,
1006     SM_CXFULLSCREEN,
1007     SM_CYFULLSCREEN,
1008     SM_CYKANJIWINDOW,
1009     SM_MOUSEPRESENT,
1010     SM_CYVSCROLL,
1011     SM_CXHSCROLL,
1012     SM_DEBUG,
1013     SM_SWAPBUTTON,
1014     SM_RESERVED1,
1015     SM_RESERVED2,
1016     SM_RESERVED3,
1017     SM_RESERVED4,
1018     SM_CXMIN,
1019     SM_CYMIN,
1020     SM_CXSIZE,
1021     SM_CYSIZE,
1022     SM_CXSIZEFRAME,   // = 32,
1023     SM_CXFRAME           = SM_CXSIZEFRAME,
1024     SM_CYSIZEFRAME,   // = 33
1025     SM_CYFRAME           = SM_CYSIZEFRAME,
1026     SM_CXMINTRACK,
1027     SM_CYMINTRACK,
1028     SM_CXDOUBLECLK,
1029     SM_CYDOUBLECLK,
1030     SM_CXICONSPACING,
1031     SM_CYICONSPACING,
1032     SM_MENUDROPALIGNMENT,
1033     SM_PENWINDOWS,
1034     SM_DBCSENABLED,
1035     SM_CMOUSEBUTTONS,
1036     SM_SECURE,
1037     SM_CXEDGE,
1038     SM_CYEDGE,
1039     SM_CXMINSPACING,
1040     SM_CYMINSPACING,
1041     SM_CXSMICON,
1042     SM_CYSMICON,
1043     SM_CYSMCAPTION,
1044     SM_CXSMSIZE,
1045     SM_CYSMSIZE,
1046     SM_CXMENUSIZE,
1047     SM_CYMENUSIZE,
1048     SM_ARRANGE,
1049     SM_CXMINIMIZED,
1050     SM_CYMINIMIZED,
1051     SM_CXMAXTRACK,
1052     SM_CYMAXTRACK,
1053     SM_CXMAXIMIZED,
1054     SM_CYMAXIMIZED,
1055     SM_NETWORK,       // = 63
1056     SM_CLEANBOOT         = 67,
1057     SM_CXDRAG,
1058     SM_CYDRAG,
1059     SM_SHOWSOUNDS,
1060     SM_CXMENUCHECK,
1061     SM_CYMENUCHECK,
1062     SM_SLOWMACHINE,
1063     SM_MIDEASTENABLED,
1064     SM_MOUSEWHEELPRESENT,
1065     SM_XVIRTUALSCREEN,
1066     SM_YVIRTUALSCREEN,
1067     SM_CXVIRTUALSCREEN,
1068     SM_CYVIRTUALSCREEN,
1069     SM_CMONITORS,
1070     SM_SAMEDISPLAYFORMAT,
1071     SM_IMMENABLED,
1072     SM_CXFOCUSBORDER,
1073     SM_CYFOCUSBORDER, // = 84
1074     SM_TABLETPC          = 86,
1075     SM_MEDIACENTER,
1076     SM_STARTER,       // = 88
1077     SM_CMETRICS          = 88,
1078     SM_SERVERR2,
1079     SM_REMOTESESSION     = 0x1000,
1080 }
1081 static if (_WIN32_WINNT >= 0x501) {
1082     enum {  // These are only for WinXP and later
1083         SM_SHUTTINGDOWN  = 0x2000,
1084         SM_REMOTECONTROL = 0x2001
1085     }
1086 }
1087 
1088 enum ARW_BOTTOMLEFT = 0;
1089 enum ARW_BOTTOMRIGHT = 1;
1090 enum ARW_HIDE = 8;
1091 enum ARW_TOPLEFT = 2;
1092 enum ARW_TOPRIGHT = 3;
1093 enum ARW_DOWN = 4;
1094 enum ARW_LEFT = 0;
1095 enum ARW_RIGHT = 0;
1096 enum ARW_UP = 4;
1097 
1098 enum UOI_FLAGS = 1;
1099 enum UOI_NAME = 2;
1100 enum UOI_TYPE = 3;
1101 enum UOI_USER_SID = 4;
1102 
1103 // For the fuLoad parameter of LoadImage()
1104 enum : UINT {
1105     LR_DEFAULTCOLOR     = 0,
1106     LR_MONOCHROME       = 0x0001,
1107     LR_COLOR            = 0x0002,
1108     LR_COPYRETURNORG    = 0x0004,
1109     LR_COPYDELETEORG    = 0x0008,
1110     LR_LOADFROMFILE     = 0x0010,
1111     LR_LOADTRANSPARENT  = 0x0020,
1112     LR_DEFAULTSIZE      = 0x0040,
1113     LR_VGACOLOR         = 0x0080,
1114     LR_LOADREALSIZE     = 0x0080,
1115     LR_LOADMAP3DCOLORS  = 0x1000,
1116     LR_CREATEDIBSECTION = 0x2000,
1117     LR_COPYFROMRESOURCE = 0x4000,
1118     LR_SHARED           = 0x8000
1119 }
1120 
1121 enum {
1122     KEYEVENTF_EXTENDEDKEY = 1,
1123     KEYEVENTF_KEYUP       = 2,
1124     KEYEVENTF_UNICODE     = 4,
1125     KEYEVENTF_SCANCODE    = 8
1126 }
1127 
1128 enum OBM_BTNCORNERS = 32758;
1129 enum OBM_BTSIZE = 32761;
1130 enum OBM_CHECK = 32760;
1131 enum OBM_CHECKBOXES = 32759;
1132 enum OBM_CLOSE = 32754;
1133 enum OBM_COMBO = 32738;
1134 enum OBM_DNARROW = 32752;
1135 enum OBM_DNARROWD = 32742;
1136 enum OBM_DNARROWI = 32736;
1137 enum OBM_LFARROW = 32750;
1138 enum OBM_LFARROWI = 32734;
1139 enum OBM_LFARROWD = 32740;
1140 enum OBM_MNARROW = 32739;
1141 enum OBM_OLD_CLOSE = 32767;
1142 enum OBM_OLD_DNARROW = 32764;
1143 enum OBM_OLD_LFARROW = 32762;
1144 enum OBM_OLD_REDUCE = 32757;
1145 enum OBM_OLD_RESTORE = 32755;
1146 enum OBM_OLD_RGARROW = 32763;
1147 enum OBM_OLD_UPARROW = 32765;
1148 enum OBM_OLD_ZOOM = 32756;
1149 enum OBM_REDUCE = 32749;
1150 enum OBM_REDUCED = 32746;
1151 enum OBM_RESTORE = 32747;
1152 enum OBM_RESTORED = 32744;
1153 enum OBM_RGARROW = 32751;
1154 enum OBM_RGARROWD = 32741;
1155 enum OBM_RGARROWI = 32735;
1156 enum OBM_SIZE = 32766;
1157 enum OBM_UPARROW = 32753;
1158 enum OBM_UPARROWD = 32743;
1159 enum OBM_UPARROWI = 32737;
1160 enum OBM_ZOOM = 32748;
1161 enum OBM_ZOOMD = 32745;
1162 
1163 enum OCR_NORMAL = 32512;
1164 enum OCR_IBEAM = 32513;
1165 enum OCR_WAIT = 32514;
1166 enum OCR_CROSS = 32515;
1167 enum OCR_UP = 32516;
1168 enum OCR_SIZE = 32640;
1169 enum OCR_ICON = 32641;
1170 enum OCR_SIZENWSE = 32642;
1171 enum OCR_SIZENESW = 32643;
1172 enum OCR_SIZEWE = 32644;
1173 enum OCR_SIZENS = 32645;
1174 enum OCR_SIZEALL = 32646;
1175 enum OCR_NO = 32648;
1176 enum OCR_APPSTARTING = 32650;
1177 
1178 enum OIC_SAMPLE = 32512;
1179 enum OIC_HAND = 32513;
1180 enum OIC_QUES = 32514;
1181 enum OIC_BANG = 32515;
1182 enum OIC_NOTE = 32516;
1183 enum OIC_WINLOGO = 32517;
1184 enum OIC_WARNING = OIC_BANG;
1185 enum OIC_ERROR = OIC_HAND;
1186 enum OIC_INFORMATION = OIC_NOTE;
1187 
1188 enum HELPINFO_MENUITEM = 2;
1189 enum HELPINFO_WINDOW = 1;
1190 
1191 static if (_WIN32_WINNT >= 0x501) {
1192     enum {
1193         WTS_CONSOLE_CONNECT = 1,
1194         WTS_CONSOLE_DISCONNECT,
1195         WTS_REMOTE_CONNECT,
1196         WTS_REMOTE_DISCONNECT,
1197         WTS_SESSION_LOGON,
1198         WTS_SESSION_LOGOFF,
1199         WTS_SESSION_LOCK,
1200         WTS_SESSION_UNLOCK,
1201         WTS_SESSION_REMOTE_CONTROL // = 9
1202     }
1203 }
1204 
1205 enum MSGF_DIALOGBOX = 0;
1206 enum MSGF_MESSAGEBOX = 1;
1207 enum MSGF_MENU = 2;
1208 enum MSGF_MOVE = 3;
1209 enum MSGF_SIZE = 4;
1210 enum MSGF_SCROLLBAR = 5;
1211 enum MSGF_NEXTWINDOW = 6;
1212 enum MSGF_MAINLOOP = 8;
1213 enum MSGF_USER = 4096;
1214 
1215 enum {
1216     MOUSEEVENTF_MOVE       = 0x0001,
1217     MOUSEEVENTF_LEFTDOWN   = 0x0002,
1218     MOUSEEVENTF_LEFTUP     = 0x0004,
1219     MOUSEEVENTF_RIGHTDOWN  = 0x0008,
1220     MOUSEEVENTF_RIGHTUP    = 0x0010,
1221     MOUSEEVENTF_MIDDLEDOWN = 0x0020,
1222     MOUSEEVENTF_MIDDLEUP   = 0x0040,
1223     MOUSEEVENTF_XDOWN      = 0x0080,
1224     MOUSEEVENTF_XUP        = 0x0100,
1225     MOUSEEVENTF_WHEEL      = 0x0800,
1226     MOUSEEVENTF_ABSOLUTE   = 0x8000
1227 }
1228 
1229 enum PM_NOREMOVE = 0;
1230 enum PM_REMOVE = 1;
1231 enum PM_NOYIELD = 2;
1232 
1233 enum : HWND {
1234     HWND_BROADCAST = cast(HWND) 0xFFFF,
1235     HWND_MESSAGE   = cast(HWND)     -3,
1236     HWND_NOTOPMOST = cast(HWND)     -2,
1237     HWND_TOPMOST   = cast(HWND)     -1,
1238     HWND_TOP       = cast(HWND)      0,
1239     HWND_DESKTOP   = cast(HWND)      0,
1240     HWND_BOTTOM    = cast(HWND)      1
1241 }
1242 
1243 enum RDW_INVALIDATE      = 1;
1244 enum RDW_INTERNALPAINT   = 2;
1245 enum RDW_ERASE           = 4;
1246 enum RDW_VALIDATE        = 8;
1247 enum RDW_NOINTERNALPAINT = 16;
1248 enum RDW_NOERASE         = 32;
1249 enum RDW_NOCHILDREN      = 64;
1250 enum RDW_ALLCHILDREN     = 128;
1251 enum RDW_UPDATENOW       = 256;
1252 enum RDW_ERASENOW        = 512;
1253 enum RDW_FRAME           = 1024;
1254 enum RDW_NOFRAME         = 2048;
1255 
1256 enum {
1257     SMTO_NORMAL             = 0,
1258     SMTO_BLOCK              = 1,
1259     SMTO_ABORTIFHUNG        = 2,
1260     SMTO_NOTIMEOUTIFNOTHUNG = 8
1261 }
1262 
1263 enum SIF_ALL = 23;
1264 enum SIF_PAGE = 2;
1265 enum SIF_POS = 4;
1266 enum SIF_RANGE = 1;
1267 enum SIF_DISABLENOSCROLL = 8;
1268 enum SIF_TRACKPOS = 16;
1269 
1270 enum SWP_DRAWFRAME = 32;
1271 enum SWP_FRAMECHANGED = 32;
1272 enum SWP_HIDEWINDOW = 128;
1273 enum SWP_NOACTIVATE = 16;
1274 enum SWP_NOCOPYBITS = 256;
1275 enum SWP_NOMOVE = 2;
1276 enum SWP_NOSIZE = 1;
1277 enum SWP_NOREDRAW = 8;
1278 enum SWP_NOZORDER = 4;
1279 enum SWP_SHOWWINDOW = 64;
1280 enum SWP_NOOWNERZORDER = 512;
1281 enum SWP_NOREPOSITION = 512;
1282 enum SWP_NOSENDCHANGING = 1024;
1283 enum SWP_DEFERERASE = 8192;
1284 enum SWP_ASYNCWINDOWPOS = 16384;
1285 
1286 enum { // passed variously as int or WPARAM
1287     HSHELL_WINDOWCREATED    =     1,
1288     HSHELL_WINDOWDESTROYED,
1289     HSHELL_ACTIVATESHELLWINDOW,
1290     HSHELL_WINDOWACTIVATED,
1291     HSHELL_GETMINRECT,
1292     HSHELL_REDRAW,
1293     HSHELL_TASKMAN,
1294     HSHELL_LANGUAGE,     // =     8
1295     HSHELL_ENDTASK          =    10,
1296     HSHELL_ACCESSIBILITYSTATE,
1297     HSHELL_APPCOMMAND,   // =    12
1298     HSHELL_RUDEAPPACTIVATED = 32772,
1299     HSHELL_FLASH            = 32774
1300 }
1301 
1302 static if (_WIN32_WINNT >= 0x501) {
1303     enum {
1304         HSHELL_WINDOWREPLACED = 13,
1305         HSHELL_WINDOWREPLACING
1306     }
1307 }
1308 
1309 enum {
1310     SPI_GETBEEP                   = 0x0001,
1311     SPI_SETBEEP                   = 0x0002,
1312     SPI_GETMOUSE                  = 0x0003,
1313     SPI_SETMOUSE                  = 0x0004,
1314     SPI_GETBORDER                 = 0x0005,
1315     SPI_SETBORDER                 = 0x0006,
1316     SPI_GETKEYBOARDSPEED          = 0x000A,
1317     SPI_SETKEYBOARDSPEED          = 0x000B,
1318     SPI_LANGDRIVER                = 0x000C,
1319     SPI_ICONHORIZONTALSPACING     = 0x000D,
1320     SPI_GETSCREENSAVETIMEOUT      = 0x000E,
1321     SPI_SETSCREENSAVETIMEOUT      = 0x000F,
1322     SPI_GETSCREENSAVEACTIVE       = 0x0010,
1323     SPI_SETSCREENSAVEACTIVE       = 0x0011,
1324     SPI_GETGRIDGRANULARITY        = 0x0012,
1325     SPI_SETGRIDGRANULARITY        = 0x0013,
1326     SPI_SETDESKWALLPAPER          = 0x0014,
1327     SPI_SETDESKPATTERN            = 0x0015,
1328     SPI_GETKEYBOARDDELAY          = 0x0016,
1329     SPI_SETKEYBOARDDELAY          = 0x0017,
1330     SPI_ICONVERTICALSPACING       = 0x0018,
1331     SPI_GETICONTITLEWRAP          = 0x0019,
1332     SPI_SETICONTITLEWRAP          = 0x001A,
1333     SPI_GETMENUDROPALIGNMENT      = 0x001B,
1334     SPI_SETMENUDROPALIGNMENT      = 0x001C,
1335     SPI_SETDOUBLECLKWIDTH         = 0x001D,
1336     SPI_SETDOUBLECLKHEIGHT        = 0x001E,
1337     SPI_GETICONTITLELOGFONT       = 0x001F,
1338     SPI_SETDOUBLECLICKTIME        = 0x0020,
1339     SPI_SETMOUSEBUTTONSWAP        = 0x0021,
1340     SPI_SETICONTITLELOGFONT       = 0x0022,
1341     SPI_GETFASTTASKSWITCH         = 0x0023,
1342     SPI_SETFASTTASKSWITCH         = 0x0024,
1343     SPI_SETDRAGFULLWINDOWS        = 0x0025,
1344     SPI_GETDRAGFULLWINDOWS        = 0x0026,
1345     SPI_GETNONCLIENTMETRICS       = 0x0029,
1346     SPI_SETNONCLIENTMETRICS       = 0x002A,
1347     SPI_GETMINIMIZEDMETRICS       = 0x002B,
1348     SPI_SETMINIMIZEDMETRICS       = 0x002C,
1349     SPI_GETICONMETRICS            = 0x002D,
1350     SPI_SETICONMETRICS            = 0x002E,
1351     SPI_SETWORKAREA               = 0x002F,
1352     SPI_GETWORKAREA               = 0x0030,
1353     SPI_SETPENWINDOWS             = 0x0031,
1354     SPI_GETFILTERKEYS             = 0x0032,
1355     SPI_SETFILTERKEYS             = 0x0033,
1356     SPI_GETTOGGLEKEYS             = 0x0034,
1357     SPI_SETTOGGLEKEYS             = 0x0035,
1358     SPI_GETMOUSEKEYS              = 0x0036,
1359     SPI_SETMOUSEKEYS              = 0x0037,
1360     SPI_GETSHOWSOUNDS             = 0x0038,
1361     SPI_SETSHOWSOUNDS             = 0x0039,
1362     SPI_GETSTICKYKEYS             = 0x003A,
1363     SPI_SETSTICKYKEYS             = 0x003B,
1364     SPI_GETACCESSTIMEOUT          = 0x003C,
1365     SPI_SETACCESSTIMEOUT          = 0x003D,
1366     SPI_GETSERIALKEYS             = 0x003E,
1367     SPI_SETSERIALKEYS             = 0x003F,
1368     SPI_GETSOUNDSENTRY            = 0x0040,
1369     SPI_SETSOUNDSENTRY            = 0x0041,
1370     SPI_GETHIGHCONTRAST           = 0x0042,
1371     SPI_SETHIGHCONTRAST           = 0x0043,
1372     SPI_GETKEYBOARDPREF           = 0x0044,
1373     SPI_SETKEYBOARDPREF           = 0x0045,
1374     SPI_GETSCREENREADER           = 0x0046,
1375     SPI_SETSCREENREADER           = 0x0047,
1376     SPI_GETANIMATION              = 0x0048,
1377     SPI_SETANIMATION              = 0x0049,
1378     SPI_GETFONTSMOOTHING          = 0x004A,
1379     SPI_SETFONTSMOOTHING          = 0x004B,
1380     SPI_SETDRAGWIDTH              = 0x004C,
1381     SPI_SETDRAGHEIGHT             = 0x004D,
1382     SPI_SETHANDHELD               = 0x004E,
1383     SPI_GETLOWPOWERTIMEOUT        = 0x004F,
1384     SPI_GETPOWEROFFTIMEOUT        = 0x0050,
1385     SPI_SETLOWPOWERTIMEOUT        = 0x0051,
1386     SPI_SETPOWEROFFTIMEOUT        = 0x0052,
1387     SPI_GETLOWPOWERACTIVE         = 0x0053,
1388     SPI_GETPOWEROFFACTIVE         = 0x0054,
1389     SPI_SETLOWPOWERACTIVE         = 0x0055,
1390     SPI_SETPOWEROFFACTIVE         = 0x0056,
1391     SPI_SETCURSORS                = 0x0057,
1392     SPI_SETICONS                  = 0x0058,
1393     SPI_GETDEFAULTINPUTLANG       = 0x0059,
1394     SPI_SETDEFAULTINPUTLANG       = 0x005A,
1395     SPI_SETLANGTOGGLE             = 0x005B,
1396     SPI_GETWINDOWSEXTENSION       = 0x005C,
1397     SPI_SETMOUSETRAILS            = 0x005D,
1398     SPI_GETMOUSETRAILS            = 0x005E,
1399     SPI_GETSNAPTODEFBUTTON        = 0x005F,
1400     SPI_SETSNAPTODEFBUTTON        = 0x0060,
1401     //SPI_SCREENSAVERRUNNING        = 0x0061, // mistake in older MinGW?
1402     SPI_SETSCREENSAVERRUNNING     = 0x0061,
1403     SPI_GETMOUSEHOVERWIDTH        = 0x0062,
1404     SPI_SETMOUSEHOVERWIDTH        = 0x0063,
1405     SPI_GETMOUSEHOVERHEIGHT       = 0x0064,
1406     SPI_SETMOUSEHOVERHEIGHT       = 0x0065,
1407     SPI_GETMOUSEHOVERTIME         = 0x0066,
1408     SPI_SETMOUSEHOVERTIME         = 0x0067,
1409     SPI_GETWHEELSCROLLLINES       = 0x0068,
1410     SPI_SETWHEELSCROLLLINES       = 0x0069,
1411     SPI_GETMENUSHOWDELAY          = 0x006A,
1412     SPI_SETMENUSHOWDELAY          = 0x006B,
1413     SPI_GETSHOWIMEUI              = 0x006E,
1414     SPI_SETSHOWIMEUI              = 0x006F,
1415     SPI_GETMOUSESPEED             = 0x0070,
1416     SPI_SETMOUSESPEED             = 0x0071,
1417     SPI_GETSCREENSAVERRUNNING     = 0x0072,
1418     SPI_GETDESKWALLPAPER          = 0x0073,
1419     SPI_GETACTIVEWINDOWTRACKING   = 0x1000,
1420     SPI_SETACTIVEWINDOWTRACKING   = 0x1001,
1421     SPI_GETMENUANIMATION          = 0x1002,
1422     SPI_SETMENUANIMATION          = 0x1003,
1423     SPI_GETCOMBOBOXANIMATION      = 0x1004,
1424     SPI_SETCOMBOBOXANIMATION      = 0x1005,
1425     SPI_GETLISTBOXSMOOTHSCROLLING = 0x1006,
1426     SPI_SETLISTBOXSMOOTHSCROLLING = 0x1007,
1427     SPI_GETGRADIENTCAPTIONS       = 0x1008,
1428     SPI_SETGRADIENTCAPTIONS       = 0x1009,
1429     SPI_GETKEYBOARDCUES           = 0x100A,
1430     SPI_GETMENUUNDERLINES         = SPI_GETKEYBOARDCUES,
1431     SPI_SETKEYBOARDCUES           = 0x100B,
1432     SPI_SETMENUUNDERLINES         = SPI_SETKEYBOARDCUES,
1433     SPI_GETACTIVEWNDTRKZORDER     = 0x100C,
1434     SPI_SETACTIVEWNDTRKZORDER     = 0x100D,
1435     SPI_GETHOTTRACKING            = 0x100E,
1436     SPI_SETHOTTRACKING            = 0x100F,
1437     SPI_GETMENUFADE               = 0x1012,
1438     SPI_SETMENUFADE               = 0x1013,
1439     SPI_GETSELECTIONFADE          = 0x1014,
1440     SPI_SETSELECTIONFADE          = 0x1015,
1441     SPI_GETTOOLTIPANIMATION       = 0x1016,
1442     SPI_SETTOOLTIPANIMATION       = 0x1017,
1443     SPI_GETTOOLTIPFADE            = 0x1018,
1444     SPI_SETTOOLTIPFADE            = 0x1019,
1445     SPI_GETCURSORSHADOW           = 0x101A,
1446     SPI_SETCURSORSHADOW           = 0x101B,
1447     SPI_GETBLOCKSENDINPUTRESETS   = 0x1026,
1448     SPI_SETBLOCKSENDINPUTRESETS   = 0x1027,
1449     SPI_GETUIEFFECTS              = 0x103E,
1450     SPI_SETUIEFFECTS              = 0x103F,
1451     SPI_GETFOREGROUNDLOCKTIMEOUT  = 0x2000,
1452     SPI_SETFOREGROUNDLOCKTIMEOUT  = 0x2001,
1453     SPI_GETACTIVEWNDTRKTIMEOUT    = 0x2002,
1454     SPI_SETACTIVEWNDTRKTIMEOUT    = 0x2003,
1455     SPI_GETFOREGROUNDFLASHCOUNT   = 0x2004,
1456     SPI_SETFOREGROUNDFLASHCOUNT   = 0x2005,
1457     SPI_GETCARETWIDTH             = 0x2006,
1458     SPI_SETCARETWIDTH             = 0x2007
1459 }
1460 
1461 enum {
1462     SPIF_UPDATEINIFILE    = 1,
1463     SPIF_SENDWININICHANGE = 2,
1464     SPIF_SENDCHANGE       = SPIF_SENDWININICHANGE
1465 }
1466 
1467 // [Redefined] ATF_ONOFFFEEDBACK = 2
1468 // [Redefined] ATF_TIMEOUTON = 1
1469 enum WM_APP = 32768;
1470 enum WM_ACTIVATE = 6;
1471 enum WM_ACTIVATEAPP = 28;
1472 enum WM_AFXFIRST = 864;
1473 enum WM_AFXLAST = 895;
1474 enum WM_ASKCBFORMATNAME = 780;
1475 enum WM_CANCELJOURNAL = 75;
1476 enum WM_CANCELMODE = 31;
1477 enum WM_CAPTURECHANGED = 533;
1478 enum WM_CHANGECBCHAIN = 781;
1479 enum WM_CHAR = 258;
1480 enum WM_CHARTOITEM = 47;
1481 enum WM_CHILDACTIVATE = 34;
1482 enum WM_CLEAR = 771;
1483 enum WM_CLOSE = 16;
1484 enum WM_COMMAND = 273;
1485 enum WM_COMMNOTIFY = 68; // obsolete
1486 enum WM_COMPACTING = 65;
1487 enum WM_COMPAREITEM = 57;
1488 enum WM_CONTEXTMENU = 123;
1489 enum WM_COPY = 769;
1490 enum WM_COPYDATA = 74;
1491 enum WM_CREATE = 1;
1492 enum WM_CTLCOLORBTN = 309;
1493 enum WM_CTLCOLORDLG = 310;
1494 enum WM_CTLCOLOREDIT = 307;
1495 enum WM_CTLCOLORLISTBOX = 308;
1496 enum WM_CTLCOLORMSGBOX = 306;
1497 enum WM_CTLCOLORSCROLLBAR = 311;
1498 enum WM_CTLCOLORSTATIC = 312;
1499 enum WM_CUT = 768;
1500 enum WM_DEADCHAR = 259;
1501 enum WM_DELETEITEM = 45;
1502 enum WM_DESTROY = 2;
1503 enum WM_DESTROYCLIPBOARD = 775;
1504 enum WM_DEVICECHANGE = 537;
1505 enum WM_DEVMODECHANGE = 27;
1506 enum WM_DISPLAYCHANGE = 126;
1507 enum WM_DRAWCLIPBOARD = 776;
1508 enum WM_DRAWITEM = 43;
1509 enum WM_DROPFILES = 563;
1510 enum WM_ENABLE = 10;
1511 enum WM_ENDSESSION = 22;
1512 enum WM_ENTERIDLE = 289;
1513 enum WM_ENTERMENULOOP = 529;
1514 enum WM_ENTERSIZEMOVE = 561;
1515 enum WM_ERASEBKGND = 20;
1516 enum WM_EXITMENULOOP = 530;
1517 enum WM_EXITSIZEMOVE = 562;
1518 enum WM_FONTCHANGE = 29;
1519 enum WM_GETDLGCODE = 135;
1520 enum WM_GETFONT = 49;
1521 enum WM_GETHOTKEY = 51;
1522 enum WM_GETICON = 127;
1523 enum WM_GETMINMAXINFO = 36;
1524 enum WM_GETTEXT = 13;
1525 enum WM_GETTEXTLENGTH = 14;
1526 enum WM_HANDHELDFIRST = 856;
1527 enum WM_HANDHELDLAST = 863;
1528 enum WM_HELP = 83;
1529 enum WM_HOTKEY = 786;
1530 enum WM_HSCROLL = 276;
1531 enum WM_HSCROLLCLIPBOARD = 782;
1532 enum WM_ICONERASEBKGND = 39;
1533 enum WM_INITDIALOG = 272;
1534 enum WM_INITMENU = 278;
1535 enum WM_INITMENUPOPUP = 279;
1536 enum WM_INPUTLANGCHANGE = 81;
1537 enum WM_INPUTLANGCHANGEREQUEST = 80;
1538 enum WM_KEYDOWN = 256;
1539 enum WM_KEYUP = 257;
1540 enum WM_KILLFOCUS = 8;
1541 enum WM_MDIACTIVATE = 546;
1542 enum WM_MDICASCADE = 551;
1543 enum WM_MDICREATE = 544;
1544 enum WM_MDIDESTROY = 545;
1545 enum WM_MDIGETACTIVE = 553;
1546 enum WM_MDIICONARRANGE = 552;
1547 enum WM_MDIMAXIMIZE = 549;
1548 enum WM_MDINEXT = 548;
1549 enum WM_MDIREFRESHMENU = 564;
1550 enum WM_MDIRESTORE = 547;
1551 enum WM_MDISETMENU = 560;
1552 enum WM_MDITILE = 550;
1553 enum WM_MEASUREITEM = 44;
1554 enum WM_UNINITMENUPOPUP = 0x0125;
1555 enum WM_MENURBUTTONUP = 290;
1556 enum WM_MENUCOMMAND = 0x0126;
1557 enum WM_MENUGETOBJECT = 0x0124;
1558 enum WM_MENUDRAG = 0x0123;
1559 
1560 enum WM_CHANGEUISTATE = 0x0127;
1561 enum WM_UPDATEUISTATE = 0x0128;
1562 enum WM_QUERYUISTATE  = 0x0129;
1563 
1564 // LOWORD(wParam) values in WM_*UISTATE*
1565 enum {
1566     UIS_SET          =  1,
1567     UIS_CLEAR        =  2,
1568     UIS_INITIALIZE   =  3
1569 }
1570 
1571 // HIWORD(wParam) values in WM_*UISTATE*
1572 enum {
1573     UISF_HIDEFOCUS   =  0x1,
1574     UISF_HIDEACCEL   =  0x2
1575 }
1576 
1577 
1578 static if (_WIN32_WINNT >= 0x501) {
1579 
1580     // HIWORD(wParam) values in WM_*UISTATE*
1581     enum {
1582         UISF_ACTIVE      =  0x4
1583     }
1584 
1585 }
1586 
1587 enum WM_MENUCHAR = 288;
1588 enum WM_MENUSELECT = 287;
1589 enum WM_MOVE = 3;
1590 enum WM_MOVING = 534;
1591 enum WM_NCACTIVATE = 134;
1592 enum WM_NCCALCSIZE = 131;
1593 enum WM_NCCREATE = 129;
1594 enum WM_NCDESTROY = 130;
1595 enum WM_NCHITTEST = 132;
1596 enum WM_NCLBUTTONDBLCLK = 163;
1597 enum WM_NCLBUTTONDOWN = 161;
1598 enum WM_NCLBUTTONUP = 162;
1599 enum WM_NCMBUTTONDBLCLK = 169;
1600 enum WM_NCMBUTTONDOWN = 167;
1601 enum WM_NCMBUTTONUP = 168;
1602 enum WM_NCXBUTTONDOWN = 171;
1603 enum WM_NCXBUTTONUP = 172;
1604 enum WM_NCXBUTTONDBLCLK = 173;
1605 enum WM_NCMOUSEHOVER = 0x02A0;
1606 enum WM_NCMOUSELEAVE = 0x02A2;
1607 enum WM_NCMOUSEMOVE = 160;
1608 enum WM_NCPAINT = 133;
1609 enum WM_NCRBUTTONDBLCLK = 166;
1610 enum WM_NCRBUTTONDOWN = 164;
1611 enum WM_NCRBUTTONUP = 165;
1612 enum WM_NEXTDLGCTL = 40;
1613 enum WM_NEXTMENU = 531;
1614 enum WM_NOTIFY = 78;
1615 enum WM_NOTIFYFORMAT = 85;
1616 enum WM_NULL = 0;
1617 enum WM_PAINT = 15;
1618 enum WM_PAINTCLIPBOARD = 777;
1619 enum WM_PAINTICON = 38;
1620 enum WM_PALETTECHANGED = 785;
1621 enum WM_PALETTEISCHANGING = 784;
1622 enum WM_PARENTNOTIFY = 528;
1623 enum WM_PASTE = 770;
1624 enum WM_PENWINFIRST = 896;
1625 enum WM_PENWINLAST = 911;
1626 enum WM_POWER = 72;
1627 enum WM_POWERBROADCAST = 536;
1628 enum WM_PRINT = 791;
1629 enum WM_PRINTCLIENT = 792;
1630 enum WM_APPCOMMAND = 0x0319;
1631 enum WM_QUERYDRAGICON = 55;
1632 enum WM_QUERYENDSESSION = 17;
1633 enum WM_QUERYNEWPALETTE = 783;
1634 enum WM_QUERYOPEN = 19;
1635 enum WM_QUEUESYNC = 35;
1636 enum WM_QUIT = 18;
1637 enum WM_RENDERALLFORMATS = 774;
1638 enum WM_RENDERFORMAT = 773;
1639 enum WM_SETCURSOR = 32;
1640 enum WM_SETFOCUS = 7;
1641 enum WM_SETFONT = 48;
1642 enum WM_SETHOTKEY = 50;
1643 enum WM_SETICON = 128;
1644 enum WM_SETREDRAW = 11;
1645 enum WM_SETTEXT = 12;
1646 enum WM_SETTINGCHANGE = 26;
1647 enum WM_SHOWWINDOW = 24;
1648 enum WM_SIZE = 5;
1649 enum WM_SIZECLIPBOARD = 779;
1650 enum WM_SIZING = 532;
1651 enum WM_SPOOLERSTATUS = 42;
1652 enum WM_STYLECHANGED = 125;
1653 enum WM_STYLECHANGING = 124;
1654 enum WM_SYSCHAR = 262;
1655 enum WM_SYSCOLORCHANGE = 21;
1656 enum WM_SYSCOMMAND = 274;
1657 enum WM_SYSDEADCHAR = 263;
1658 enum WM_SYSKEYDOWN = 260;
1659 enum WM_SYSKEYUP = 261;
1660 static if (_WIN32_WINNT >= 0x501) {
1661     enum WM_TABLET_FIRST = 704;
1662     enum WM_TABLET_LAST = 735;
1663 }
1664 enum WM_TCARD = 82;
1665 enum WM_THEMECHANGED = 794;
1666 enum WM_TIMECHANGE = 30;
1667 enum WM_TIMER = 275;
1668 enum WM_UNDO = 772;
1669 enum WM_USER = 1024;
1670 enum WM_USERCHANGED = 84;
1671 enum WM_VKEYTOITEM = 46;
1672 enum WM_VSCROLL = 277;
1673 enum WM_VSCROLLCLIPBOARD = 778;
1674 enum WM_WINDOWPOSCHANGED = 71;
1675 enum WM_WINDOWPOSCHANGING = 70;
1676 enum WM_WININICHANGE = 26;
1677 static if (_WIN32_WINNT >= 0x501) {
1678 enum WM_WTSSESSION_CHANGE = 689;
1679 }
1680 enum WM_INPUT = 255;
1681 enum WM_KEYFIRST = 256;
1682 static if (_WIN32_WINNT >= 0x501) {
1683 enum WM_UNICHAR = 265;
1684 enum WM_KEYLAST = 265;
1685 enum UNICODE_NOCHAR = 0xFFFF;
1686 } else {
1687 enum WM_KEYLAST = 264;
1688 }
1689 enum WM_SYNCPAINT = 136;
1690 enum WM_MOUSEACTIVATE = 33;
1691 enum WM_MOUSEMOVE = 512;
1692 enum WM_LBUTTONDOWN = 513;
1693 enum WM_LBUTTONUP = 514;
1694 enum WM_LBUTTONDBLCLK = 515;
1695 enum WM_RBUTTONDOWN = 516;
1696 enum WM_RBUTTONUP = 517;
1697 enum WM_RBUTTONDBLCLK = 518;
1698 enum WM_MBUTTONDOWN = 519;
1699 enum WM_MBUTTONUP = 520;
1700 enum WM_MBUTTONDBLCLK = 521;
1701 enum WM_MOUSEWHEEL = 522;
1702 enum WM_MOUSEFIRST = 512;
1703 static if (_WIN32_WINNT >= 0x501) {
1704     enum WM_XBUTTONDOWN = 523;
1705     enum WM_XBUTTONUP = 524;
1706     enum WM_XBUTTONDBLCLK = 525;
1707 }
1708 static if (_WIN32_WINNT >= 0x600) { // FIXME: where did this come from? what version is it?
1709     enum WM_MOUSEHWHEEL = 526;
1710 }
1711 
1712 static if (_WIN32_WINNT >= 0x600) {
1713     enum WM_MOUSELAST = WM_MOUSEHWHEEL;
1714 } else static if (_WIN32_WINNT >= 0x501) {
1715     enum WM_MOUSELAST = WM_XBUTTONDBLCLK;
1716 } else {
1717     enum WM_MOUSELAST = WM_MOUSEWHEEL;
1718 }
1719 
1720 enum WM_MOUSEHOVER = 0x2A1;
1721 enum WM_MOUSELEAVE = 0x2A3;
1722 
1723 enum WHEEL_DELTA = 120;
1724 
1725 SHORT GET_WHEEL_DELTA_WPARAM()(WPARAM wparam) {
1726     return cast(SHORT) HIWORD(wparam);
1727 }
1728 
1729 enum WHEEL_PAGESCROLL = uint.max;
1730 
1731 enum BM_CLICK = 245;
1732 enum BM_GETCHECK = 240;
1733 enum BM_GETIMAGE = 246;
1734 enum BM_GETSTATE = 242;
1735 enum BM_SETCHECK = 241;
1736 enum BM_SETIMAGE = 247;
1737 static if (_WIN32_WINNT >= 0x600) {
1738     enum BM_SETDONTCLICK = 248;
1739 }
1740 enum BM_SETSTATE = 243;
1741 enum BM_SETSTYLE = 244;
1742 enum BN_CLICKED = 0;
1743 enum BN_DBLCLK = 5;
1744 enum BN_DISABLE = 4;
1745 enum BN_DOUBLECLICKED = 5;
1746 enum BN_HILITE = 2;
1747 enum BN_KILLFOCUS = 7;
1748 enum BN_PAINT = 1;
1749 enum BN_PUSHED = 2;
1750 enum BN_SETFOCUS = 6;
1751 enum BN_UNHILITE = 3;
1752 enum BN_UNPUSHED = 3;
1753 enum CB_ADDSTRING = 323;
1754 enum CB_DELETESTRING = 324;
1755 enum CB_DIR = 325;
1756 enum CB_FINDSTRING = 332;
1757 enum CB_FINDSTRINGEXACT = 344;
1758 enum CB_GETCOUNT = 326;
1759 enum CB_GETCURSEL = 327;
1760 enum CB_GETDROPPEDCONTROLRECT = 338;
1761 enum CB_GETDROPPEDSTATE = 343;
1762 enum CB_GETDROPPEDWIDTH = 351;
1763 enum CB_GETEDITSEL = 320;
1764 enum CB_GETEXTENDEDUI = 342;
1765 enum CB_GETHORIZONTALEXTENT = 349;
1766 enum CB_GETITEMDATA = 336;
1767 enum CB_GETITEMHEIGHT = 340;
1768 enum CB_GETLBTEXT = 328;
1769 enum CB_GETLBTEXTLEN = 329;
1770 enum CB_GETLOCALE = 346;
1771 enum CB_GETTOPINDEX = 347;
1772 enum CB_INITSTORAGE = 353;
1773 enum CB_INSERTSTRING = 330;
1774 enum CB_LIMITTEXT = 321;
1775 enum CB_RESETCONTENT = 331;
1776 enum CB_SELECTSTRING = 333;
1777 enum CB_SETCURSEL = 334;
1778 enum CB_SETDROPPEDWIDTH = 352;
1779 enum CB_SETEDITSEL = 322;
1780 enum CB_SETEXTENDEDUI = 341;
1781 enum CB_SETHORIZONTALEXTENT = 350;
1782 enum CB_SETITEMDATA = 337;
1783 enum CB_SETITEMHEIGHT = 339;
1784 enum CB_SETLOCALE = 345;
1785 enum CB_SETTOPINDEX = 348;
1786 enum CB_SHOWDROPDOWN = 335;
1787 
1788 static if (_WIN32_WINNT >= 0x501) {
1789 enum CB_GETCOMBOBOXINFO = 356;
1790 }
1791 
1792 enum CBN_CLOSEUP = 8;
1793 enum CBN_DBLCLK = 2;
1794 enum CBN_DROPDOWN = 7;
1795 enum CBN_EDITCHANGE = 5;
1796 enum CBN_EDITUPDATE = 6;
1797 enum CBN_ERRSPACE = (-1);
1798 enum CBN_KILLFOCUS = 4;
1799 enum CBN_SELCHANGE = 1;
1800 enum CBN_SELENDCANCEL = 10;
1801 enum CBN_SELENDOK = 9;
1802 enum CBN_SETFOCUS = 3;
1803 
1804 enum EM_CANUNDO = 198;
1805 enum EM_CHARFROMPOS = 215;
1806 enum EM_EMPTYUNDOBUFFER = 205;
1807 enum EM_FMTLINES = 200;
1808 enum EM_GETFIRSTVISIBLELINE = 206;
1809 enum EM_GETHANDLE = 189;
1810 enum EM_GETLIMITTEXT = 213;
1811 enum EM_GETLINE = 196;
1812 enum EM_GETLINECOUNT = 186;
1813 enum EM_GETMARGINS = 212;
1814 enum EM_GETMODIFY = 184;
1815 enum EM_GETPASSWORDCHAR = 210;
1816 enum EM_GETRECT = 178;
1817 enum EM_GETSEL = 176;
1818 enum EM_GETTHUMB = 190;
1819 enum EM_GETWORDBREAKPROC = 209;
1820 enum EM_LIMITTEXT = 197;
1821 enum EM_LINEFROMCHAR = 201;
1822 enum EM_LINEINDEX = 187;
1823 enum EM_LINELENGTH = 193;
1824 enum EM_LINESCROLL = 182;
1825 enum EM_POSFROMCHAR = 214;
1826 enum EM_REPLACESEL = 194;
1827 enum EM_SCROLL = 181;
1828 enum EM_SCROLLCARET = 183;
1829 enum EM_SETHANDLE = 188;
1830 enum EM_SETLIMITTEXT = 197;
1831 enum EM_SETMARGINS = 211;
1832 enum EM_SETMODIFY = 185;
1833 enum EM_SETPASSWORDCHAR = 204;
1834 enum EM_SETREADONLY = 207;
1835 enum EM_SETRECT = 179;
1836 enum EM_SETRECTNP = 180;
1837 enum EM_SETSEL = 177;
1838 enum EM_SETTABSTOPS = 203;
1839 enum EM_SETWORDBREAKPROC = 208;
1840 enum EM_UNDO = 199;
1841 
1842 enum EM_SETIMESTATUS = 216;
1843 enum EM_GETIMESTATUS = 217;
1844 
1845 enum EN_CHANGE = 768;
1846 enum EN_ERRSPACE = 1280;
1847 enum EN_HSCROLL = 1537;
1848 enum EN_KILLFOCUS = 512;
1849 enum EN_MAXTEXT = 1281;
1850 enum EN_SETFOCUS = 256;
1851 enum EN_UPDATE = 1024;
1852 enum EN_VSCROLL = 1538;
1853 
1854 enum LB_ADDFILE = 406;
1855 enum LB_ADDSTRING = 384;
1856 enum LB_DELETESTRING = 386;
1857 enum LB_DIR = 397;
1858 enum LB_FINDSTRING = 399;
1859 enum LB_FINDSTRINGEXACT = 418;
1860 enum LB_GETANCHORINDEX = 413;
1861 enum LB_GETCARETINDEX = 415;
1862 enum LB_GETCOUNT = 395;
1863 enum LB_GETCURSEL = 392;
1864 enum LB_GETHORIZONTALEXTENT = 403;
1865 enum LB_GETITEMDATA = 409;
1866 enum LB_GETITEMHEIGHT = 417;
1867 enum LB_GETITEMRECT = 408;
1868 enum LB_GETLOCALE = 422;
1869 enum LB_GETSEL = 391;
1870 enum LB_GETSELCOUNT = 400;
1871 enum LB_GETSELITEMS = 401;
1872 enum LB_GETTEXT = 393;
1873 enum LB_GETTEXTLEN = 394;
1874 enum LB_GETTOPINDEX = 398;
1875 enum LB_INITSTORAGE = 424;
1876 enum LB_INSERTSTRING = 385;
1877 enum LB_ITEMFROMPOINT = 425;
1878 enum LB_RESETCONTENT = 388;
1879 enum LB_SELECTSTRING = 396;
1880 enum LB_SELITEMRANGE = 411;
1881 enum LB_SELITEMRANGEEX = 387;
1882 enum LB_SETANCHORINDEX = 412;
1883 enum LB_SETCARETINDEX = 414;
1884 enum LB_SETCOLUMNWIDTH = 405;
1885 enum LB_SETCOUNT = 423;
1886 enum LB_SETCURSEL = 390;
1887 enum LB_SETHORIZONTALEXTENT = 404;
1888 enum LB_SETITEMDATA = 410;
1889 enum LB_SETITEMHEIGHT = 416;
1890 enum LB_SETLOCALE = 421;
1891 enum LB_SETSEL = 389;
1892 enum LB_SETTABSTOPS = 402;
1893 enum LB_SETTOPINDEX = 407;
1894 static if (_WIN32_WINNT >= 0x501) {
1895 enum LB_GETLISTBOXINFO = 434;
1896 }
1897 
1898 enum LBN_DBLCLK = 2;
1899 enum LBN_ERRSPACE = -2;
1900 enum LBN_KILLFOCUS = 5;
1901 enum LBN_SELCANCEL = 3;
1902 enum LBN_SELCHANGE = 1;
1903 enum LBN_SETFOCUS = 4;
1904 
1905 enum SBM_ENABLE_ARROWS = 228;
1906 enum SBM_GETPOS = 225;
1907 enum SBM_GETRANGE = 227;
1908 enum SBM_GETSCROLLINFO = 234;
1909 enum SBM_SETPOS = 224;
1910 enum SBM_SETRANGE = 226;
1911 enum SBM_SETRANGEREDRAW = 230;
1912 enum SBM_SETSCROLLINFO = 233;
1913 static if (_WIN32_WINNT >= 0x501) {
1914 enum SBM_GETSCROLLBARINFO = 235;
1915 }
1916 
1917 enum STM_GETICON = 369;
1918 enum STM_GETIMAGE = 371;
1919 enum STM_SETICON = 368;
1920 enum STM_SETIMAGE = 370;
1921 enum STN_CLICKED = 0;
1922 enum STN_DBLCLK = 1;
1923 enum STN_DISABLE = 3;
1924 enum STN_ENABLE = 2;
1925 enum STM_MSGMAX = 372;
1926 
1927 enum DM_GETDEFID   = WM_USER;
1928 enum DM_SETDEFID   = WM_USER+1;
1929 enum DM_REPOSITION = WM_USER+2;
1930 
1931 enum PSM_PAGEINFO  = WM_USER+100;
1932 enum PSM_SHEETINFO = WM_USER+101;
1933 
1934 enum PSI_SETACTIVE = 1;
1935 enum PSI_KILLACTIVE = 2;
1936 enum PSI_APPLY = 3;
1937 enum PSI_RESET = 4;
1938 enum PSI_HASHELP = 5;
1939 enum PSI_HELP = 6;
1940 enum PSI_CHANGED = 1;
1941 enum PSI_GUISTART = 2;
1942 enum PSI_REBOOT = 3;
1943 enum PSI_GETSIBLINGS = 4;
1944 
1945 enum DCX_WINDOW = 1;
1946 enum DCX_CACHE = 2;
1947 enum DCX_PARENTCLIP = 32;
1948 enum DCX_CLIPSIBLINGS = 16;
1949 enum DCX_CLIPCHILDREN = 8;
1950 enum DCX_NORESETATTRS = 4;
1951 enum DCX_INTERSECTUPDATE = 0x200;
1952 enum DCX_LOCKWINDOWUPDATE = 0x400;
1953 enum DCX_EXCLUDERGN = 64;
1954 enum DCX_INTERSECTRGN = 128;
1955 enum DCX_EXCLUDEUPDATE = 256;
1956 enum DCX_VALIDATE = 0x200000;
1957 
1958 enum GMDI_GOINTOPOPUPS = 2;
1959 enum GMDI_USEDISABLED = 1;
1960 enum FKF_AVAILABLE = 2;
1961 enum FKF_CLICKON = 64;
1962 enum FKF_FILTERKEYSON = 1;
1963 enum FKF_HOTKEYACTIVE = 4;
1964 enum FKF_HOTKEYSOUND = 16;
1965 enum FKF_CONFIRMHOTKEY = 8;
1966 enum FKF_INDICATOR = 32;
1967 enum HCF_HIGHCONTRASTON = 1;
1968 enum HCF_AVAILABLE = 2;
1969 enum HCF_HOTKEYACTIVE = 4;
1970 enum HCF_CONFIRMHOTKEY = 8;
1971 enum HCF_HOTKEYSOUND = 16;
1972 enum HCF_INDICATOR = 32;
1973 enum HCF_HOTKEYAVAILABLE = 64;
1974 enum MKF_AVAILABLE = 2;
1975 enum MKF_CONFIRMHOTKEY = 8;
1976 enum MKF_HOTKEYACTIVE = 4;
1977 enum MKF_HOTKEYSOUND = 16;
1978 enum MKF_INDICATOR = 32;
1979 enum MKF_MOUSEKEYSON = 1;
1980 enum MKF_MODIFIERS = 64;
1981 enum MKF_REPLACENUMBERS = 128;
1982 enum SERKF_ACTIVE = 8;  // May be obsolete. Not in recent MS docs.
1983 enum SERKF_AVAILABLE = 2;
1984 enum SERKF_INDICATOR = 4;
1985 enum SERKF_SERIALKEYSON = 1;
1986 enum SSF_AVAILABLE = 2;
1987 enum SSF_SOUNDSENTRYON = 1;
1988 enum SSTF_BORDER = 2;
1989 enum SSTF_CHARS = 1;
1990 enum SSTF_DISPLAY = 3;
1991 enum SSTF_NONE = 0;
1992 enum SSGF_DISPLAY = 3;
1993 enum SSGF_NONE = 0;
1994 enum SSWF_CUSTOM = 4;
1995 enum SSWF_DISPLAY = 3;
1996 enum SSWF_NONE = 0;
1997 enum SSWF_TITLE = 1;
1998 enum SSWF_WINDOW = 2;
1999 enum SKF_AUDIBLEFEEDBACK = 64;
2000 enum SKF_AVAILABLE = 2;
2001 enum SKF_CONFIRMHOTKEY = 8;
2002 enum SKF_HOTKEYACTIVE = 4;
2003 enum SKF_HOTKEYSOUND = 16;
2004 enum SKF_INDICATOR = 32;
2005 enum SKF_STICKYKEYSON = 1;
2006 enum SKF_TRISTATE = 128;
2007 enum SKF_TWOKEYSOFF = 256;
2008 enum TKF_AVAILABLE = 2;
2009 enum TKF_CONFIRMHOTKEY = 8;
2010 enum TKF_HOTKEYACTIVE = 4;
2011 enum TKF_HOTKEYSOUND = 16;
2012 enum TKF_TOGGLEKEYSON = 1;
2013 enum MDITILE_SKIPDISABLED = 2;
2014 enum MDITILE_HORIZONTAL = 1;
2015 enum MDITILE_VERTICAL = 0;
2016 
2017 enum {
2018     VK_LBUTTON = 0x01,
2019     VK_RBUTTON = 0x02,
2020     VK_CANCEL = 0x03,
2021     VK_MBUTTON = 0x04,
2022     VK_XBUTTON1 = 0x05,
2023     VK_XBUTTON2 = 0x06,
2024     VK_BACK = 0x08,
2025     VK_TAB = 0x09,
2026     VK_CLEAR = 0x0C,
2027     VK_RETURN = 0x0D,
2028     VK_SHIFT = 0x10,
2029     VK_CONTROL = 0x11,
2030     VK_MENU = 0x12,
2031     VK_PAUSE = 0x13,
2032     VK_CAPITAL = 0x14,
2033     VK_KANA = 0x15,
2034     VK_HANGEUL = 0x15,
2035     VK_HANGUL = 0x15,
2036     VK_JUNJA = 0x17,
2037     VK_FINAL = 0x18,
2038     VK_HANJA = 0x19,
2039     VK_KANJI = 0x19,
2040     VK_ESCAPE = 0x1B,
2041     VK_CONVERT = 0x1C,
2042     VK_NONCONVERT = 0x1D,
2043     VK_ACCEPT = 0x1E,
2044     VK_MODECHANGE = 0x1F,
2045     VK_SPACE = 0x20,
2046     VK_PRIOR = 0x21,
2047     VK_NEXT = 0x22,
2048     VK_END = 0x23,
2049     VK_HOME = 0x24,
2050     VK_LEFT = 0x25,
2051     VK_UP = 0x26,
2052     VK_RIGHT = 0x27,
2053     VK_DOWN = 0x28,
2054     VK_SELECT = 0x29,
2055     VK_PRINT = 0x2A,
2056     VK_EXECUTE = 0x2B,
2057     VK_SNAPSHOT = 0x2C,
2058     VK_INSERT = 0x2D,
2059     VK_DELETE = 0x2E,
2060     VK_HELP = 0x2F,
2061     VK_LWIN = 0x5B,
2062     VK_RWIN = 0x5C,
2063     VK_APPS = 0x5D,
2064     VK_SLEEP = 0x5F,
2065     VK_NUMPAD0 = 0x60,
2066     VK_NUMPAD1 = 0x61,
2067     VK_NUMPAD2 = 0x62,
2068     VK_NUMPAD3 = 0x63,
2069     VK_NUMPAD4 = 0x64,
2070     VK_NUMPAD5 = 0x65,
2071     VK_NUMPAD6 = 0x66,
2072     VK_NUMPAD7 = 0x67,
2073     VK_NUMPAD8 = 0x68,
2074     VK_NUMPAD9 = 0x69,
2075     VK_MULTIPLY = 0x6A,
2076     VK_ADD = 0x6B,
2077     VK_SEPARATOR = 0x6C,
2078     VK_SUBTRACT = 0x6D,
2079     VK_DECIMAL = 0x6E,
2080     VK_DIVIDE = 0x6F,
2081     VK_F1 = 0x70,
2082     VK_F2 = 0x71,
2083     VK_F3 = 0x72,
2084     VK_F4 = 0x73,
2085     VK_F5 = 0x74,
2086     VK_F6 = 0x75,
2087     VK_F7 = 0x76,
2088     VK_F8 = 0x77,
2089     VK_F9 = 0x78,
2090     VK_F10 = 0x79,
2091     VK_F11 = 0x7A,
2092     VK_F12 = 0x7B,
2093     VK_F13 = 0x7C,
2094     VK_F14 = 0x7D,
2095     VK_F15 = 0x7E,
2096     VK_F16 = 0x7F,
2097     VK_F17 = 0x80,
2098     VK_F18 = 0x81,
2099     VK_F19 = 0x82,
2100     VK_F20 = 0x83,
2101     VK_F21 = 0x84,
2102     VK_F22 = 0x85,
2103     VK_F23 = 0x86,
2104     VK_F24 = 0x87,
2105     VK_NUMLOCK = 0x90,
2106     VK_SCROLL = 0x91,
2107     VK_LSHIFT = 0xA0,
2108     VK_RSHIFT = 0xA1,
2109     VK_LCONTROL = 0xA2,
2110     VK_RCONTROL = 0xA3,
2111     VK_LMENU = 0xA4,
2112     VK_RMENU = 0xA5,
2113     VK_BROWSER_BACK = 0xA6,
2114     VK_BROWSER_FORWARD = 0xA7,
2115     VK_BROWSER_REFRESH = 0xA8,
2116     VK_BROWSER_STOP = 0xA9,
2117     VK_BROWSER_SEARCH = 0xAA,
2118     VK_BROWSER_FAVORITES = 0xAB,
2119     VK_BROWSER_HOME = 0xAC,
2120     VK_VOLUME_MUTE = 0xAD,
2121     VK_VOLUME_DOWN = 0xAE,
2122     VK_VOLUME_UP = 0xAF,
2123     VK_MEDIA_NEXT_TRACK = 0xB0,
2124     VK_MEDIA_PREV_TRACK = 0xB1,
2125     VK_MEDIA_STOP = 0xB2,
2126     VK_MEDIA_PLAY_PAUSE = 0xB3,
2127     VK_LAUNCH_MAIL = 0xB4,
2128     VK_LAUNCH_MEDIA_SELECT = 0xB5,
2129     VK_LAUNCH_APP1 = 0xB6,
2130     VK_LAUNCH_APP2 = 0xB7,
2131     VK_OEM_1 = 0xBA,
2132     VK_OEM_PLUS = 0xBB,
2133     VK_OEM_COMMA = 0xBC,
2134     VK_OEM_MINUS = 0xBD,
2135     VK_OEM_PERIOD = 0xBE,
2136     VK_OEM_2 = 0xBF,
2137     VK_OEM_3 = 0xC0,
2138     VK_OEM_4 = 0xDB,
2139     VK_OEM_5 = 0xDC,
2140     VK_OEM_6 = 0xDD,
2141     VK_OEM_7 = 0xDE,
2142     VK_OEM_8 = 0xDF,
2143     VK_OEM_102 = 0xE2,
2144     VK_PROCESSKEY = 0xE5,
2145     VK_PACKET = 0xE7,
2146     VK_ATTN = 0xF6,
2147     VK_CRSEL = 0xF7,
2148     VK_EXSEL = 0xF8,
2149     VK_EREOF = 0xF9,
2150     VK_PLAY = 0xFA,
2151     VK_ZOOM = 0xFB,
2152     VK_NONAME = 0xFC,
2153     VK_PA1 = 0xFD,
2154     VK_OEM_CLEAR = 0xFE,
2155 }
2156 
2157 enum TME_HOVER = 1;
2158 enum TME_LEAVE = 2;
2159 enum TME_QUERY = 0x40000000;
2160 enum TME_CANCEL = 0x80000000;
2161 
2162 enum HOVER_DEFAULT = 0xFFFFFFFF;
2163 
2164 enum MK_LBUTTON = 1;
2165 enum MK_RBUTTON = 2;
2166 enum MK_SHIFT = 4;
2167 enum MK_CONTROL = 8;
2168 enum MK_MBUTTON = 16;
2169 enum MK_XBUTTON1 = 32;
2170 enum MK_XBUTTON2 = 64;
2171 
2172 enum {
2173     TPM_RECURSE      = 0x0001,
2174     TPM_LEFTBUTTON   = 0,
2175     TPM_RIGHTBUTTON  = 0x0002,
2176     TPM_LEFTALIGN    = 0,
2177     TPM_CENTERALIGN  = 0x0004,
2178     TPM_RIGHTALIGN   = 0x0008,
2179     TPM_TOPALIGN     = 0,
2180     TPM_VCENTERALIGN = 0x0010,
2181     TPM_BOTTOMALIGN  = 0x0020,
2182     TPM_HORIZONTAL   = 0,
2183     TPM_VERTICAL     = 0x0040,
2184     TPM_NONOTIFY     = 0x0080,
2185     TPM_RETURNCMD    = 0x0100
2186 }
2187 
2188 enum HELP_COMMAND = 0x102;
2189 enum HELP_CONTENTS = 3;
2190 enum HELP_CONTEXT = 1;
2191 enum HELP_CONTEXTPOPUP = 8;
2192 enum HELP_FORCEFILE = 9;
2193 enum HELP_HELPONHELP = 4;
2194 enum HELP_INDEX = 3;
2195 enum HELP_KEY = 0x101;
2196 enum HELP_MULTIKEY = 0x201;
2197 enum HELP_PARTIALKEY = 0x105;
2198 enum HELP_QUIT = 2;
2199 enum HELP_SETCONTENTS = 5;
2200 enum HELP_SETINDEX = 5;
2201 enum HELP_SETWINPOS = 0x203;
2202 enum HELP_CONTEXTMENU = 0xa;
2203 enum HELP_FINDER = 0xb;
2204 enum HELP_WM_HELP = 0xc;
2205 enum HELP_TCARD = 0x8000;
2206 enum HELP_TCARD_DATA = 16;
2207 enum HELP_TCARD_OTHER_CALLER = 0x11;
2208 
2209 enum IDH_NO_HELP = 28440;
2210 enum IDH_MISSING_CONTEXT = 28441;
2211 enum IDH_GENERIC_HELP_BUTTON = 28442;
2212 enum IDH_OK = 28443;
2213 enum IDH_CANCEL = 28444;
2214 enum IDH_HELP = 28445;
2215 
2216 enum LB_CTLCODE = 0;
2217 enum LB_OKAY = 0;
2218 enum LB_ERR = -1;
2219 enum LB_ERRSPACE = -2;
2220 
2221 enum CB_OKAY = 0;
2222 enum CB_ERR = -1;
2223 enum CB_ERRSPACE = -2;
2224 
2225 enum HIDE_WINDOW = 0;
2226 
2227 enum SHOW_OPENWINDOW = 1;
2228 enum SHOW_ICONWINDOW = 2;
2229 enum SHOW_FULLSCREEN = 3;
2230 enum SHOW_OPENNOACTIVATE = 4;
2231 
2232 enum KF_EXTENDED = 256;
2233 enum KF_DLGMODE = 2048;
2234 enum KF_MENUMODE = 4096;
2235 enum KF_ALTDOWN = 8192;
2236 enum KF_REPEAT = 16384;
2237 enum KF_UP = 32768;
2238 
2239 enum WSF_VISIBLE = 1;
2240 
2241 enum PWR_OK = 1;
2242 enum PWR_FAIL = -1;
2243 enum PWR_SUSPENDREQUEST = 1;
2244 enum PWR_SUSPENDRESUME = 2;
2245 enum PWR_CRITICALRESUME = 3;
2246 
2247 enum NFR_ANSI = 1;
2248 enum NFR_UNICODE = 2;
2249 enum NF_QUERY = 3;
2250 enum NF_REQUERY = 4;
2251 
2252 enum MENULOOP_WINDOW = 0;
2253 enum MENULOOP_POPUP = 1;
2254 
2255 enum WMSZ_LEFT = 1;
2256 enum WMSZ_RIGHT = 2;
2257 enum WMSZ_TOP = 3;
2258 enum WMSZ_TOPLEFT = 4;
2259 enum WMSZ_TOPRIGHT = 5;
2260 enum WMSZ_BOTTOM = 6;
2261 enum WMSZ_BOTTOMLEFT = 7;
2262 enum WMSZ_BOTTOMRIGHT = 8;
2263 
2264 enum HTERROR = -2;
2265 enum HTTRANSPARENT = -1;
2266 enum HTNOWHERE = 0;
2267 enum HTCLIENT = 1;
2268 enum HTCAPTION = 2;
2269 enum HTSYSMENU = 3;
2270 enum HTGROWBOX = 4;
2271 enum HTSIZE = 4;
2272 enum HTMENU = 5;
2273 enum HTHSCROLL = 6;
2274 enum HTVSCROLL = 7;
2275 enum HTMINBUTTON = 8;
2276 enum HTMAXBUTTON = 9;
2277 enum HTREDUCE = 8;
2278 enum HTZOOM = 9;
2279 enum HTLEFT = 10;
2280 enum HTSIZEFIRST = 10;
2281 enum HTRIGHT = 11;
2282 enum HTTOP = 12;
2283 enum HTTOPLEFT = 13;
2284 enum HTTOPRIGHT = 14;
2285 enum HTBOTTOM = 15;
2286 enum HTBOTTOMLEFT = 16;
2287 enum HTBOTTOMRIGHT = 17;
2288 enum HTSIZELAST = 17;
2289 enum HTBORDER = 18;
2290 enum HTOBJECT = 19;
2291 enum HTCLOSE = 20;
2292 enum HTHELP = 21;
2293 
2294 enum MA_ACTIVATE = 1;
2295 enum MA_ACTIVATEANDEAT = 2;
2296 enum MA_NOACTIVATE = 3;
2297 enum MA_NOACTIVATEANDEAT = 4;
2298 
2299 enum SIZE_RESTORED = 0;
2300 enum SIZE_MINIMIZED = 1;
2301 enum SIZE_MAXIMIZED = 2;
2302 enum SIZE_MAXSHOW = 3;
2303 enum SIZE_MAXHIDE = 4;
2304 
2305 enum SIZENORMAL = 0;
2306 enum SIZEICONIC = 1;
2307 enum SIZEFULLSCREEN = 2;
2308 enum SIZEZOOMSHOW = 3;
2309 enum SIZEZOOMHIDE = 4;
2310 
2311 enum WVR_ALIGNTOP = 16;
2312 enum WVR_ALIGNLEFT = 32;
2313 enum WVR_ALIGNBOTTOM = 64;
2314 enum WVR_ALIGNRIGHT = 128;
2315 enum WVR_HREDRAW = 256;
2316 enum WVR_VREDRAW = 512;
2317 enum WVR_REDRAW = (WVR_HREDRAW|WVR_VREDRAW);
2318 enum WVR_VALIDRECTS = 1024;
2319 
2320 enum PRF_CHECKVISIBLE = 1;
2321 enum PRF_NONCLIENT = 2;
2322 enum PRF_CLIENT = 4;
2323 enum PRF_ERASEBKGND = 8;
2324 enum PRF_CHILDREN = 16;
2325 enum PRF_OWNED = 32;
2326 
2327 enum IDANI_OPEN = 1;
2328 enum IDANI_CLOSE = 2;
2329 enum IDANI_CAPTION = 3;
2330 
2331 enum WPF_RESTORETOMAXIMIZED = 2;
2332 enum WPF_SETMINPOSITION = 1;
2333 
2334 enum ODT_MENU = 1;
2335 enum ODT_LISTBOX = 2;
2336 enum ODT_COMBOBOX = 3;
2337 enum ODT_BUTTON = 4;
2338 enum ODT_STATIC = 5;
2339 enum ODA_DRAWENTIRE = 1;
2340 enum ODA_SELECT = 2;
2341 enum ODA_FOCUS = 4;
2342 enum ODS_SELECTED = 1;
2343 enum ODS_GRAYED = 2;
2344 enum ODS_DISABLED = 4;
2345 enum ODS_CHECKED = 8;
2346 enum ODS_FOCUS = 16;
2347 enum ODS_DEFAULT = 32;
2348 enum ODS_COMBOBOXEDIT = 4096;
2349 
2350 enum IDHOT_SNAPWINDOW = -1;
2351 enum IDHOT_SNAPDESKTOP = -2;
2352 
2353 enum DBWF_LPARAMPOINTER = 0x8000;
2354 enum DLGWINDOWEXTRA = 30;
2355 enum MNC_IGNORE = 0;
2356 enum MNC_CLOSE = 1;
2357 enum MNC_EXECUTE = 2;
2358 enum MNC_SELECT = 3;
2359 enum DOF_EXECUTABLE = 0x8001;
2360 enum DOF_DOCUMENT = 0x8002;
2361 enum DOF_DIRECTORY = 0x8003;
2362 enum DOF_MULTIPLE = 0x8004;
2363 enum DOF_PROGMAN = 1;
2364 enum DOF_SHELLDATA = 2;
2365 enum DO_DROPFILE = 0x454C4946;
2366 enum DO_PRINTFILE = 0x544E5250;
2367 
2368 enum SC_SIZE = 0xF000;
2369 enum SC_MOVE = 0xF010;
2370 enum SC_MINIMIZE = 0xF020;
2371 enum SC_ICON = 0xf020;
2372 enum SC_MAXIMIZE = 0xF030;
2373 enum SC_ZOOM = 0xF030;
2374 enum SC_NEXTWINDOW = 0xF040;
2375 enum SC_PREVWINDOW = 0xF050;
2376 enum SC_CLOSE = 0xF060;
2377 enum SC_VSCROLL = 0xF070;
2378 enum SC_HSCROLL = 0xF080;
2379 enum SC_MOUSEMENU = 0xF090;
2380 enum SC_KEYMENU = 0xF100;
2381 enum SC_ARRANGE = 0xF110;
2382 enum SC_RESTORE = 0xF120;
2383 enum SC_TASKLIST = 0xF130;
2384 enum SC_SCREENSAVE = 0xF140;
2385 enum SC_HOTKEY = 0xF150;
2386 enum SC_DEFAULT = 0xF160;
2387 enum SC_MONITORPOWER = 0xF170;
2388 enum SC_CONTEXTHELP = 0xF180;
2389 enum SC_SEPARATOR = 0xF00F;
2390 
2391 enum EC_LEFTMARGIN = 1;
2392 enum EC_RIGHTMARGIN = 2;
2393 enum EC_USEFONTINFO = 0xffff;
2394 
2395 enum DC_HASDEFID = 0x534B;
2396 
2397 enum DLGC_WANTARROWS = 1;
2398 enum DLGC_WANTTAB = 2;
2399 enum DLGC_WANTALLKEYS = 4;
2400 enum DLGC_WANTMESSAGE = 4;
2401 enum DLGC_HASSETSEL = 8;
2402 enum DLGC_DEFPUSHBUTTON = 16;
2403 enum DLGC_UNDEFPUSHBUTTON = 32;
2404 enum DLGC_RADIOBUTTON = 64;
2405 enum DLGC_WANTCHARS = 128;
2406 enum DLGC_STATIC = 256;
2407 enum DLGC_BUTTON = 0x2000;
2408 
2409 enum WA_INACTIVE = 0;
2410 enum WA_ACTIVE = 1;
2411 enum WA_CLICKACTIVE = 2;
2412 
2413 enum ICON_SMALL = 0;
2414 enum ICON_BIG = 1;
2415 static if (_WIN32_WINNT >= 0x501) {
2416 enum ICON_SMALL2 = 2;
2417 }
2418 
2419 enum HBITMAP
2420     HBMMENU_CALLBACK = cast(HBITMAP)-1,
2421     HBMMENU_SYSTEM = cast(HBITMAP)1,
2422     HBMMENU_MBAR_RESTORE = cast(HBITMAP)2,
2423     HBMMENU_MBAR_MINIMIZE = cast(HBITMAP)3,
2424     HBMMENU_MBAR_CLOSE = cast(HBITMAP)5,
2425     HBMMENU_MBAR_CLOSE_D = cast(HBITMAP)6,
2426     HBMMENU_MBAR_MINIMIZE_D = cast(HBITMAP)7,
2427     HBMMENU_POPUP_CLOSE = cast(HBITMAP)8,
2428     HBMMENU_POPUP_RESTORE = cast(HBITMAP)9,
2429     HBMMENU_POPUP_MAXIMIZE = cast(HBITMAP)10,
2430     HBMMENU_POPUP_MINIMIZE = cast(HBITMAP)11;
2431 
2432 enum MOD_ALT = 1;
2433 enum MOD_CONTROL = 2;
2434 enum MOD_SHIFT = 4;
2435 enum MOD_WIN = 8;
2436 enum MOD_IGNORE_ALL_MODIFIER = 1024;
2437 enum MOD_ON_KEYUP = 2048;
2438 enum MOD_RIGHT = 16384;
2439 enum MOD_LEFT = 32768;
2440 
2441 enum LLKHF_EXTENDED = (KF_EXTENDED >> 8);
2442 enum LLKHF_INJECTED = 0x00000010;
2443 enum LLKHF_ALTDOWN = (KF_ALTDOWN >> 8);
2444 enum LLKHF_UP = (KF_UP >> 8);
2445 
2446 enum CURSOR_SHOWING = 0x00000001;
2447 enum WS_ACTIVECAPTION = 0x00000001;
2448 enum ENDSESSION_LOGOFF = 0x80000000;
2449 
2450 enum GA_PARENT    = 1;
2451 enum GA_ROOT      = 2;
2452 enum GA_ROOTOWNER = 3;
2453 
2454 enum {
2455     MAPVK_VK_TO_VSC,
2456     MAPVK_VSC_TO_VK,
2457     MAPVK_VK_TO_CHAR,
2458     MAPVK_VSC_TO_VK_EX,
2459     MAPVK_VK_TO_VSC_EX // = 4
2460 }
2461 
2462 enum {
2463     INPUT_MOUSE,
2464     INPUT_KEYBOARD,
2465     INPUT_HARDWARE // = 2
2466 }
2467 
2468 // Callbacks
2469 // ---------
2470 extern (Windows) nothrow {
2471     alias INT_PTR function(HWND, UINT, WPARAM, LPARAM)   DLGPROC;
2472     alias void function(HWND, UINT, UINT_PTR, DWORD)     TIMERPROC;
2473     alias BOOL function(HDC, LPARAM, int)                GRAYSTRINGPROC;
2474     alias LRESULT function(int, WPARAM, LPARAM)          HOOKPROC;
2475     alias BOOL function(HWND, LPCSTR, HANDLE)            PROPENUMPROCA;
2476     alias BOOL function(HWND, LPCWSTR, HANDLE)           PROPENUMPROCW;
2477     alias BOOL function(HWND, LPSTR, HANDLE, ULONG_PTR)  PROPENUMPROCEXA;
2478     alias BOOL function(HWND, LPWSTR, HANDLE, ULONG_PTR) PROPENUMPROCEXW;
2479     alias int function(LPSTR, int, int, int)             EDITWORDBREAKPROCA;
2480     alias int function(LPWSTR, int, int, int)            EDITWORDBREAKPROCW;
2481     alias LRESULT function(HWND, UINT, WPARAM, LPARAM)   WNDPROC;
2482     alias BOOL function(HDC, LPARAM, WPARAM, int, int)   DRAWSTATEPROC;
2483     alias BOOL function(HWND, LPARAM)                    WNDENUMPROC;
2484     alias BOOL function(HWND, LPARAM)                    ENUMWINDOWSPROC;
2485     alias void function(LPHELPINFO)                      MSGBOXCALLBACK;
2486 
2487     alias BOOL function(HMONITOR, HDC, LPRECT, LPARAM)   MONITORENUMPROC;
2488     alias BOOL function(LPSTR, LPARAM)                   NAMEENUMPROCA;
2489     alias BOOL function(LPWSTR, LPARAM)                  NAMEENUMPROCW;
2490     alias void function(HWND, UINT, ULONG_PTR, LRESULT)  SENDASYNCPROC;
2491 
2492     alias NAMEENUMPROCA DESKTOPENUMPROCA;
2493     alias NAMEENUMPROCW DESKTOPENUMPROCW;
2494     alias NAMEENUMPROCA WINSTAENUMPROCA;
2495     alias NAMEENUMPROCW WINSTAENUMPROCW;
2496 }
2497 
2498 mixin DECLARE_HANDLE!("HDWP");
2499 mixin DECLARE_HANDLE!("HDEVNOTIFY");
2500 
2501 struct MENUGETOBJECTINFO {
2502     DWORD dwFlags;
2503     UINT  uPos;
2504     HMENU hmenu;
2505     PVOID riid;
2506     PVOID pvObj;
2507 }
2508 alias MENUGETOBJECTINFO* PMENUGETOBJECTINFO;
2509 
2510 struct ACCEL {
2511     BYTE fVirt;
2512     WORD key;
2513     WORD cmd;
2514 }
2515 alias ACCEL* LPACCEL;
2516 
2517 struct ACCESSTIMEOUT {
2518     UINT  cbSize = ACCESSTIMEOUT.sizeof;
2519     DWORD dwFlags;
2520     DWORD iTimeOutMSec;
2521 }
2522 alias ACCESSTIMEOUT* LPACCESSTIMEOUT;
2523 
2524 struct ANIMATIONINFO {
2525     UINT cbSize = ANIMATIONINFO.sizeof;
2526     int  iMinAnimate;
2527 }
2528 alias ANIMATIONINFO* LPANIMATIONINFO;
2529 
2530 struct CREATESTRUCTA {
2531     LPVOID    lpCreateParams;
2532     HINSTANCE hInstance;
2533     HMENU     hMenu;
2534     HWND      hwndParent;
2535     int       cy;
2536     int       cx;
2537     int       y;
2538     int       x;
2539     LONG      style;
2540     LPCSTR    lpszName;
2541     LPCSTR    lpszClass;
2542     DWORD     dwExStyle;
2543 }
2544 alias CREATESTRUCTA* LPCREATESTRUCTA;
2545 
2546 struct CREATESTRUCTW {
2547     LPVOID    lpCreateParams;
2548     HINSTANCE hInstance;
2549     HMENU     hMenu;
2550     HWND      hwndParent;
2551     int       cy;
2552     int       cx;
2553     int       y;
2554     int       x;
2555     LONG      style;
2556     LPCWSTR   lpszName;
2557     LPCWSTR   lpszClass;
2558     DWORD     dwExStyle;
2559 }
2560 alias CREATESTRUCTW* LPCREATESTRUCTW;
2561 
2562 struct CBT_CREATEWNDA {
2563     LPCREATESTRUCTA lpcs;
2564     HWND            hwndInsertAfter;
2565 }
2566 alias CBT_CREATEWNDA* LPCBT_CREATEWNDA;
2567 
2568 struct CBT_CREATEWNDW {
2569     LPCREATESTRUCTW lpcs;
2570     HWND            hwndInsertAfter;
2571 }
2572 alias CBT_CREATEWNDW* LPCBT_CREATEWNDW;
2573 
2574 struct CBTACTIVATESTRUCT {
2575     BOOL fMouse;
2576     HWND hWndActive;
2577 }
2578 alias CBTACTIVATESTRUCT* LPCBTACTIVATESTRUCT;
2579 
2580 static if (_WIN32_WINNT >= 0x501) {
2581 
2582 struct WTSSESSION_NOTIFICATION
2583 {
2584     DWORD cbSize;
2585     DWORD dwSessionId;
2586 }
2587 alias WTSSESSION_NOTIFICATION* PWTSSESSION_NOTIFICATION;
2588 
2589 }
2590 
2591 struct CLIENTCREATESTRUCT {
2592     HANDLE hWindowMenu;
2593     UINT   idFirstChild;
2594 }
2595 alias CLIENTCREATESTRUCT* LPCLIENTCREATESTRUCT;
2596 
2597 struct COMPAREITEMSTRUCT {
2598     UINT  CtlType;
2599     UINT  CtlID;
2600     HWND  hwndItem;
2601     UINT  itemID1;
2602     ULONG_PTR itemData1;
2603     UINT  itemID2;
2604     ULONG_PTR itemData2;
2605     DWORD dwLocaleId;
2606 }
2607 alias COMPAREITEMSTRUCT* LPCOMPAREITEMSTRUCT;
2608 
2609 struct COPYDATASTRUCT {
2610     ULONG_PTR dwData;
2611     DWORD cbData;
2612     PVOID lpData;
2613 }
2614 alias COPYDATASTRUCT* PCOPYDATASTRUCT;
2615 
2616 struct CURSORSHAPE {
2617     int xHotSpot;
2618     int yHotSpot;
2619     int cx;
2620     int cy;
2621     int cbWidth;
2622     BYTE Planes;
2623     BYTE BitsPixel;
2624 }
2625 alias CURSORSHAPE* LPCURSORSHAPE;
2626 
2627 struct CWPRETSTRUCT {
2628     LRESULT lResult;
2629     LPARAM lParam;
2630     WPARAM wParam;
2631     DWORD message;
2632     HWND hwnd;
2633 }
2634 
2635 struct CWPSTRUCT {
2636     LPARAM lParam;
2637     WPARAM wParam;
2638     UINT message;
2639     HWND hwnd;
2640 }
2641 alias CWPSTRUCT* PCWPSTRUCT;
2642 
2643 struct DEBUGHOOKINFO {
2644     DWORD idThread;
2645     DWORD idThreadInstaller;
2646     LPARAM lParam;
2647     WPARAM wParam;
2648     int code;
2649 }
2650 alias DEBUGHOOKINFO* PDEBUGHOOKINFO, LPDEBUGHOOKINFO;
2651 
2652 struct DELETEITEMSTRUCT {
2653     UINT CtlType;
2654     UINT CtlID;
2655     UINT itemID;
2656     HWND hwndItem;
2657     ULONG_PTR itemData;
2658 }
2659 alias DELETEITEMSTRUCT* PDELETEITEMSTRUCT, LPDELETEITEMSTRUCT;
2660 
2661 align(2):
2662 struct DLGITEMTEMPLATE {
2663     DWORD style;
2664     DWORD dwExtendedStyle;
2665     short x;
2666     short y;
2667     short cx;
2668     short cy;
2669     WORD id;
2670 }
2671 alias DLGITEMTEMPLATE* LPDLGITEMTEMPLATE;
2672 
2673 struct DLGTEMPLATE {
2674     DWORD style;
2675     DWORD dwExtendedStyle;
2676     WORD  cdit;
2677     short x;
2678     short y;
2679     short cx;
2680     short cy;
2681 }
2682 alias DLGTEMPLATE*        LPDLGTEMPLATE, LPDLGTEMPLATEA, LPDLGTEMPLATEW;
2683 alias const(DLGTEMPLATE)* LPCDLGTEMPLATE, LPCDLGTEMPLATEA, LPCDLGTEMPLATEW;
2684 
2685 align:
2686 
2687 struct DRAWITEMSTRUCT {
2688     UINT  CtlType;
2689     UINT  CtlID;
2690     UINT  itemID;
2691     UINT  itemAction;
2692     UINT  itemState;
2693     HWND  hwndItem;
2694     HDC   hDC;
2695     RECT  rcItem;
2696     ULONG_PTR itemData;
2697 }
2698 alias DRAWITEMSTRUCT* LPDRAWITEMSTRUCT, PDRAWITEMSTRUCT;
2699 
2700 struct DRAWTEXTPARAMS {
2701     UINT cbSize = DRAWTEXTPARAMS.sizeof;
2702     int  iTabLength;
2703     int  iLeftMargin;
2704     int  iRightMargin;
2705     UINT uiLengthDrawn;
2706 }
2707 alias DRAWTEXTPARAMS* LPDRAWTEXTPARAMS;
2708 
2709 struct PAINTSTRUCT {
2710     HDC      hdc;
2711     BOOL     fErase;
2712     RECT     rcPaint;
2713     BOOL     fRestore;
2714     BOOL     fIncUpdate;
2715     BYTE[32] rgbReserved;
2716 }
2717 alias PAINTSTRUCT* PPAINTSTRUCT, NPPAINTSTRUCT, LPPAINTSTRUCT;
2718 
2719 struct MSG {
2720     HWND   hwnd;
2721     UINT   message;
2722     WPARAM wParam;
2723     LPARAM lParam;
2724     DWORD  time;
2725     POINT  pt;
2726 }
2727 alias MSG* NPMSG, LPMSG, PMSG;
2728 
2729 struct ICONINFO {
2730     BOOL    fIcon;
2731     DWORD   xHotspot;
2732     DWORD   yHotspot;
2733     HBITMAP hbmMask;
2734     HBITMAP hbmColor;
2735 }
2736 alias ICONINFO* PICONINFO;
2737 
2738 struct NMHDR {
2739     HWND hwndFrom;
2740     UINT_PTR idFrom;
2741     UINT code;
2742 }
2743 alias NMHDR* LPNMHDR;
2744 
2745 struct WNDCLASSA {
2746     UINT      style;
2747     WNDPROC   lpfnWndProc;
2748     int       cbClsExtra;
2749     int       cbWndExtra;
2750     HINSTANCE hInstance;
2751     HICON     hIcon;
2752     HCURSOR   hCursor;
2753     HBRUSH    hbrBackground;
2754     LPCSTR    lpszMenuName;
2755     LPCSTR    lpszClassName;
2756 }
2757 alias WNDCLASSA* NPWNDCLASSA, LPWNDCLASSA, PWNDCLASSA;
2758 
2759 struct WNDCLASSW {
2760     UINT      style;
2761     WNDPROC   lpfnWndProc;
2762     int       cbClsExtra;
2763     int       cbWndExtra;
2764     HINSTANCE hInstance;
2765     HICON     hIcon;
2766     HCURSOR   hCursor;
2767     HBRUSH    hbrBackground;
2768     LPCWSTR   lpszMenuName;
2769     LPCWSTR   lpszClassName;
2770 }
2771 alias WNDCLASSW* NPWNDCLASSW, LPWNDCLASSW, PWNDCLASSW;
2772 
2773 struct WNDCLASSEXA {
2774     UINT      cbSize = WNDCLASSEXA.sizeof;
2775     UINT      style;
2776     WNDPROC   lpfnWndProc;
2777     int       cbClsExtra;
2778     int       cbWndExtra;
2779     HINSTANCE hInstance;
2780     HICON     hIcon;
2781     HCURSOR   hCursor;
2782     HBRUSH    hbrBackground;
2783     LPCSTR    lpszMenuName;
2784     LPCSTR    lpszClassName;
2785     HICON     hIconSm;
2786 }
2787 alias WNDCLASSEXA* NPWNDCLASSEXA, LPWNDCLASSEXA, PWNDCLASSEXA;
2788 
2789 struct WNDCLASSEXW {
2790     UINT      cbSize = WNDCLASSEXW.sizeof;
2791     UINT      style;
2792     WNDPROC   lpfnWndProc;
2793     int       cbClsExtra;
2794     int       cbWndExtra;
2795     HINSTANCE hInstance;
2796     HICON     hIcon;
2797     HCURSOR   hCursor;
2798     HBRUSH    hbrBackground;
2799     LPCWSTR   lpszMenuName;
2800     LPCWSTR   lpszClassName;
2801     HICON     hIconSm;
2802 }
2803 alias WNDCLASSEXW* LPWNDCLASSEXW, PWNDCLASSEXW;
2804 
2805 struct MENUITEMINFOA {
2806     UINT      cbSize = MENUITEMINFOA.sizeof;
2807     UINT      fMask;
2808     UINT      fType;
2809     UINT      fState;
2810     UINT      wID;
2811     HMENU     hSubMenu;
2812     HBITMAP   hbmpChecked;
2813     HBITMAP   hbmpUnchecked;
2814     ULONG_PTR dwItemData;
2815     LPSTR     dwTypeData;
2816     UINT      cch;
2817     HBITMAP   hbmpItem;
2818 }
2819 alias MENUITEMINFOA*        LPMENUITEMINFOA;
2820 alias const(MENUITEMINFOA)* LPCMENUITEMINFOA;
2821 
2822 struct MENUITEMINFOW {
2823     UINT      cbSize = MENUITEMINFOW.sizeof;
2824     UINT      fMask;
2825     UINT      fType;
2826     UINT      fState;
2827     UINT      wID;
2828     HMENU     hSubMenu;
2829     HBITMAP   hbmpChecked;
2830     HBITMAP   hbmpUnchecked;
2831     ULONG_PTR dwItemData;
2832     LPWSTR    dwTypeData;
2833     UINT      cch;
2834     HBITMAP   hbmpItem;
2835 }
2836 alias MENUITEMINFOW*        LPMENUITEMINFOW;
2837 alias const(MENUITEMINFOW)* LPCMENUITEMINFOW;
2838 
2839 struct SCROLLINFO {
2840     UINT cbSize = this.sizeof;
2841     UINT fMask;
2842     int nMin;
2843     int nMax;
2844     UINT nPage;
2845     int nPos;
2846     int nTrackPos;
2847 }
2848 alias SCROLLINFO*        LPSCROLLINFO;
2849 alias const(SCROLLINFO)* LPCSCROLLINFO;
2850 
2851 struct WINDOWPLACEMENT {
2852     UINT length;
2853     UINT flags;
2854     UINT showCmd;
2855     POINT ptMinPosition;
2856     POINT ptMaxPosition;
2857     RECT rcNormalPosition;
2858 }
2859 alias WINDOWPLACEMENT* LPWINDOWPLACEMENT, PWINDOWPLACEMENT;
2860 
2861 struct MENUITEMTEMPLATEHEADER {
2862     WORD versionNumber;
2863     WORD offset;
2864 }
2865 
2866 struct MENUITEMTEMPLATE {
2867     WORD mtOption;
2868     WORD mtID;
2869     WCHAR[1] mtString = 0;
2870 }
2871 
2872 alias void MENUTEMPLATE, MENUTEMPLATEA, MENUTEMPLATEW;
2873 
2874 alias MENUTEMPLATE* LPMENUTEMPLATEA, LPMENUTEMPLATEW, LPMENUTEMPLATE;
2875 
2876 struct HELPINFO {
2877     UINT cbSize = this.sizeof;
2878     int iContextType;
2879     int iCtrlId;
2880     HANDLE hItemHandle;
2881     DWORD_PTR dwContextId;
2882     POINT MousePos;
2883 }
2884 alias HELPINFO* LPHELPINFO;
2885 
2886 struct MSGBOXPARAMSA {
2887     UINT cbSize = this.sizeof;
2888     HWND hwndOwner;
2889     HINSTANCE hInstance;
2890     LPCSTR lpszText;
2891     LPCSTR lpszCaption;
2892     DWORD dwStyle;
2893     LPCSTR lpszIcon;
2894     DWORD_PTR dwContextHelpId;
2895     MSGBOXCALLBACK lpfnMsgBoxCallback;
2896     DWORD dwLanguageId;
2897 }
2898 alias MSGBOXPARAMSA* PMSGBOXPARAMSA, LPMSGBOXPARAMSA;
2899 
2900 struct MSGBOXPARAMSW {
2901     UINT cbSize = this.sizeof;
2902     HWND hwndOwner;
2903     HINSTANCE hInstance;
2904     LPCWSTR lpszText;
2905     LPCWSTR lpszCaption;
2906     DWORD dwStyle;
2907     LPCWSTR lpszIcon;
2908     DWORD_PTR dwContextHelpId;
2909     MSGBOXCALLBACK lpfnMsgBoxCallback;
2910     DWORD dwLanguageId;
2911 }
2912 alias MSGBOXPARAMSW* PMSGBOXPARAMSW, LPMSGBOXPARAMSW;
2913 
2914 struct USEROBJECTFLAGS {
2915     BOOL fInherit;
2916     BOOL fReserved;
2917     DWORD dwFlags;
2918 }
2919 
2920 struct FILTERKEYS {
2921     UINT cbSize = this.sizeof;
2922     DWORD dwFlags;
2923     DWORD iWaitMSec;
2924     DWORD iDelayMSec;
2925     DWORD iRepeatMSec;
2926     DWORD iBounceMSec;
2927 }
2928 
2929 struct HIGHCONTRASTA {
2930     UINT cbSize = this.sizeof;
2931     DWORD dwFlags;
2932     LPSTR lpszDefaultScheme;
2933 }
2934 alias HIGHCONTRASTA* LPHIGHCONTRASTA;
2935 
2936 struct HIGHCONTRASTW {
2937     UINT cbSize = this.sizeof;
2938     DWORD dwFlags;
2939     LPWSTR lpszDefaultScheme;
2940 }
2941 alias HIGHCONTRASTW* LPHIGHCONTRASTW;
2942 
2943 struct ICONMETRICSA {
2944     UINT cbSize = this.sizeof;
2945     int iHorzSpacing;
2946     int iVertSpacing;
2947     int iTitleWrap;
2948     LOGFONTA lfFont;
2949 }
2950 alias ICONMETRICSA* LPICONMETRICSA;
2951 
2952 struct ICONMETRICSW {
2953     UINT cbSize = this.sizeof;
2954     int iHorzSpacing;
2955     int iVertSpacing;
2956     int iTitleWrap;
2957     LOGFONTW lfFont;
2958 }
2959 alias ICONMETRICSW* LPICONMETRICSW;
2960 
2961 struct MINIMIZEDMETRICS {
2962     UINT cbSize = this.sizeof;
2963     int iWidth;
2964     int iHorzGap;
2965     int iVertGap;
2966     int iArrange;
2967 }
2968 alias MINIMIZEDMETRICS* LPMINIMIZEDMETRICS;
2969 
2970 struct MOUSEKEYS {
2971     UINT cbSize = this.sizeof;
2972     DWORD dwFlags;
2973     DWORD iMaxSpeed;
2974     DWORD iTimeToMaxSpeed;
2975     DWORD iCtrlSpeed;
2976     DWORD dwReserved1;
2977     DWORD dwReserved2;
2978 }
2979 alias MOUSEKEYS* LPMOUSEKEYS;
2980 
2981 struct NONCLIENTMETRICSA {
2982     UINT cbSize = this.sizeof;
2983     int iBorderWidth;
2984     int iScrollWidth;
2985     int iScrollHeight;
2986     int iCaptionWidth;
2987     int iCaptionHeight;
2988     LOGFONTA lfCaptionFont;
2989     int iSmCaptionWidth;
2990     int iSmCaptionHeight;
2991     LOGFONTA lfSmCaptionFont;
2992     int iMenuWidth;
2993     int iMenuHeight;
2994     LOGFONTA lfMenuFont;
2995     LOGFONTA lfStatusFont;
2996     LOGFONTA lfMessageFont;
2997 }
2998 alias NONCLIENTMETRICSA* LPNONCLIENTMETRICSA;
2999 
3000 struct NONCLIENTMETRICSW {
3001     UINT cbSize = this.sizeof;
3002     int iBorderWidth;
3003     int iScrollWidth;
3004     int iScrollHeight;
3005     int iCaptionWidth;
3006     int iCaptionHeight;
3007     LOGFONTW lfCaptionFont;
3008     int iSmCaptionWidth;
3009     int iSmCaptionHeight;
3010     LOGFONTW lfSmCaptionFont;
3011     int iMenuWidth;
3012     int iMenuHeight;
3013     LOGFONTW lfMenuFont;
3014     LOGFONTW lfStatusFont;
3015     LOGFONTW lfMessageFont;
3016 }
3017 alias NONCLIENTMETRICSW* LPNONCLIENTMETRICSW;
3018 
3019 struct SERIALKEYSA {
3020     UINT cbSize = this.sizeof;
3021     DWORD dwFlags;
3022     LPSTR lpszActivePort;
3023     LPSTR lpszPort;
3024     UINT iBaudRate;
3025     UINT iPortState;
3026     UINT iActive;
3027 }
3028 alias SERIALKEYSA* LPSERIALKEYSA;
3029 
3030 struct SERIALKEYSW {
3031     UINT cbSize = this.sizeof;
3032     DWORD dwFlags;
3033     LPWSTR lpszActivePort;
3034     LPWSTR lpszPort;
3035     UINT iBaudRate;
3036     UINT iPortState;
3037     UINT iActive;
3038 }
3039 alias SERIALKEYSW* LPSERIALKEYSW;
3040 
3041 struct SOUNDSENTRYA {
3042     UINT cbSize = this.sizeof;
3043     DWORD dwFlags;
3044     DWORD iFSTextEffect;
3045     DWORD iFSTextEffectMSec;
3046     DWORD iFSTextEffectColorBits;
3047     DWORD iFSGrafEffect;
3048     DWORD iFSGrafEffectMSec;
3049     DWORD iFSGrafEffectColor;
3050     DWORD iWindowsEffect;
3051     DWORD iWindowsEffectMSec;
3052     LPSTR lpszWindowsEffectDLL;
3053     DWORD iWindowsEffectOrdinal;
3054 }
3055 alias SOUNDSENTRYA* LPSOUNDSENTRYA;
3056 
3057 struct SOUNDSENTRYW {
3058     UINT cbSize = this.sizeof;
3059     DWORD dwFlags;
3060     DWORD iFSTextEffect;
3061     DWORD iFSTextEffectMSec;
3062     DWORD iFSTextEffectColorBits;
3063     DWORD iFSGrafEffect;
3064     DWORD iFSGrafEffectMSec;
3065     DWORD iFSGrafEffectColor;
3066     DWORD iWindowsEffect;
3067     DWORD iWindowsEffectMSec;
3068     LPWSTR lpszWindowsEffectDLL;
3069     DWORD iWindowsEffectOrdinal;
3070 }
3071 alias SOUNDSENTRYW* LPSOUNDSENTRYW;
3072 
3073 struct STICKYKEYS {
3074     DWORD cbSize = this.sizeof;
3075     DWORD dwFlags;
3076 }
3077 alias STICKYKEYS* LPSTICKYKEYS;
3078 
3079 struct TOGGLEKEYS {
3080     DWORD cbSize = this.sizeof;
3081     DWORD dwFlags;
3082 }
3083 
3084 struct MOUSEHOOKSTRUCT {
3085     POINT pt;
3086     HWND hwnd;
3087     UINT wHitTestCode;
3088     ULONG_PTR dwExtraInfo;
3089 }
3090 alias MOUSEHOOKSTRUCT* LPMOUSEHOOKSTRUCT, PMOUSEHOOKSTRUCT;
3091 
3092 struct TRACKMOUSEEVENT {
3093     DWORD cbSize = this.sizeof;
3094     DWORD dwFlags;
3095     HWND  hwndTrack;
3096     DWORD dwHoverTime;
3097 }
3098 alias TRACKMOUSEEVENT* LPTRACKMOUSEEVENT;
3099 
3100 struct TPMPARAMS {
3101     UINT cbSize = this.sizeof;
3102     RECT rcExclude;
3103 }
3104 alias TPMPARAMS* LPTPMPARAMS;
3105 
3106 struct EVENTMSG {
3107     UINT message;
3108     UINT paramL;
3109     UINT paramH;
3110     DWORD time;
3111     HWND hwnd;
3112 }
3113 alias EVENTMSG* PEVENTMSGMSG, LPEVENTMSGMSG, PEVENTMSG, LPEVENTMSG;
3114 
3115 struct WINDOWPOS {
3116     HWND hwnd;
3117     HWND hwndInsertAfter;
3118     int x;
3119     int y;
3120     int cx;
3121     int cy;
3122     UINT flags;
3123 }
3124 alias WINDOWPOS* PWINDOWPOS, LPWINDOWPOS;
3125 
3126 struct NCCALCSIZE_PARAMS {
3127     RECT[3] rgrc;
3128     PWINDOWPOS lppos;
3129 }
3130 alias NCCALCSIZE_PARAMS* LPNCCALCSIZE_PARAMS;
3131 
3132 struct MDICREATESTRUCTA {
3133     LPCSTR szClass;
3134     LPCSTR szTitle;
3135     HANDLE hOwner;
3136     int x;
3137     int y;
3138     int cx;
3139     int cy;
3140     DWORD style;
3141     LPARAM lParam;
3142 }
3143 alias MDICREATESTRUCTA* LPMDICREATESTRUCTA;
3144 
3145 struct MDICREATESTRUCTW {
3146     LPCWSTR szClass;
3147     LPCWSTR szTitle;
3148     HANDLE hOwner;
3149     int x;
3150     int y;
3151     int cx;
3152     int cy;
3153     DWORD style;
3154     LPARAM lParam;
3155 }
3156 alias MDICREATESTRUCTW* LPMDICREATESTRUCTW;
3157 
3158 struct MINMAXINFO {
3159     POINT ptReserved;
3160     POINT ptMaxSize;
3161     POINT ptMaxPosition;
3162     POINT ptMinTrackSize;
3163     POINT ptMaxTrackSize;
3164 }
3165 alias MINMAXINFO* PMINMAXINFO, LPMINMAXINFO;
3166 
3167 struct MDINEXTMENU {
3168     HMENU hmenuIn;
3169     HMENU hmenuNext;
3170     HWND hwndNext;
3171 }
3172 alias MDINEXTMENU* PMDINEXTMENU, LPMDINEXTMENU;
3173 
3174 struct MEASUREITEMSTRUCT {
3175     UINT CtlType;
3176     UINT CtlID;
3177     UINT itemID;
3178     UINT itemWidth;
3179     UINT itemHeight;
3180     ULONG_PTR itemData;
3181 }
3182 alias MEASUREITEMSTRUCT* PMEASUREITEMSTRUCT, LPMEASUREITEMSTRUCT;
3183 
3184 struct DROPSTRUCT {
3185     HWND hwndSource;
3186     HWND hwndSink;
3187     DWORD wFmt;
3188     ULONG_PTR dwData;
3189     POINT ptDrop;
3190     DWORD dwControlData;
3191 }
3192 alias DROPSTRUCT* PDROPSTRUCT, LPDROPSTRUCT;
3193 
3194 alias DWORD HELPPOLY;
3195 
3196 struct MULTIKEYHELPA {
3197     DWORD mkSize;
3198     CHAR mkKeylist = 0;
3199     CHAR[1] szKeyphrase = 0;
3200 }
3201 alias MULTIKEYHELPA* PMULTIKEYHELPA, LPMULTIKEYHELPA;
3202 
3203 struct MULTIKEYHELPW {
3204     DWORD mkSize;
3205     WCHAR mkKeylist = 0;
3206     WCHAR[1] szKeyphrase = 0;
3207 }
3208 alias MULTIKEYHELPW* PMULTIKEYHELPW, LPMULTIKEYHELPW;
3209 
3210 struct HELPWININFOA {
3211     int wStructSize;
3212     int x;
3213     int y;
3214     int dx;
3215     int dy;
3216     int wMax;
3217     CHAR[2] rgchMember = 0;
3218 }
3219 alias HELPWININFOA* PHELPWININFOA, LPHELPWININFOA;
3220 
3221 struct HELPWININFOW {
3222     int wStructSize;
3223     int x;
3224     int y;
3225     int dx;
3226     int dy;
3227     int wMax;
3228     WCHAR[2] rgchMember = 0;
3229 }
3230 alias HELPWININFOW* PHELPWININFOW, LPHELPWININFOW;
3231 
3232 struct STYLESTRUCT {
3233     DWORD styleOld;
3234     DWORD styleNew;
3235 }
3236 alias STYLESTRUCT* LPSTYLESTRUCT;
3237 
3238 struct ALTTABINFO {
3239     DWORD cbSize = this.sizeof;
3240     int   cItems;
3241     int   cColumns;
3242     int   cRows;
3243     int   iColFocus;
3244     int   iRowFocus;
3245     int   cxItem;
3246     int   cyItem;
3247     POINT ptStart;
3248 }
3249 alias ALTTABINFO* PALTTABINFO, LPALTTABINFO;
3250 
3251 struct COMBOBOXINFO {
3252     DWORD cbSize = this.sizeof;
3253     RECT rcItem;
3254     RECT rcButton;
3255     DWORD stateButton;
3256     HWND hwndCombo;
3257     HWND hwndItem;
3258     HWND hwndList;
3259 }
3260 alias COMBOBOXINFO* PCOMBOBOXINFO, LPCOMBOBOXINFO;
3261 
3262 struct CURSORINFO {
3263     DWORD cbSize = this.sizeof;
3264     DWORD flags;
3265     HCURSOR hCursor;
3266     POINT ptScreenPos;
3267 }
3268 alias CURSORINFO* PCURSORINFO, LPCURSORINFO;
3269 
3270 struct MENUBARINFO {
3271     DWORD cbSize = this.sizeof;
3272     RECT  rcBar;
3273     HMENU hMenu;
3274     HWND  hwndMenu;
3275     byte bf_; // Simulated bitfield
3276 //  BOOL  fBarFocused:1;
3277 //  BOOL  fFocused:1;
3278     bool fBarFocused()       { return (bf_ & 1) == 1; }
3279     bool fFocused()          { return (bf_ & 2) == 2; }
3280     bool fBarFocused(bool b) { bf_ = cast(byte) ((bf_ & 0xFE) | b);           return b; }
3281     bool fFocused(bool b)    { bf_ = cast(byte) (b ? (bf_ | 2) : bf_ & 0xFD); return b; }
3282 }
3283 alias MENUBARINFO* PMENUBARINFO;
3284 
3285 struct MENUINFO {
3286     DWORD cbSize = this.sizeof;
3287     DWORD fMask;
3288     DWORD dwStyle;
3289     UINT cyMax;
3290     HBRUSH  hbrBack;
3291     DWORD   dwContextHelpID;
3292     ULONG_PTR dwMenuData;
3293 }
3294 alias MENUINFO*        LPMENUINFO;
3295 alias const(MENUINFO)* LPCMENUINFO;
3296 
3297 
3298 enum CCHILDREN_SCROLLBAR = 5;
3299 
3300 struct SCROLLBARINFO {
3301     DWORD cbSize = this.sizeof;
3302     RECT  rcScrollBar;
3303     int   dxyLineButton;
3304     int   xyThumbTop;
3305     int   xyThumbBottom;
3306     int   reserved;
3307     DWORD[CCHILDREN_SCROLLBAR+1] rgstate;
3308 }
3309 alias SCROLLBARINFO* PSCROLLBARINFO, LPSCROLLBARINFO;
3310 
3311 enum CCHILDREN_TITLEBAR = 5;
3312 
3313 struct WINDOWINFO {
3314     DWORD cbSize = WINDOWINFO.sizeof;
3315     RECT  rcWindow;
3316     RECT  rcClient;
3317     DWORD dwStyle;
3318     DWORD dwExStyle;
3319     DWORD dwWindowStatus;
3320     UINT  cxWindowBorders;
3321     UINT  cyWindowBorders;
3322     ATOM  atomWindowType;
3323     WORD  wCreatorVersion;
3324 }
3325 alias WINDOWINFO* PWINDOWINFO, LPWINDOWINFO;
3326 
3327 struct LASTINPUTINFO {
3328     UINT cbSize = this.sizeof;
3329     DWORD dwTime;
3330 }
3331 alias LASTINPUTINFO* PLASTINPUTINFO;
3332 
3333 struct MONITORINFO {
3334     DWORD cbSize = this.sizeof;
3335     RECT rcMonitor;
3336     RECT rcWork;
3337     DWORD dwFlags;
3338 }
3339 alias MONITORINFO* LPMONITORINFO;
3340 
3341 enum CCHDEVICENAME = 32;
3342 
3343 struct MONITORINFOEXA {
3344     DWORD cbSize = MONITORINFOEXA.sizeof;
3345     RECT  rcMonitor;
3346     RECT  rcWork;
3347     DWORD dwFlags;
3348     CHAR[CCHDEVICENAME] szDevice = 0;
3349 }
3350 alias MONITORINFOEXA* LPMONITORINFOEXA;
3351 
3352 struct MONITORINFOEXW {
3353     DWORD cbSize = MONITORINFOEXW.sizeof;
3354     RECT  rcMonitor;
3355     RECT  rcWork;
3356     DWORD dwFlags;
3357     WCHAR[CCHDEVICENAME] szDevice = 0;
3358 }
3359 alias MONITORINFOEXW* LPMONITORINFOEXW;
3360 
3361 struct KBDLLHOOKSTRUCT {
3362     DWORD vkCode;
3363     DWORD scanCode;
3364     DWORD flags;
3365     DWORD time;
3366     ULONG_PTR dwExtraInfo;
3367 }
3368 alias KBDLLHOOKSTRUCT* LPKBDLLHOOKSTRUCT, PKBDLLHOOKSTRUCT;
3369 
3370 struct MSLLHOOKSTRUCT {
3371     POINT     pt;
3372     DWORD     mouseData;
3373     DWORD     flags;
3374     DWORD     time;
3375     ULONG_PTR dwExtraInfo;
3376 }
3377 alias MSLLHOOKSTRUCT* PMSLLHOOKSTRUCT;
3378 
3379 struct MOUSEINPUT {
3380     LONG dx;
3381     LONG dy;
3382     DWORD mouseData;
3383     DWORD dwFlags;
3384     DWORD time;
3385     ULONG_PTR dwExtraInfo;
3386 }
3387 alias MOUSEINPUT* PMOUSEINPUT;
3388 
3389 struct KEYBDINPUT {
3390     WORD wVk;
3391     WORD wScan;
3392     DWORD dwFlags;
3393     DWORD time;
3394     ULONG_PTR dwExtraInfo;
3395 }
3396 alias KEYBDINPUT* PKEYBDINPUT;
3397 
3398 struct HARDWAREINPUT {
3399     DWORD uMsg;
3400     WORD wParamL;
3401     WORD wParamH;
3402 }
3403 alias HARDWAREINPUT* PHARDWAREINPUT;
3404 
3405 struct INPUT {
3406     DWORD type;
3407     union {
3408         MOUSEINPUT mi;
3409         KEYBDINPUT ki;
3410         HARDWAREINPUT hi;
3411     }
3412 }
3413 alias INPUT* PINPUT, LPINPUT;
3414 
3415 static if (_WIN32_WINNT >= 0x501) {
3416     align(4) struct BSMINFO {
3417         UINT  cbSize = this.sizeof;
3418         HDESK hdesk;
3419         HWND  hwnd;
3420 align(4) LUID  luid;
3421     }
3422     alias BSMINFO* PBSMINFO;
3423 
3424     alias TypeDef!(HANDLE) HRAWINPUT;
3425 
3426     struct RAWINPUTHEADER {
3427         DWORD dwType;
3428         DWORD dwSize;
3429         HANDLE hDevice;
3430         WPARAM wParam;
3431     }
3432     alias RAWINPUTHEADER* PRAWINPUTHEADER;
3433 
3434     struct RAWMOUSE {
3435         USHORT usFlags;
3436         union {
3437             ULONG ulButtons;
3438             struct {
3439                 USHORT usButtonFlags;
3440                 USHORT usButtonData;
3441             }
3442         }
3443         ULONG ulRawButtons;
3444         LONG lLastX;
3445         LONG lLastY;
3446         ULONG ulExtraInformation;
3447     }
3448     alias RAWMOUSE* PRAWMOUSE, LPRAWMOUSE;
3449 
3450     struct RAWKEYBOARD {
3451         USHORT MakeCode;
3452         USHORT Flags;
3453         USHORT Reserved;
3454         USHORT VKey;
3455         UINT Message;
3456         ULONG ExtraInformation;
3457     }
3458     alias RAWKEYBOARD* PRAWKEYBOARD, LPRAWKEYBOARD;
3459 
3460     struct RAWHID {
3461         DWORD dwSizeHid;
3462         DWORD dwCount;
3463         BYTE bRawData;
3464     }
3465     alias RAWHID* PRAWHID, LPRAWHID;
3466 
3467     struct RAWINPUT {
3468         RAWINPUTHEADER header;
3469         union _data {
3470             RAWMOUSE    mouse;
3471             RAWKEYBOARD keyboard;
3472             RAWHID      hid;
3473         }
3474         _data data;
3475     }
3476     alias RAWINPUT* PRAWINPUT, LPRAWINPUT;
3477 
3478     struct RAWINPUTDEVICE {
3479         USHORT usUsagePage;
3480         USHORT usUsage;
3481         DWORD dwFlags;
3482         HWND hwndTarget;
3483     }
3484     alias RAWINPUTDEVICE*        PRAWINPUTDEVICE, LPRAWINPUTDEVICE;
3485     alias const(RAWINPUTDEVICE)* PCRAWINPUTDEVICE;
3486 
3487     struct RAWINPUTDEVICELIST {
3488         HANDLE hDevice;
3489         DWORD dwType;
3490     }
3491     alias RAWINPUTDEVICELIST* PRAWINPUTDEVICELIST;
3492 
3493     struct RID_DEVICE_INFO_MOUSE {
3494         DWORD dwId;
3495         DWORD dwNumberOfButtons;
3496         DWORD dwSampleRate;
3497         BOOL  fHasHorizontalWheel;
3498     }
3499 
3500     struct RID_DEVICE_INFO_KEYBOARD {
3501         DWORD dwType;
3502         DWORD dwSubType;
3503         DWORD dwKeyboardMode;
3504         DWORD dwNumberOfFunctionKeys;
3505         DWORD dwNumberOfIndicators;
3506         DWORD dwNumberOfKeysTotal;
3507     }
3508 
3509     struct RID_DEVICE_INFO_HID {
3510         DWORD dwVendorId;
3511         DWORD dwProductId;
3512         DWORD dwVersionNumber;
3513         USHORT usUsagePage;
3514         USHORT usUsage;
3515     }
3516 
3517     struct RID_DEVICE_INFO {
3518         DWORD cbSize = this.sizeof;
3519         DWORD dwType;
3520         union {
3521             RID_DEVICE_INFO_MOUSE mouse;
3522             RID_DEVICE_INFO_KEYBOARD keyboard;
3523             RID_DEVICE_INFO_HID hid;
3524         }
3525     }
3526 }// (_WIN32_WINNT >= 0x501)
3527 
3528 alias CharToOemA AnsiToOem;
3529 alias OemToCharA OemToAnsi;
3530 alias CharToOemBuffA AnsiToOemBuff;
3531 alias OemToCharBuffA OemToAnsiBuff;
3532 alias CharUpperA AnsiUpper;
3533 alias CharUpperBuffA AnsiUpperBuff;
3534 alias CharLowerA AnsiLower;
3535 alias CharLowerBuffA AnsiLowerBuff;
3536 alias CharNextA AnsiNext;
3537 alias CharPrevA AnsiPrev;
3538 
3539 alias MAKELONG MAKEWPARAM;
3540 alias MAKELONG MAKELPARAM;
3541 alias MAKELONG MAKELRESULT;
3542 
3543 void POINTSTOPOINT()(out POINT p, LONG ps) {
3544     p.x = LOWORD(ps);
3545     p.y = HIWORD(ps);
3546 }
3547 
3548 POINTS POINTTOPOINTS()(const POINT p) {
3549     return MAKELONG(p.x, p.y);
3550 }
3551 
3552 extern (Windows) nothrow @nogc {
3553     HKL ActivateKeyboardLayout(HKL, UINT);
3554     BOOL AdjustWindowRect(LPRECT, DWORD, BOOL);
3555     BOOL AdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD);
3556     BOOL AnyPopup();
3557     BOOL AppendMenuA(HMENU, UINT, UINT_PTR, LPCSTR);
3558     BOOL AppendMenuW(HMENU, UINT, UINT_PTR, LPCWSTR);
3559     UINT ArrangeIconicWindows(HWND);
3560     BOOL AttachThreadInput(DWORD, DWORD, BOOL);
3561     HDWP BeginDeferWindowPos(int);
3562     HDC BeginPaint(HWND, LPPAINTSTRUCT);
3563     BOOL BringWindowToTop(HWND);
3564     BOOL CallMsgFilterA(LPMSG, INT);
3565     BOOL CallMsgFilterW(LPMSG, INT);
3566     LRESULT CallNextHookEx(HHOOK, int, WPARAM, LPARAM);
3567     LRESULT CallWindowProcA(WNDPROC, HWND, UINT, WPARAM, LPARAM);
3568     LRESULT CallWindowProcW(WNDPROC, HWND, UINT, WPARAM, LPARAM);
3569     WORD CascadeWindows(HWND, UINT, LPCRECT, UINT, const(HWND)*);
3570     BOOL ChangeClipboardChain(HWND, HWND);
3571 
3572     LONG ChangeDisplaySettingsA(PDEVMODEA, DWORD);
3573     LONG ChangeDisplaySettingsW(PDEVMODEW, DWORD);
3574     LONG ChangeDisplaySettingsExA(LPCSTR, LPDEVMODEA, HWND, DWORD, LPVOID);
3575     LONG ChangeDisplaySettingsExW(LPCWSTR, LPDEVMODEW, HWND, DWORD, LPVOID);
3576 
3577     BOOL ChangeMenuA(HMENU, UINT, LPCSTR, UINT, UINT);
3578     BOOL ChangeMenuW(HMENU, UINT, LPCWSTR, UINT, UINT);
3579     LPSTR CharLowerA(LPSTR);
3580     LPWSTR CharLowerW(LPWSTR);
3581     DWORD CharLowerBuffA(LPSTR, DWORD);
3582     DWORD CharLowerBuffW(LPWSTR, DWORD);
3583     LPSTR CharNextA(LPCSTR);
3584     LPWSTR CharNextW(LPCWSTR);
3585     LPSTR CharNextExA(WORD, LPCSTR, DWORD);
3586     LPWSTR CharNextExW(WORD, LPCWSTR, DWORD);
3587     LPSTR CharPrevA(LPCSTR, LPCSTR);
3588     LPWSTR CharPrevW(LPCWSTR, LPCWSTR);
3589     LPSTR CharPrevExA(WORD, LPCSTR, LPCSTR, DWORD);
3590     LPWSTR CharPrevExW(WORD, LPCWSTR, LPCWSTR, DWORD);
3591     BOOL CharToOemA(LPCSTR, LPSTR);
3592     BOOL CharToOemW(LPCWSTR, LPSTR);
3593     BOOL CharToOemBuffA(LPCSTR, LPSTR, DWORD);
3594     BOOL CharToOemBuffW(LPCWSTR, LPSTR, DWORD);
3595     LPSTR CharUpperA(LPSTR);
3596     LPWSTR CharUpperW(LPWSTR);
3597     DWORD CharUpperBuffA(LPSTR, DWORD);
3598     DWORD CharUpperBuffW(LPWSTR, DWORD);
3599     BOOL CheckDlgButton(HWND, int, UINT);
3600     DWORD CheckMenuItem(HMENU, UINT, UINT);
3601     BOOL CheckMenuRadioItem(HMENU, UINT, UINT, UINT, UINT);
3602     BOOL CheckRadioButton(HWND, int, int, int);
3603     HWND ChildWindowFromPoint(HWND, POINT);
3604     HWND ChildWindowFromPointEx(HWND, POINT, UINT);
3605     BOOL ClientToScreen(HWND, LPPOINT);
3606     BOOL ClipCursor(LPCRECT);
3607     BOOL CloseClipboard();
3608     BOOL CloseDesktop(HDESK);
3609     BOOL CloseWindow(HWND);
3610     BOOL CloseWindowStation(HWINSTA);
3611     int CopyAcceleratorTableA(HACCEL, LPACCEL, int);
3612     int CopyAcceleratorTableW(HACCEL, LPACCEL, int);
3613 
3614     HICON CopyIcon(HICON);
3615     HANDLE CopyImage(HANDLE, UINT, int, int, UINT);
3616     BOOL CopyRect(LPRECT, LPCRECT);
3617     int CountClipboardFormats();
3618     HACCEL CreateAcceleratorTableA(LPACCEL, int);
3619     HACCEL CreateAcceleratorTableW(LPACCEL, int);
3620     BOOL CreateCaret(HWND, HBITMAP, int, int);
3621     HCURSOR CreateCursor(HINSTANCE, int, int, int, int, PCVOID, PCVOID);
3622 
3623     HDESK CreateDesktopA(LPCSTR, LPCSTR, LPDEVMODEA, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
3624     HDESK CreateDesktopW(LPCWSTR, LPCWSTR, LPDEVMODEW, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
3625 
3626     HWND CreateDialogParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
3627     HWND CreateDialogParamW(HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM);
3628     HWND CreateDialogIndirectParamA(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
3629     HWND CreateDialogIndirectParamW(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
3630 
3631     HICON CreateIcon(HINSTANCE, int, int, BYTE, BYTE, const(BYTE)*, BYTE*);
3632     HICON CreateIconFromResource(PBYTE, DWORD, BOOL, DWORD);
3633     HICON CreateIconFromResourceEx(PBYTE, DWORD, BOOL, DWORD, int, int, UINT);
3634     HICON CreateIconIndirect(PICONINFO);
3635     HWND CreateMDIWindowA(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HINSTANCE, LPARAM);
3636     HWND CreateMDIWindowW(LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HINSTANCE, LPARAM);
3637     HMENU CreateMenu();
3638     HMENU CreatePopupMenu();
3639 
3640     HWND CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
3641     HWND CreateWindowExW(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
3642 
3643     HWINSTA CreateWindowStationA(LPSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
3644     HWINSTA CreateWindowStationW(LPWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
3645     LRESULT DefDlgProcA(HWND, UINT, WPARAM, LPARAM);
3646     LRESULT DefDlgProcW(HWND, UINT, WPARAM, LPARAM);
3647     HDWP DeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT);
3648     LRESULT DefFrameProcA(HWND, HWND, UINT, WPARAM, LPARAM);
3649     LRESULT DefFrameProcW(HWND, HWND, UINT, WPARAM, LPARAM);
3650 
3651     LRESULT DefMDIChildProcA(HWND, UINT, WPARAM, LPARAM);
3652     LRESULT DefMDIChildProcW(HWND, UINT, WPARAM, LPARAM);
3653     LRESULT DefWindowProcA(HWND, UINT, WPARAM, LPARAM);
3654     LRESULT DefWindowProcW(HWND, UINT, WPARAM, LPARAM);
3655     BOOL DeleteMenu(HMENU, UINT, UINT);
3656     BOOL DeregisterShellHookWindow(HWND);
3657     BOOL DestroyAcceleratorTable(HACCEL);
3658     BOOL DestroyCaret();
3659     BOOL DestroyCursor(HCURSOR);
3660     BOOL DestroyIcon(HICON);
3661     BOOL DestroyMenu(HMENU);
3662     BOOL DestroyWindow(HWND);
3663 
3664     INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
3665     INT_PTR DialogBoxParamW(HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM);
3666     INT_PTR DialogBoxIndirectParamA(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
3667     INT_PTR DialogBoxIndirectParamW(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
3668 
3669 } // extern (Windows)
3670 
3671 nothrow @nogc {
3672     HCURSOR CopyCursor(HCURSOR c) {
3673         return cast(HCURSOR)CopyIcon(cast(HICON)c);
3674     }
3675 
3676     HWND CreateDialogA(HINSTANCE h, LPCSTR n, HWND w, DLGPROC f) {
3677         return CreateDialogParamA(h, n, w, f, 0);
3678     }
3679 
3680     HWND CreateDialogW(HINSTANCE h, LPCWSTR n, HWND w, DLGPROC f) {
3681         return CreateDialogParamW(h, n, w, f, 0);
3682     }
3683 
3684     HWND CreateDialogIndirectA(HINSTANCE h, LPCDLGTEMPLATE t, HWND w, DLGPROC f) {
3685         return CreateDialogIndirectParamA(h, t, w, f, 0);
3686     }
3687 
3688     HWND CreateDialogIndirectW(HINSTANCE h, LPCDLGTEMPLATE t, HWND w, DLGPROC f) {
3689         return CreateDialogIndirectParamW(h, t, w, f, 0);
3690     }
3691 
3692     HWND CreateWindowA(LPCSTR a, LPCSTR b, DWORD c, int d, int e, int f, int g, HWND h, HMENU i, HINSTANCE j, LPVOID k) {
3693         return CreateWindowExA(0, a, b, c, d, e, f, g, h, i, j, k);
3694     }
3695 
3696     HWND CreateWindowW(LPCWSTR a, LPCWSTR b, DWORD c, int d, int e, int f, int g, HWND h, HMENU i, HINSTANCE j, LPVOID k) {
3697         return CreateWindowExW(0, a, b, c, d, e, f, g, h, i, j, k);
3698     }
3699 
3700     INT_PTR DialogBoxA(HINSTANCE i, LPCSTR t, HWND p, DLGPROC f) {
3701         return DialogBoxParamA(i, t, p, f, 0);
3702     }
3703 
3704     INT_PTR DialogBoxW(HINSTANCE i, LPCWSTR t, HWND p, DLGPROC f) {
3705         return DialogBoxParamW(i, t, p, f, 0);
3706     }
3707 
3708     INT_PTR DialogBoxIndirectA(HINSTANCE i, LPCDLGTEMPLATE t, HWND p, DLGPROC f) {
3709         return DialogBoxIndirectParamA(i, t, p, f, 0);
3710     }
3711 
3712     INT_PTR DialogBoxIndirectW(HINSTANCE i, LPCDLGTEMPLATE t, HWND p, DLGPROC f) {
3713         return DialogBoxIndirectParamW(i, t, p, f, 0);
3714     }
3715 
3716     BOOL ExitWindows(UINT r, DWORD c) {
3717         return ExitWindowsEx(EWX_LOGOFF, 0);
3718     }
3719 }
3720 alias GetWindow GetNextWindow;
3721 
3722 extern (Windows) nothrow @nogc:
3723 LONG DispatchMessageA(const(MSG)*);
3724 LONG DispatchMessageW(const(MSG)*);
3725 int DlgDirListA(HWND, LPSTR, int, int, UINT);
3726 int DlgDirListW(HWND, LPWSTR, int, int, UINT);
3727 int DlgDirListComboBoxA(HWND, LPSTR, int, int, UINT);
3728 int DlgDirListComboBoxW(HWND, LPWSTR, int, int, UINT);
3729 BOOL DlgDirSelectComboBoxExA(HWND, LPSTR, int, int);
3730 BOOL DlgDirSelectComboBoxExW(HWND, LPWSTR, int, int);
3731 BOOL DlgDirSelectExA(HWND, LPSTR, int, int);
3732 BOOL DlgDirSelectExW(HWND, LPWSTR, int, int);
3733 BOOL DragDetect(HWND, POINT);
3734 DWORD DragObject(HWND, HWND, UINT, ULONG_PTR, HCURSOR);
3735 BOOL DrawAnimatedRects(HWND, int, LPCRECT, LPCRECT);
3736 BOOL DrawCaption(HWND, HDC, LPCRECT, UINT);
3737 BOOL DrawEdge(HDC, LPRECT, UINT, UINT);
3738 BOOL DrawFocusRect(HDC, LPCRECT);
3739 BOOL DrawFrameControl(HDC, LPRECT, UINT, UINT);
3740 BOOL DrawIcon(HDC, int, int, HICON);
3741 BOOL DrawIconEx(HDC, int, int, HICON, int, int, UINT, HBRUSH, UINT);
3742 BOOL DrawMenuBar(HWND);
3743 BOOL DrawStateA(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
3744 BOOL DrawStateW(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
3745 int DrawTextA(HDC, LPCSTR, int, LPRECT, UINT);
3746 int DrawTextW(HDC, LPCWSTR, int, LPRECT, UINT);
3747 int DrawTextExA(HDC, LPSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
3748 int DrawTextExW(HDC, LPWSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
3749 BOOL EmptyClipboard();
3750 BOOL EnableMenuItem(HMENU, UINT, UINT);
3751 BOOL EnableScrollBar(HWND, UINT, UINT);
3752 BOOL EnableWindow(HWND, BOOL);
3753 BOOL EndDeferWindowPos(HDWP);
3754 BOOL EndDialog(HWND, INT_PTR);
3755 BOOL EndMenu();
3756 BOOL EndPaint(HWND, const(PAINTSTRUCT)*);
3757 BOOL EnumChildWindows(HWND, ENUMWINDOWSPROC, LPARAM);
3758 UINT EnumClipboardFormats(UINT);
3759 BOOL EnumDesktopsA(HWINSTA, DESKTOPENUMPROCA, LPARAM);
3760 BOOL EnumDesktopsW(HWINSTA, DESKTOPENUMPROCW, LPARAM);
3761 BOOL EnumDesktopWindows(HDESK, ENUMWINDOWSPROC, LPARAM);
3762 BOOL EnumDisplaySettingsA(LPCSTR, DWORD, PDEVMODEA);
3763 BOOL EnumDisplaySettingsW(LPCWSTR, DWORD, PDEVMODEW);
3764 
3765 BOOL EnumDisplayDevicesA(LPCSTR, DWORD, PDISPLAY_DEVICEA, DWORD);
3766 BOOL EnumDisplayDevicesW(LPCWSTR, DWORD, PDISPLAY_DEVICEW, DWORD);
3767 
3768 int EnumPropsA(HWND, PROPENUMPROCA);
3769 int EnumPropsW(HWND, PROPENUMPROCW);
3770 int EnumPropsExA(HWND, PROPENUMPROCEXA, LPARAM);
3771 int EnumPropsExW(HWND, PROPENUMPROCEXW, LPARAM);
3772 
3773 BOOL EnumThreadWindows(DWORD, WNDENUMPROC, LPARAM);
3774 BOOL EnumWindows(WNDENUMPROC, LPARAM);
3775 BOOL EnumWindowStationsA(WINSTAENUMPROCA, LPARAM);
3776 BOOL EnumWindowStationsW(WINSTAENUMPROCW, LPARAM);
3777 BOOL EqualRect(LPCRECT, LPCRECT);
3778 
3779 BOOL ExitWindowsEx(UINT, DWORD);
3780 HWND FindWindowA(LPCSTR, LPCSTR);
3781 HWND FindWindowExA(HWND, HWND, LPCSTR, LPCSTR);
3782 HWND FindWindowExW(HWND, HWND, LPCWSTR, LPCWSTR);
3783 HWND FindWindowW(LPCWSTR, LPCWSTR);
3784 BOOL FlashWindow(HWND, BOOL);
3785 
3786 int FrameRect(HDC, LPCRECT, HBRUSH);
3787 BOOL FrameRgn(HDC, HRGN, HBRUSH, int, int);
3788 HWND GetActiveWindow();
3789 HWND GetAncestor(HWND, UINT);
3790 SHORT GetAsyncKeyState(int);
3791 HWND GetCapture();
3792 UINT GetCaretBlinkTime();
3793 BOOL GetCaretPos(LPPOINT);
3794 BOOL GetClassInfoA(HINSTANCE, LPCSTR, LPWNDCLASSA);
3795 BOOL GetClassInfoExA(HINSTANCE, LPCSTR, LPWNDCLASSEXA);
3796 BOOL GetClassInfoW(HINSTANCE, LPCWSTR, LPWNDCLASSW);
3797 BOOL GetClassInfoExW(HINSTANCE, LPCWSTR, LPWNDCLASSEXW);
3798 DWORD GetClassLongA(HWND, int);
3799 DWORD GetClassLongW(HWND, int);
3800 int GetClassNameA(HWND, LPSTR, int);
3801 int GetClassNameW(HWND, LPWSTR, int);
3802 WORD GetClassWord(HWND, int);
3803 BOOL GetClientRect(HWND, LPRECT);
3804 HANDLE GetClipboardData(UINT);
3805 int GetClipboardFormatNameA(UINT, LPSTR, int);
3806 int GetClipboardFormatNameW(UINT, LPWSTR, int);
3807 HWND GetClipboardOwner();
3808 HWND GetClipboardViewer();
3809 BOOL GetClipCursor(LPRECT);
3810 BOOL GetCursorPos(LPPOINT);
3811 HDC GetDC(HWND);
3812 HDC GetDCEx(HWND, HRGN, DWORD);
3813 HWND GetDesktopWindow();
3814 int GetDialogBaseUnits();
3815 int GetDlgCtrlID(HWND);
3816 HWND GetDlgItem(HWND, int);
3817 UINT GetDlgItemInt(HWND, int, PBOOL, BOOL);
3818 UINT GetDlgItemTextA(HWND, int, LPSTR, int);
3819 UINT GetDlgItemTextW(HWND, int, LPWSTR, int);
3820 UINT GetDoubleClickTime();
3821 HWND GetFocus();
3822 HWND GetForegroundWindow();
3823 
3824 BOOL GetIconInfo(HICON, PICONINFO);
3825 BOOL GetInputState();
3826 UINT GetKBCodePage();
3827 HKL GetKeyboardLayout(DWORD);
3828 UINT GetKeyboardLayoutList(int, HKL*);
3829 BOOL GetKeyboardLayoutNameA(LPSTR);
3830 BOOL GetKeyboardLayoutNameW(LPWSTR);
3831 BOOL GetKeyboardState(PBYTE);
3832 int GetKeyboardType(int);
3833 int GetKeyNameTextA(LONG, LPSTR, int);
3834 int GetKeyNameTextW(LONG, LPWSTR, int);
3835 SHORT GetKeyState(int);
3836 HWND GetLastActivePopup(HWND);
3837 HMENU GetMenu(HWND);
3838 LONG GetMenuCheckMarkDimensions();
3839 DWORD GetMenuContextHelpId(HMENU);
3840 UINT GetMenuDefaultItem(HMENU, UINT, UINT);
3841 int GetMenuItemCount(HMENU);
3842 UINT GetMenuItemID(HMENU, int);
3843 BOOL GetMenuItemInfoA(HMENU, UINT, BOOL, LPMENUITEMINFOA);
3844 BOOL GetMenuItemInfoW(HMENU, UINT, BOOL, LPMENUITEMINFOW);
3845 BOOL GetMenuItemRect(HWND, HMENU, UINT, LPRECT);
3846 UINT GetMenuState(HMENU, UINT, UINT);
3847 int GetMenuStringA(HMENU, UINT, LPSTR, int, UINT);
3848 int GetMenuStringW(HMENU, UINT, LPWSTR, int, UINT);
3849 BOOL GetMessageA(LPMSG, HWND, UINT, UINT);
3850 BOOL GetMessageW(LPMSG, HWND, UINT, UINT);
3851 LONG GetMessageExtraInfo();
3852 DWORD GetMessagePos();
3853 LONG GetMessageTime();
3854 
3855 HWND GetNextDlgGroupItem(HWND, HWND, BOOL);
3856 HWND GetNextDlgTabItem(HWND, HWND, BOOL);
3857 
3858 HWND GetOpenClipboardWindow();
3859 HWND GetParent(HWND);
3860 int GetPriorityClipboardFormat(UINT*, int);
3861 HANDLE GetPropA(HWND, LPCSTR);
3862 HANDLE GetPropW(HWND, LPCWSTR);
3863 
3864 DWORD GetQueueStatus(UINT);
3865 BOOL GetScrollInfo(HWND, int, LPSCROLLINFO);
3866 int GetScrollPos(HWND, int);
3867 BOOL GetScrollRange(HWND, int, LPINT, LPINT);
3868 
3869 HMENU GetSubMenu(HMENU, int);
3870 DWORD GetSysColor(int);
3871 HBRUSH GetSysColorBrush(int);
3872 
3873 HMENU GetSystemMenu(HWND, BOOL);
3874 int GetSystemMetrics(int);
3875 DWORD GetTabbedTextExtentA(HDC, LPCSTR, int, int, LPINT);
3876 DWORD GetTabbedTextExtentW(HDC, LPCWSTR, int, int, LPINT);
3877 LONG GetWindowLongA(HWND, int);
3878 LONG GetWindowLongW(HWND, int);
3879 
3880 HDESK GetThreadDesktop(DWORD);
3881 HWND GetTopWindow(HWND);
3882 BOOL GetUpdateRect(HWND, LPRECT, BOOL);
3883 int GetUpdateRgn(HWND, HRGN, BOOL);
3884 BOOL GetUserObjectInformationA(HANDLE, int, PVOID, DWORD, PDWORD);
3885 BOOL GetUserObjectInformationW(HANDLE, int, PVOID, DWORD, PDWORD);
3886 BOOL GetUserObjectSecurity(HANDLE, PSECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, PDWORD);
3887 HWND GetWindow(HWND, UINT);
3888 DWORD GetWindowContextHelpId(HWND);
3889 HDC GetWindowDC(HWND);
3890 BOOL GetWindowPlacement(HWND, WINDOWPLACEMENT*);
3891 BOOL GetWindowRect(HWND, LPRECT);
3892 int GetWindowRgn(HWND, HRGN);
3893 int GetWindowTextA(HWND, LPSTR, int);
3894 int GetWindowTextLengthA(HWND);
3895 int GetWindowTextLengthW(HWND);
3896 int GetWindowTextW(HWND, LPWSTR, int);
3897 WORD GetWindowWord(HWND, int);
3898 BOOL GetAltTabInfoA(HWND, int, PALTTABINFO, LPSTR, UINT);
3899 BOOL GetAltTabInfoW(HWND, int, PALTTABINFO, LPWSTR, UINT);
3900 BOOL GetComboBoxInfo(HWND, PCOMBOBOXINFO);
3901 BOOL GetCursorInfo(PCURSORINFO);
3902 BOOL GetLastInputInfo(PLASTINPUTINFO);
3903 DWORD GetListBoxInfo(HWND);
3904 BOOL GetMenuBarInfo(HWND, LONG, LONG, PMENUBARINFO);
3905 BOOL GetMenuInfo(HMENU, LPMENUINFO);
3906 BOOL GetScrollBarInfo(HWND, LONG, PSCROLLBARINFO);
3907 BOOL GetTitleBarInfo(HWND, PTITLEBARINFO);
3908 BOOL GetWindowInfo(HWND, PWINDOWINFO);
3909 UINT GetWindowModuleFileNameA(HWND, LPSTR, UINT);
3910 UINT GetWindowModuleFileNameW(HWND, LPWSTR, UINT);
3911 BOOL GrayStringA(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
3912 BOOL GrayStringW(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
3913 BOOL HideCaret(HWND);
3914 BOOL HiliteMenuItem(HWND, HMENU, UINT, UINT);
3915 BOOL InflateRect(LPRECT, int, int);
3916 BOOL InSendMessage();
3917 BOOL InsertMenuA(HMENU, UINT, UINT, UINT_PTR, LPCSTR);
3918 BOOL InsertMenuW(HMENU, UINT, UINT, UINT_PTR, LPCWSTR);
3919 BOOL InsertMenuItemA(HMENU, UINT, BOOL, LPCMENUITEMINFOA);
3920 BOOL InsertMenuItemW(HMENU, UINT, BOOL, LPCMENUITEMINFOW);
3921 INT InternalGetWindowText(HWND, LPWSTR, INT);
3922 BOOL IntersectRect(LPRECT, LPCRECT, LPCRECT);
3923 BOOL InvalidateRect(HWND, LPCRECT, BOOL);
3924 BOOL InvalidateRgn(HWND, HRGN, BOOL);
3925 BOOL InvertRect(HDC, LPCRECT);
3926 BOOL IsCharAlphaA(CHAR ch);
3927 BOOL IsCharAlphaNumericA(CHAR);
3928 BOOL IsCharAlphaNumericW(WCHAR);
3929 BOOL IsCharAlphaW(WCHAR);
3930 BOOL IsCharLowerA(CHAR);
3931 BOOL IsCharLowerW(WCHAR);
3932 BOOL IsCharUpperA(CHAR);
3933 BOOL IsCharUpperW(WCHAR);
3934 BOOL IsChild(HWND, HWND);
3935 BOOL IsClipboardFormatAvailable(UINT);
3936 BOOL IsDialogMessageA(HWND, LPMSG);
3937 BOOL IsDialogMessageW(HWND, LPMSG);
3938 UINT IsDlgButtonChecked(HWND, int);
3939 BOOL IsIconic(HWND);
3940 BOOL IsMenu(HMENU);
3941 BOOL IsRectEmpty(LPCRECT);
3942 BOOL IsWindow(HWND);
3943 BOOL IsWindowEnabled(HWND);
3944 BOOL IsWindowUnicode(HWND);
3945 BOOL IsWindowVisible(HWND);
3946 BOOL IsZoomed(HWND);
3947 void keybd_event(BYTE, BYTE, DWORD, ULONG_PTR);
3948 BOOL KillTimer(HWND, UINT_PTR);
3949 HACCEL LoadAcceleratorsA(HINSTANCE, LPCSTR);
3950 HACCEL LoadAcceleratorsW(HINSTANCE, LPCWSTR);
3951 HBITMAP LoadBitmapA(HINSTANCE, LPCSTR);
3952 HBITMAP LoadBitmapW(HINSTANCE, LPCWSTR);
3953 HCURSOR LoadCursorA(HINSTANCE, LPCSTR);
3954 HCURSOR LoadCursorFromFileA(LPCSTR);
3955 HCURSOR LoadCursorFromFileW(LPCWSTR);
3956 HCURSOR LoadCursorW(HINSTANCE, LPCWSTR);
3957 HICON LoadIconA(HINSTANCE, LPCSTR);
3958 HICON LoadIconW(HINSTANCE, LPCWSTR);
3959 HANDLE LoadImageA(HINSTANCE, LPCSTR, UINT, int, int, UINT);
3960 HANDLE LoadImageW(HINSTANCE, LPCWSTR, UINT, int, int, UINT);
3961 HKL LoadKeyboardLayoutA(LPCSTR, UINT);
3962 HKL LoadKeyboardLayoutW(LPCWSTR, UINT);
3963 HMENU LoadMenuA(HINSTANCE, LPCSTR);
3964 HMENU LoadMenuIndirectA(const(MENUTEMPLATE)*);
3965 HMENU LoadMenuIndirectW(const(MENUTEMPLATE)*);
3966 HMENU LoadMenuW(HINSTANCE, LPCWSTR);
3967 int LoadStringA(HINSTANCE, UINT, LPSTR, int);
3968 int LoadStringW(HINSTANCE, UINT, LPWSTR, int);
3969 BOOL LockWindowUpdate(HWND);
3970 int LookupIconIdFromDirectory(PBYTE, BOOL);
3971 int LookupIconIdFromDirectoryEx(PBYTE, BOOL, int, int, UINT);
3972 BOOL MapDialogRect(HWND, LPRECT);
3973 UINT MapVirtualKeyA(UINT, UINT);
3974 UINT MapVirtualKeyExA(UINT, UINT, HKL);
3975 UINT MapVirtualKeyExW(UINT, UINT, HKL);
3976 UINT MapVirtualKeyW(UINT, UINT);
3977 int MapWindowPoints(HWND, HWND, LPPOINT, UINT);
3978 int MenuItemFromPoint(HWND, HMENU, POINT);
3979 BOOL MessageBeep(UINT);
3980 int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT);
3981 int MessageBoxW(HWND, LPCWSTR, LPCWSTR, UINT);
3982 int MessageBoxExA(HWND, LPCSTR, LPCSTR, UINT, WORD);
3983 int MessageBoxExW(HWND, LPCWSTR, LPCWSTR, UINT, WORD);
3984 int MessageBoxIndirectA(const(MSGBOXPARAMSA)*);
3985 int MessageBoxIndirectW(const(MSGBOXPARAMSW)*);
3986 BOOL ModifyMenuA(HMENU, UINT, UINT, UINT_PTR, LPCSTR);
3987 BOOL ModifyMenuW(HMENU, UINT, UINT, UINT_PTR, LPCWSTR);
3988 void mouse_event(DWORD, DWORD, DWORD, DWORD, ULONG_PTR);
3989 BOOL MoveWindow(HWND, int, int, int, int, BOOL);
3990 DWORD MsgWaitForMultipleObjects(DWORD, const(HANDLE)*, BOOL, DWORD, DWORD);
3991 DWORD MsgWaitForMultipleObjectsEx(DWORD, const(HANDLE)*, DWORD, DWORD, DWORD);
3992 DWORD OemKeyScan(WORD);
3993 BOOL OemToCharA(LPCSTR, LPSTR);
3994 BOOL OemToCharBuffA(LPCSTR, LPSTR, DWORD);
3995 BOOL OemToCharBuffW(LPCSTR, LPWSTR, DWORD);
3996 BOOL OemToCharW(LPCSTR, LPWSTR);
3997 BOOL OffsetRect(LPRECT, int, int);
3998 BOOL OpenClipboard(HWND);
3999 HDESK OpenDesktopA(LPSTR, DWORD, BOOL, DWORD);
4000 HDESK OpenDesktopW(LPWSTR, DWORD, BOOL, DWORD);
4001 BOOL OpenIcon(HWND);
4002 HDESK OpenInputDesktop(DWORD, BOOL, DWORD);
4003 HWINSTA OpenWindowStationA(LPSTR, BOOL, DWORD);
4004 HWINSTA OpenWindowStationW(LPWSTR, BOOL, DWORD);
4005 BOOL PaintDesktop(HDC);
4006 BOOL PeekMessageA(LPMSG, HWND, UINT, UINT, UINT);
4007 BOOL PeekMessageW(LPMSG, HWND, UINT, UINT, UINT);
4008 BOOL PostMessageA(HWND, UINT, WPARAM, LPARAM);
4009 BOOL PostMessageW(HWND, UINT, WPARAM, LPARAM);
4010 void PostQuitMessage(int);
4011 BOOL PostThreadMessageA(DWORD, UINT, WPARAM, LPARAM);
4012 BOOL PostThreadMessageW(DWORD, UINT, WPARAM, LPARAM);
4013 BOOL PtInRect(LPCRECT, POINT);
4014 HWND RealChildWindowFromPoint(HWND, POINT);
4015 UINT RealGetWindowClassA(HWND, LPSTR, UINT);
4016 UINT RealGetWindowClassW(HWND, LPWSTR, UINT);
4017 BOOL RedrawWindow(HWND, LPCRECT, HRGN, UINT);
4018 ATOM RegisterClassA(const(WNDCLASSA)*);
4019 ATOM RegisterClassW(const(WNDCLASSW)*);
4020 ATOM RegisterClassExA(const(WNDCLASSEXA)*);
4021 ATOM RegisterClassExW(const(WNDCLASSEXW)*);
4022 UINT RegisterClipboardFormatA(LPCSTR);
4023 UINT RegisterClipboardFormatW(LPCWSTR);
4024 BOOL RegisterHotKey(HWND, int, UINT, UINT);
4025 UINT RegisterWindowMessageA(LPCSTR);
4026 UINT RegisterWindowMessageW(LPCWSTR);
4027 BOOL ReleaseCapture();
4028 int ReleaseDC(HWND, HDC);
4029 BOOL RemoveMenu(HMENU, UINT, UINT);
4030 HANDLE RemovePropA(HWND, LPCSTR);
4031 HANDLE RemovePropW(HWND, LPCWSTR);
4032 BOOL ReplyMessage(LRESULT);
4033 BOOL ScreenToClient(HWND, LPPOINT);
4034 BOOL ScrollDC(HDC, int, int, LPCRECT, LPCRECT, HRGN, LPRECT);
4035 BOOL ScrollWindow(HWND, int, int, LPCRECT, LPCRECT);
4036 int ScrollWindowEx(HWND, int, int, LPCRECT, LPCRECT, HRGN, LPRECT, UINT);
4037 LONG SendDlgItemMessageA(HWND, int, UINT, WPARAM, LPARAM);
4038 LONG SendDlgItemMessageW(HWND, int, UINT, WPARAM, LPARAM);
4039 LRESULT SendMessageA(HWND, UINT, WPARAM, LPARAM);
4040 BOOL SendMessageCallbackA(HWND, UINT, WPARAM, LPARAM, SENDASYNCPROC, ULONG_PTR);
4041 BOOL SendMessageCallbackW(HWND, UINT, WPARAM, LPARAM, SENDASYNCPROC, ULONG_PTR);
4042 LRESULT SendMessageTimeoutA(HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD);
4043 LRESULT SendMessageTimeoutW(HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD);
4044 LRESULT SendMessageW(HWND, UINT, WPARAM, LPARAM);
4045 BOOL SendNotifyMessageA(HWND, UINT, WPARAM, LPARAM);
4046 BOOL SendNotifyMessageW(HWND, UINT, WPARAM, LPARAM);
4047 HWND SetActiveWindow(HWND);
4048 HWND SetCapture(HWND hWnd);
4049 BOOL SetCaretBlinkTime(UINT);
4050 BOOL SetCaretPos(int, int);
4051 DWORD SetClassLongA(HWND, int, LONG);
4052 DWORD SetClassLongW(HWND, int, LONG);
4053 WORD SetClassWord(HWND, int, WORD);
4054 HANDLE SetClipboardData(UINT, HANDLE);
4055 HWND SetClipboardViewer(HWND);
4056 HCURSOR SetCursor(HCURSOR);
4057 BOOL SetCursorPos(int, int);
4058 void SetDebugErrorLevel(DWORD);
4059 BOOL SetDlgItemInt(HWND, int, UINT, BOOL);
4060 BOOL SetDlgItemTextA(HWND, int, LPCSTR);
4061 BOOL SetDlgItemTextW(HWND, int, LPCWSTR);
4062 BOOL SetDoubleClickTime(UINT);
4063 HWND SetFocus(HWND);
4064 BOOL SetForegroundWindow(HWND);
4065 BOOL SetKeyboardState(PBYTE);
4066 BOOL SetMenu(HWND, HMENU);
4067 BOOL SetMenuContextHelpId(HMENU, DWORD);
4068 BOOL SetMenuDefaultItem(HMENU, UINT, UINT);
4069 BOOL SetMenuInfo(HMENU, LPCMENUINFO);
4070 BOOL SetMenuItemBitmaps(HMENU, UINT, UINT, HBITMAP, HBITMAP);
4071 BOOL SetMenuItemInfoA(HMENU, UINT, BOOL, LPCMENUITEMINFOA);
4072 BOOL SetMenuItemInfoW(HMENU, UINT, BOOL, LPCMENUITEMINFOW);
4073 LPARAM SetMessageExtraInfo(LPARAM);
4074 BOOL SetMessageQueue(int);
4075 HWND SetParent(HWND, HWND);
4076 BOOL SetProcessWindowStation(HWINSTA);
4077 BOOL SetPropA(HWND, LPCSTR, HANDLE);
4078 BOOL SetPropW(HWND, LPCWSTR, HANDLE);
4079 BOOL SetRect(LPRECT, int, int, int, int);
4080 BOOL SetRectEmpty(LPRECT);
4081 int SetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL);
4082 int SetScrollPos(HWND, int, int, BOOL);
4083 BOOL SetScrollRange(HWND, int, int, int, BOOL);
4084 BOOL SetSysColors(int, const(INT)*, const(COLORREF)*);
4085 BOOL SetSystemCursor(HCURSOR, DWORD);
4086 BOOL SetThreadDesktop(HDESK);
4087 UINT_PTR SetTimer(HWND, UINT_PTR, UINT, TIMERPROC);
4088 BOOL SetUserObjectInformationA(HANDLE, int, PVOID, DWORD);
4089 BOOL SetUserObjectInformationW(HANDLE, int, PVOID, DWORD);
4090 BOOL SetUserObjectSecurity(HANDLE, PSECURITY_INFORMATION, PSECURITY_DESCRIPTOR);
4091 BOOL SetWindowContextHelpId(HWND, DWORD);
4092 LONG SetWindowLongA(HWND, int, LONG);
4093 LONG SetWindowLongW(HWND, int, LONG);
4094 BOOL SetWindowPlacement(HWND hWnd, const(WINDOWPLACEMENT)*);
4095 BOOL SetWindowPos(HWND, HWND, int, int, int, int, UINT);
4096 int SetWindowRgn(HWND, HRGN, BOOL);
4097 HHOOK SetWindowsHookA(int, HOOKPROC);
4098 HHOOK SetWindowsHookW(int, HOOKPROC);
4099 HHOOK SetWindowsHookExA(int, HOOKPROC, HINSTANCE, DWORD);
4100 HHOOK SetWindowsHookExW(int, HOOKPROC, HINSTANCE, DWORD);
4101 BOOL SetWindowTextA(HWND, LPCSTR);
4102 BOOL SetWindowTextW(HWND, LPCWSTR);
4103 WORD SetWindowWord(HWND, int, WORD);
4104 BOOL ShowCaret(HWND);
4105 int ShowCursor(BOOL);
4106 BOOL ShowOwnedPopups(HWND, BOOL);
4107 BOOL ShowScrollBar(HWND, int, BOOL);
4108 BOOL ShowWindow(HWND, int);
4109 BOOL ShowWindowAsync(HWND, int);
4110 BOOL SubtractRect(LPRECT, LPCRECT, LPCRECT);
4111 BOOL SwapMouseButton(BOOL);
4112 BOOL SwitchDesktop(HDESK);
4113 BOOL SystemParametersInfoA(UINT, UINT, PVOID, UINT);
4114 BOOL SystemParametersInfoW(UINT, UINT, PVOID, UINT);
4115 LONG TabbedTextOutA(HDC, int, int, LPCSTR, int, int, LPINT, int);
4116 LONG TabbedTextOutW(HDC, int, int, LPCWSTR, int, int, LPINT, int);
4117 WORD TileWindows(HWND, UINT, LPCRECT, UINT, const(HWND)*);
4118 int ToAscii(UINT, UINT, PBYTE, LPWORD, UINT);
4119 int ToAsciiEx(UINT, UINT, PBYTE, LPWORD, UINT, HKL);
4120 int ToUnicode(UINT, UINT, PBYTE, LPWSTR, int, UINT);
4121 int ToUnicodeEx(UINT, UINT, PBYTE, LPWSTR, int, UINT, HKL);
4122 BOOL TrackMouseEvent(LPTRACKMOUSEEVENT);
4123 BOOL TrackPopupMenu(HMENU, UINT, int, int, int, HWND, LPCRECT);
4124 BOOL TrackPopupMenuEx(HMENU, UINT, int, int, HWND, LPTPMPARAMS);
4125 int TranslateAcceleratorA(HWND, HACCEL, LPMSG);
4126 int TranslateAcceleratorW(HWND, HACCEL, LPMSG);
4127 BOOL TranslateMDISysAccel(HWND, LPMSG);
4128 BOOL TranslateMessage(const(MSG)*);
4129 BOOL UnhookWindowsHook(int, HOOKPROC);
4130 BOOL UnhookWindowsHookEx(HHOOK);
4131 BOOL UnionRect(LPRECT, LPCRECT, LPCRECT);
4132 BOOL UnloadKeyboardLayout(HKL);
4133 BOOL UnregisterClassA(LPCSTR, HINSTANCE);
4134 BOOL UnregisterClassW(LPCWSTR, HINSTANCE);
4135 BOOL UnregisterHotKey(HWND, int);
4136 BOOL UpdateWindow(HWND);
4137 BOOL ValidateRect(HWND, LPCRECT);
4138 BOOL ValidateRgn(HWND, HRGN);
4139 SHORT VkKeyScanA(CHAR);
4140 SHORT VkKeyScanExA(CHAR, HKL);
4141 SHORT VkKeyScanExW(WCHAR, HKL);
4142 SHORT VkKeyScanW(WCHAR);
4143 DWORD WaitForInputIdle(HANDLE, DWORD);
4144 BOOL WaitMessage();
4145 HWND WindowFromDC(HDC hDC);
4146 HWND WindowFromPoint(POINT);
4147 UINT WinExec(LPCSTR, UINT);
4148 BOOL WinHelpA(HWND, LPCSTR, UINT, ULONG_PTR);
4149 BOOL WinHelpW(HWND, LPCWSTR, UINT, ULONG_PTR);
4150 
4151 extern (C) {
4152     int wsprintfA(LPSTR, LPCSTR, ...);
4153     int wsprintfW(LPWSTR, LPCWSTR, ...);
4154 }
4155 
4156 
4157 // These shouldn't be necessary for D.
4158 alias TypeDef!(char*) va_list_;
4159 int wvsprintfA(LPSTR, LPCSTR, va_list_ arglist);
4160 int wvsprintfW(LPWSTR, LPCWSTR, va_list_ arglist);
4161 
4162 enum : DWORD {
4163     MONITOR_DEFAULTTONULL,
4164     MONITOR_DEFAULTTOPRIMARY,
4165     MONITOR_DEFAULTTONEAREST // = 2
4166 }
4167 enum MONITORINFOF_PRIMARY = 1;
4168 
4169 enum EDS_RAWMODE = 0x00000002;
4170 
4171 enum {
4172     ISMEX_NOSEND   = 0,
4173     ISMEX_SEND     = 1,
4174     ISMEX_NOTIFY   = 2,
4175     ISMEX_CALLBACK = 4,
4176     ISMEX_REPLIED  = 8
4177 }
4178 
4179 struct TITLEBARINFO {
4180     DWORD cbSize = TITLEBARINFO.sizeof;
4181     RECT  rcTitleBar;
4182     DWORD[CCHILDREN_TITLEBAR+1] rgstate;
4183 }
4184 alias TITLEBARINFO* PTITLEBARINFO, LPTITLEBARINFO;
4185 
4186 static if (_WIN32_WINNT >= 0x501) { // *** correct?
4187     struct FLASHWINFO {
4188         UINT  cbSize = this.sizeof;
4189         HWND  hwnd;
4190         DWORD dwFlags;
4191         UINT  uCount;
4192         DWORD dwTimeout;
4193     }
4194     alias FLASHWINFO* PFLASHWINFO;
4195 }
4196 
4197 enum DWORD ASFW_ANY = -1;
4198 enum : UINT {
4199     LSFW_LOCK = 1,
4200     LSFW_UNLOCK
4201 }
4202 enum {
4203     GMMP_USE_DISPLAY_POINTS = 1,
4204     GMMP_USE_HIGH_RESOLUTION_POINTS
4205 }
4206 
4207 struct MOUSEMOVEPOINT {
4208     int x;
4209     int y;
4210     DWORD time;
4211     ULONG_PTR dwExtraInfo;
4212 }
4213 alias MOUSEMOVEPOINT* PMOUSEMOVEPOINT, LPMOUSEMOVEPOINT;
4214 
4215 enum {
4216     MIM_MAXHEIGHT       =  1,
4217     MIM_BACKGROUND      =  2,
4218     MIM_HELPID          =  4,
4219     MIM_MENUDATA        =  8,
4220     MIM_STYLE           = 16,
4221     MIM_APPLYTOSUBMENUS = 0x80000000L
4222 }
4223 
4224 enum {
4225     MNS_NOCHECK     = 0x80000000,
4226     MNS_MODELESS    = 0x40000000,
4227     MNS_DRAGDROP    = 0x20000000,
4228     MNS_AUTODISMISS = 0x10000000,
4229     MNS_NOTIFYBYPOS = 0x08000000,
4230     MNS_CHECKORBMP  = 0x04000000
4231 }
4232 
4233 enum {
4234     PM_QS_INPUT       = (QS_INPUT << 16),
4235     PM_QS_POSTMESSAGE = ((QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16),
4236     PM_QS_PAINT       = (QS_PAINT << 16),
4237     PM_QS_SENDMESSAGE = (QS_SENDMESSAGE << 16)
4238 }
4239 /*
4240 #define WM_GETOBJECT 0x003D
4241 #define WM_CHANGEUISTATE 0x0127
4242 #define WM_UPDATEUISTATE 0x0128
4243 #define WM_QUERYUISTATE 0x0129
4244 #define WM_UNINITMENUPOPUP 0x0125
4245 #define WM_MENURBUTTONUP 290
4246 #define WM_MENUCOMMAND 0x0126
4247 #define WM_MENUGETOBJECT 0x0124
4248 #define WM_MENUDRAG 0x0123
4249 #define WM_APPCOMMAND 0x0319
4250 #define WM_NCXBUTTONDOWN 171
4251 #define WM_NCXBUTTONUP 172
4252 #define WM_NCXBUTTONDBLCLK 173
4253 #define WM_NCMOUSEHOVER 0x02A0
4254 #define WM_NCMOUSELEAVE 0x02A2*/
4255 
4256 enum {
4257     FLASHW_STOP      = 0,
4258     FLASHW_CAPTION   = 0x01,
4259     FLASHW_TRAY      = 0x02,
4260     FLASHW_ALL       = 0x03,
4261     FLASHW_TIMER     = 0x04,
4262     FLASHW_TIMERNOFG = 0x0C
4263 }
4264 
4265 enum CHILDID_SELF = 0;
4266 
4267 enum {
4268     OBJID_WINDOW   = 0x00000000,
4269     OBJID_SOUND    = 0xFFFFFFF5,
4270     OBJID_ALERT    = 0xFFFFFFF6,
4271     OBJID_CURSOR   = 0xFFFFFFF7,
4272     OBJID_CARET    = 0xFFFFFFF8,
4273     OBJID_SIZEGRIP = 0xFFFFFFF9,
4274     OBJID_HSCROLL  = 0xFFFFFFFA,
4275     OBJID_VSCROLL  = 0xFFFFFFFB,
4276     OBJID_CLIENT   = 0xFFFFFFFC,
4277     OBJID_MENU     = 0xFFFFFFFD,
4278     OBJID_TITLEBAR = 0xFFFFFFFE,
4279     OBJID_SYSMENU  = 0xFFFFFFFF
4280 }
4281 
4282 enum {
4283     GUI_CARETBLINKING  = 0x0001,
4284     GUI_INMOVESIZE     = 0x0002,
4285     GUI_INMENUMODE     = 0x0004,
4286     GUI_SYSTEMMENUMODE = 0x0008,
4287     GUI_POPUPMENUMODE  = 0x0010
4288 }
4289 static if (_WIN32_WINNT >= 0x501) {
4290     enum GUI_16BITTASK = 0x0020;
4291 }
4292 
4293 enum {
4294     WINEVENT_OUTOFCONTEXT   = 0x00,
4295     WINEVENT_SKIPOWNTHREAD  = 0x01,
4296     WINEVENT_SKIPOWNPROCESS = 0x02,
4297     WINEVENT_INCONTEXT      = 0x04
4298 }
4299 
4300 enum {
4301     AW_HOR_POSITIVE = 0x00000001,
4302     AW_HOR_NEGATIVE = 0x00000002,
4303     AW_VER_POSITIVE = 0x00000004,
4304     AW_VER_NEGATIVE = 0x00000008,
4305     AW_CENTER       = 0x00000010,
4306     AW_HIDE         = 0x00010000,
4307     AW_ACTIVATE     = 0x00020000,
4308     AW_SLIDE        = 0x00040000,
4309     AW_BLEND        = 0x00080000
4310 }
4311 
4312 enum {
4313     DEVICE_NOTIFY_WINDOW_HANDLE  = 0x00000000,
4314     DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001
4315 }
4316 
4317 static if (_WIN32_WINNT >= 0x501) {
4318     enum DEVICE_NOTIFY_ALL_INTERFACE_CLASSES = 0x00000004;
4319 }
4320 
4321 enum : DWORD {
4322     EVENT_MIN                          = 0x00000001,
4323     EVENT_SYSTEM_SOUND                 = 0x00000001,
4324     EVENT_SYSTEM_ALERT,
4325     EVENT_SYSTEM_FOREGROUND,
4326     EVENT_SYSTEM_MENUSTART,
4327     EVENT_SYSTEM_MENUEND,
4328     EVENT_SYSTEM_MENUPOPUPSTART,
4329     EVENT_SYSTEM_MENUPOPUPEND,
4330     EVENT_SYSTEM_CAPTURESTART,
4331     EVENT_SYSTEM_CAPTUREEND,
4332     EVENT_SYSTEM_MOVESIZESTART,
4333     EVENT_SYSTEM_MOVESIZEEND,
4334     EVENT_SYSTEM_CONTEXTHELPSTART,
4335     EVENT_SYSTEM_CONTEXTHELPEND,
4336     EVENT_SYSTEM_DRAGDROPSTART,
4337     EVENT_SYSTEM_DRAGDROPEND,
4338     EVENT_SYSTEM_DIALOGSTART,
4339     EVENT_SYSTEM_DIALOGEND,
4340     EVENT_SYSTEM_SCROLLINGSTART,
4341     EVENT_SYSTEM_SCROLLINGEND,
4342     EVENT_SYSTEM_SWITCHSTART,
4343     EVENT_SYSTEM_SWITCHEND,
4344     EVENT_SYSTEM_MINIMIZESTART,
4345     EVENT_SYSTEM_MINIMIZEEND,       // = 0x00000017
4346     EVENT_OBJECT_CREATE                = 0x00008000,
4347     EVENT_OBJECT_DESTROY,
4348     EVENT_OBJECT_SHOW,
4349     EVENT_OBJECT_HIDE,
4350     EVENT_OBJECT_REORDER,
4351     EVENT_OBJECT_FOCUS,
4352     EVENT_OBJECT_SELECTION,
4353     EVENT_OBJECT_SELECTIONADD,
4354     EVENT_OBJECT_SELECTIONREMOVE,
4355     EVENT_OBJECT_SELECTIONWITHIN,
4356     EVENT_OBJECT_STATECHANGE,
4357     EVENT_OBJECT_LOCATIONCHANGE,
4358     EVENT_OBJECT_NAMECHANGE,
4359     EVENT_OBJECT_DESCRIPTIONCHANGE,
4360     EVENT_OBJECT_VALUECHANGE,
4361     EVENT_OBJECT_PARENTCHANGE,
4362     EVENT_OBJECT_HELPCHANGE,
4363     EVENT_OBJECT_DEFACTIONCHANGE,
4364     EVENT_OBJECT_ACCELERATORCHANGE, // = 0x00008012
4365     EVENT_MAX                          = 0x7FFFFFFF
4366 }
4367 
4368 static if (_WIN32_WINNT >= 0x501) {
4369     enum : DWORD {
4370         EVENT_CONSOLE_CARET                = 0x00004000,
4371         EVENT_CONSOLE_UPDATE_REGION,
4372         EVENT_CONSOLE_UPDATE_SIMPLE,
4373         EVENT_CONSOLE_UPDATE_SCROLL,
4374         EVENT_CONSOLE_LAYOUT,
4375         EVENT_CONSOLE_START_APPLICATION,
4376         EVENT_CONSOLE_END_APPLICATION,  // = 0x00004007
4377     }
4378 
4379     enum : LONG {
4380         CONSOLE_CARET_SELECTION  = 1,
4381         CONSOLE_CARET_VISIBLE // = 2
4382     }
4383     enum LONG CONSOLE_APPLICATION_16BIT = 1;
4384 }
4385 
4386 enum {
4387     LWA_COLORKEY = 1,
4388     LWA_ALPHA
4389 }
4390 enum {
4391     ULW_COLORKEY = 1,
4392     ULW_ALPHA    = 2,
4393     ULW_OPAQUE   = 4
4394 }
4395 enum {
4396     GR_GDIOBJECTS,
4397     GR_USEROBJECTS
4398 }
4399 
4400 enum {
4401     XBUTTON1 = 1,
4402     XBUTTON2
4403 }
4404 
4405 struct GUITHREADINFO {
4406     DWORD cbSize = this.sizeof;
4407     DWORD flags;
4408     HWND  hwndActive;
4409     HWND  hwndFocus;
4410     HWND  hwndCapture;
4411     HWND  hwndMenuOwner;
4412     HWND  hwndMoveSize;
4413     HWND  hwndCaret;
4414     RECT  rcCaret;
4415 }
4416 alias GUITHREADINFO* PGUITHREADINFO, LPGUITHREADINFO;
4417 extern (Windows) {
4418     alias void function(HWINEVENTHOOK, DWORD, HWND, LONG, LONG, DWORD, DWORD) WINEVENTPROC;
4419 }
4420 // *** line 4680 of MinGW 4.0
4421 int BroadcastSystemMessageA(DWORD, LPDWORD, UINT, WPARAM, LPARAM);
4422 int BroadcastSystemMessageW(DWORD, LPDWORD, UINT, WPARAM, LPARAM);
4423 
4424 UINT SendInput(UINT, LPINPUT, int);
4425 BOOL EnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
4426 BOOL GetMonitorInfoA(HMONITOR, LPMONITORINFO);
4427 extern(D) BOOL GetMonitorInfoA(HMONITOR m, LPMONITORINFOEXA mi) { return GetMonitorInfoA(m, cast(LPMONITORINFO)mi); }
4428 BOOL GetMonitorInfoW(HMONITOR, LPMONITORINFO);
4429 extern(D) BOOL GetMonitorInfoW(HMONITOR m, LPMONITORINFOEXW mi) { return GetMonitorInfoW(m, cast(LPMONITORINFO)mi); }
4430 HMONITOR MonitorFromPoint(POINT, DWORD);
4431 HMONITOR MonitorFromRect(LPCRECT, DWORD);
4432 HMONITOR MonitorFromWindow(HWND, DWORD);
4433 BOOL AllowSetForegroundWindow(DWORD);
4434 BOOL AnimateWindow(HWND, DWORD, DWORD);
4435 BOOL EndTask(HWND, BOOL, BOOL);
4436 BOOL EnumDisplaySettingsExA(LPCSTR, DWORD, LPDEVMODEA, DWORD);
4437 BOOL EnumDisplaySettingsExW(LPCWSTR, DWORD, LPDEVMODEW, DWORD);
4438 DWORD GetClipboardSequenceNumber();
4439 DWORD GetGuiResources(HANDLE, DWORD);
4440 BOOL GetGUIThreadInfo(DWORD, LPGUITHREADINFO);
4441 
4442 int GetMouseMovePointsEx(UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD);
4443 BOOL GetProcessDefaultLayout(DWORD*);
4444 HWND GetShellWindow();
4445 BOOL IsHungAppWindow(HWND);
4446 DWORD InSendMessageEx(LPVOID);
4447 BOOL LockSetForegroundWindow(UINT);
4448 BOOL LockWorkStation();
4449 void NotifyWinEvent(DWORD, HWND, LONG, LONG);
4450 HDEVNOTIFY RegisterDeviceNotificationA(HANDLE, LPVOID, DWORD);
4451 HDEVNOTIFY RegisterDeviceNotificationW(HANDLE, LPVOID, DWORD);
4452 BOOL SetProcessDefaultLayout(DWORD);
4453 HWINEVENTHOOK SetWinEventHook(UINT, UINT, HMODULE, WINEVENTPROC, DWORD, DWORD, UINT);
4454 void SwitchToThisWindow(HWND, BOOL);
4455 BOOL SetLayeredWindowAttributes(HWND, COLORREF, BYTE, DWORD);
4456 BOOL UpdateLayeredWindow(HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD);
4457 BOOL UserHandleGrantAccess(HANDLE, HANDLE, BOOL);
4458 BOOL UnhookWinEvent(HWINEVENTHOOK);
4459 BOOL UnregisterDeviceNotification(HANDLE);
4460 
4461 static if (_WIN32_WINNT >= 0x501) {
4462     int BroadcastSystemMessageExA(DWORD, LPDWORD, UINT, WPARAM, LPARAM, PBSMINFO);
4463     int BroadcastSystemMessageExW(DWORD, LPDWORD, UINT, WPARAM, LPARAM, PBSMINFO);
4464     LRESULT DefRawInputProc(PRAWINPUT*, INT, UINT);
4465     BOOL FlashWindowEx(PFLASHWINFO);
4466     BOOL GetLayeredWindowAttributes(HWND, COLORREF*, BYTE*, DWORD*);
4467     UINT GetRawInputBuffer(PRAWINPUT, PUINT, UINT);
4468     UINT GetRawInputData(HRAWINPUT, UINT, LPVOID, PUINT, UINT);
4469     UINT GetRawInputDeviceInfoA(HANDLE, UINT, LPVOID, PUINT);
4470     UINT GetRawInputDeviceInfoW(HANDLE, UINT, LPVOID, PUINT);
4471     UINT GetRawInputDeviceList(PRAWINPUTDEVICELIST, PUINT, UINT);
4472     UINT GetRegisteredRawInputDevices(PRAWINPUTDEVICE, PUINT, UINT);
4473     BOOL IsGUIThread(BOOL);
4474     BOOL IsWinEventHookInstalled(DWORD);
4475     BOOL PrintWindow(HWND, HDC, UINT);
4476     BOOL RegisterRawInputDevices(PCRAWINPUTDEVICE, UINT, UINT);
4477 }
4478 
4479 version (Win64) {
4480     ULONG_PTR GetClassLongPtrA(HWND, int);
4481     ULONG_PTR GetClassLongPtrW(HWND, int);
4482     ULONG_PTR SetClassLongPtrA(HWND, int, LONG_PTR);
4483     ULONG_PTR SetClassLongPtrW(HWND, int, LONG_PTR);
4484     LONG_PTR GetWindowLongPtrA(HWND, int);
4485     LONG_PTR GetWindowLongPtrW(HWND, int);
4486     LONG_PTR SetWindowLongPtrA(HWND, int, LONG_PTR);
4487     LONG_PTR SetWindowLongPtrW(HWND, int, LONG_PTR);
4488 } else {
4489     alias GetClassLongA GetClassLongPtrA;
4490     alias GetClassLongW GetClassLongPtrW;
4491     alias SetClassLongA SetClassLongPtrA;
4492     alias SetClassLongW SetClassLongPtrW;
4493     alias GetWindowLongA GetWindowLongPtrA;
4494     alias GetWindowLongW GetWindowLongPtrW;
4495     alias SetWindowLongA SetWindowLongPtrA;
4496     alias SetWindowLongW SetWindowLongPtrW;
4497 }
4498 
4499 
4500 // -----
4501 // Aliases for Unicode or Ansi
4502 version (Unicode) {
4503     alias EDITWORDBREAKPROCW EDITWORDBREAKPROC;
4504     alias PROPENUMPROCW PROPENUMPROC;
4505     alias PROPENUMPROCEXW PROPENUMPROCEX;
4506     alias DESKTOPENUMPROCW DESKTOPENUMPROC;
4507     alias WINSTAENUMPROCW WINSTAENUMPROC;
4508     alias MAKEINTRESOURCEW MAKEINTRESOURCE;
4509 
4510     alias WNDCLASSW WNDCLASS;
4511     alias WNDCLASSEXW WNDCLASSEX;
4512     alias MENUITEMINFOW MENUITEMINFO;
4513     alias LPCMENUITEMINFOW LPCMENUITEMINFO;
4514     alias MSGBOXPARAMSW MSGBOXPARAMS;
4515     alias HIGHCONTRASTW HIGHCONTRAST;
4516     alias SERIALKEYSW SERIALKEYS;
4517     alias SOUNDSENTRYW SOUNDSENTRY;
4518     alias CREATESTRUCTW CREATESTRUCT;
4519     alias CBT_CREATEWNDW CBT_CREATEWND;
4520     alias MDICREATESTRUCTW MDICREATESTRUCT;
4521     alias MULTIKEYHELPW MULTIKEYHELP;
4522     alias MONITORINFOEXW MONITORINFOEX;
4523     alias ICONMETRICSW ICONMETRICS;
4524     alias NONCLIENTMETRICSW NONCLIENTMETRICS;
4525 
4526     alias AppendMenuW AppendMenu;
4527     alias BroadcastSystemMessageW BroadcastSystemMessage;
4528     static if (_WIN32_WINNT >= 0x501) {
4529         alias BroadcastSystemMessageExW BroadcastSystemMessageEx;
4530     }
4531     alias CallMsgFilterW CallMsgFilter;
4532     alias CallWindowProcW CallWindowProc;
4533     alias ChangeMenuW ChangeMenu;
4534     alias CharLowerW CharLower;
4535     alias CharLowerBuffW CharLowerBuff;
4536     alias CharNextW CharNext;
4537     alias CharNextExW CharNextEx;
4538     alias CharPrevW CharPrev;
4539     alias CharPrevExW CharPrevEx;
4540     alias CharToOemW CharToOem;
4541     alias CharToOemBuffW CharToOemBuff;
4542     alias CharUpperW CharUpper;
4543     alias CharUpperBuffW CharUpperBuff;
4544     alias CopyAcceleratorTableW CopyAcceleratorTable;
4545     alias CreateAcceleratorTableW CreateAcceleratorTable;
4546     alias CreateDialogW CreateDialog;
4547     alias CreateDialogIndirectW CreateDialogIndirect;
4548     alias CreateDialogIndirectParamW CreateDialogIndirectParam;
4549     alias CreateDialogParamW CreateDialogParam;
4550     alias CreateMDIWindowW CreateMDIWindow;
4551     alias CreateWindowW CreateWindow;
4552     alias CreateWindowExW CreateWindowEx;
4553     alias CreateWindowStationW CreateWindowStation;
4554     alias DefDlgProcW DefDlgProc;
4555     alias DefFrameProcW DefFrameProc;
4556     alias DefMDIChildProcW DefMDIChildProc;
4557     alias DefWindowProcW DefWindowProc;
4558     alias DialogBoxW DialogBox;
4559     alias DialogBoxIndirectW DialogBoxIndirect;
4560     alias DialogBoxIndirectParamW DialogBoxIndirectParam;
4561     alias DialogBoxParamW DialogBoxParam;
4562     alias DispatchMessageW DispatchMessage;
4563     alias DlgDirListW DlgDirList;
4564     alias DlgDirListComboBoxW DlgDirListComboBox;
4565     alias DlgDirSelectComboBoxExW DlgDirSelectComboBoxEx;
4566     alias DlgDirSelectExW DlgDirSelectEx;
4567     alias DrawStateW DrawState;
4568     alias DrawTextW DrawText;
4569     alias DrawTextExW DrawTextEx;
4570     alias EnumDesktopsW EnumDesktops;
4571     alias EnumPropsW EnumProps;
4572     alias EnumPropsExW EnumPropsEx;
4573     alias EnumWindowStationsW EnumWindowStations;
4574     alias FindWindowW FindWindow;
4575     alias FindWindowExW FindWindowEx;
4576     alias GetClassInfoW GetClassInfo;
4577     alias GetClassInfoExW GetClassInfoEx;
4578     alias GetClassLongW GetClassLong;
4579     alias GetClassLongPtrW GetClassLongPtr;
4580     alias GetClassNameW GetClassName;
4581     alias GetClipboardFormatNameW GetClipboardFormatName;
4582     alias GetDlgItemTextW GetDlgItemText;
4583     alias GetKeyboardLayoutNameW GetKeyboardLayoutName;
4584     alias GetKeyNameTextW GetKeyNameText;
4585     alias GetMenuItemInfoW GetMenuItemInfo;
4586     alias GetMenuStringW GetMenuString;
4587     alias GetMessageW GetMessage;
4588     alias GetMonitorInfoW GetMonitorInfo;
4589     alias GetPropW GetProp;
4590     static if (_WIN32_WINNT >= 0x501) {
4591         alias GetRawInputDeviceInfoW GetRawInputDeviceInfo;
4592     }
4593     alias GetTabbedTextExtentW GetTabbedTextExtent;
4594     alias GetUserObjectInformationW GetUserObjectInformation;
4595     alias GetWindowLongW GetWindowLong;
4596     alias GetWindowLongPtrW GetWindowLongPtr;
4597     alias GetWindowTextW GetWindowText;
4598     alias GetWindowTextLengthW GetWindowTextLength;
4599     alias GetAltTabInfoW GetAltTabInfo;
4600     alias GetWindowModuleFileNameW GetWindowModuleFileName;
4601     alias GrayStringW GrayString;
4602     alias InsertMenuW InsertMenu;
4603     alias InsertMenuItemW InsertMenuItem;
4604     alias IsCharAlphaW IsCharAlpha;
4605     alias IsCharAlphaNumericW IsCharAlphaNumeric;
4606     alias IsCharLowerW IsCharLower;
4607     alias IsCharUpperW IsCharUpper;
4608     alias IsDialogMessageW IsDialogMessage;
4609     alias LoadAcceleratorsW LoadAccelerators;
4610     alias LoadBitmapW LoadBitmap;
4611     alias LoadCursorW LoadCursor;
4612     alias LoadCursorFromFileW LoadCursorFromFile;
4613     alias LoadIconW LoadIcon;
4614     alias LoadImageW LoadImage;
4615     alias LoadKeyboardLayoutW LoadKeyboardLayout;
4616     alias LoadMenuW LoadMenu;
4617     alias LoadMenuIndirectW LoadMenuIndirect;
4618     alias LoadStringW LoadString;
4619     alias MapVirtualKeyW MapVirtualKey;
4620     alias MapVirtualKeyExW MapVirtualKeyEx;
4621     alias MessageBoxW MessageBox;
4622     alias MessageBoxExW MessageBoxEx;
4623     alias MessageBoxIndirectW MessageBoxIndirect;
4624     alias ModifyMenuW ModifyMenu;
4625     alias OemToCharW OemToChar;
4626     alias OemToCharBuffW OemToCharBuff;
4627     alias OpenDesktopW OpenDesktop;
4628     alias OpenWindowStationW OpenWindowStation;
4629     alias PeekMessageW PeekMessage;
4630     alias PostMessageW PostMessage;
4631     alias PostThreadMessageW PostThreadMessage;
4632     alias RealGetWindowClassW RealGetWindowClass;
4633     alias RegisterClassW RegisterClass;
4634     alias RegisterClassExW RegisterClassEx;
4635     alias RegisterClipboardFormatW RegisterClipboardFormat;
4636     alias RegisterDeviceNotificationW RegisterDeviceNotification;
4637     alias RegisterWindowMessageW RegisterWindowMessage;
4638     alias RemovePropW RemoveProp;
4639     alias SendDlgItemMessageW SendDlgItemMessage;
4640     alias SendMessageW SendMessage;
4641     alias SendMessageCallbackW SendMessageCallback;
4642     alias SendMessageTimeoutW SendMessageTimeout;
4643     alias SendNotifyMessageW SendNotifyMessage;
4644     alias SetClassLongW SetClassLong;
4645     alias SetClassLongPtrW SetClassLongPtr;
4646     alias SetDlgItemTextW SetDlgItemText;
4647     alias SetMenuItemInfoW SetMenuItemInfo;
4648     alias SetPropW SetProp;
4649     alias SetUserObjectInformationW SetUserObjectInformation;
4650     alias SetWindowLongW SetWindowLong;
4651     alias SetWindowLongPtrW SetWindowLongPtr;
4652     alias SetWindowsHookW SetWindowsHook;
4653     alias SetWindowsHookExW SetWindowsHookEx;
4654     alias SetWindowTextW SetWindowText;
4655     alias SystemParametersInfoW SystemParametersInfo;
4656     alias TabbedTextOutW TabbedTextOut;
4657     alias TranslateAcceleratorW TranslateAccelerator;
4658     alias UnregisterClassW UnregisterClass;
4659     alias VkKeyScanW VkKeyScan;
4660     alias VkKeyScanExW VkKeyScanEx;
4661     alias WinHelpW WinHelp;
4662     alias wsprintfW wsprintf;
4663     alias wvsprintfW wvsprintf;
4664 
4665     alias ChangeDisplaySettingsW ChangeDisplaySettings;
4666     alias ChangeDisplaySettingsExW ChangeDisplaySettingsEx;
4667     alias CreateDesktopW CreateDesktop;
4668     alias EnumDisplaySettingsW EnumDisplaySettings;
4669     alias EnumDisplaySettingsExW EnumDisplaySettingsEx;
4670     alias EnumDisplayDevicesW EnumDisplayDevices;
4671 
4672 } else { // ANSI
4673 
4674     alias EDITWORDBREAKPROCA EDITWORDBREAKPROC;
4675     alias PROPENUMPROCA PROPENUMPROC;
4676     alias PROPENUMPROCEXA PROPENUMPROCEX;
4677     alias DESKTOPENUMPROCA DESKTOPENUMPROC;
4678     alias WINSTAENUMPROCA WINSTAENUMPROC;
4679     alias MAKEINTRESOURCEA MAKEINTRESOURCE;
4680 
4681     alias WNDCLASSA WNDCLASS;
4682     alias WNDCLASSEXA WNDCLASSEX;
4683     alias MENUITEMINFOA MENUITEMINFO;
4684     alias LPCMENUITEMINFOA LPCMENUITEMINFO;
4685     alias MSGBOXPARAMSA MSGBOXPARAMS;
4686     alias HIGHCONTRASTA HIGHCONTRAST;
4687     alias SERIALKEYSA SERIALKEYS;
4688     alias SOUNDSENTRYA SOUNDSENTRY;
4689     alias CREATESTRUCTA CREATESTRUCT;
4690     alias CBT_CREATEWNDA CBT_CREATEWND;
4691     alias MDICREATESTRUCTA MDICREATESTRUCT;
4692     alias MULTIKEYHELPA MULTIKEYHELP;
4693     alias MONITORINFOEXA MONITORINFOEX;
4694     alias ICONMETRICSA ICONMETRICS;
4695     alias NONCLIENTMETRICSA NONCLIENTMETRICS;
4696 
4697     alias AppendMenuA AppendMenu;
4698     alias BroadcastSystemMessageA BroadcastSystemMessage;
4699     static if (_WIN32_WINNT >= 0x501) {
4700         alias BroadcastSystemMessageExA BroadcastSystemMessageEx;
4701     }
4702     alias CallMsgFilterA CallMsgFilter;
4703     alias CallWindowProcA CallWindowProc;
4704     alias ChangeMenuA ChangeMenu;
4705     alias CharLowerA CharLower;
4706     alias CharLowerBuffA CharLowerBuff;
4707     alias CharNextA CharNext;
4708     alias CharNextExA CharNextEx;
4709     alias CharPrevA CharPrev;
4710     alias CharPrevExA CharPrevEx;
4711     alias CharToOemA CharToOem;
4712     alias CharToOemBuffA CharToOemBuff;
4713     alias CharUpperA CharUpper;
4714     alias CharUpperBuffA CharUpperBuff;
4715     alias CopyAcceleratorTableA CopyAcceleratorTable;
4716     alias CreateAcceleratorTableA CreateAcceleratorTable;
4717     alias CreateDialogA CreateDialog;
4718     alias CreateDialogIndirectA CreateDialogIndirect;
4719     alias CreateDialogIndirectParamA CreateDialogIndirectParam;
4720     alias CreateDialogParamA CreateDialogParam;
4721     alias CreateMDIWindowA CreateMDIWindow;
4722     alias CreateWindowA CreateWindow;
4723     alias CreateWindowExA CreateWindowEx;
4724     alias CreateWindowStationA CreateWindowStation;
4725     alias DefDlgProcA DefDlgProc;
4726     alias DefFrameProcA DefFrameProc;
4727     alias DefMDIChildProcA DefMDIChildProc;
4728     alias DefWindowProcA DefWindowProc;
4729     alias DialogBoxA DialogBox;
4730     alias DialogBoxIndirectA DialogBoxIndirect;
4731     alias DialogBoxIndirectParamA DialogBoxIndirectParam;
4732     alias DialogBoxParamA DialogBoxParam;
4733     alias DispatchMessageA DispatchMessage;
4734     alias DlgDirListA DlgDirList;
4735     alias DlgDirListComboBoxA DlgDirListComboBox;
4736     alias DlgDirSelectComboBoxExA DlgDirSelectComboBoxEx;
4737     alias DlgDirSelectExA DlgDirSelectEx;
4738     alias DrawStateA DrawState;
4739     alias DrawTextA DrawText;
4740     alias DrawTextExA DrawTextEx;
4741     alias EnumDesktopsA EnumDesktops;
4742     alias EnumPropsA EnumProps;
4743     alias EnumPropsExA EnumPropsEx;
4744     alias EnumWindowStationsA EnumWindowStations;
4745     alias FindWindowA FindWindow;
4746     alias FindWindowExA FindWindowEx;
4747     alias GetClassInfoA GetClassInfo;
4748     alias GetClassInfoExA GetClassInfoEx;
4749     alias GetClassLongA GetClassLong;
4750     alias GetClassLongPtrA GetClassLongPtr;
4751     alias GetClassNameA GetClassName;
4752     alias GetClipboardFormatNameA GetClipboardFormatName;
4753     alias GetDlgItemTextA GetDlgItemText;
4754     alias GetKeyboardLayoutNameA GetKeyboardLayoutName;
4755     alias GetKeyNameTextA GetKeyNameText;
4756     alias GetMenuItemInfoA GetMenuItemInfo;
4757     alias GetMenuStringA GetMenuString;
4758     alias GetMessageA GetMessage;
4759     alias GetMonitorInfoA GetMonitorInfo;
4760     alias GetPropA GetProp;
4761     static if (_WIN32_WINNT >= 0x501) {
4762         alias GetRawInputDeviceInfoA GetRawInputDeviceInfo;
4763     }
4764     alias GetTabbedTextExtentA GetTabbedTextExtent;
4765     alias GetUserObjectInformationA GetUserObjectInformation;
4766     alias GetWindowLongA GetWindowLong;
4767     alias GetWindowLongPtrA GetWindowLongPtr;
4768     alias GetWindowTextA GetWindowText;
4769     alias GetWindowTextLengthA GetWindowTextLength;
4770     alias GetAltTabInfoA GetAltTabInfo;
4771     alias GetWindowModuleFileNameA GetWindowModuleFileName;
4772     alias GrayStringA GrayString;
4773     alias InsertMenuA InsertMenu;
4774     alias InsertMenuItemA InsertMenuItem;
4775     alias IsCharAlphaA IsCharAlpha;
4776     alias IsCharAlphaNumericA IsCharAlphaNumeric;
4777     alias IsCharLowerA IsCharLower;
4778     alias IsCharUpperA IsCharUpper;
4779     alias IsDialogMessageA IsDialogMessage;
4780     alias LoadAcceleratorsA LoadAccelerators;
4781     alias LoadBitmapA LoadBitmap;
4782     alias LoadCursorA LoadCursor;
4783     alias LoadIconA LoadIcon;
4784     alias LoadCursorFromFileA LoadCursorFromFile;
4785     alias LoadImageA LoadImage;
4786     alias LoadKeyboardLayoutA LoadKeyboardLayout;
4787     alias LoadMenuA LoadMenu;
4788     alias LoadMenuIndirectA LoadMenuIndirect;
4789     alias LoadStringA LoadString;
4790     alias MapVirtualKeyA MapVirtualKey;
4791     alias MapVirtualKeyExA MapVirtualKeyEx;
4792     alias MessageBoxA MessageBox;
4793     alias MessageBoxExA MessageBoxEx;
4794     alias MessageBoxIndirectA MessageBoxIndirect;
4795     alias ModifyMenuA ModifyMenu;
4796     alias OemToCharA OemToChar;
4797     alias OemToCharBuffA OemToCharBuff;
4798     alias OpenDesktopA OpenDesktop;
4799     alias OpenWindowStationA OpenWindowStation;
4800     alias PeekMessageA PeekMessage;
4801     alias PostMessageA PostMessage;
4802     alias PostThreadMessageA PostThreadMessage;
4803     alias RealGetWindowClassA RealGetWindowClass;
4804     alias RegisterClassA RegisterClass;
4805     alias RegisterClassExA RegisterClassEx;
4806     alias RegisterClipboardFormatA RegisterClipboardFormat;
4807     alias RegisterDeviceNotificationA RegisterDeviceNotification;
4808     alias RegisterWindowMessageA RegisterWindowMessage;
4809     alias RemovePropA RemoveProp;
4810     alias SendDlgItemMessageA SendDlgItemMessage;
4811     alias SendMessageA SendMessage;
4812     alias SendMessageCallbackA SendMessageCallback;
4813     alias SendMessageTimeoutA SendMessageTimeout;
4814     alias SendNotifyMessageA SendNotifyMessage;
4815     alias SetClassLongA SetClassLong;
4816     alias SetClassLongPtrA SetClassLongPtr;
4817     alias SetDlgItemTextA SetDlgItemText;
4818     alias SetMenuItemInfoA SetMenuItemInfo;
4819     alias SetPropA SetProp;
4820     alias SetUserObjectInformationA SetUserObjectInformation;
4821     alias SetWindowLongA SetWindowLong;
4822     alias SetWindowLongPtrA SetWindowLongPtr;
4823     alias SetWindowsHookA SetWindowsHook;
4824     alias SetWindowsHookExA SetWindowsHookEx;
4825     alias SetWindowTextA SetWindowText;
4826     alias SystemParametersInfoA SystemParametersInfo;
4827     alias TabbedTextOutA TabbedTextOut;
4828     alias TranslateAcceleratorA TranslateAccelerator;
4829     alias UnregisterClassA UnregisterClass;
4830     alias VkKeyScanA VkKeyScan;
4831     alias VkKeyScanExA VkKeyScanEx;
4832     alias WinHelpA WinHelp;
4833     alias wsprintfA wsprintf;
4834     alias wvsprintfA wvsprintf;
4835 
4836     alias ChangeDisplaySettingsA ChangeDisplaySettings;
4837     alias ChangeDisplaySettingsExA ChangeDisplaySettingsEx;
4838     alias CreateDesktopA CreateDesktop;
4839     alias EnumDisplaySettingsA EnumDisplaySettings;
4840     alias EnumDisplaySettingsExA EnumDisplaySettingsEx;
4841     alias EnumDisplayDevicesA EnumDisplayDevices;
4842 }
4843 
4844 alias WNDCLASS* LPWNDCLASS, PWNDCLASS;
4845 alias WNDCLASSEX* LPWNDCLASSEX, PWNDCLASSEX;
4846 alias MENUITEMINFO* LPMENUITEMINFO;
4847 alias MSGBOXPARAMS* PMSGBOXPARAMS, LPMSGBOXPARAMS;
4848 alias HIGHCONTRAST* LPHIGHCONTRAST;
4849 alias SERIALKEYS* LPSERIALKEYS;
4850 alias SOUNDSENTRY* LPSOUNDSENTRY;
4851 alias CREATESTRUCT* LPCREATESTRUCT;
4852 alias CBT_CREATEWND* LPCBT_CREATEWND;
4853 alias MDICREATESTRUCT* LPMDICREATESTRUCT;
4854 alias MULTIKEYHELP* PMULTIKEYHELP, LPMULTIKEYHELP;
4855 alias MONITORINFOEX* LPMONITORINFOEX;
4856 alias ICONMETRICS* LPICONMETRICS;
4857 alias NONCLIENTMETRICS* LPNONCLIENTMETRICS;
4858 
4859 static if (_WIN32_WINNT >= 0x501) {
4860     enum PW_CLIENTONLY               = 0x00000001;
4861     enum RIM_INPUT                   = 0x00000000;
4862     enum RIM_INPUTSINK               = 0x00000001;
4863     enum RIM_TYPEMOUSE               = 0x00000000;
4864     enum RIM_TYPEKEYBOARD            = 0x00000001;
4865     enum RIM_TYPEHID                 = 0x00000002;
4866     enum MOUSE_MOVE_RELATIVE         = 0x00000000;
4867     enum MOUSE_MOVE_ABSOLUTE         = 0x00000001;
4868     enum MOUSE_VIRTUAL_DESKTOP       = 0x00000002;
4869     enum MOUSE_ATTRIBUTES_CHANGED    = 0x00000004;
4870     enum RI_MOUSE_LEFT_BUTTON_DOWN   = 0x0001;
4871     enum RI_MOUSE_LEFT_BUTTON_UP     = 0x0002;
4872     enum RI_MOUSE_RIGHT_BUTTON_DOWN  = 0x0004;
4873     enum RI_MOUSE_RIGHT_BUTTON_UP    = 0x0008;
4874     enum RI_MOUSE_MIDDLE_BUTTON_DOWN = 0x0010;
4875     enum RI_MOUSE_MIDDLE_BUTTON_UP   = 0x0020;
4876     enum RI_MOUSE_BUTTON_1_DOWN = RI_MOUSE_LEFT_BUTTON_DOWN;
4877     enum RI_MOUSE_BUTTON_1_UP   = RI_MOUSE_LEFT_BUTTON_UP;
4878     enum RI_MOUSE_BUTTON_2_DOWN = RI_MOUSE_RIGHT_BUTTON_DOWN;
4879     enum RI_MOUSE_BUTTON_2_UP   = RI_MOUSE_RIGHT_BUTTON_UP;
4880     enum RI_MOUSE_BUTTON_3_DOWN = RI_MOUSE_MIDDLE_BUTTON_DOWN;
4881     enum RI_MOUSE_BUTTON_3_UP   = RI_MOUSE_MIDDLE_BUTTON_UP;
4882     enum RI_MOUSE_BUTTON_4_DOWN = 0x0040;
4883     enum RI_MOUSE_BUTTON_4_UP   = 0x0080;
4884     enum RI_MOUSE_BUTTON_5_DOWN = 0x0100;
4885     enum RI_MOUSE_BUTTON_5_UP   = 0x0200;
4886     enum RI_MOUSE_WHEEL         = 0x0400;
4887     enum KEYBOARD_OVERRUN_MAKE_CODE = 0x00ff;
4888     enum RI_KEY_MAKE            = 0x0000;
4889     enum RI_KEY_BREAK           = 0x0001;
4890     enum RI_KEY_E0              = 0x0002;
4891     enum RI_KEY_E1              = 0x0004;
4892     enum RI_KEY_TERMSRV_SET_LED = 0x0008;
4893     enum RI_KEY_TERMSRV_SHADOW  = 0x0010;
4894 
4895     enum RID_INPUT          = 0x10000003;
4896     enum RID_HEADER         = 0x10000005;
4897 
4898     enum RIDI_PREPARSEDDATA = 0x20000005;
4899     enum RIDI_DEVICENAME    = 0x20000007;
4900     enum RIDI_DEVICEINFO    = 0x2000000b;
4901 
4902     enum RIDEV_REMOVE       = 0x00000001;
4903     enum RIDEV_EXCLUDE      = 0x00000010;
4904     enum RIDEV_PAGEONLY     = 0x00000020;
4905     enum RIDEV_NOLEGACY     = 0x00000030;
4906     enum RIDEV_INPUTSINK    = 0x00000100;
4907     enum RIDEV_CAPTUREMOUSE = 0x00000200;
4908     enum RIDEV_NOHOTKEYS    = 0x00000200;
4909     enum RIDEV_APPKEYS      = 0x00000400;
4910 }