1 // This module just contains things that are needed but aren't in std.c.windows.windows.
2 // This code is public domain.
3 
4 module dfl.internal.winapi;
5 
6 
7 public import core.sys.windows.windows;
8 private import dfl.internal.wincom;
9 
10 
11 version(D_Version2) {
12    version = DFL_D2;
13    version = DFL_D2_AND_ABOVE;
14 }
15 else version(D_Version3) {
16    version = DFL_D3;
17    version = DFL_D3_AND_ABOVE;
18    version = DFL_D2_AND_ABOVE;
19 }
20 else version(D_Version4) {
21    version = DFL_D4;
22    version = DFL_D4_AND_ABOVE;
23    version = DFL_D3_AND_ABOVE;
24    version = DFL_D2_AND_ABOVE;
25 }
26 else {
27    static assert(0, "This environment is not supported.");
28 }
29 
30 
31 extern(Windows) nothrow:
32 
33 struct SIZE {
34    LONG cx;
35    LONG cy;
36 }
37 alias SIZE* LPSIZE;
38 
39 
40 struct POINTL {
41    LONG x;
42    LONG y;
43 }
44 alias POINTL* LPPOINTL;
45 
46 
47 alias RECT* LPCRECT;
48 
49 
50 alias WORD LANGID;
51 
52 
53 alias size_t ULONG_PTR;
54 
55 
56 alias long LONGLONG;
57 
58 alias ulong DWORDLONG;
59 
60 
61 alias HRESULT THEMEAPI;
62 
63 
64 union LARGE_INTEGER {
65    struct {
66       DWORD LowPart;
67       LONG HighPart;
68    }
69    private struct _U {
70       DWORD LowPart;
71       LONG HighPart;
72    }
73    _U u;
74    LONGLONG QuadPart;
75 }
76 
77 
78 union ULARGE_INTEGER {
79    struct {
80       DWORD LowPart;
81       DWORD HighPart;
82    }
83    private struct _U {
84       DWORD LowPart;
85       DWORD HighPart;
86    }
87    _U u;
88    DWORDLONG QuadPart;
89 }
90 
91 
92 enum: UINT {
93    SWP_NOSIZE = 0x0001,
94    SWP_NOMOVE = 0x0002,
95    SWP_NOZORDER = 0x0004,
96    SWP_NOREDRAW = 0x0008,
97    SWP_NOACTIVATE = 0x0010,
98    SWP_FRAMECHANGED = 0x0020,
99    SWP_SHOWWINDOW = 0x0040,
100    SWP_HIDEWINDOW = 0x0080,
101    SWP_NOCOPYBITS = 0x0100,
102    SWP_NOOWNERZORDER = 0x0200,
103    SWP_NOSENDCHANGING = 0x0400,
104    SWP_DRAWFRAME = SWP_FRAMECHANGED,
105    SWP_NOREPOSITION = SWP_NOOWNERZORDER,
106    SWP_DEFERERASE = 0x2000,
107    SWP_ASYNCWINDOWPOS = 0x4000,
108 }
109 
110 
111 enum: UINT {
112    GW_HWNDFIRST = 0,
113    GW_HWNDLAST = 1,
114    GW_HWNDNEXT = 2,
115    GW_HWNDPREV = 3,
116    GW_OWNER = 4,
117    GW_CHILD = 5,
118 }
119 
120 
121 enum: UINT {
122    DI_MASK = 0x0001,
123    DI_IMAGE = 0x0002,
124    DI_COMPAT = 0x0004,
125    DI_DEFAULTSIZE = 0x0008,
126    DI_NORMAL = DI_IMAGE | DI_MASK,
127 }
128 
129 
130 enum: int {
131    GCL_MENUNAME = -8,
132    GCL_HBRBACKGROUND = -10,
133    GCL_HCURSOR = -12,
134    GCL_HICON = -14,
135    GCL_HMODULE = -16,
136    GCL_CBWNDEXTRA = -18,
137    GCL_CBCLSEXTRA = -20,
138    GCL_WNDPROC = -24,
139    GCL_STYLE = -26,
140    GCW_ATOM = -32,
141    GCL_HICONSM = -34,
142 }
143 
144 
145 enum: UINT {
146    SC_SIZE = 0xF000,
147    SC_MOVE = 0xF010,
148    SC_MINIMIZE = 0xF020,
149    SC_MAXIMIZE = 0xF030,
150    SC_CLOSE = 0xF060,
151    SC_VSCROLL = 0xF070,
152    SC_HSCROLL = 0xF080,
153    SC_RESTORE = 0xF120,
154    SC_SEPARATOR = 0xF00F,
155 }
156 
157 
158 enum: int {
159    GWL_WNDPROC = -4,
160    GWL_HINSTANCE = -6,
161    GWL_HWNDPARENT = -8,
162    GWL_STYLE = -16,
163    GWL_EXSTYLE = -20,
164    GWL_USERDATA = -21,
165    GWL_ID = -12,
166 
167    DWL_MSGRESULT = 0,
168    DWL_DLGPROC = 4,
169    DWL_USER = 8,
170 }
171 
172 
173 enum: UINT {
174    WM_SETFONT = 0x0030,
175    WM_GETFONT = 0x0031,
176    WM_COMPACTING = 0x0041,
177    WM_USER = 0x0400,
178    WM_NEXTDLGCTL = 0x0028,
179    WM_CAPTURECHANGED = 0x0215,
180    WM_WINDOWPOSCHANGING = 0x0046,
181    WM_WINDOWPOSCHANGED = 0x0047,
182    WM_DRAWITEM = 0x002B,
183    WM_DROPFILES = 0x0233,
184    WM_PALETTECHANGED = 0x0311,
185 
186    WM_CLEAR = 0x0303,
187 
188    WM_CUT = 0x0300,
189    WM_COPY = 0x0301,
190    WM_PASTE = 0x0302,
191 
192    WM_MDIACTIVATE = 0x0222,
193    WM_MDITILE = 0x0226,
194    WM_MDICASCADE = 0x0227,
195    WM_MDIICONARRANGE = 0x0228,
196    WM_MDIGETACTIVE = 0x0229,
197 
198    WM_MOUSEWHEEL = 0x020A,
199    WM_MOUSEHOVER = 0x02A1,
200    WM_MOUSELEAVE = 0x02A3,
201 
202    WM_HOTKEY = 0x0312,
203 
204    WM_PRINT = 0x0317,
205    WM_PRINTCLIENT = 0x0318,
206 
207    WM_MEASUREITEM = 0x002C,
208 
209    DM_SETDEFID = WM_USER + 1,
210 }
211 
212 
213 enum: UINT {
214    BFFM_INITIALIZED = 1,
215    BFFM_SETSELECTIONA = WM_USER + 102,
216    BFFM_SETSELECTIONW = WM_USER + 103,
217 }
218 
219 
220 enum: UINT {
221    NM_FIRST = 0,
222    NM_CLICK = NM_FIRST - 2,
223    NM_CUSTOMDRAW = NM_FIRST - 12,
224 }
225 
226 
227 struct NMMOUSE {
228    NMHDR hdr;
229    DWORD dwItemSpec;
230    DWORD dwItemData;
231    POINT pt;
232    LPARAM dwHitInfo;
233 }
234 alias NMMOUSE* LPNMMOUSE;
235 
236 
237 enum: UINT {
238    TTM_ACTIVATE = WM_USER + 1,
239    TTM_SETDELAYTIME = WM_USER + 3,
240    TTM_ADDTOOLA = WM_USER + 4,
241    TTM_DELTOOLA = WM_USER + 5,
242    TTM_GETTOOLINFOA = WM_USER + 8,
243    TTM_GETTEXTA = WM_USER + 11,
244    TTM_UPDATETIPTEXTA = WM_USER + 12,
245    TTM_ENUMTOOLSA = WM_USER + 14,
246    TTM_GETCURRENTTOOLA = WM_USER + 15,
247    TTM_ADDTOOLW = WM_USER + 50,
248    TTM_GETTEXTW = WM_USER + 56,
249    TTM_UPDATETIPTEXTW = WM_USER + 57,
250 }
251 
252 
253 enum: WPARAM {
254    TTDT_AUTOMATIC = 0,
255    TTDT_RESHOW = 1,
256    TTDT_AUTOPOP = 2,
257    TTDT_INITIAL = 3,
258 }
259 
260 
261 // Rich edit.
262 enum: UINT {
263    ES_DISABLENOSCROLL = 0x00002000,
264 
265    EM_CANPASTE = WM_USER + 50,
266    EM_EXGETSEL = WM_USER + 52,
267    EM_EXLIMITTEXT = WM_USER + 53,
268    EM_EXLINEFROMCHAR = WM_USER + 54,
269    EM_EXSETSEL = WM_USER + 55,
270    EM_GETCHARFORMAT = WM_USER + 58,
271    EM_GETSELTEXT = WM_USER + 62,
272    EM_PASTESPECIAL = WM_USER + 64,
273    EM_SETBKGNDCOLOR = WM_USER + 67,
274    EM_SETCHARFORMAT = WM_USER + 68,
275    EM_SETEVENTMASK = WM_USER + 69,
276    EM_STREAMIN = WM_USER + 73,
277    EM_STREAMOUT = WM_USER + 74,
278    EM_GETTEXTRANGE = WM_USER + 75,
279 
280    // 2.0
281    EM_SETUNDOLIMIT = WM_USER + 82,
282    EM_REDO = WM_USER + 84,
283    EM_CANREDO = WM_USER + 85,
284    EM_GETUNDONAME = WM_USER + 86,
285    EM_GETREDONAME = WM_USER + 87,
286    EM_STOPGROUPTYPING = WM_USER + 88,
287    EM_SETTEXTMODE = WM_USER + 89,
288    EM_GETTEXTMODE = WM_USER + 90,
289 
290    EM_AUTOURLDETECT = WM_USER + 91,
291    EM_GETAUTOURLDETECT = WM_USER + 92,
292    EM_SETPALETTE = WM_USER + 93,
293    EM_GETTEXTEX = WM_USER + 94,
294    EM_GETTEXTLENGTHEX = WM_USER + 95,
295    EM_SHOWSCROLLBAR = WM_USER + 96,
296    EM_SETTEXTEX = WM_USER + 97,
297 
298    EN_LINK = 0x070B,
299 }
300 
301 
302 // Rich edit.
303 enum: UINT {
304    SF_TEXT = 0x0001,
305    SF_RTF = 0x0002,
306    SF_RTFNOOBJS = 0x0003,
307    SF_TEXTIZED = 0x0004,
308 
309    SFF_SELECTION = 0x8000,
310    SFF_PLAINRTF = 0x4000,
311 
312    SCF_SELECTION = 0x0001,
313    SCF_WORD = 0x0002,
314    SCF_ALL = 0x0004,
315 
316    CFM_BOLD = 0x00000001,
317    CFM_ITALIC = 0x00000002,
318    CFM_UNDERLINE = 0x00000004,
319    CFM_STRIKEOUT = 0x00000008,
320    CFM_PROTECTED = 0x00000010,
321    CFM_LINK = 0x00000020,
322    CFM_SIZE = 0x80000000,
323    CFM_COLOR = 0x40000000,
324    CFM_FACE = 0x20000000,
325    CFM_OFFSET = 0x10000000,
326    CFM_CHARSET = 0x08000000,
327    CFM_SMALLCAPS = 0x0040,
328    CFM_ALLCAPS = 0x0080,
329    CFM_HIDDEN = 0x0100,
330    CFM_OUTLINE = 0x0200,
331    CFM_SHADOW = 0x0400,
332    CFM_EMBOSS = 0x0800,
333    CFM_IMPRINT = 0x1000,
334    CFM_DISABLED = 0x2000,
335    CFM_REVISED = 0x4000,
336    CFM_BACKCOLOR = 0x04000000,
337    CFM_LCID = 0x02000000,
338    CFM_UNDERLINETYPE = 0x00800000,
339    CFM_WEIGHT = 0x00400000,
340    CFM_SPACING = 0x00200000,
341    CFM_KERNING = 0x00100000,
342    CFM_STYLE = 0x00080000,
343    CFM_ANIMATION = 0x00040000,
344    CFM_REVAUTHOR = 0x00008000,
345 
346    CFE_BOLD = 0x0001,
347    CFE_ITALIC = 0x0002,
348    CFE_UNDERLINE = 0x0004,
349    CFE_STRIKEOUT = 0x0008,
350    CFE_PROTECTED = 0x0010,
351    CFE_LINK = 0x0020,
352    CFE_AUTOCOLOR = 0x40000000,
353    CFE_AUTOBACKCOLOR = CFM_BACKCOLOR,
354    CFE_SUBSCRIPT = 0x00010000,
355    CFE_SUPERSCRIPT = 0x00020000,
356 
357    CFM_SUBSCRIPT = CFE_SUBSCRIPT | CFE_SUPERSCRIPT,
358    CFM_SUPERSCRIPT = CFM_SUBSCRIPT,
359 
360    CFU_UNDERLINE = 1,
361 
362    ENM_NONE = 0x00000000,
363    ENM_CHANGE = 0x00000001,
364    ENM_UPDATE = 0x00000002,
365    ENM_LINK = 0x04000000,
366    ENM_PROTECTED = 0x00200000,
367 }
368 
369 
370 enum: DWORD {
371    PRF_CLIENT = 0x00000004,
372 }
373 
374 
375 enum: DWORD {
376    STAP_ALLOW_NONCLIENT = 0x00000001,
377    STAP_ALLOW_CONTROLS = 0x00000002,
378    STAP_ALLOW_WEBCONTENT = 0x00000004,
379 }
380 
381 
382 enum: LPARAM {
383    ENDSESSION_LOGOFF = 0x80000000,
384 }
385 
386 
387 enum: int {
388    BLACKONWHITE = 1,
389    WHITEONBLACK = 2,
390    COLORONCOLOR = 3,
391    HALFTONE = 4,
392 }
393 
394 
395 enum: UINT {
396    CDN_FIRST = cast(UINT)-601,
397    CDN_LAST = cast(UINT)-699,
398    CDN_INITDONE = CDN_FIRST - 0x0000,
399    CDN_SELCHANGE = CDN_FIRST - 0x0001,
400    CDN_FOLDERCHANGE = CDN_FIRST - 0x0002,
401    CDN_SHAREVIOLATION = CDN_FIRST - 0x0003,
402    CDN_HELP = CDN_FIRST - 0x0004,
403    CDN_FILEOK = CDN_FIRST - 0x0005,
404    CDN_TYPECHANGE = CDN_FIRST - 0x0006,
405    CDN_INCLUDEITEM = CDN_FIRST - 0x0007,
406 }
407 
408 
409 enum: DWORD {
410    OFN_READONLY = 0x00000001,
411    OFN_OVERWRITEPROMPT = 0x00000002,
412    OFN_HIDEREADONLY = 0x00000004,
413    OFN_NOCHANGEDIR = 0x00000008,
414    OFN_SHOWHELP = 0x00000010,
415    OFN_ENABLEHOOK = 0x00000020,
416    OFN_ENABLETEMPLATE = 0x00000040,
417    OFN_ENABLETEMPLATEHANDLE = 0x00000080,
418    OFN_NOVALIDATE = 0x00000100,
419    OFN_ALLOWMULTISELECT = 0x00000200,
420    OFN_EXTENSIONDIFFERENT = 0x00000400,
421    OFN_PATHMUSTEXIST = 0x00000800,
422    OFN_FILEMUSTEXIST = 0x00001000,
423    OFN_CREATEPROMPT = 0x00002000,
424    OFN_SHAREAWARE = 0x00004000,
425    OFN_NOREADONLYRETURN = 0x00008000,
426    OFN_NOTESTFILECREATE = 0x00010000,
427    OFN_NONETWORKBUTTON = 0x00020000,
428    OFN_NOLONGNAMES = 0x00040000,
429    OFN_EXPLORER = 0x00080000,
430    OFN_NODEREFERENCELINKS = 0x00100000,
431    OFN_LONGNAMES = 0x00200000,
432    OFN_ENABLEINCLUDENOTIFY = 0x00400000,
433    OFN_ENABLESIZING = 0x00800000,
434    OFN_DONTADDTORECENT = 0x02000000,
435    OFN_FORCESHOWHIDDEN = 0x10000000,
436 }
437 
438 
439 enum: DWORD {
440    CF_SCREENFONTS = 0x00000001,
441    CF_PRINTERFONTS = 0x00000002,
442    CF_BOTH = CF_SCREENFONTS | CF_PRINTERFONTS,
443    CF_SHOWHELP = 0x00000004,
444    CF_ENABLEHOOK = 0x00000008,
445    CF_ENABLETEMPLATE = 0x00000010,
446    CF_ENABLETEMPLATEHANDLE = 0x00000020,
447    CF_INITTOLOGFONTSTRUCT = 0x00000040,
448    CF_USESTYLE = 0x00000080,
449    CF_EFFECTS = 0x00000100,
450    CF_APPLY = 0x00000200,
451    CF_ANSIONLY = 0x00000400,
452    CF_SCRIPTSONLY = CF_ANSIONLY,
453    CF_NOVECTORFONTS = 0x00000800,
454    CF_NOOEMFONTS = CF_NOVECTORFONTS,
455    CF_NOSIMULATIONS = 0x00001000,
456    CF_LIMITSIZE = 0x00002000,
457    CF_FIXEDPITCHONLY = 0x00004000,
458    CF_WYSIWYG = 0x00008000,
459    CF_FORCEFONTEXIST = 0x00010000,
460    CF_SCALABLEONLY = 0x00020000,
461    CF_TTONLY = 0x00040000,
462    CF_NOFACESEL = 0x00080000,
463    CF_NOSTYLESEL = 0x00100000,
464    CF_NOSIZESEL = 0x00200000,
465    CF_SELECTSCRIPT = 0x00400000,
466    CF_NOSCRIPTSEL = 0x00800000,
467    CF_NOVERTFONTS = 0x01000000,
468 }
469 
470 
471 enum: UINT {
472    ODT_MENU = 1,
473    ODT_LISTBOX = 2,
474    ODT_COMBOBOX = 3,
475    ODT_BUTTON = 4,
476    ODT_STATIC = 5,
477 }
478 
479 
480 enum: int {
481    HC_ACTION = 0,
482 }
483 
484 
485 enum: int {
486    WH_GETMESSAGE = 3,
487    WH_CALLWNDPROC = 4,
488    WH_CALLWNDPROCRET = 12,
489 }
490 
491 
492 struct CWPSTRUCT {
493    LPARAM lParam;
494    WPARAM wParam;
495    UINT message;
496    HWND hwnd;
497 }
498 alias CWPSTRUCT* LPCWPSTRUCT;
499 
500 
501 struct CWPRETSTRUCT {
502    LRESULT lResult;
503    LPARAM lParam;
504    WPARAM wParam;
505    DWORD message;
506    HWND hwnd;
507 }
508 alias CWPRETSTRUCT* LPCWPRETSTRUCT;
509 
510 
511 enum: UINT {
512    MDITILE_VERTICAL = 0x0000,
513    MDITILE_HORIZONTAL = 0x0001,
514    MDITILE_SKIPDISABLED = 0x0002,
515    MDITILE_ZORDER = 0x0004,
516 }
517 
518 
519 enum: DWORD {
520    WS_EX_NOPARENTNOTIFY = 0x00000004,
521    WS_EX_ACCEPTFILES = 0x00000010,
522    WS_EX_TRANSPARENT = 0x00000020,
523    WS_EX_RTLREADING = 0x00002000,
524    WS_EX_APPWINDOW = 0x00040000,
525    WS_EX_DLGMODALFRAME = 0x00000001,
526    WS_EX_CONTROLPARENT = 0x00010000,
527    WS_EX_WINDOWEDGE = 0x00000100,
528    WS_EX_CLIENTEDGE = 0x00000200,
529    WS_EX_TOOLWINDOW = 0x00000080,
530    WS_EX_STATICEDGE = 0x00020000,
531    WS_EX_CONTEXTHELP = 0x00000400,
532    WS_EX_MDICHILD = 0x00000040,
533    WS_EX_LAYERED = 0x00080000,
534    WS_EX_TOPMOST = 0x00000008,
535 }
536 
537 
538 enum: DWORD {
539    TTS_ALWAYSTIP = 0x01,
540    TTS_NOPREFIX = 0x02,
541    TTS_NOANIMATE = 0x10, // IE5+
542    TTS_NOFADE = 0x20, // IE5+
543    TTS_BALLOON = 0x40, // IE5+
544 }
545 
546 
547 enum {
548    TTF_IDISHWND = 0x0001,
549    TTF_CENTERTIP = 0x0002,
550    TTF_RTLREADING = 0x0004,
551    TTF_SUBCLASS = 0x0010,
552    TTF_TRACK = 0x0020, // IE3+
553    TTF_ABSOLUTE = 0x0080, // IE3+
554    TTF_TRANSPARENT = 0x0100, // IE3+
555    TTF_DI_SETITEM = 0x8000, // IE3+
556 }
557 
558 
559 enum: WPARAM {
560    SIZE_RESTORED = 0,
561    SIZE_MINIMIZED = 1,
562    SIZE_MAXIMIZED = 2,
563    SIZE_MAXSHOW = 3,
564    SIZE_MAXHIDE = 4,
565 }
566 
567 
568 enum: DWORD {
569    LWA_COLORKEY = 1,
570    LWA_ALPHA = 2,
571 
572    AW_HOR_POSITIVE = 0x00000001,
573    AW_HOR_NEGATIVE = 0x00000002,
574    AW_VER_POSITIVE = 0x00000004,
575    AW_VER_NEGATIVE = 0x00000008,
576    AW_CENTER = 0x00000010,
577    AW_HIDE = 0x00010000,
578    AW_ACTIVATE = 0x00020000,
579    AW_SLIDE = 0x00040000,
580    AW_BLEND = 0x00080000,
581 }
582 
583 
584 enum: UINT {
585    MF_STRING = 0x00000000,
586    MF_UNCHECKED = 0x00000000,
587    MF_BYCOMMAND = 0x00000000,
588    MF_GRAYED = 0x00000001,
589    MF_CHECKED = 0x00000008,
590    MF_POPUP = 0x00000010,
591    MF_MENUBARBREAK = 0x00000020,
592    MF_MENUBREAK = 0x00000040,
593    MF_BYPOSITION = 0x00000400,
594    MF_SEPARATOR = 0x00000800,
595    MF_DEFAULT = 0x00001000,
596    MF_SYSMENU = 0x00002000,
597 
598    MFT_STRING = MF_STRING,
599    MFT_MENUBARBREAK = MF_MENUBARBREAK,
600    MFT_MENUBREAK = MF_MENUBREAK,
601    MFT_RADIOCHECK = 0x00000200,
602    MFT_SEPARATOR = MF_SEPARATOR,
603 
604    MFS_UNCHECKED = MF_UNCHECKED,
605    MFS_CHECKED = MF_CHECKED,
606    MFS_DEFAULT = MF_DEFAULT,
607    MFS_GRAYED = MF_GRAYED,
608 
609    MIIM_STATE = 0x00000001,
610    MIIM_ID = 0x00000002,
611    MIIM_SUBMENU = 0x00000004,
612    MIIM_TYPE = 0x00000010,
613 }
614 
615 
616 enum: int {
617    RGN_AND = 1,
618    RGN_OR = 2,
619    RGN_XOR = 3,
620    RGN_DIFF = 4,
621    RGN_COPY = 5,
622 }
623 
624 
625 //alias UINT CLIPFORMAT; // ?
626 alias WORD CLIPFORMAT; // ?
627 
628 
629 // enum can't derive from HWND.
630 enum HWND_TOP = cast(HWND)0;
631 enum HWND_BOTTOM = cast(HWND)1;
632 enum HWND_TOPMOST = cast(HWND)-1;
633 enum HWND_NOTOPMOST = cast(HWND)-2;
634 
635 
636 enum: UINT {
637    BS_SOLID = 0,
638    BS_GROUPBOX = 0x00000007,
639 }
640 
641 
642 enum: UINT {
643    CBS_SIMPLE = 0x0001,
644    CBS_DROPDOWN = 0x0002,
645    CBS_DROPDOWNLIST = 0x0003,
646    CBS_AUTOHSCROLL = 0x0040,
647    CBS_OWNERDRAWFIXED = 0x0010,
648    CBS_OWNERDRAWVARIABLE = 0x0020,
649 }
650 
651 
652 enum: DWORD {
653    TME_HOVER =   1,
654    TME_LEAVE =   2,
655    TME_QUERY =   0x40000000,
656    TME_CANCEL =  0x80000000,
657 }
658 
659 
660 enum DWORD HOVER_DEFAULT = 0xFFFFFFFF;
661 
662 
663 enum: UINT {
664    TPM_LEFTBUTTON = 0x0000,
665    TPM_RIGHTBUTTON = 0x0002,
666    TPM_LEFTALIGN = 0x0000,
667    TPM_CENTERALIGN = 0x0004,
668    TPM_RIGHTALIGN = 0x0008,
669    TPM_TOPALIGN = 0x0000,
670    TPM_VCENTERALIGN = 0x0010,
671    TPM_BOTTOMALIGN = 0x0020,
672    TPM_HORIZONTAL = 0x0000,
673    TPM_VERTICAL = 0x0040,
674    TPM_NONOTIFY = 0x0080,
675    TPM_RETURNCMD = 0x0100,
676    TPM_RECURSE = 0x0001,
677 }
678 
679 
680 enum {
681    ICON_SMALL = 0,
682    ICON_BIG = 1,
683 }
684 
685 
686 enum {
687    WAIT_TIMEOUT = 258,
688 }
689 
690 
691 enum: DWORD {
692    INFINITE = 0xFFFFFFFF,
693    IGNORE = 0,
694    WAIT_FAILED = 0xFFFFFFFF,
695    STATUS_WAIT_0 = 0x00000000,
696    STATUS_ABANDONED_WAIT_0 = 0x00000080,
697    WAIT_OBJECT_0 = STATUS_WAIT_0,
698    WAIT_ABANDONED_0 = STATUS_ABANDONED_WAIT_0,
699 }
700 
701 
702 enum: UINT {
703    SPI_GETNONCLIENTMETRICS = 41,
704    SPI_GETWORKAREA = 48,
705    SPI_GETANIMATION = 72,
706    SPI_GETWHEELSCROLLLINES = 104,
707    SPI_GETWHEELSCROLLCHARS = 108,
708    // ...
709 }
710 
711 
712 enum: DWORD {
713    ABM_GETTASKBARPOS = 0x00000005,
714    // ...
715 }
716 
717 
718 enum: UINT {
719    ABE_LEFT = 0,
720    ABE_TOP = 1,
721    ABE_RIGHT = 2,
722    ABE_BOTTOM = 3,
723 }
724 
725 
726 enum LPSTR IDC_APPSTARTING =  cast(LPSTR)32650;
727 enum LPSTR IDC_HAND = cast(LPSTR)32649; // Windows 98+
728 enum LPSTR IDC_HELP = cast(LPSTR)32651;
729 enum LPSTR IDC_IBEAM = cast(LPSTR)32513;
730 enum LPSTR IDC_NO = cast(LPSTR)32648;
731 enum LPSTR IDC_SIZEALL = cast(LPSTR)32646;
732 enum LPSTR IDC_SIZENESW = cast(LPSTR)32643;
733 enum LPSTR IDC_SIZENS = cast(LPSTR)32645;
734 enum LPSTR IDC_SIZENWSE = cast(LPSTR)32642;
735 enum LPSTR IDC_SIZEWE = cast(LPSTR)32644;
736 enum LPSTR IDC_WAIT = cast(LPSTR)32514;
737 
738 
739 enum: WORD {
740    MK_LBUTTON = 0x0001,
741    MK_RBUTTON = 0x0002,
742    MK_SHIFT = 0x0004,
743    MK_CONTROL = 0x0008,
744    MK_MBUTTON = 0x0010,
745 }
746 
747 
748 enum: UINT {
749    GMEM_MOVEABLE = 0x0002,
750    GMEM_DDESHARE = 0x2000,
751    GMEM_SHARE = 0x2000,
752 }
753 
754 
755 enum: int {
756    DRIVERVERSION   = 0,
757    TECHNOLOGY      = 2,
758    HORZSIZE        = 4,
759    VERTSIZE        = 6,
760    HORZRES         = 8,
761    VERTRES         = 10,
762    BITSPIXEL       = 12,
763    PLANES          = 14,
764    NUMBRUSHES      = 16,
765    NUMPENS         = 18,
766    NUMMARKERS      = 20,
767    NUMFONTS        = 22,
768    NUMCOLORS       = 24,
769    PDEVICESIZE     = 26,
770    CURVECAPS       = 28,
771    LINECAPS        = 30,
772    POLYGONALCAPS   = 32,
773    TEXTCAPS        = 34,
774    CLIPCAPS        = 36,
775    RASTERCAPS      = 38,
776    ASPECTX         = 40,
777    ASPECTY         = 42,
778    ASPECTXY        = 44,
779    LOGPIXELSX      = 88,
780    LOGPIXELSY      = 90,
781    SIZEPALETTE     = 104,
782    NUMRESERVED     = 106,
783    COLORRES        = 108,
784    PHYSICALWIDTH   = 110,
785    PHYSICALHEIGHT  = 111,
786    PHYSICALOFFSETX = 112,
787    PHYSICALOFFSETY = 113,
788    SCALINGFACTORX  = 114,
789    SCALINGFACTORY  = 115,
790    VREFRESH        = 116,
791    DESKTOPVERTRES  = 117,
792    DESKTOPHORZRES  = 118,
793    BLTALIGNMENT    = 119
794 }
795 
796 
797 enum {
798    MB_SERVICE_NOTIFICATION = 0x00200000,
799 }
800 
801 
802 enum {
803    DLGC_WANTARROWS = 0x0001,
804    DLGC_WANTTAB = 0x0002,
805    DLGC_WANTALLKEYS = 0x0004,
806    DLGC_HASSETSEL = 0x0008,
807    DLGC_RADIOBUTTON = 0x0040,
808    DLGC_WANTCHARS = 0x0080,
809    DLGC_STATIC = 0x0100,
810 }
811 
812 
813 enum {
814    LB_OKAY = 0,
815    LB_ERR = -1,
816    LB_ERRSPACE = -2,
817 }
818 
819 
820 enum: UINT {
821    LB_GETCOUNT = 0x018B,
822    LB_GETITEMDATA = 0x0199,
823    LB_ADDSTRING = 0x0180,
824    LB_SETITEMDATA = 0x019A,
825    LB_RESETCONTENT = 0x0184,
826    LB_INSERTSTRING = 0x0181,
827    LB_DELETESTRING = 0x0182,
828    LB_GETHORIZONTALEXTENT = 0x0193,
829    LB_SETHORIZONTALEXTENT = 0x0194,
830    LB_SETITEMHEIGHT = 0x01A0,
831    LB_GETITEMHEIGHT = 0x01A1,
832    LB_GETSELCOUNT = 0x0190,
833    LB_GETSELITEMS = 0x0191,
834    LB_SETCURSEL = 0x0186,
835    LB_GETCURSEL = 0x0188,
836    LB_SETTOPINDEX = 0x0197,
837    LB_GETTOPINDEX = 0x018E,
838    LB_SELITEMRANGE = 0x0183,
839    LB_SETSEL = 0x0185,
840    LB_FINDSTRING = 0x018F,
841    LB_FINDSTRINGEXACT = 0x01A2,
842    LB_GETITEMRECT = 0x0198,
843    LB_GETSEL = 0x0187,
844    LB_ITEMFROMPOINT = 0x01A9,
845    LB_ADDFILE = 0x0196,
846    LB_DIR = 0x018D,
847 }
848 
849 
850 enum: DWORD {
851    LBS_NOINTEGRALHEIGHT = 0x0100,
852    LBS_MULTICOLUMN = 0x0200,
853    LBS_DISABLENOSCROLL = 0x1000,
854    LBS_NOSEL = 0x4000,
855    LBS_EXTENDEDSEL = 0x0800,
856    LBS_MULTIPLESEL = 0x0008,
857    LBS_SORT = 0x0002,
858    LBS_USETABSTOPS = 0x0080,
859    LBS_OWNERDRAWVARIABLE = 0x0020,
860    LBS_OWNERDRAWFIXED = 0x0010,
861    LBS_NOTIFY = 0x0001,
862    LBS_HASSTRINGS = 0x0040,
863 }
864 
865 
866 enum {
867    LBN_ERRSPACE = -2,
868    LBN_SELCHANGE = 1,
869    LBN_DBLCLK = 2,
870    LBN_SELCANCEL = 3,
871    LBN_SETFOCUS = 4,
872    LBN_KILLFOCUS = 5,
873 }
874 
875 
876 enum {
877    CB_OKAY = 0,
878    CB_ERR = -1,
879    CB_ERRSPACE = -2,
880 }
881 
882 
883 enum: UINT {
884    CB_SETCURSEL = 0x014E,
885    CB_GETCURSEL = 0x0147,
886    CB_FINDSTRING = 0x014C,
887    CB_FINDSTRINGEXACT = 0x0158,
888    CB_SETITEMHEIGHT = 0x0153,
889    CB_GETITEMHEIGHT = 0x0154,
890    CB_ADDSTRING = 0x0143,
891    CB_DELETESTRING = 0x0144,
892    CB_DIR = 0x0145,
893    CB_INSERTSTRING = 0x014A,
894    CB_RESETCONTENT = 0x014B,
895    CB_SETITEMDATA = 0x0151,
896    CB_GETDROPPEDWIDTH = 0x015f,
897    CB_SETDROPPEDWIDTH = 0x0160,
898    CB_LIMITTEXT = 0x0141,
899    CB_GETEDITSEL = 0x0140,
900    CB_SETEDITSEL = 0x0142,
901    CB_SHOWDROPDOWN = 0x014F,
902    CB_GETDROPPEDSTATE = 0x0157,
903 }
904 
905 
906 enum: DWORD {
907    CBS_SORT = 0x0100,
908    CBS_HASSTRINGS = 0x0200,
909    CBS_NOINTEGRALHEIGHT = 0x0400,
910 }
911 
912 
913 enum {
914    CBN_SELCHANGE = 1,
915    CBN_SETFOCUS = 3,
916    CBN_KILLFOCUS = 4,
917    CBN_EDITCHANGE = 5,
918 }
919 
920 
921 enum: UINT {
922    TVE_COLLAPSE = 0x0001,
923    TVE_EXPAND = 0x0002,
924    TVE_TOGGLE = 0x0003,
925 }
926 
927 
928 enum: UINT {
929    TVIS_SELECTED = 0x0002,
930    TVIS_EXPANDED = 0x0020,
931 }
932 
933 
934 enum: UINT {
935    TVIF_TEXT = 0x0001,
936    TVIF_IMAGE = 0x0002,
937    TVIF_PARAM = 0x0004,
938    TVIF_STATE = 0x0008,
939    TVIF_HANDLE = 0x0010,
940    TVIF_SELECTEDIMAGE = 0x0020,
941    TVIF_CHILDREN = 0x0040,
942    TVIF_INTEGRAL = 0x0080, // IE4+
943 }
944 
945 
946 enum int I_CHILDRENCALLBACK = -1;
947 
948 
949 enum: UINT {
950    TVGN_FIRSTVISIBLE = 0x0005,
951    TVGN_CARET = 0x0009,
952 }
953 
954 
955 enum: UINT {
956    TV_FIRST = 0x1100,
957 
958    TVM_INSERTITEMA = TV_FIRST + 0,
959    TVM_DELETEITEM = TV_FIRST + 1,
960    TVM_EXPAND = TV_FIRST + 2,
961    TVM_GETITEMRECT = TV_FIRST + 4,
962    TVM_GETINDENT = TV_FIRST + 6,
963    TVM_SETINDENT = TV_FIRST + 7,
964    TVM_SETIMAGELIST = TV_FIRST + 9,
965    TVM_GETNEXTITEM = TV_FIRST + 10,
966    TVM_SELECTITEM = TV_FIRST + 11,
967    TVM_GETITEMA = TV_FIRST + 12,
968    TVM_SETITEMA = TV_FIRST + 13,
969    TVM_EDITLABELA = TV_FIRST + 14,
970    TVM_GETVISIBLECOUNT = TV_FIRST + 16,
971    TVM_HITTEST = TV_FIRST + 17,
972    TVM_ENSUREVISIBLE = TV_FIRST + 20,
973    TVM_SETITEMHEIGHT = TV_FIRST + 27, // IE4+
974    TVM_GETITEMHEIGHT = TV_FIRST + 28, // IE4+
975    TVM_INSERTITEMW = TV_FIRST + 50,
976    TVM_SETITEMW = TV_FIRST + 63,
977 
978    TVN_FIRST = cast(UINT)-400,
979 
980    TVN_SELCHANGINGA = TVN_FIRST - 1,
981    TVN_SELCHANGEDA = TVN_FIRST - 2,
982    TVN_GETDISPINFOA = TVN_FIRST - 3,
983    TVN_ITEMEXPANDINGA = TVN_FIRST - 5,
984    TVN_ITEMEXPANDEDA = TVN_FIRST - 6,
985    TVN_BEGINLABELEDITA = TVN_FIRST - 10,
986    TVN_ENDLABELEDITA = TVN_FIRST - 11,
987 
988    TVN_SELCHANGINGW = TVN_FIRST - 50,
989    TVN_SELCHANGEDW = TVN_FIRST - 51,
990    TVN_GETDISPINFOW = TVN_FIRST - 52,
991    TVN_ITEMEXPANDINGW = TVN_FIRST - 54,
992    TVN_ITEMEXPANDEDW = TVN_FIRST - 55,
993    TVN_BEGINLABELEDITW = TVN_FIRST - 59,
994    TVN_ENDLABELEDITW = TVN_FIRST - 60,
995 }
996 
997 
998 enum: DWORD {
999    TVS_HASBUTTONS = 0x0001,
1000    TVS_HASLINES = 0x0002,
1001    TVS_LINESATROOT = 0x0004,
1002    TVS_EDITLABELS = 0x0008,
1003    TVS_SHOWSELALWAYS = 0x0020,
1004    TVS_CHECKBOXES = 0x0100, // IE3+
1005    TVS_TRACKSELECT = 0x0200, // IE3+
1006    TVS_FULLROWSELECT = 0x1000, // IE4+
1007    TVS_NOSCROLL = 0x2000, // IE4+
1008    TVS_SINGLEEXPAND = 0x0400, // IE4+
1009 }
1010 
1011 
1012 version(DFL_D2_AND_ABOVE) {
1013    /+ // DMD 2.012: Error: cannot implicitly convert expression (cast(HANDLE)cast(void*)-65536u) of type const(HANDLE) to int
1014    const HTREEITEM TVI_ROOT = cast(HTREEITEM)-0x10000;
1015    const HTREEITEM TVI_FIRST = cast(HTREEITEM)-0x0FFFF;
1016    const HTREEITEM TVI_LAST = cast(HTREEITEM)-0x0FFFE;
1017    const HTREEITEM TVI_SORT = cast(HTREEITEM)-0x0FFFD;
1018    +/
1019    enum: HTREEITEM {
1020       TVI_ROOT = cast(HTREEITEM)-0x10000,
1021       TVI_FIRST = cast(HTREEITEM)-0x0FFFF,
1022       TVI_LAST = cast(HTREEITEM)-0x0FFFE,
1023       TVI_SORT = cast(HTREEITEM)-0x0FFFD,
1024    }
1025 }
1026 else {
1027    const HTREEITEM TVI_ROOT = cast(HTREEITEM)-0x10000;
1028    const HTREEITEM TVI_FIRST = cast(HTREEITEM)-0x0FFFF;
1029    const HTREEITEM TVI_LAST = cast(HTREEITEM)-0x0FFFE;
1030    const HTREEITEM TVI_SORT = cast(HTREEITEM)-0x0FFFD;
1031 }
1032 
1033 
1034 enum: UINT {
1035    TVC_UNKNOWN = 0x0000,
1036    TVC_BYMOUSE = 0x0001,
1037    TVC_BYKEYBOARD = 0x0002,
1038 }
1039 
1040 
1041 enum: WPARAM {
1042    TVSIL_NORMAL = 0,
1043    TVSIL_STATE = 2,
1044 }
1045 
1046 
1047 enum: UINT {
1048    SB_SETTEXTA = WM_USER + 1,
1049    SB_SETPARTS = WM_USER + 4,
1050    SB_SIMPLE = WM_USER + 9,
1051    SB_SETTEXTW = WM_USER + 11,
1052 }
1053 
1054 
1055 enum: DWORD {
1056    SBARS_SIZEGRIP = 0x0100,
1057 }
1058 
1059 
1060 enum: WPARAM {
1061    SBT_NOBORDERS = 0x0100,
1062    SBT_POPOUT = 0x0200,
1063    SBT_RTLREADING = 0x0400,
1064    SBT_OWNERDRAW = 0x1000,
1065 }
1066 
1067 
1068 enum: LRESULT {
1069    CDRF_DODEFAULT = 0x0,
1070    CDRF_NEWFONT = 0x2,
1071    CDRF_NOTIFYITEMDRAW = 0x20,
1072    CDRF_NOTIFYITEMERASE = 0x80,
1073 }
1074 
1075 
1076 enum: DWORD {
1077    CDDS_ITEM = 0x00010000,
1078 }
1079 
1080 
1081 enum: UINT {
1082    CDIS_SELECTED = 0x0001,
1083 }
1084 
1085 
1086 enum LPWSTR LPSTR_TEXTCALLBACKW = cast(LPWSTR)-1L;
1087 enum LPSTR LPSTR_TEXTCALLBACKA = cast(LPSTR)-1L;
1088 
1089 
1090 enum: UINT {
1091    CCM_FIRST = 0x2000,
1092    CCM_SETVERSION = CCM_FIRST + 0x7,
1093 }
1094 
1095 
1096 enum: UINT {
1097    LVM_FIRST = 0x1000,
1098 
1099    LVM_SETBKCOLOR = LVM_FIRST + 1,
1100    LVM_SETIMAGELIST = LVM_FIRST + 3,
1101    LVM_SETITEMA = LVM_FIRST + 6,
1102    LVM_INSERTITEMA = LVM_FIRST + 7,
1103    LVM_DELETEITEM = LVM_FIRST + 8,
1104    LVM_DELETEALLITEMS = LVM_FIRST + 9,
1105    LVM_SETCALLBACKMASK = LVM_FIRST + 11,
1106    LVM_GETNEXTITEM = LVM_FIRST + 12,
1107    LVM_GETITEMRECT = LVM_FIRST + 14,
1108    LVM_ENSUREVISIBLE = LVM_FIRST + 19,
1109    LVM_REDRAWITEMS = LVM_FIRST + 21,
1110    LVM_ARRANGE = LVM_FIRST + 22,
1111    LVM_EDITLABELA = LVM_FIRST + 23,
1112    LVM_GETCOLUMNA = LVM_FIRST + 25,
1113    LVM_SETCOLUMNA = LVM_FIRST + 26,
1114    LVM_INSERTCOLUMNA = LVM_FIRST + 27,
1115    LVM_DELETECOLUMN = LVM_FIRST + 28,
1116    LVM_SETCOLUMNWIDTH = LVM_FIRST + 30,
1117    LVM_SETTEXTCOLOR = LVM_FIRST + 36,
1118    LVM_SETTEXTBKCOLOR = LVM_FIRST + 38,
1119    LVM_SETITEMSTATE = LVM_FIRST + 43,
1120    LVM_GETITEMSTATE = LVM_FIRST + 44,
1121    LVM_SETITEMTEXTA = LVM_FIRST + 46,
1122    LVM_SORTITEMS = LVM_FIRST + 48,
1123    LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54,
1124    LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55,
1125    LVM_INSERTITEMW = LVM_FIRST + 77,
1126    LVM_SETCOLUMNW = LVM_FIRST + 96,
1127    LVM_INSERTCOLUMNW = LVM_FIRST + 97,
1128    LVM_SETITEMTEXTW = LVM_FIRST + 116,
1129    LVM_EDITLABELW = LVM_FIRST + 118,
1130 }
1131 
1132 
1133 enum: UINT {
1134    LVIS_OVERLAYMASK = 0x0F00,
1135    LVIS_STATEIMAGEMASK = 0xF000,
1136 }
1137 
1138 
1139 enum: int {
1140    LVSCW_AUTOSIZE = -1,
1141    LVSCW_AUTOSIZE_USEHEADER = -2,
1142 }
1143 
1144 
1145 enum: UINT {
1146    LVNI_ALL = 0x0000,
1147    LVNI_FOCUSED = 0x0001,
1148    LVNI_SELECTED = 0x0002,
1149    LVNI_CUT = 0x0004,
1150    LVNI_DROPHILITED = 0x0008,
1151 
1152    LVNI_ABOVE = 0x0100,
1153    LVNI_BELOW = 0x0200,
1154    LVNI_TOLEFT = 0x0400,
1155    LVNI_TORIGHT = 0x0800,
1156 }
1157 
1158 
1159 enum: UINT {
1160    LVN_FIRST = cast(UINT)-100,
1161 
1162    LVN_ITEMCHANGING = (LVN_FIRST - 0),
1163    LVN_ITEMCHANGED = (LVN_FIRST - 1),
1164 
1165    LVN_BEGINLABELEDITA = LVN_FIRST - 5,
1166    LVN_BEGINLABELEDITW = LVN_FIRST - 75,
1167 
1168    LVN_ENDLABELEDITA = LVN_FIRST - 6,
1169    LVN_ENDLABELEDITW = LVN_FIRST - 76,
1170 
1171    LVN_COLUMNCLICK = LVN_FIRST - 8,
1172 
1173    LVN_GETDISPINFOA = LVN_FIRST - 50,
1174    LVN_GETDISPINFOW = LVN_FIRST - 77,
1175 }
1176 
1177 
1178 enum: UINT {
1179    LVCF_FMT = 0x0001,
1180    LVCF_WIDTH = 0x0002,
1181    LVCF_TEXT = 0x0004,
1182    LVCF_SUBITEM = 0x0008,
1183 }
1184 
1185 
1186 enum: int {
1187    LVCFMT_LEFT = 0x0000,
1188    LVCFMT_RIGHT = 0x0001,
1189    LVCFMT_CENTER = 0x0002,
1190    LVCFMT_JUSTIFYMASK = 0x0003,
1191 }
1192 
1193 
1194 enum: UINT {
1195    LVIF_TEXT = 0x0001,
1196    LVIF_IMAGE = 0x0002,
1197    LVIF_PARAM = 0x0004,
1198    LVIF_STATE = 0x0008,
1199 }
1200 
1201 
1202 enum: UINT {
1203    LVIS_FOCUSED = 0x0001,
1204    LVIS_SELECTED = 0x0002,
1205    LVIS_CUT = 0x0004,
1206    LVIS_DROPHILITED = 0x0008,
1207 }
1208 
1209 
1210 enum: int {
1211    LVA_DEFAULT = 0x0000,
1212    LVA_ALIGNLEFT = 0x0001,
1213    LVA_ALIGNTOP = 0x0002,
1214    LVA_SNAPTOGRID = 0x0005,
1215 }
1216 
1217 
1218 enum: int {
1219    LVIR_BOUNDS = 0,
1220    LVIR_ICON = 1,
1221    LVIR_LABEL = 2,
1222    LVIR_SELECTBOUNDS = 3,
1223 }
1224 
1225 
1226 enum: UINT {
1227    LVS_ALIGNTOP = 0x0000,
1228    LVS_ALIGNLEFT = 0x0800,
1229 
1230    LVS_ICON = 0x0000,
1231    LVS_REPORT = 0x0001,
1232    LVS_SMALLICON = 0x0002,
1233    LVS_LIST = 0x0003,
1234    LVS_SINGLESEL = 0x0004,
1235    LVS_SHOWSELALWAYS = 0x0008,
1236    LVS_SORTASCENDING = 0x0010,
1237    LVS_SORTDESCENDING = 0x0020,
1238    LVS_SHAREIMAGELISTS = 0x0040,
1239    LVS_NOLABELWRAP = 0x0080,
1240    LVS_AUTOARRANGE = 0x0100,
1241    LVS_EDITLABELS = 0x0200,
1242    LVS_OWNERDATA = 0x1000,
1243    LVS_NOSCROLL = 0x2000,
1244 }
1245 
1246 
1247 enum: DWORD {
1248    LVS_EX_GRIDLINES = 0x00000001,
1249    LVS_EX_SUBITEMIMAGES = 0x00000002,
1250    LVS_EX_CHECKBOXES = 0x00000004,
1251    LVS_EX_TRACKSELECT = 0x00000008,
1252    LVS_EX_HEADERDRAGDROP = 0x00000010,
1253    LVS_EX_FULLROWSELECT = 0x00000020,
1254    LVS_EX_ONECLICKACTIVATE = 0x00000040,
1255    LVS_EX_TWOCLICKACTIVATE = 0x00000080,
1256 
1257    // IE4+
1258    LVS_EX_FLATSB = 0x00000100,
1259    LVS_EX_REGIONAL = 0x00000200,
1260    LVS_EX_INFOTIP = 0x00000400,
1261    LVS_EX_UNDERLINEHOT = 0x00000800,
1262    LVS_EX_UNDERLINECOLD = 0x00001000,
1263    LVS_EX_MULTIWORKAREAS = 0x00002000,
1264 }
1265 
1266 
1267 enum {
1268    LVSIL_NORMAL = 0,
1269    LVSIL_SMALL = 1,
1270    LVSIL_STATE = 2,
1271 }
1272 
1273 
1274 enum {
1275    I_IMAGECALLBACK = -1,
1276 }
1277 
1278 
1279 enum: UINT {
1280    TCM_FIRST = 0x1300,
1281 
1282    TCM_SETITEMA = TCM_FIRST + 6,
1283    TCM_INSERTITEMA = TCM_FIRST + 7,
1284    TCM_DELETEITEM = TCM_FIRST + 8,
1285    TCM_DELETEALLITEMS = TCM_FIRST + 9,
1286    TCM_GETITEMRECT = TCM_FIRST + 10,
1287    TCM_GETCURSEL = TCM_FIRST + 11,
1288    TCM_SETCURSEL = TCM_FIRST + 12,
1289    TCM_SETITEMEXTRA = TCM_FIRST + 14,
1290    TCM_ADJUSTRECT = TCM_FIRST + 40,
1291    TCM_SETITEMSIZE = TCM_FIRST + 41,
1292    TCM_SETPADDING = TCM_FIRST + 43,
1293    TCM_GETROWCOUNT = TCM_FIRST + 44,
1294    TCM_SETTOOLTIPS = TCM_FIRST + 46,
1295    TCM_SETITEMW = TCM_FIRST + 61,
1296    TCM_INSERTITEMW = TCM_FIRST + 62,
1297 }
1298 
1299 
1300 enum: UINT {
1301    TCIF_TEXT = 0x0001,
1302    TCIF_IMAGE = 0x0002,
1303    TCIF_RTLREADING = 0x0004,
1304    TCIF_PARAM = 0x0008,
1305 }
1306 
1307 
1308 enum: DWORD {
1309    TCS_FORCEICONLEFT = 0x0010,
1310    TCS_FORCELABELLEFT = 0x0020,
1311    TCS_TABS = 0x0000,
1312    TCS_BUTTONS = 0x0100,
1313    TCS_SINGLELINE = 0x0000,
1314    TCS_MULTILINE = 0x0200,
1315    TCS_RIGHTJUSTIFY = 0x0000,
1316    TCS_FIXEDWIDTH = 0x0400,
1317    TCS_RAGGEDRIGHT = 0x0800,
1318    TCS_FOCUSONBUTTONDOWN = 0x1000,
1319    TCS_OWNERDRAWFIXED = 0x2000,
1320    TCS_TOOLTIPS = 0x4000,
1321    TCS_FOCUSNEVER = 0x8000,
1322 
1323    // IE3+
1324    TCS_SCROLLOPPOSITE = 0x0001,
1325    TCS_BOTTOM = 0x0002,
1326    TCS_RIGHT = 0x0002,
1327    TCS_MULTISELECT = 0x0004,
1328    TCS_HOTTRACK = 0x0040,
1329    TCS_VERTICAL = 0x0080,
1330 
1331    // IE4+
1332    TCS_FLATBUTTONS = 0x0008,
1333 }
1334 
1335 
1336 enum: UINT {
1337    TCN_FIRST = cast(UINT)-550,
1338 
1339    TCN_SELCHANGE = TCN_FIRST - 1,
1340    TCN_SELCHANGING = TCN_FIRST - 2,
1341 }
1342 
1343 
1344 enum {
1345    HTERROR = -2,
1346    HTTRANSPARENT = -1,
1347    HTNOWHERE = 0,
1348    HTCLIENT = 1,
1349    HTCAPTION = 2,
1350    HTSYSMENU = 3,
1351    HTGROWBOX = 4,
1352    HTMENU = 5,
1353    HTHSCROLL = 6,
1354    HTVSCROLL = 7,
1355    HTMINBUTTON = 8,
1356    HTMAXBUTTON = 9,
1357    HTLEFT = 10,
1358    HTRIGHT = 11,
1359    HTTOP = 12,
1360    HTTOPLEFT = 13,
1361    HTTOPRIGHT = 14,
1362    HTBOTTOM = 15,
1363    HTBOTTOMLEFT = 16,
1364    HTBOTTOMRIGHT = 17,
1365    HTBORDER = 18,
1366    HTOBJECT = 19,
1367    HTCLOSE = 20,
1368    HTHELP = 21,
1369    HTSIZE = HTGROWBOX,
1370    HTREDUCE = HTMINBUTTON,
1371    HTZOOM = HTMAXBUTTON,
1372    HTSIZEFIRST = HTLEFT,
1373    HTSIZELAST = HTBOTTOMRIGHT,
1374 }
1375 
1376 
1377 enum {
1378    WVR_VALIDRECTS = 0x0400,
1379 }
1380 
1381 
1382 enum: UINT {
1383    NIF_MESSAGE = 0x00000001,
1384    NIF_ICON = 0x00000002,
1385    NIF_TIP = 0x00000004,
1386 }
1387 
1388 
1389 enum: DWORD {
1390    NIM_ADD = 0x00000000,
1391    NIM_MODIFY = 0x00000001,
1392    NIM_DELETE = 0x00000002,
1393 }
1394 
1395 
1396 enum: DWORD {
1397    VER_PLATFORM_WIN32s = 0,
1398    VER_PLATFORM_WIN32_WINDOWS = 1,
1399    VER_PLATFORM_WIN32_NT = 2,
1400 }
1401 
1402 
1403 enum: UINT {
1404    SIF_RANGE = 0x0001,
1405    SIF_PAGE = 0x0002,
1406    SIF_POS = 0x0004,
1407    SIF_DISABLENOSCROLL = 0x0008,
1408    SIF_ALL = 23,
1409 }
1410 
1411 
1412 enum: int {
1413    SM_SWAPBUTTON = 23,
1414 
1415    SM_CXFRAME = 32,
1416    SM_CYFRAME = 33,
1417 
1418    SM_CXSMICON = 49,
1419    SM_CYSMICON = 50,
1420 
1421    SM_CYSMCAPTION = 51,
1422 
1423    SM_CXSIZEFRAME = SM_CXFRAME,
1424    SM_CYSIZEFRAME = SM_CYFRAME,
1425 
1426    SM_CYMENU = 15,
1427 
1428    SM_CXVSCROLL = 2,
1429    SM_CYHSCROLL = 3,
1430 }
1431 
1432 
1433 enum: UINT {
1434    DFC_SCROLL = 3,
1435 }
1436 
1437 
1438 enum: UINT {
1439    DFCS_SCROLLSIZEGRIP = 0x0008,
1440 }
1441 
1442 
1443 enum: UINT {
1444    LR_LOADFROMFILE = 0x0010,
1445    LR_DEFAULTSIZE = 0x0040,
1446    LR_COPYFROMRESOURCE = 0x4000,
1447    LR_SHARED = 0x8000,
1448 }
1449 
1450 
1451 enum: COLORREF {
1452    CLR_INVALID = 0xFFFFFFFF,
1453    CLR_NONE = CLR_INVALID,
1454 }
1455 
1456 
1457 enum: UINT {
1458    DT_TOP = 0x00000000,
1459    DT_LEFT = 0x00000000,
1460    DT_CENTER = 0x00000001,
1461    DT_RIGHT = 0x00000002,
1462    DT_VCENTER = 0x00000004,
1463    DT_BOTTOM = 0x00000008,
1464    DT_WORDBREAK = 0x00000010,
1465    DT_SINGLELINE = 0x00000020,
1466    DT_EXPANDTABS = 0x00000040,
1467    DT_TABSTOP = 0x00000080,
1468    DT_NOCLIP = 0x00000100,
1469    DT_EXTERNALLEADING = 0x00000200,
1470    DT_CALCRECT = 0x00000400,
1471    DT_NOPREFIX = 0x00000800,
1472    DT_INTERNAL = 0x00001000,
1473    DT_EDITCONTROL = 0x00002000,
1474    DT_PATH_ELLIPSIS = 0x00004000,
1475    DT_END_ELLIPSIS = 0x00008000,
1476    DT_MODIFYSTRING = 0x00010000,
1477    DT_RTLREADING = 0x00020000,
1478    DT_WORD_ELLIPSIS = 0x00040000,
1479 }
1480 
1481 
1482 enum: UINT {
1483    CF_TEXT = 1,
1484    CF_BITMAP = 2,
1485    CF_METAFILEPICT = 3,
1486    CF_SYLK = 4,
1487    CF_DIF = 5,
1488    CF_TIFF = 6,
1489    CF_OEMTEXT = 7,
1490    CF_DIB = 8,
1491    CF_PALETTE = 9,
1492    CF_PENDATA = 10,
1493    CF_RIFF = 11,
1494    CF_WAVE = 12,
1495    CF_UNICODETEXT = 13,
1496    CF_ENHMETAFILE = 14,
1497    CF_HDROP = 15,
1498    CF_LOCALE = 16,
1499 }
1500 
1501 
1502 enum: UINT {
1503    BIF_RETURNONLYFSDIRS  = 0x0001,
1504    BIF_EDITBOX           = 0x0010,
1505    BIF_NEWDIALOGSTYLE    = 0x0040,
1506    BIF_NONEWFOLDERBUTTON = 0x0200, // shell32.dll 6.0+
1507 }
1508 
1509 
1510 enum {
1511    TRANSPARENT = 1,
1512    OPAQUE = 2,
1513 }
1514 
1515 
1516 enum: UINT {
1517    ETO_OPAQUE = 0x0002,
1518    ETO_CLIPPED = 0x0004,
1519 }
1520 
1521 
1522 enum: UINT {
1523    PS_SOLID = 0,
1524    PS_DASH = 1,
1525    PS_DOT = 2,
1526    PS_DASHDOT = 3,
1527    PS_DASHDOTDOT = 4,
1528    PS_NULL = 5,
1529    PS_INSIDEFRAME = 6,
1530 }
1531 
1532 
1533 enum: UINT {
1534    IMAGE_BITMAP = 0,
1535    IMAGE_ICON = 1,
1536    IMAGE_CURSOR = 2,
1537 }
1538 
1539 
1540 enum LPCSTR IDI_HAND = cast(LPCSTR)32513;
1541 enum LPCSTR IDI_QUESTION = cast(LPCSTR)32514;
1542 enum LPCSTR IDI_EXCLAMATION = cast(LPCSTR)32515;
1543 enum LPCSTR IDI_ASTERISK = cast(LPCSTR)32516;
1544 enum LPCSTR IDI_INFORMATION = IDI_ASTERISK;
1545 
1546 
1547 enum LPCSTR RT_STRING = cast(LPCSTR)6;
1548 
1549 
1550 enum: LONG {
1551    HS_HORIZONTAL = 0,
1552    HS_VERTICAL = 1,
1553    HS_FDIAGONAL = 2,
1554    HS_BDIAGONAL = 3,
1555    HS_CROSS = 4,
1556    HS_DIAGCROSS = 5,
1557 }
1558 
1559 
1560 enum: DWORD {
1561    LOAD_LIBRARY_AS_DATAFILE = 0x00000002,
1562 }
1563 
1564 
1565 enum: DWORD {
1566    // IE3+
1567    ICC_LISTVIEW_CLASSES = 0x00000001,
1568    ICC_TREEVIEW_CLASSES = 0x00000002,
1569    ICC_BAR_CLASSES = 0x00000004, // tool/status/track
1570    ICC_TAB_CLASSES = 0x00000008,
1571    ICC_UPDOWN_CLASS = 0x00000010,
1572    ICC_PROGRESS_CLASS = 0x00000020,
1573    ICC_HOTKEY_CLASS = 0x00000040,
1574    ICC_ANIMATE_CLASS = 0x00000080,
1575    ICC_WIN95_CLASSES = 0x000000FF,
1576    ICC_DATE_CLASSES = 0x00000100,
1577    ICC_USEREX_CLASSES = 0x00000200,
1578    ICC_COOL_CLASSES = 0x00000400,
1579 
1580    ICC_STANDARD_CLASSES = 0x00004000,
1581 
1582    // IE4+
1583    ICC_INTERNET_CLASSES = 0x00000800,
1584    ICC_PAGESCROLLER_CLASS = 0x00001000,
1585    ICC_NATIVEFNTCTL_CLASS = 0x00002000,
1586 }
1587 
1588 
1589 enum: UINT {
1590    PBM_SETRANGE = WM_USER + 1,
1591    PBM_SETPOS = WM_USER + 2,
1592    PBM_DELTAPOS = WM_USER + 3,
1593    PBM_SETSTEP = WM_USER + 4,
1594    PBM_STEPIT = WM_USER + 5,
1595 }
1596 
1597 
1598 enum DWORD MAX_COMPUTERNAME_LENGTH = 15;
1599 
1600 enum DWORD LF_FACESIZE = 32;
1601 
1602 
1603 alias HANDLE HIMAGELIST;
1604 
1605 
1606 enum: UINT {
1607    ILD_NORMAL = 0,
1608 }
1609 
1610 
1611 enum: UINT {
1612    //ILC_COLOR = ,
1613    ILC_COLOR4 = 0x0004,
1614    ILC_COLOR8 = 0x0008,
1615    ILC_COLOR16 = 0x0010,
1616    ILC_COLOR24 = 0x0018,
1617    ILC_COLOR32 = 0x0020,
1618 
1619    ILC_MASK = 0x0001,
1620 }
1621 
1622 
1623 // Rich edit.
1624 alias DWORD function(/+ DWORD_PTR +/ DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb) EDITSTREAMCALLBACK;
1625 
1626 
1627 alias DWORD LCID;
1628 
1629 
1630 struct WINDOWPOS {
1631    HWND hwnd;
1632    HWND hwndInsertAfter;
1633    int  x;
1634    int  y;
1635    int  cx;
1636    int  cy;
1637    UINT flags;
1638 }
1639 alias WINDOWPOS* LPWINDOWPOS;
1640 alias WINDOWPOS* PWINDOWPOS;
1641 
1642 
1643 struct WNDCLASSW {
1644    UINT style;
1645    WNDPROC lpfnWndProc;
1646    int cbClsExtra;
1647    int cbWndExtra;
1648    HANDLE hInstance;
1649    HICON hIcon;
1650    HCURSOR hCursor;
1651    HBRUSH hbrBackground;
1652    LPCWSTR lpszMenuName;
1653    LPCWSTR lpszClassName;
1654 }
1655 alias WNDCLASSW* LPWNDCLASSW;
1656 
1657 
1658 struct OSVERSIONINFOA {
1659    DWORD dwOSVersionInfoSize;
1660    DWORD dwMajorVersion;
1661    DWORD dwMinorVersion;
1662    DWORD dwBuildNumber;
1663    DWORD dwPlatformId;
1664    CHAR[128] szCSDVersion;
1665 }
1666 alias OSVERSIONINFOA* LPOSVERSIONINFOA;
1667 
1668 
1669 const HWND HWND_MESSAGE = cast(HWND)-3; // Win2000/XP only.
1670 
1671 
1672 struct NOTIFYICONDATA {
1673    DWORD cbSize;
1674    HWND hWnd;
1675    UINT uID;
1676    UINT uFlags;
1677    UINT uCallbackMessage;
1678    HICON hIcon;
1679    char[64] szTip;
1680 }
1681 alias NOTIFYICONDATA* PNOTIFYICONDATA;
1682 
1683 
1684 // Unaligned!
1685 struct SHITEMID {
1686    align(1):
1687       USHORT cb; // Size including cb.
1688       BYTE[1] abID;
1689    }
1690    alias SHITEMID* PSHITEMID;
1691    alias SHITEMID* LPSHITEMID;
1692    alias SHITEMID* LPCSHITEMID;
1693 
1694 
1695    struct ITEMIDLIST {
1696    SHITEMID mkid;
1697 }
1698 alias ITEMIDLIST* PITEMIDLIST;
1699 alias ITEMIDLIST* LPITEMIDLIST;
1700 alias ITEMIDLIST* LPCITEMIDLIST;
1701 
1702 
1703 alias int function(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) BFFCALLBACK;
1704 
1705 
1706 struct BROWSEINFOA {
1707    HWND hwndOwner;
1708    LPCITEMIDLIST pidlRoot;
1709    LPSTR pszDisplayName;
1710    LPCSTR lpszTitle;
1711    UINT ulFlags;
1712    BFFCALLBACK lpfn;
1713    LPARAM lParam;
1714    int iImage;
1715 }
1716 alias BROWSEINFOA* PBROWSEINFOA;
1717 alias BROWSEINFOA* LPBROWSEINFOA;
1718 
1719 
1720 struct BROWSEINFOW {
1721    HWND hwndOwner;
1722    LPCITEMIDLIST pidlRoot;
1723    LPWSTR pszDisplayName;
1724    LPCWSTR lpszTitle;
1725    UINT ulFlags;
1726    BFFCALLBACK lpfn;
1727    LPARAM lParam;
1728    int iImage;
1729 }
1730 alias BROWSEINFOW* PBROWSEINFOW;
1731 alias BROWSEINFOW* LPBROWSEINFOW;
1732 
1733 
1734 struct LOGBRUSH {
1735    UINT lbStyle;
1736    COLORREF lbColor;
1737    LONG lbHatch;
1738 }
1739 alias LOGBRUSH* LPLOGBRUSH;
1740 
1741 
1742 struct DRAWTEXTPARAMS {
1743    UINT cbSize;
1744    int iTabLength;
1745    int iLeftMargin;
1746    int iRightMargin;
1747    UINT uiLengthDrawn;
1748 }
1749 alias DRAWTEXTPARAMS* LPDRAWTEXTPARAMS;
1750 
1751 
1752 struct NMHDR {
1753    HWND hwndFrom;
1754    UINT idFrom;
1755    UINT code;
1756 }
1757 alias NMHDR* LPNMHDR;
1758 
1759 
1760 struct NMCUSTOMDRAW {
1761    NMHDR hdr;
1762    DWORD dwDrawStage;
1763    HDC hdc;
1764    RECT rc;
1765    /+ DWORD_PTR +/ DWORD dwItemSpec;
1766    UINT uItemState;
1767    LPARAM lItemlParam;
1768 }
1769 alias NMCUSTOMDRAW* LPNMCUSTOMDRAW;
1770 
1771 
1772 struct NMTVCUSTOMDRAW {
1773    NMCUSTOMDRAW nmcd;
1774    COLORREF clrText;
1775    COLORREF clrTextBk;
1776    int iLevel; // IE4+
1777 }
1778 alias NMTVCUSTOMDRAW* LPNMTVCUSTOMDRAW;
1779 
1780 
1781 struct NM_LISTVIEW {
1782    NMHDR hdr;
1783    int iItem;
1784    int iSubItem;
1785    UINT uNewState;
1786    UINT uOldState;
1787    UINT uChanged;
1788    POINT ptAction;
1789    LPARAM lParam;
1790 }
1791 
1792 
1793 struct LVITEMA {
1794    UINT mask;
1795    int iItem;
1796    int iSubItem;
1797    UINT state;
1798    UINT stateMask;
1799    LPSTR pszText;
1800    int cchTextMax;
1801    int iImage;
1802    LPARAM lParam;
1803 }
1804 alias LVITEMA* LPLVITEMA;
1805 alias LVITEMA* PLVITEMA;
1806 alias LVITEMA LV_ITEMA;
1807 alias LVITEMA* LPLV_ITEMA;
1808 alias LVITEMA* PLV_ITEMA;
1809 
1810 
1811 struct LVITEMW {
1812    UINT mask;
1813    int iItem;
1814    int iSubItem;
1815    UINT state;
1816    UINT stateMask;
1817    LPWSTR pszText;
1818    int cchTextMax;
1819    int iImage;
1820    LPARAM lParam;
1821 }
1822 alias LVITEMW* LPLVITEMW;
1823 alias LVITEMW* PLVITEMW;
1824 alias LVITEMW LV_ITEMW;
1825 alias LVITEMW* LPLV_ITEMW;
1826 alias LVITEMW* PLV_ITEMW;
1827 
1828 
1829 struct LVDISPINFOA {
1830    NMHDR hdr;
1831    LVITEMA item;
1832 }
1833 alias LVDISPINFOA* LPLVDISPINFOA;
1834 alias LVDISPINFOA* PLVDISPINFOA;
1835 alias LVDISPINFOA LV_DISPINFOA;
1836 alias LVDISPINFOA* LPLV_DISPINFOA;
1837 alias LVDISPINFOA* PLV_DISPINFOA;
1838 
1839 
1840 struct LVDISPINFOW {
1841    NMHDR hdr;
1842    LVITEMW item;
1843 }
1844 alias LVDISPINFOW* LPLVDISPINFOW;
1845 alias LVDISPINFOW* PLVDISPINFOW;
1846 alias LVDISPINFOW LV_DISPINFOW;
1847 alias LVDISPINFOW* LPLV_DISPINFOW;
1848 alias LVDISPINFOW* PLV_DISPINFOW;
1849 
1850 
1851 struct LVCOLUMNA {
1852    UINT mask;
1853    int fmt;
1854    int cx;
1855    LPSTR pszText;
1856    int cchTextMax;
1857    int iSubItem;
1858 }
1859 alias LVCOLUMNA* LPLVCOLUMNA;
1860 alias LVCOLUMNA* PLVCOLUMNA;
1861 alias LVCOLUMNA LV_COLUMNA;
1862 alias LVCOLUMNA* LPLV_COLUMNA;
1863 alias LVCOLUMNA* PLV_COLUMNA;
1864 
1865 
1866 struct LVCOLUMNW {
1867    UINT mask;
1868    int fmt;
1869    int cx;
1870    LPWSTR pszText;
1871    int cchTextMax;
1872    int iSubItem;
1873 }
1874 alias LVCOLUMNW* LPLVCOLUMNW;
1875 alias LVCOLUMNW* PLVCOLUMNW;
1876 alias LVCOLUMNW LV_COLUMNW;
1877 alias LVCOLUMNW* LPLV_COLUMNW;
1878 alias LVCOLUMNW* PLV_COLUMNW;
1879 
1880 
1881 struct TBBUTTON {
1882    int iBitmap;
1883    int idCommand;
1884    BYTE fsState;
1885    BYTE fsStyle;
1886    BYTE[2] bReserved;
1887    DWORD dwData;
1888    int iString;
1889 }
1890 alias TBBUTTON* PTBBUTTON, LPTBBUTTON, LPCTBBUTTON;
1891 
1892 
1893 struct NMTOOLBARA {
1894    NMHDR hdr;
1895    int iItem;
1896    TBBUTTON tbButton;
1897    int cchText;
1898    LPSTR pszText;
1899    RECT rcButton;
1900 }
1901 alias NMTOOLBARA* LPNMTOOLBARA;
1902 
1903 
1904 struct NMTOOLBARW {
1905    NMHDR hdr;
1906    int iItem;
1907    TBBUTTON tbButton;
1908    int cchText;
1909    LPWSTR pszText;
1910    RECT rcButton;
1911 }
1912 alias NMTOOLBARW* LPNMTOOLBARW;
1913 
1914 
1915 enum: BYTE {
1916    TBSTYLE_BUTTON = 0x00,
1917    TBSTYLE_SEP = 0x01,
1918    TBSTYLE_CHECK = 0x02,
1919    TBSTYLE_GROUP = 0x04,
1920    TBSTYLE_DROPDOWN = 0x08,
1921    TBSTYLE_AUTOSIZE = 0x10,
1922 
1923    /+
1924    // The following are too big for TBBUTTON.fsStyle
1925    TBSTYLE_TOOLTIPS = 0x0100,
1926    TBSTYLE_WRAPABLE = 0x0200,
1927    TBSTYLE_ALTDRAG = 0x0400,
1928    +/
1929 }
1930 
1931 
1932 enum: BYTE {
1933    //BTNS_AUTOSIZE = TBSTYLE_AUTOSIZE,
1934 
1935    BTNS_WHOLEDROPDOWN = 0x80,
1936 }
1937 
1938 
1939 enum: BYTE {
1940    TBSTATE_CHECKED = 0x01,
1941    TBSTATE_PRESSED = 0x02,
1942    TBSTATE_ENABLED = 0x04,
1943    TBSTATE_HIDDEN = 0x08,
1944    TBSTATE_INDETERMINATE = 0x10,
1945    TBSTATE_WRAP = 0x20,
1946    TBSTATE_ELLIPSES = 0x40,
1947    TBSTATE_MARKED = 0x80,
1948 }
1949 
1950 
1951 enum: LRESULT {
1952    TBDDRET_DEFAULT = 0,
1953    TBDDRET_NODEFAULT = 1,
1954    TBDDRET_TREATPRESSED = 2,
1955 }
1956 
1957 
1958 enum: UINT {
1959    TB_SETSTATE = WM_USER + 17,
1960    TB_ADDBUTTONSA = WM_USER + 20,
1961    TB_INSERTBUTTONA = WM_USER + 21,
1962    TB_DELETEBUTTON = WM_USER + 22,
1963    TB_GETITEMRECT = WM_USER + 29,
1964    TB_BUTTONSTRUCTSIZE = WM_USER + 30,
1965    TB_SETBUTTONSIZE = WM_USER + 31,
1966    TB_AUTOSIZE = WM_USER + 33,
1967    TB_SETIMAGELIST = WM_USER + 48,
1968    TB_INSERTBUTTONW = WM_USER + 67,
1969    TB_ADDBUTTONSW = WM_USER + 68,
1970    TB_SETPADDING = WM_USER + 87,
1971 }
1972 
1973 
1974 enum: UINT {
1975    TBN_FIRST = cast(UINT)-700,
1976    TBN_DROPDOWN = TBN_FIRST - 10,
1977 }
1978 
1979 
1980 struct TVITEMA {
1981    UINT mask;
1982    HTREEITEM hItem;
1983    UINT state;
1984    UINT stateMask;
1985    LPSTR pszText;
1986    int cchTextMax;
1987    int iImage;
1988    int iSelectedImage;
1989    int cChildren;
1990    LPARAM lParam;
1991 }
1992 alias TVITEMA* LPTVITEMA;
1993 alias TVITEMA* PTVITEMA;
1994 alias TVITEMA TV_ITEMA;
1995 alias TVITEMA* LPTV_ITEMA;
1996 alias TVITEMA* PTV_ITEMA;
1997 
1998 
1999 struct TVITEMW {
2000    UINT mask;
2001    HTREEITEM hItem;
2002    UINT state;
2003    UINT stateMask;
2004    LPWSTR pszText;
2005    int cchTextMax;
2006    int iImage;
2007    int iSelectedImage;
2008    int cChildren;
2009    LPARAM lParam;
2010 }
2011 alias TVITEMW* LPTVITEMW;
2012 alias TVITEMW* PTVITEMW;
2013 alias TVITEMW TV_ITEMW;
2014 alias TVITEMW* LPTV_ITEMW;
2015 alias TVITEMW* PTV_ITEMW;
2016 
2017 
2018 struct TVHITTESTINFO {
2019    POINT pt;
2020    UINT flags;
2021    HTREEITEM hItem;
2022 }
2023 alias TVHITTESTINFO* LPTVHITTESTINFO;
2024 
2025 
2026 struct TVINSERTSTRUCTA {
2027    HTREEITEM hParent;
2028    HTREEITEM hInsertAfter;
2029    TV_ITEMA item;
2030 }
2031 alias TVINSERTSTRUCTA* LPTVINSERTSTRUCTA;
2032 alias TVINSERTSTRUCTA TV_INSERTSTRUCTA;
2033 alias TVINSERTSTRUCTA* LPTV_INSERTSTRUCTA;
2034 
2035 
2036 struct NMTREEVIEWA {
2037    NMHDR hdr;
2038    UINT action;
2039    TVITEMA itemOld;
2040    TVITEMA itemNew;
2041    POINT ptDrag;
2042 }
2043 alias NMTREEVIEWA* LPNMTREEVIEWA;
2044 alias NMTREEVIEWA NM_TREEVIEW;
2045 alias NMTREEVIEWA* LPNM_TREEVIEW;
2046 
2047 
2048 struct NMTVDISPINFOA {
2049    NMHDR hdr;
2050    TVITEMA item;
2051 }
2052 alias NMTVDISPINFOA* LPNMTVDISPINFOA;
2053 alias NMTVDISPINFOA TV_DISPINFOA;
2054 alias NMTVDISPINFOA* LPTV_DISPINFOA;
2055 
2056 
2057 struct NMTVDISPINFOW {
2058    NMHDR hdr;
2059    TVITEMW item;
2060 }
2061 alias NMTVDISPINFOW* LPNMTVDISPINFOW;
2062 alias NMTVDISPINFOW TV_DISPINFOW;
2063 alias NMTVDISPINFOW* LPTV_DISPINFOW;
2064 
2065 
2066 struct TCITEMA {
2067    UINT mask;
2068    UINT lpReserved1;
2069    UINT lpReserved2;
2070    LPSTR pszText;
2071    int cchTextMax;
2072    int iImage;
2073    LPARAM lParam;
2074 }
2075 alias TCITEMA* LPTCITEMA;
2076 alias TCITEMA TC_ITEMA;
2077 alias TCITEMA* LPTC_ITEMA;
2078 
2079 
2080 struct TCITEMW {
2081    UINT mask;
2082    UINT lpReserved1;
2083    UINT lpReserved2;
2084    LPWSTR pszText;
2085    int cchTextMax;
2086    int iImage;
2087    LPARAM lParam;
2088 }
2089 alias TCITEMW* LPTCITEMW;
2090 alias TCITEMW TC_ITEMW;
2091 alias TCITEMW* LPTC_ITEMW;
2092 
2093 
2094 // Rich edit.
2095 struct CHARRANGE {
2096    LONG cpMin;
2097    LONG cpMax;
2098 }
2099 
2100 
2101 // Rich edit.
2102 struct EDITSTREAM {
2103    /+ DWORD_PTR +/ DWORD dwCookie;
2104    DWORD dwError;
2105    EDITSTREAMCALLBACK pfnCallback;
2106 }
2107 
2108 
2109 // Rich edit.
2110 struct CHARFORMAT2A {
2111    UINT cbSize;
2112    DWORD dwMask;
2113    DWORD dwEffects;
2114    LONG yHeight;
2115    LONG yOffset;
2116    COLORREF crTextColor;
2117    BYTE bCharSet;
2118    BYTE bPitchAndFamily;
2119    char[LF_FACESIZE] szFaceName;
2120    WORD wWeight;
2121    SHORT sSpacing;
2122    COLORREF crBackColor;
2123    LCID lcid;
2124    DWORD dwReserved;
2125    SHORT sStyle;
2126    WORD wKerning;
2127    BYTE bUnderlineType;
2128    BYTE bAnimation;
2129    BYTE bRevAuthor;
2130    BYTE bReserved1;
2131 }
2132 static assert(CHARFORMAT2A.sizeof == 84);
2133 
2134 
2135 // Rich edit.
2136 struct ENLINK {
2137    NMHDR nmhdr;
2138    UINT msg;
2139    WPARAM wParam;
2140    LPARAM lParam;
2141    CHARRANGE chrg;
2142 }
2143 
2144 
2145 struct TEXTRANGEA {
2146    CHARRANGE chrg;
2147    LPSTR lpstrText;
2148 }
2149 
2150 
2151 struct MENUITEMINFOA {
2152    UINT cbSize;
2153    UINT fMask;
2154    UINT fType;
2155    UINT fState;
2156    UINT wID;
2157    HMENU hSubMenu;
2158    HBITMAP hbmpChecked;
2159    HBITMAP hbmpUnchecked;
2160    DWORD dwItemData;
2161    LPSTR dwTypeData;
2162    UINT cch;
2163    //HBITMAP hbmpItem;
2164 }
2165 alias MENUITEMINFOA* LPMENUITEMINFOA;
2166 
2167 
2168 struct MENUITEMINFOW {
2169    UINT cbSize;
2170    UINT fMask;
2171    UINT fType;
2172    UINT fState;
2173    UINT wID;
2174    HMENU hSubMenu;
2175    HBITMAP hbmpChecked;
2176    HBITMAP hbmpUnchecked;
2177    DWORD dwItemData;
2178    LPWSTR dwTypeData;
2179    UINT cch;
2180    //HBITMAP hbmpItem;
2181 }
2182 alias MENUITEMINFOW* LPMENUITEMINFOW;
2183 
2184 
2185 struct SCROLLINFO {
2186    UINT cbSize;
2187    UINT fMask;
2188    int nMin;
2189    int nMax;
2190    UINT nPage;
2191    int nPos;
2192    int nTrackPos;
2193 }
2194 alias SCROLLINFO* LPSCROLLINFO;
2195 
2196 
2197 struct OPENFILENAMEW {
2198    DWORD lStructSize;
2199    HWND hwndOwner;
2200    HINSTANCE hInstance;
2201    LPCWSTR lpstrFilter;
2202    LPWSTR lpstrCustomFilter;
2203    DWORD nMaxCustFilter;
2204    DWORD nFilterIndex;
2205    LPWSTR lpstrFile;
2206    DWORD nMaxFile;
2207    LPWSTR lpstrFileTitle;
2208    DWORD nMaxFileTitle;
2209    LPCWSTR lpstrInitialDir;
2210    LPCWSTR lpstrTitle;
2211    DWORD Flags;
2212    WORD nFileOffset;
2213    WORD nFileExtension;
2214    LPCWSTR lpstrDefExt;
2215    LPARAM lCustData;
2216    LPOFNHOOKPROC lpfnHook;
2217    LPCWSTR lpTemplateName;
2218 }
2219 alias OPENFILENAMEW* LPOPENFILENAMEW;
2220 
2221 
2222 alias UINT function(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) LPCCHOOKPROC;
2223 
2224 
2225 alias UINT function(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) LPCFHOOKPROC;
2226 
2227 
2228 alias BOOL function(HDC hdc, LPARAM lpData, int cchData) GRAYSTRINGPROC;
2229 
2230 
2231 enum: DWORD {
2232    CC_RGBINIT = 0x00000001,
2233    CC_FULLOPEN = 0x00000002,
2234    CC_PREVENTFULLOPEN = 0x00000004,
2235    CC_SHOWHELP = 0x00000008,
2236    CC_ENABLEHOOK = 0x00000010,
2237    CC_ENABLETEMPLATE = 0x00000020,
2238    CC_ENABLETEMPLATEHANDLE = 0x00000040,
2239    CC_SOLIDCOLOR = 0x00000080,
2240    CC_ANYCOLOR = 0x00000100,
2241 }
2242 
2243 
2244 struct CHOOSECOLORA {
2245    DWORD lStructSize;
2246    HWND hwndOwner;
2247    HWND hInstance;
2248    COLORREF rgbResult;
2249    COLORREF* lpCustColors;
2250    DWORD Flags;
2251    LPARAM lCustData;
2252    LPCCHOOKPROC lpfnHook;
2253    LPCSTR lpTemplateName;
2254 }
2255 alias CHOOSECOLORA* PCHOOSECOLORA;
2256 alias CHOOSECOLORA* LPCHOOSECOLORA;
2257 
2258 
2259 struct LOGFONTW {
2260    LONG lfHeight;
2261    LONG lfWidth;
2262    LONG lfEscapement;
2263    LONG lfOrientation;
2264    LONG lfWeight;
2265    BYTE lfItalic;
2266    BYTE lfUnderline;
2267    BYTE lfStrikeOut;
2268    BYTE lfCharSet;
2269    BYTE lfOutPrecision;
2270    BYTE lfClipPrecision;
2271    BYTE lfQuality;
2272    BYTE lfPitchAndFamily;
2273    WCHAR[32] lfFaceName;
2274 }
2275 alias LOGFONTW* PLOGFONTW;
2276 alias LOGFONTW* LPLOGFONTW;
2277 
2278 
2279 struct NONCLIENTMETRICSA {
2280    UINT cbSize;
2281    int iBorderWidth;
2282    int iScrollWidth;
2283    int iScrollHeight;
2284    int iCaptionWidth;
2285    int iCaptionHeight;
2286    LOGFONTA lfCaptionFont;
2287    int iSmCaptionWidth;
2288    int iSmCaptionHeight;
2289    LOGFONTA lfSmCaptionFont;
2290    int iMenuWidth;
2291    int iMenuHeight;
2292    LOGFONTA lfMenuFont;
2293    LOGFONTA lfStatusFont;
2294    LOGFONTA lfMessageFont;
2295 }
2296 alias NONCLIENTMETRICSA LPNONCLIENTMETRICSA;
2297 
2298 
2299 struct CHOOSEFONTW {
2300    align(1):
2301       DWORD lStructSize;
2302       HWND hwndOwner;
2303       HDC hDC;
2304       LPLOGFONTW lpLogFont;
2305       INT iPointSize;
2306       DWORD Flags;
2307       DWORD rgbColors;
2308       LPARAM lCustData;
2309       LPCFHOOKPROC lpfnHook;
2310       LPCWSTR lpTemplateName;
2311       HINSTANCE hInstance;
2312       LPWSTR lpszStyle;
2313       WORD nFontType;
2314       WORD ___MISSING_ALIGNMENT__;
2315       INT nSizeMin;
2316       INT nSizeMax;
2317    }
2318    alias CHOOSEFONTW* PCHOOSEFONTW;
2319    alias CHOOSEFONTW* LPCHOOSEFONTW;
2320 
2321 
2322    struct CHOOSEFONTA {
2323    align(1):
2324       DWORD lStructSize;
2325       HWND hwndOwner;
2326       HDC hDC;
2327       LPLOGFONTA lpLogFont;
2328       INT iPointSize;
2329       DWORD Flags;
2330       DWORD rgbColors;
2331       LPARAM lCustData;
2332       LPCFHOOKPROC lpfnHook;
2333       LPCSTR lpTemplateName;
2334       HINSTANCE hInstance;
2335       LPSTR lpszStyle;
2336       WORD nFontType;
2337       WORD ___MISSING_ALIGNMENT__;
2338       INT nSizeMin;
2339       INT nSizeMax;
2340    }
2341    alias CHOOSEFONTA* PCHOOSEFONTA;
2342    alias CHOOSEFONTA* LPCHOOSEFONTA;
2343 
2344 
2345    struct ICONINFO {
2346    BOOL fIcon;
2347    DWORD xHotspot;
2348    DWORD yHotspot;
2349    HBITMAP hbmMask;
2350    HBITMAP hbmColor;
2351 }
2352 alias ICONINFO* LPICONINFO;
2353 alias ICONINFO* PICONINFO;
2354 
2355 
2356 struct MINMAXINFO {
2357    POINT ptReserved;
2358    POINT ptMaxSize;
2359    POINT ptMaxPosition;
2360    POINT ptMinTrackSize;
2361    POINT ptMaxTrackSize;
2362 }
2363 alias MINMAXINFO* LPMINMAXINFO;
2364 alias MINMAXINFO* PMINMAXINFO;
2365 
2366 
2367 struct NCCALCSIZE_PARAMS {
2368    RECT[3] rgrc;
2369    PWINDOWPOS lppos;
2370 }
2371 alias NCCALCSIZE_PARAMS* LPNCCALCSIZE_PARAMS;
2372 
2373 
2374 struct CREATESTRUCTA {
2375    LPVOID lpCreateParams;
2376    HINSTANCE hInstance;
2377    HMENU hMenu;
2378    HWND hwndParent;
2379    int cy;
2380    int cx;
2381    int y;
2382    int x;
2383    LONG style;
2384    LPCSTR lpszName;
2385    LPCSTR lpszClass;
2386    DWORD dwExStyle;
2387 }
2388 alias CREATESTRUCTA* LPCREATESTRUCTA;
2389 
2390 
2391 struct ACTCTXW {
2392    ULONG cbSize;
2393    DWORD dwFlags;
2394    LPCWSTR lpSource;
2395    USHORT wProcessorArchitecture;
2396    LANGID wLangId;
2397    LPCWSTR lpAssemblyDirectory;
2398    LPCWSTR lpResourceName;
2399    LPCWSTR lpApplicationName;
2400    HMODULE hModule;
2401 }
2402 alias ACTCTXW* PACTCTXW;
2403 alias ACTCTXW* LPACTCTXW;
2404 
2405 
2406 struct HELPINFO {
2407    UINT cbSize;
2408    int iContextType;
2409    int iCtrlId;
2410    HANDLE hItemHandle;
2411    DWORD dwContextId;
2412    POINT MousePos;
2413 }
2414 alias HELPINFO* LPHELPINFO;
2415 
2416 
2417 struct TOOLINFOA {
2418    UINT cbSize;
2419    UINT uFlags;
2420    HWND hwnd;
2421    UINT uId;
2422    RECT rect;
2423    HINSTANCE hinst;
2424    LPSTR lpszText;
2425 }
2426 alias TOOLINFOA* PTOOLINFOA;
2427 alias TOOLINFOA* LPTOOLINFOA;
2428 
2429 
2430 struct TRACKMOUSEEVENT {
2431    DWORD cbSize;
2432    DWORD dwFlags;
2433    HWND hwndTrack;
2434    DWORD dwHoverTime;
2435 }
2436 alias TRACKMOUSEEVENT* LPTRACKMOUSEEVENT;
2437 
2438 
2439 struct STYLESTRUCT {
2440    DWORD styleOld;
2441    DWORD styleNew;
2442 }
2443 alias STYLESTRUCT* LPSTYLESTRUCT;
2444 
2445 
2446 //extern(C) DWORD MAKELONG(WORD wLow, WORD wHigh)
2447 extern(C) DWORD MAKELONG(int wLow, int wHigh) {
2448    return cast(DWORD)cast(WORD)wLow | (cast(DWORD)cast(WORD)wHigh << 16);
2449 }
2450 
2451 alias MAKELONG MAKELPARAM;
2452 alias MAKELONG MAKEWPARAM;
2453 alias MAKELONG MAKELRESULT;
2454 
2455 
2456 enum int DLGWINDOWEXTRA = 30;
2457 
2458 
2459 extern(C) COLORREF RGB(int r, int g , int b) {
2460    return cast(COLORREF)(cast(BYTE)r |
2461                          cast(WORD)(cast(BYTE)g << 8) |
2462                          cast(DWORD)(cast(BYTE)b << 16));
2463 }
2464 
2465 
2466 struct DRAWITEMSTRUCT {
2467    UINT CtlType;
2468    UINT CtlID;
2469    UINT itemID;
2470    UINT itemAction;
2471    UINT itemState;
2472    HWND hwndItem;
2473    HDC hDC;
2474    RECT rcItem;
2475    DWORD itemData;
2476 }
2477 alias DRAWITEMSTRUCT* LPDRAWITEMSTRUCT;
2478 
2479 
2480 struct MEASUREITEMSTRUCT {
2481    UINT CtlType;
2482    UINT CtlID;
2483    UINT itemID;
2484    UINT itemWidth;
2485    UINT itemHeight;
2486    DWORD itemData;
2487 }
2488 alias MEASUREITEMSTRUCT* LPMEASUREITEMSTRUCT;
2489 
2490 
2491 struct ANIMATIONINFO {
2492    UINT cbSize;
2493    int iMinAnimate;
2494 }
2495 
2496 
2497 struct APPBARDATA {
2498    DWORD cbSize;
2499    HWND hWnd;
2500    UINT uCallbackMessage;
2501    UINT uEdge;
2502    RECT rc;
2503    LPARAM lParam; // message specific
2504 }
2505 alias APPBARDATA* PAPPBARDATA;
2506 
2507 
2508 struct CLIENTCREATESTRUCT {
2509    HANDLE hWindowMenu;
2510    UINT idFirstChild;
2511 }
2512 alias CLIENTCREATESTRUCT* LPCLIENTCREATESTRUCT;
2513 
2514 
2515 struct MDICREATESTRUCTA {
2516    LPCSTR szClass;
2517    LPCSTR szTitle;
2518    HANDLE hOwner;
2519    int x;
2520    int y;
2521    int cx;
2522    int cy;
2523    DWORD style;
2524    LPARAM lParam;
2525 }
2526 alias MDICREATESTRUCTA* LPMDICREATESTRUCTA;
2527 
2528 
2529 struct INITCOMMONCONTROLSEX {
2530    DWORD dwSize;
2531    DWORD dwICC;
2532 }
2533 alias INITCOMMONCONTROLSEX* LPINITCOMMONCONTROLSEX;
2534 alias INITCOMMONCONTROLSEX* PINITCOMMONCONTROLSEX;
2535 
2536 
2537 struct DROPFILES {
2538    DWORD pFiles;
2539    POINT pt;
2540    BOOL fNC;
2541    BOOL fWide;
2542 }
2543 alias DROPFILES* LPDROPFILES;
2544 
2545 
2546 alias HANDLE HHOOK;
2547 alias HANDLE HTHEME;
2548 alias HANDLE HTREEITEM;
2549 alias HANDLE HDROP;
2550 alias HANDLE HMONITOR;
2551 
2552 
2553 HCURSOR CopyCursor(HCURSOR pcur) {
2554    return cast(HCURSOR)CopyIcon(cast(HICON)pcur);
2555 }
2556 
2557 
2558 alias BOOL function(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) MONITORENUMPROC;
2559 
2560 
2561 struct MONITORINFO {
2562    DWORD cbSize;
2563    RECT rcMonitor;
2564    RECT rcWork;
2565    DWORD dwFlags;
2566 }
2567 alias MONITORINFO* LPMONITORINFO;
2568 
2569 
2570 enum: DWORD {
2571    MONITORINFOF_PRIMARY = 1,
2572 }
2573 
2574 
2575 enum: DWORD {
2576    MONITOR_DEFAULTTONULL = 0x00000000,
2577    MONITOR_DEFAULTTOPRIMARY = 0x00000001,
2578    MONITOR_DEFAULTTONEAREST = 0x00000002,
2579 }
2580 
2581 
2582 struct ENHMETAHEADER {
2583    alias SIZE SIZEL;
2584    alias RECT RECTL;
2585    DWORD iType = 1;
2586    DWORD nSize = ENHMETAHEADER.sizeof;
2587    RECTL rclBounds;
2588    RECTL rclFrame;
2589    DWORD dSignature = 1179469088;
2590    DWORD nVersion;
2591    DWORD nBytes;
2592    DWORD nRecords;
2593    WORD nHandles;
2594    WORD sReserved;
2595    DWORD nDescription;
2596    DWORD offDescription;
2597    DWORD nPalEntries;
2598    SIZEL szlDevice;
2599    SIZEL szlMillimeters;
2600    DWORD cbPixelFormat;
2601    DWORD offPixelFormat;
2602    DWORD bOpenGL;
2603    SIZEL szlMicrometers;
2604 }
2605 
2606 
2607 BOOL DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
2608 BOOL DrawIcon(HDC hDC, int X, int Y, HICON hIcon);
2609 BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
2610 HWND GetCapture();
2611 HWND SetCapture(HWND hWnd);
2612 BOOL ReleaseCapture();
2613 HMENU GetMenu(HWND hWnd);
2614 BOOL IsChild(HWND hWndParent, HWND hWnd);
2615 BOOL IsWindow(HWND hWnd);
2616 HWND CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
2617 LRESULT SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
2618 int MessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType);
2619 DWORD SetClassLongA(HWND hWnd, int nIndex, LONG dwNewLong);
2620 DWORD GetClassLongA(HWND hWnd, int nIndex);
2621 LONG SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong);
2622 LONG GetWindowLongA(HWND hWnd, int nIndex);
2623 DWORD GetSysColor(int nIndex);
2624 BOOL EnableWindow(HWND hWnd, BOOL bEnable);
2625 BOOL IsWindowEnabled(HWND hWnd);
2626 COLORREF GetTextColor(HDC hdc);
2627 COLORREF SetTextColor(HDC hdc, COLORREF crColor);
2628 HWND GetWindow(HWND hWnd, UINT uCmd);
2629 DWORD GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId);
2630 SHORT GetKeyState(int nVirtKey);
2631 SHORT GetAsyncKeyState(int vKey);
2632 HWND SetParent(HWND hWndChild, HWND hWndNewParent);
2633 int CombineRgn(HRGN hrgnDest, HRGN hrgnSrc1, HRGN hrgnSrc2, int fnCombineMode);
2634 BOOL EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam);
2635 BOOL EnumChildWindows(HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM lParam);
2636 BOOL SetWindowTextA(HWND hWnd, LPCSTR lpString);
2637 BOOL SetWindowTextW(HWND hWnd, LPCWSTR lpString);
2638 int GetWindowTextLengthA(HWND hWnd);
2639 int GetWindowTextLengthW(HWND hWnd);
2640 int GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount);
2641 int GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount);
2642 BOOL IsWindowVisible(HWND hWnd);
2643 BOOL WaitMessage();
2644 DWORD TlsAlloc();
2645 BOOL TlsFree(DWORD dwTlsIndex);
2646 LPVOID TlsGetValue(DWORD dwTlsIndex);
2647 BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
2648 BOOL BringWindowToTop(HWND hWnd);
2649 UINT RegisterWindowMessageA(LPCSTR lpString);
2650 HWND GetParent(HWND hWnd);
2651 HWND GetDesktopWindow();
2652 HWND GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious);
2653 HBRUSH CreateSolidBrush(COLORREF crColor);
2654 HBRUSH CreateHatchBrush(int fnStyle, COLORREF clrref);
2655 int GetObjectA(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject);
2656 void InitCommonControls();
2657 BOOL DestroyWindow(HWND hwnd);
2658 ATOM RegisterClassExA(WNDCLASSEXA* lpwcx);
2659 ATOM RegisterClassW(WNDCLASSW* lpWndClass);
2660 HWND GetActiveWindow();
2661 LRESULT DefDlgProcA(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
2662 LRESULT DefDlgProcW(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
2663 BOOL IsDialogMessageA(HWND hDlg, LPMSG lpMsg);
2664 BOOL IsDialogMessageW(HWND hDlg, LPMSG lpMsg);
2665 HBRUSH GetSysColorBrush(int nIndex);
2666 BOOL PostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
2667 UINT SetTimer(HWND hWnd, UINT nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc);
2668 BOOL KillTimer(HWND hWnd, UINT uIDEvent);
2669 LPSTR GetCommandLineA();
2670 LPWSTR GetCommandLineW();
2671 BOOL SetCurrentDirectoryW(LPCWSTR lpPathName);
2672 DWORD GetCurrentDirectoryW(DWORD nBufferLength, LPWSTR lpBuffer);
2673 BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD nSize);
2674 BOOL GetComputerNameW(LPWSTR lpBuffer, LPDWORD nSize);
2675 BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation);
2676 UINT GetSystemDirectoryA(LPSTR lpBuffer, UINT uSize);
2677 UINT GetSystemDirectoryW(LPWSTR lpBuffer, UINT uSize);
2678 BOOL GetUserNameA(LPSTR lpBuffer, LPDWORD nSize); // advapi32.lib
2679 BOOL GetUserNameW(LPWSTR lpBuffer, LPDWORD nSize); // advapi32.lib
2680 DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize);
2681 DWORD GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize);
2682 DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize);
2683 DWORD GetLogicalDrives();
2684 BOOL SetMenu(HWND hWnd, HMENU hMenu);
2685 BOOL SetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
2686 BOOL SystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
2687 BOOL TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack);
2688 BOOL GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass);
2689 BOOL GetClassInfoW(HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSW lpWndClass);
2690 LRESULT CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
2691 LRESULT CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
2692 BOOL OpenClipboard(HWND hWndNewOwner);
2693 BOOL EmptyClipboard();
2694 HGLOBAL GlobalAlloc(UINT uFlags, DWORD dwBytes);
2695 BOOL CloseClipboard();
2696 HANDLE SetClipboardData(UINT uFormat, HANDLE hMem);
2697 HANDLE GetClipboardData(UINT uFormat);
2698 HGLOBAL GlobalFree(HGLOBAL hMem);
2699 LPVOID GlobalLock(HGLOBAL hMem);
2700 BOOL GlobalUnlock(HGLOBAL hMem);
2701 BOOL DrawFocusRect(HDC hDC, RECT* lprc);
2702 LRESULT CallNextHookEx(HHOOK hhk, int nCode, WPARAM wParam, LPARAM lParam);
2703 HHOOK SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId);
2704 BOOL UnhookWindowsHookEx(HHOOK hhk);
2705 int GetSystemMetrics(int nIndex);
2706 BOOL DestroyMenu(HMENU hMenu);
2707 BOOL SetMenuItemInfoA(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOA lpmii);
2708 BOOL SetMenuItemInfoW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOW lpmii);
2709 BOOL InsertMenuItemA(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOA lpmii);
2710 BOOL InsertMenuItemW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOW lpmii);
2711 BOOL RemoveMenu(HMENU hMenu, UINT uPosition, UINT uFlags );
2712 UINT GetMenuItemID(HMENU hMenu, int nPos);
2713 BOOL DrawMenuBar(HWND hWnd);
2714 HMENU CreatePopupMenu();
2715 HMENU CreateMenu();
2716 BOOL Shell_NotifyIconA(DWORD dwMessage, NOTIFYICONDATA* pnid);
2717 LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
2718 LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
2719 LONG RegConnectRegistryA(LPCSTR lpMachineName, HKEY hKey, PHKEY phkResult);
2720 UINT RegisterClipboardFormatA(LPCSTR lpszFormat);
2721 UINT RegisterClipboardFormatW(LPCWSTR lpszFormat);
2722 int GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount);
2723 int GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, int cchMaxCount);
2724 DWORD GlobalSize(HGLOBAL hMem);
2725 VOID ExitProcess(UINT uExitCode);
2726 BOOL DrawAnimatedRects(HWND hwnd, int idAni, RECT* lprcFrom, RECT* lprcTo);
2727 HWND FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow);
2728 UINT SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
2729 BOOL SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData);
2730 HANDLE GetPropA(HWND hWnd, LPCSTR lpString);
2731 HANDLE RemovePropA(HWND hWnd, LPCSTR lpString);
2732 DWORD CommDlgExtendedError();
2733 LRESULT DefFrameProcA(HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam);
2734 LRESULT DefFrameProcW(HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam);
2735 LRESULT DefMDIChildProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
2736 LRESULT DefMDIChildProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
2737 VOID SetLastError(DWORD dwErrCode);
2738 HWND CreateMDIWindowA(LPSTR lpClassName, LPSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance, LPARAM lParam);
2739 int MulDiv(int nNumber, int nNumerator, int nDenominator) pure nothrow;
2740 BOOL FillRgn(HDC hdc, HRGN hrgn, HBRUSH hbr);
2741 COLORREF GetNearestColor(HDC hdc,COLORREF crColor);
2742 int DrawTextA(HDC hDC, LPCSTR lpString, int nCount, LPRECT lpRect, UINT uFormat);
2743 int DrawTextExA(HDC hdc, LPSTR lpchText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams);
2744 int DrawTextExW(HDC hdc, LPWSTR lpchText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams);
2745 HANDLE LoadImageA(HINSTANCE hinst, LPCSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad);
2746 HANDLE LoadImageW(HINSTANCE hinst, LPCWSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad);
2747 HANDLE CopyImage(HANDLE hImage, UINT uType, int cxDesired, int cyDesired, UINT fuFlags);
2748 int WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
2749 HANDLE WSAAsyncGetHostByName(HWND hWnd, uint wMsg, PCSTR name, char* buf, int buflen);
2750 HANDLE WSAAsyncGetHostByAddr(HWND hWnd, uint wMsg, PCSTR addr, int len, int type, char* buf, int buflen);
2751 BOOL ExtTextOutA(HDC hdc, int X, int Y, UINT fuOptions, RECT* lprc, LPCSTR lpString, UINT cbCount, INT* lpDx);
2752 BOOL Arc(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nXStartArc, int nYStartArc, int nXEndArc, int nYEndArc);
2753 BOOL PolyBezier(HDC hdc, POINT* lppt,DWORD cPoints);
2754 BOOL Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
2755 BOOL Polygon(HDC hdc, POINT* lpPoints,int nCount);
2756 BOOL Rectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
2757 BOOL GdiFlush();
2758 LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, BYTE* lpData, DWORD cbData);
2759 LONG RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
2760 LONG RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
2761 LONG RegDeleteKeyW(HKEY hKey, LPCWSTR lpSubKey);
2762 LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcbName, LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime);
2763 LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPTSTR lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
2764 BOOL DrawFrameControl(HDC hdc, LPRECT lprc, UINT uType, UINT uState);
2765 BOOL GetTextExtentPoint32A(HDC hdc, LPCSTR lpString, int cbString, LPSIZE lpSize);
2766 BOOL GetTextExtentPoint32W(HDC hdc, LPCWSTR lpString, int cbString, LPSIZE lpSize);
2767 HINSTANCE ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
2768 HANDLE CreateActCtxW(PACTCTXW pActCtx);
2769 BOOL ActivateActCtx(HANDLE hActCtx, ULONG** lpCookie);
2770 UINT GetTempFileNameW(LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
2771 DWORD GetTempPathW(DWORD nBufferLength, LPWSTR lpBuffer);
2772 VOID OutputDebugStringA(LPCSTR lpOutputString);
2773 VOID DebugBreak();
2774 BOOL BitBlt(HDC hdcDest, int nXDest,int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
2775 BOOL GetIconInfo(HICON hIcon, PICONINFO piconinfo);
2776 BOOL DestroyIcon(HICON hIcon);
2777 BOOL DestroyCursor(HCURSOR hCursor);
2778 LPITEMIDLIST SHBrowseForFolderA(LPBROWSEINFOA lpbi);
2779 LPITEMIDLIST SHBrowseForFolderW(LPBROWSEINFOW lpbi);
2780 HRESULT SHGetMalloc(LPMALLOC* ppMalloc);
2781 BOOL SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
2782 BOOL SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath);
2783 BOOL InitCommonControlsEx(LPINITCOMMONCONTROLSEX lpInitCtrls);
2784 int GetDlgCtrlID(HWND hwndCtl);
2785 HWND GetDlgItem(HWND hDlg, int nIDDlgItem);
2786 BOOL ShowOwnedPopups(HWND hWnd, BOOL fShow);
2787 UINT GetWindowsDirectoryA(LPSTR lpBuffer, UINT uSize);
2788 UINT GetWindowsDirectoryW(LPWSTR lpBuffer, UINT uSize);
2789 //HCURSOR CopyCursor(HCURSOR pcur);
2790 HINSTANCE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
2791 HINSTANCE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
2792 HICON CopyIcon(HICON hIcon);
2793 BOOL ChooseColorA(LPCHOOSECOLORA lpcc);
2794 UINT DragQueryFileA(HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch);
2795 UINT DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
2796 VOID DragFinish(HDROP hDrop);
2797 BOOL DragQueryPoint(HDROP hDrop, LPPOINT lppt);
2798 BOOL GrayStringA(HDC hDC, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc, LPARAM lpData, int nCount, int X, int Y, int nWidth, int nHeight);
2799 BOOL IsWindowUnicode(HWND hWnd);
2800 BOOL ChooseFontA(LPCHOOSEFONTA lpcf);
2801 BOOL ChooseFontW(LPCHOOSEFONTW lpcf);
2802 HBITMAP CreateCompatibleBitmap(HDC hdc, int nWidth, int nHeight);
2803 LONG DispatchMessageW(MSG* lpmsg);
2804 BOOL PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
2805 LRESULT DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
2806 HWND GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious);
2807 HANDLE FindFirstChangeNotificationA(LPCSTR lpPathName, BOOL bWatchSubtree, DWORD dwNotifyFilter);
2808 HANDLE FindFirstChangeNotificationW(LPCWSTR lpPathName, BOOL bWatchSubtree, DWORD dwNotifyFilter);
2809 BOOL FindCloseChangeNotification(HANDLE hChangeHandle);
2810 BOOL FindNextChangeNotification(HANDLE hChangeHandle);
2811 DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart);
2812 DWORD GetFullPathNameW(LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart);
2813 SHORT VkKeyScanA(char ch);
2814 SHORT VkKeyScanW(wchar ch);
2815 HRSRC FindResourceExA(HMODULE hModule, LPCSTR lpType, LPCSTR lpName, WORD wLanguage);
2816 HRSRC FindResourceExW(HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage);
2817 HGLOBAL LoadResource(HMODULE hModule, HRSRC hResInfo);
2818 DWORD SizeofResource(HMODULE hModule, HRSRC hResInfo);
2819 BOOL EnableMenuItem(HMENU hMenu, UINT uIDEnableItem, UINT uEnable);
2820 BOOL IsMenu(HMENU hMenu);
2821 HMENU GetSystemMenu(HWND hWnd, BOOL bRevert);
2822 DWORD GetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize);
2823 HDC CreateEnhMetaFileW(HDC hdcRef, LPCWSTR lpFilename, in RECT* lpRect, LPCWSTR lpDescription  );
2824 BOOL PlayEnhMetaFile(HDC hdc, HENHMETAFILE hemf, in RECT* lpRect);
2825 HENHMETAFILE CloseEnhMetaFile(HDC hdc);
2826 BOOL DeleteEnhMetaFile(HENHMETAFILE hemf);
2827 HENHMETAFILE GetEnhMetaFileW(LPCWSTR lpszMetaFile);
2828 UINT GetEnhMetaFileHeader(HENHMETAFILE hemf, UINT cbBuffer, ENHMETAHEADER* cbBuffer);
2829 HBITMAP CreateBitmap(int nWidth, int nHeight, UINT cPlanes, UINT cBitsPerPel, VOID *lpvBits);
2830 BOOL SetBrushOrgEx(HDC hdc, int nXOrg, int nYOrg, LPPOINT lppt);
2831 BOOL PatBlt(HDC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD dwRop);
2832 HTHEME GetWindowTheme(HWND hWnd);
2833 THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList);
2834 int SetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw);
2835 BOOL GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi);
2836 BOOL DragDetect(HWND hwnd, POINT pt);
2837 HFONT CreateFontIndirectW(LOGFONTW *lplf);
2838 DWORD GetThemeAppProperties();
2839 BOOL IsAppThemed();
2840 HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
2841 HRESULT CloseThemeData(HTHEME hTheme);
2842 HRESULT GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor);
2843 HIMAGELIST ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
2844 BOOL ImageList_Destroy(HIMAGELIST himl);
2845 BOOL ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
2846 BOOL ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
2847 int ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
2848 int ImageList_AddIcon(HIMAGELIST himl, HICON hicon);
2849 int ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
2850 BOOL ImageList_Remove(HIMAGELIST himl, int i);
2851 BOOL EnumDisplayMonitors(HDC hdc, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData);
2852 BOOL GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpmi);
2853 HMONITOR MonitorFromWindow(HWND hwnd, DWORD dwFlags);
2854 HMONITOR MonitorFromPoint(POINT pt, DWORD dwFlags);
2855 HMONITOR MonitorFromRect(LPCRECT lprc, DWORD dwFlags);
2856 BOOL RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, UINT vk);
2857 BOOL UnregisterHotKey(HWND hWnd, int id);
2858 //} // Temporary.
2859