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