go-tg-screenshot-bot
3499 строк · 87.4 Кб
1// Copyright 2010 The win Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build windows
6
7package win8
9import (10"syscall"11"unsafe"12
13"golang.org/x/sys/windows"14)
15
16const CW_USEDEFAULT = ^0x7fffffff17
18// MessageBox constants
19const (20MB_OK = 0x0000000021MB_OKCANCEL = 0x0000000122MB_ABORTRETRYIGNORE = 0x0000000223MB_YESNOCANCEL = 0x0000000324MB_YESNO = 0x0000000425MB_RETRYCANCEL = 0x0000000526MB_CANCELTRYCONTINUE = 0x0000000627MB_ICONHAND = 0x0000001028MB_ICONQUESTION = 0x0000002029MB_ICONEXCLAMATION = 0x0000003030MB_ICONASTERISK = 0x0000004031MB_USERICON = 0x0000008032MB_ICONWARNING = MB_ICONEXCLAMATION33MB_ICONERROR = MB_ICONHAND34MB_ICONINFORMATION = MB_ICONASTERISK35MB_ICONSTOP = MB_ICONHAND36MB_DEFBUTTON1 = 0x0000000037MB_DEFBUTTON2 = 0x0000010038MB_DEFBUTTON3 = 0x0000020039MB_DEFBUTTON4 = 0x0000030040MB_APPLMODAL = 0x0000000041MB_SYSTEMMODAL = 0x0000100042MB_TASKMODAL = 0x0000200043MB_HELP = 0x0000400044MB_SETFOREGROUND = 0x0001000045MB_DEFAULT_DESKTOP_ONLY = 0x0002000046MB_TOPMOST = 0x0004000047MB_RIGHT = 0x0008000048MB_RTLREADING = 0x0010000049MB_SERVICE_NOTIFICATION = 0x0020000050)
51
52// Dialog box command ids
53const (54IDOK = 155IDCANCEL = 256IDABORT = 357IDRETRY = 458IDIGNORE = 559IDYES = 660IDNO = 761IDCLOSE = 862IDHELP = 963IDTRYAGAIN = 1064IDCONTINUE = 1165IDTIMEOUT = 3200066)
67
68// System commands
69const (70SC_SIZE = 0xF00071SC_MOVE = 0xF01072SC_MINIMIZE = 0xF02073SC_MAXIMIZE = 0xF03074SC_NEXTWINDOW = 0xF04075SC_PREVWINDOW = 0xF05076SC_CLOSE = 0xF06077SC_VSCROLL = 0xF07078SC_HSCROLL = 0xF08079SC_MOUSEMENU = 0xF09080SC_KEYMENU = 0xF10081SC_ARRANGE = 0xF11082SC_RESTORE = 0xF12083SC_TASKLIST = 0xF13084SC_SCREENSAVE = 0xF14085SC_HOTKEY = 0xF15086SC_DEFAULT = 0xF16087SC_MONITORPOWER = 0xF17088SC_CONTEXTHELP = 0xF18089SC_SEPARATOR = 0xF00F90)
91
92// Static control styles
93const (94SS_BITMAP = 1495SS_BLACKFRAME = 796SS_BLACKRECT = 497SS_CENTER = 198SS_CENTERIMAGE = 51299SS_EDITCONTROL = 0x2000100SS_ENHMETAFILE = 15101SS_ETCHEDFRAME = 18102SS_ETCHEDHORZ = 16103SS_ETCHEDVERT = 17104SS_GRAYFRAME = 8105SS_GRAYRECT = 5106SS_ICON = 3107SS_LEFT = 0108SS_LEFTNOWORDWRAP = 0xc109SS_NOPREFIX = 128110SS_NOTIFY = 256111SS_OWNERDRAW = 0xd112SS_REALSIZECONTROL = 0x040113SS_REALSIZEIMAGE = 0x800114SS_RIGHT = 2115SS_RIGHTJUST = 0x400116SS_SIMPLE = 11117SS_SUNKEN = 4096118SS_WHITEFRAME = 9119SS_WHITERECT = 6120SS_USERITEM = 10121SS_TYPEMASK = 0x0000001F122SS_ENDELLIPSIS = 0x00004000123SS_PATHELLIPSIS = 0x00008000124SS_WORDELLIPSIS = 0x0000C000125SS_ELLIPSISMASK = 0x0000C000126)
127
128// Button message constants
129const (130BM_CLICK = 245131BM_GETCHECK = 240132BM_GETIMAGE = 246133BM_GETSTATE = 242134BM_SETCHECK = 241135BM_SETIMAGE = 247136BM_SETSTATE = 243137BM_SETSTYLE = 244138)
139
140// Button notifications
141const (142BCN_DROPDOWN = 0xfffffb20143BN_CLICKED = 0144BN_PAINT = 1145BN_HILITE = 2146BN_PUSHED = BN_HILITE147BN_UNHILITE = 3148BN_UNPUSHED = BN_UNHILITE149BN_DISABLE = 4150BN_DOUBLECLICKED = 5151BN_DBLCLK = BN_DOUBLECLICKED152BN_SETFOCUS = 6153BN_KILLFOCUS = 7154)
155
156const (157IMAGE_BITMAP = 0158IMAGE_ICON = 1159IMAGE_CURSOR = 2160IMAGE_ENHMETAFILE = 3161)
162
163const (164LR_DEFAULTCOLOR = 0165LR_MONOCHROME = 1166LR_COLOR = 2167LR_COPYRETURNORG = 4168LR_COPYDELETEORG = 8169LR_LOADFROMFILE = 16170LR_LOADTRANSPARENT = 32171LR_LOADREALSIZE = 128172LR_DEFAULTSIZE = 0x0040173LR_VGACOLOR = 0x0080174LR_LOADMAP3DCOLORS = 4096175LR_CREATEDIBSECTION = 8192176LR_COPYFROMRESOURCE = 0x4000177LR_SHARED = 32768178)
179
180// Button style constants
181const (182BS_3STATE = 5183BS_AUTO3STATE = 6184BS_AUTOCHECKBOX = 3185BS_AUTORADIOBUTTON = 9186BS_BITMAP = 128187BS_BOTTOM = 0X800188BS_CENTER = 0X300189BS_CHECKBOX = 2190BS_DEFPUSHBUTTON = 1191BS_GROUPBOX = 7192BS_ICON = 64193BS_LEFT = 256194BS_LEFTTEXT = 32195BS_MULTILINE = 0X2000196BS_NOTIFY = 0X4000197BS_OWNERDRAW = 0XB198BS_PUSHBUTTON = 0199BS_PUSHLIKE = 4096200BS_RADIOBUTTON = 4201BS_RIGHT = 512202BS_RIGHTBUTTON = 32203BS_SPLITBUTTON = 0x0000000c204BS_TEXT = 0205BS_TOP = 0X400206BS_USERBUTTON = 8207BS_VCENTER = 0XC00208BS_FLAT = 0X8000209)
210
211const (212PM_NOREMOVE = 0x0000213PM_REMOVE = 0x0001214PM_NOYIELD = 0x0002215)
216
217// Button state constants
218const (219BST_CHECKED = 1220BST_INDETERMINATE = 2221BST_UNCHECKED = 0222BST_FOCUS = 8223BST_PUSHED = 4224)
225
226// Predefined brushes constants
227const (228COLOR_3DDKSHADOW = 21229COLOR_3DFACE = 15230COLOR_3DHILIGHT = 20231COLOR_3DHIGHLIGHT = 20232COLOR_3DLIGHT = 22233COLOR_BTNHILIGHT = 20234COLOR_3DSHADOW = 16235COLOR_ACTIVEBORDER = 10236COLOR_ACTIVECAPTION = 2237COLOR_APPWORKSPACE = 12238COLOR_BACKGROUND = 1239COLOR_DESKTOP = 1240COLOR_BTNFACE = 15241COLOR_BTNHIGHLIGHT = 20242COLOR_BTNSHADOW = 16243COLOR_BTNTEXT = 18244COLOR_CAPTIONTEXT = 9245COLOR_GRAYTEXT = 17246COLOR_HIGHLIGHT = 13247COLOR_HIGHLIGHTTEXT = 14248COLOR_INACTIVEBORDER = 11249COLOR_INACTIVECAPTION = 3250COLOR_INACTIVECAPTIONTEXT = 19251COLOR_INFOBK = 24252COLOR_INFOTEXT = 23253COLOR_MENU = 4254COLOR_MENUTEXT = 7255COLOR_SCROLLBAR = 0256COLOR_WINDOW = 5257COLOR_WINDOWFRAME = 6258COLOR_WINDOWTEXT = 8259COLOR_HOTLIGHT = 26260COLOR_GRADIENTACTIVECAPTION = 27261COLOR_GRADIENTINACTIVECAPTION = 28262)
263
264// GetAncestor flags
265const (266GA_PARENT = 1267GA_ROOT = 2268GA_ROOTOWNER = 3269)
270
271// GetWindowLong and GetWindowLongPtr constants
272const (273GWL_EXSTYLE = -20274GWL_STYLE = -16275GWL_WNDPROC = -4276GWLP_WNDPROC = -4277GWL_HINSTANCE = -6278GWLP_HINSTANCE = -6279GWL_HWNDPARENT = -8280GWLP_HWNDPARENT = -8281GWL_ID = -12282GWLP_ID = -12283GWL_USERDATA = -21284GWLP_USERDATA = -21285)
286
287// Predefined window handles
288const (289HWND_BROADCAST = HWND(0xFFFF)290HWND_BOTTOM = HWND(1)291HWND_NOTOPMOST = ^HWND(1) // -2292HWND_TOP = HWND(0)293HWND_TOPMOST = ^HWND(0) // -1294HWND_DESKTOP = HWND(0)295HWND_MESSAGE = ^HWND(2) // -3296)
297
298// Predefined icon constants
299const (300IDI_APPLICATION = 32512301IDI_HAND = 32513302IDI_QUESTION = 32514303IDI_EXCLAMATION = 32515304IDI_ASTERISK = 32516305IDI_WINLOGO = 32517306IDI_SHIELD = 32518307IDI_WARNING = IDI_EXCLAMATION308IDI_ERROR = IDI_HAND309IDI_INFORMATION = IDI_ASTERISK310)
311
312// Predefined cursor constants
313const (314IDC_ARROW = 32512315IDC_IBEAM = 32513316IDC_WAIT = 32514317IDC_CROSS = 32515318IDC_UPARROW = 32516319IDC_SIZENWSE = 32642320IDC_SIZENESW = 32643321IDC_SIZEWE = 32644322IDC_SIZENS = 32645323IDC_SIZEALL = 32646324IDC_NO = 32648325IDC_HAND = 32649326IDC_APPSTARTING = 32650327IDC_HELP = 32651328IDC_ICON = 32641329IDC_SIZE = 32640330)
331
332// GetSystemMetrics constants
333const (334SM_CXSCREEN = 0335SM_CYSCREEN = 1336SM_CXVSCROLL = 2337SM_CYHSCROLL = 3338SM_CYCAPTION = 4339SM_CXBORDER = 5340SM_CYBORDER = 6341SM_CXDLGFRAME = 7342SM_CYDLGFRAME = 8343SM_CYVTHUMB = 9344SM_CXHTHUMB = 10345SM_CXICON = 11346SM_CYICON = 12347SM_CXCURSOR = 13348SM_CYCURSOR = 14349SM_CYMENU = 15350SM_CXFULLSCREEN = 16351SM_CYFULLSCREEN = 17352SM_CYKANJIWINDOW = 18353SM_MOUSEPRESENT = 19354SM_CYVSCROLL = 20355SM_CXHSCROLL = 21356SM_DEBUG = 22357SM_SWAPBUTTON = 23358SM_RESERVED1 = 24359SM_RESERVED2 = 25360SM_RESERVED3 = 26361SM_RESERVED4 = 27362SM_CXMIN = 28363SM_CYMIN = 29364SM_CXSIZE = 30365SM_CYSIZE = 31366SM_CXFRAME = 32367SM_CYFRAME = 33368SM_CXMINTRACK = 34369SM_CYMINTRACK = 35370SM_CXDOUBLECLK = 36371SM_CYDOUBLECLK = 37372SM_CXICONSPACING = 38373SM_CYICONSPACING = 39374SM_MENUDROPALIGNMENT = 40375SM_PENWINDOWS = 41376SM_DBCSENABLED = 42377SM_CMOUSEBUTTONS = 43378SM_CXFIXEDFRAME = SM_CXDLGFRAME379SM_CYFIXEDFRAME = SM_CYDLGFRAME380SM_CXSIZEFRAME = SM_CXFRAME381SM_CYSIZEFRAME = SM_CYFRAME382SM_SECURE = 44383SM_CXEDGE = 45384SM_CYEDGE = 46385SM_CXMINSPACING = 47386SM_CYMINSPACING = 48387SM_CXSMICON = 49388SM_CYSMICON = 50389SM_CYSMCAPTION = 51390SM_CXSMSIZE = 52391SM_CYSMSIZE = 53392SM_CXMENUSIZE = 54393SM_CYMENUSIZE = 55394SM_ARRANGE = 56395SM_CXMINIMIZED = 57396SM_CYMINIMIZED = 58397SM_CXMAXTRACK = 59398SM_CYMAXTRACK = 60399SM_CXMAXIMIZED = 61400SM_CYMAXIMIZED = 62401SM_NETWORK = 63402SM_CLEANBOOT = 67403SM_CXDRAG = 68404SM_CYDRAG = 69405SM_SHOWSOUNDS = 70406SM_CXMENUCHECK = 71407SM_CYMENUCHECK = 72408SM_SLOWMACHINE = 73409SM_MIDEASTENABLED = 74410SM_MOUSEWHEELPRESENT = 75411SM_XVIRTUALSCREEN = 76412SM_YVIRTUALSCREEN = 77413SM_CXVIRTUALSCREEN = 78414SM_CYVIRTUALSCREEN = 79415SM_CMONITORS = 80416SM_SAMEDISPLAYFORMAT = 81417SM_IMMENABLED = 82418SM_CXFOCUSBORDER = 83419SM_CYFOCUSBORDER = 84420SM_TABLETPC = 86421SM_MEDIACENTER = 87422SM_STARTER = 88423SM_SERVERR2 = 89424SM_CMETRICS = 91425SM_REMOTESESSION = 0x1000426SM_SHUTTINGDOWN = 0x2000427SM_REMOTECONTROL = 0x2001428SM_CARETBLINKINGENABLED = 0x2002429)
430
431// ShowWindow constants
432const (433SW_HIDE = 0434SW_NORMAL = 1435SW_SHOWNORMAL = 1436SW_SHOWMINIMIZED = 2437SW_MAXIMIZE = 3438SW_SHOWMAXIMIZED = 3439SW_SHOWNOACTIVATE = 4440SW_SHOW = 5441SW_MINIMIZE = 6442SW_SHOWMINNOACTIVE = 7443SW_SHOWNA = 8444SW_RESTORE = 9445SW_SHOWDEFAULT = 10446SW_FORCEMINIMIZE = 11447)
448
449// SetWindowPos flags
450const (451SWP_DRAWFRAME = 0x0020452SWP_FRAMECHANGED = 0x0020453SWP_HIDEWINDOW = 0x0080454SWP_NOACTIVATE = 0x0010455SWP_NOCOPYBITS = 0x0100456SWP_NOMOVE = 0x0002457SWP_NOSIZE = 0x0001458SWP_NOREDRAW = 0x0008459SWP_NOZORDER = 0x0004460SWP_SHOWWINDOW = 0x0040461SWP_NOOWNERZORDER = 0x0200462SWP_NOREPOSITION = SWP_NOOWNERZORDER463SWP_NOSENDCHANGING = 0x0400464SWP_DEFERERASE = 0x2000465SWP_ASYNCWINDOWPOS = 0x4000466)
467
468// UI state constants
469const (470UIS_SET = 1471UIS_CLEAR = 2472UIS_INITIALIZE = 3473)
474
475// UI state constants
476const (477UISF_HIDEFOCUS = 0x1478UISF_HIDEACCEL = 0x2479UISF_ACTIVE = 0x4480)
481
482// Virtual key codes
483const (484VK_LBUTTON = 1485VK_RBUTTON = 2486VK_CANCEL = 3487VK_MBUTTON = 4488VK_XBUTTON1 = 5489VK_XBUTTON2 = 6490VK_BACK = 8491VK_TAB = 9492VK_CLEAR = 12493VK_RETURN = 13494VK_SHIFT = 16495VK_CONTROL = 17496VK_MENU = 18497VK_PAUSE = 19498VK_CAPITAL = 20499VK_KANA = 0x15500VK_HANGEUL = 0x15501VK_HANGUL = 0x15502VK_JUNJA = 0x17503VK_FINAL = 0x18504VK_HANJA = 0x19505VK_KANJI = 0x19506VK_ESCAPE = 0x1B507VK_CONVERT = 0x1C508VK_NONCONVERT = 0x1D509VK_ACCEPT = 0x1E510VK_MODECHANGE = 0x1F511VK_SPACE = 32512VK_PRIOR = 33513VK_NEXT = 34514VK_END = 35515VK_HOME = 36516VK_LEFT = 37517VK_UP = 38518VK_RIGHT = 39519VK_DOWN = 40520VK_SELECT = 41521VK_PRINT = 42522VK_EXECUTE = 43523VK_SNAPSHOT = 44524VK_INSERT = 45525VK_DELETE = 46526VK_HELP = 47527VK_LWIN = 0x5B528VK_RWIN = 0x5C529VK_APPS = 0x5D530VK_SLEEP = 0x5F531VK_NUMPAD0 = 0x60532VK_NUMPAD1 = 0x61533VK_NUMPAD2 = 0x62534VK_NUMPAD3 = 0x63535VK_NUMPAD4 = 0x64536VK_NUMPAD5 = 0x65537VK_NUMPAD6 = 0x66538VK_NUMPAD7 = 0x67539VK_NUMPAD8 = 0x68540VK_NUMPAD9 = 0x69541VK_MULTIPLY = 0x6A542VK_ADD = 0x6B543VK_SEPARATOR = 0x6C544VK_SUBTRACT = 0x6D545VK_DECIMAL = 0x6E546VK_DIVIDE = 0x6F547VK_F1 = 0x70548VK_F2 = 0x71549VK_F3 = 0x72550VK_F4 = 0x73551VK_F5 = 0x74552VK_F6 = 0x75553VK_F7 = 0x76554VK_F8 = 0x77555VK_F9 = 0x78556VK_F10 = 0x79557VK_F11 = 0x7A558VK_F12 = 0x7B559VK_F13 = 0x7C560VK_F14 = 0x7D561VK_F15 = 0x7E562VK_F16 = 0x7F563VK_F17 = 0x80564VK_F18 = 0x81565VK_F19 = 0x82566VK_F20 = 0x83567VK_F21 = 0x84568VK_F22 = 0x85569VK_F23 = 0x86570VK_F24 = 0x87571VK_NUMLOCK = 0x90572VK_SCROLL = 0x91573VK_LSHIFT = 0xA0574VK_RSHIFT = 0xA1575VK_LCONTROL = 0xA2576VK_RCONTROL = 0xA3577VK_LMENU = 0xA4578VK_RMENU = 0xA5579VK_BROWSER_BACK = 0xA6580VK_BROWSER_FORWARD = 0xA7581VK_BROWSER_REFRESH = 0xA8582VK_BROWSER_STOP = 0xA9583VK_BROWSER_SEARCH = 0xAA584VK_BROWSER_FAVORITES = 0xAB585VK_BROWSER_HOME = 0xAC586VK_VOLUME_MUTE = 0xAD587VK_VOLUME_DOWN = 0xAE588VK_VOLUME_UP = 0xAF589VK_MEDIA_NEXT_TRACK = 0xB0590VK_MEDIA_PREV_TRACK = 0xB1591VK_MEDIA_STOP = 0xB2592VK_MEDIA_PLAY_PAUSE = 0xB3593VK_LAUNCH_MAIL = 0xB4594VK_LAUNCH_MEDIA_SELECT = 0xB5595VK_LAUNCH_APP1 = 0xB6596VK_LAUNCH_APP2 = 0xB7597VK_OEM_1 = 0xBA598VK_OEM_PLUS = 0xBB599VK_OEM_COMMA = 0xBC600VK_OEM_MINUS = 0xBD601VK_OEM_PERIOD = 0xBE602VK_OEM_2 = 0xBF603VK_OEM_3 = 0xC0604VK_OEM_4 = 0xDB605VK_OEM_5 = 0xDC606VK_OEM_6 = 0xDD607VK_OEM_7 = 0xDE608VK_OEM_8 = 0xDF609VK_OEM_102 = 0xE2610VK_PROCESSKEY = 0xE5611VK_PACKET = 0xE7612VK_ATTN = 0xF6613VK_CRSEL = 0xF7614VK_EXSEL = 0xF8615VK_EREOF = 0xF9616VK_PLAY = 0xFA617VK_ZOOM = 0xFB618VK_NONAME = 0xFC619VK_PA1 = 0xFD620VK_OEM_CLEAR = 0xFE621)
622
623// Window style constants
624const (625WS_OVERLAPPED = 0X00000000626WS_POPUP = 0X80000000627WS_CHILD = 0X40000000628WS_MINIMIZE = 0X20000000629WS_VISIBLE = 0X10000000630WS_DISABLED = 0X08000000631WS_CLIPSIBLINGS = 0X04000000632WS_CLIPCHILDREN = 0X02000000633WS_MAXIMIZE = 0X01000000634WS_CAPTION = 0X00C00000635WS_BORDER = 0X00800000636WS_DLGFRAME = 0X00400000637WS_VSCROLL = 0X00200000638WS_HSCROLL = 0X00100000639WS_SYSMENU = 0X00080000640WS_THICKFRAME = 0X00040000641WS_GROUP = 0X00020000642WS_TABSTOP = 0X00010000643WS_MINIMIZEBOX = 0X00020000644WS_MAXIMIZEBOX = 0X00010000645WS_TILED = 0X00000000646WS_ICONIC = 0X20000000647WS_SIZEBOX = 0X00040000648WS_OVERLAPPEDWINDOW = 0X00000000 | 0X00C00000 | 0X00080000 | 0X00040000 | 0X00020000 | 0X00010000649WS_POPUPWINDOW = 0X80000000 | 0X00800000 | 0X00080000650WS_CHILDWINDOW = 0X40000000651)
652
653// Extended window style constants
654const (655WS_EX_DLGMODALFRAME = 0X00000001656WS_EX_NOPARENTNOTIFY = 0X00000004657WS_EX_TOPMOST = 0X00000008658WS_EX_ACCEPTFILES = 0X00000010659WS_EX_TRANSPARENT = 0X00000020660WS_EX_MDICHILD = 0X00000040661WS_EX_TOOLWINDOW = 0X00000080662WS_EX_WINDOWEDGE = 0X00000100663WS_EX_CLIENTEDGE = 0X00000200664WS_EX_CONTEXTHELP = 0X00000400665WS_EX_RIGHT = 0X00001000666WS_EX_LEFT = 0X00000000667WS_EX_RTLREADING = 0X00002000668WS_EX_LTRREADING = 0X00000000669WS_EX_LEFTSCROLLBAR = 0X00004000670WS_EX_RIGHTSCROLLBAR = 0X00000000671WS_EX_CONTROLPARENT = 0X00010000672WS_EX_STATICEDGE = 0X00020000673WS_EX_APPWINDOW = 0X00040000674WS_EX_OVERLAPPEDWINDOW = 0X00000100 | 0X00000200675WS_EX_PALETTEWINDOW = 0X00000100 | 0X00000080 | 0X00000008676WS_EX_LAYERED = 0X00080000677WS_EX_NOINHERITLAYOUT = 0X00100000678WS_EX_LAYOUTRTL = 0X00400000679WS_EX_COMPOSITED = 0X02000000680WS_EX_NOACTIVATE = 0X08000000681)
682
683// Window message constants
684const (685WM_APP = 32768686WM_ACTIVATE = 6687WM_ACTIVATEAPP = 28688WM_AFXFIRST = 864689WM_AFXLAST = 895690WM_ASKCBFORMATNAME = 780691WM_CANCELJOURNAL = 75692WM_CANCELMODE = 31693WM_CAPTURECHANGED = 533694WM_CHANGECBCHAIN = 781695WM_CHAR = 258696WM_CHARTOITEM = 47697WM_CHILDACTIVATE = 34698WM_CLEAR = 771699WM_CLOSE = 16700WM_COMMAND = 273701WM_COMMNOTIFY = 68 /* OBSOLETE */702WM_COMPACTING = 65703WM_COMPAREITEM = 57704WM_CONTEXTMENU = 123705WM_COPY = 769706WM_COPYDATA = 74707WM_CREATE = 1708WM_CTLCOLORBTN = 309709WM_CTLCOLORDLG = 310710WM_CTLCOLOREDIT = 307711WM_CTLCOLORLISTBOX = 308712WM_CTLCOLORMSGBOX = 306713WM_CTLCOLORSCROLLBAR = 311714WM_CTLCOLORSTATIC = 312715WM_CUT = 768716WM_DEADCHAR = 259717WM_DELETEITEM = 45718WM_DESTROY = 2719WM_DESTROYCLIPBOARD = 775720WM_DEVICECHANGE = 537721WM_DEVMODECHANGE = 27722WM_DISPLAYCHANGE = 126723WM_DPICHANGED = 0x02E0724WM_DRAWCLIPBOARD = 776725WM_DRAWITEM = 43726WM_DROPFILES = 563727WM_ENABLE = 10728WM_ENDSESSION = 22729WM_ENTERIDLE = 289730WM_ENTERMENULOOP = 529731WM_ENTERSIZEMOVE = 561732WM_ERASEBKGND = 20733WM_EXITMENULOOP = 530734WM_EXITSIZEMOVE = 562735WM_FONTCHANGE = 29736WM_GETDLGCODE = 135737WM_GETFONT = 49738WM_GETHOTKEY = 51739WM_GETICON = 127740WM_GETMINMAXINFO = 36741WM_GETTEXT = 13742WM_GETTEXTLENGTH = 14743WM_HANDHELDFIRST = 856744WM_HANDHELDLAST = 863745WM_HELP = 83746WM_HOTKEY = 786747WM_HSCROLL = 276748WM_HSCROLLCLIPBOARD = 782749WM_ICONERASEBKGND = 39750WM_INITDIALOG = 272751WM_INITMENU = 278752WM_INITMENUPOPUP = 279753WM_INPUT = 0X00FF754WM_INPUTLANGCHANGE = 81755WM_INPUTLANGCHANGEREQUEST = 80756WM_KEYDOWN = 256757WM_KEYUP = 257758WM_KILLFOCUS = 8759WM_MDIACTIVATE = 546760WM_MDICASCADE = 551761WM_MDICREATE = 544762WM_MDIDESTROY = 545763WM_MDIGETACTIVE = 553764WM_MDIICONARRANGE = 552765WM_MDIMAXIMIZE = 549766WM_MDINEXT = 548767WM_MDIREFRESHMENU = 564768WM_MDIRESTORE = 547769WM_MDISETMENU = 560770WM_MDITILE = 550771WM_MEASUREITEM = 44772WM_GETOBJECT = 0X003D773WM_CHANGEUISTATE = 0X0127774WM_UPDATEUISTATE = 0X0128775WM_QUERYUISTATE = 0X0129776WM_UNINITMENUPOPUP = 0X0125777WM_MENURBUTTONUP = 290778WM_MENUCOMMAND = 0X0126779WM_MENUGETOBJECT = 0X0124780WM_MENUDRAG = 0X0123781WM_APPCOMMAND = 0X0319782WM_MENUCHAR = 288783WM_MENUSELECT = 287784WM_MOVE = 3785WM_MOVING = 534786WM_NCACTIVATE = 134787WM_NCCALCSIZE = 131788WM_NCCREATE = 129789WM_NCDESTROY = 130790WM_NCHITTEST = 132791WM_NCLBUTTONDBLCLK = 163792WM_NCLBUTTONDOWN = 161793WM_NCLBUTTONUP = 162794WM_NCMBUTTONDBLCLK = 169795WM_NCMBUTTONDOWN = 167796WM_NCMBUTTONUP = 168797WM_NCXBUTTONDOWN = 171798WM_NCXBUTTONUP = 172799WM_NCXBUTTONDBLCLK = 173800WM_NCMOUSEHOVER = 0X02A0801WM_NCMOUSELEAVE = 0X02A2802WM_NCMOUSEMOVE = 160803WM_NCPAINT = 133804WM_NCRBUTTONDBLCLK = 166805WM_NCRBUTTONDOWN = 164806WM_NCRBUTTONUP = 165807WM_NEXTDLGCTL = 40808WM_NEXTMENU = 531809WM_NOTIFY = 78810WM_NOTIFYFORMAT = 85811WM_NULL = 0812WM_PAINT = 15813WM_PAINTCLIPBOARD = 777814WM_PAINTICON = 38815WM_PALETTECHANGED = 785816WM_PALETTEISCHANGING = 784817WM_PARENTNOTIFY = 528818WM_PASTE = 770819WM_PENWINFIRST = 896820WM_PENWINLAST = 911821WM_POWER = 72822WM_POWERBROADCAST = 536823WM_PRINT = 791824WM_PRINTCLIENT = 792825WM_QUERYDRAGICON = 55826WM_QUERYENDSESSION = 17827WM_QUERYNEWPALETTE = 783828WM_QUERYOPEN = 19829WM_QUEUESYNC = 35830WM_QUIT = 18831WM_RENDERALLFORMATS = 774832WM_RENDERFORMAT = 773833WM_SETCURSOR = 32834WM_SETFOCUS = 7835WM_SETFONT = 48836WM_SETHOTKEY = 50837WM_SETICON = 128838WM_SETREDRAW = 11839WM_SETTEXT = 12840WM_SETTINGCHANGE = 26841WM_SHOWWINDOW = 24842WM_SIZE = 5843WM_SIZECLIPBOARD = 779844WM_SIZING = 532845WM_SPOOLERSTATUS = 42846WM_STYLECHANGED = 125847WM_STYLECHANGING = 124848WM_SYSCHAR = 262849WM_SYSCOLORCHANGE = 21850WM_SYSCOMMAND = 274851WM_SYSDEADCHAR = 263852WM_SYSKEYDOWN = 260853WM_SYSKEYUP = 261854WM_TCARD = 82855WM_THEMECHANGED = 794856WM_TIMECHANGE = 30857WM_TIMER = 275858WM_UNDO = 772859WM_USER = 1024860WM_USERCHANGED = 84861WM_VKEYTOITEM = 46862WM_VSCROLL = 277863WM_VSCROLLCLIPBOARD = 778864WM_WINDOWPOSCHANGED = 71865WM_WINDOWPOSCHANGING = 70866WM_WININICHANGE = 26867WM_KEYFIRST = 256868WM_KEYLAST = 264869WM_SYNCPAINT = 136870WM_MOUSEACTIVATE = 33871WM_MOUSEMOVE = 512872WM_LBUTTONDOWN = 513873WM_LBUTTONUP = 514874WM_LBUTTONDBLCLK = 515875WM_RBUTTONDOWN = 516876WM_RBUTTONUP = 517877WM_RBUTTONDBLCLK = 518878WM_MBUTTONDOWN = 519879WM_MBUTTONUP = 520880WM_MBUTTONDBLCLK = 521881WM_MOUSEWHEEL = 522882WM_MOUSEFIRST = 512883WM_XBUTTONDOWN = 523884WM_XBUTTONUP = 524885WM_XBUTTONDBLCLK = 525886WM_MOUSELAST = 525887WM_MOUSEHOVER = 0X2A1888WM_MOUSELEAVE = 0X2A3889WM_CLIPBOARDUPDATE = 0x031D890WM_UNICHAR = 0x0109891)
892
893const (894CHILDID_SELF = 0895INDEXID_OBJECT = 0896INDEXID_CONTAINER = 0897
898OBJID_WINDOW = int32(0x00000000)899OBJID_SYSMENU = int32(-((0xFFFFFFFF ^ 0xFFFFFFFF) + 1))900OBJID_TITLEBAR = int32(-((0xFFFFFFFE ^ 0xFFFFFFFF) + 1))901OBJID_MENU = int32(-((0xFFFFFFFD ^ 0xFFFFFFFF) + 1))902OBJID_CLIENT = int32(-((0xFFFFFFFC ^ 0xFFFFFFFF) + 1))903OBJID_VSCROLL = int32(-((0xFFFFFFFB ^ 0xFFFFFFFF) + 1))904OBJID_HSCROLL = int32(-((0xFFFFFFFA ^ 0xFFFFFFFF) + 1))905OBJID_SIZEGRIP = int32(-((0xFFFFFFF9 ^ 0xFFFFFFFF) + 1))906OBJID_CARET = int32(-((0xFFFFFFF8 ^ 0xFFFFFFFF) + 1))907OBJID_CURSOR = int32(-((0xFFFFFFF7 ^ 0xFFFFFFFF) + 1))908OBJID_ALERT = int32(-((0xFFFFFFF6 ^ 0xFFFFFFFF) + 1))909OBJID_SOUND = int32(-((0xFFFFFFF5 ^ 0xFFFFFFFF) + 1))910OBJID_QUERYCLASSNAMEIDX = int32(-((0xFFFFFFF4 ^ 0xFFFFFFFF) + 1))911OBJID_NATIVEOM = int32(-((0xFFFFFFF0 ^ 0xFFFFFFFF) + 1))912)
913
914// event constants
915const (916EVENT_MIN = 0x00000001917EVENT_MAX = 0x7FFFFFFF918
919EVENT_SYSTEM_SOUND = 0x0001920EVENT_SYSTEM_ALERT = 0x0002921EVENT_SYSTEM_FOREGROUND = 0x0003922EVENT_SYSTEM_MENUSTART = 0x0004923EVENT_SYSTEM_MENUEND = 0x0005924EVENT_SYSTEM_MENUPOPUPSTART = 0x0006925EVENT_SYSTEM_MENUPOPUPEND = 0x0007926EVENT_SYSTEM_CAPTURESTART = 0x0008927EVENT_SYSTEM_CAPTUREEND = 0x0009928EVENT_SYSTEM_MOVESIZESTART = 0x000A929EVENT_SYSTEM_MOVESIZEEND = 0x000B930EVENT_SYSTEM_CONTEXTHELPSTART = 0x000C931EVENT_SYSTEM_CONTEXTHELPEND = 0x000D932EVENT_SYSTEM_DRAGDROPSTART = 0x000E933EVENT_SYSTEM_DRAGDROPEND = 0x000F934EVENT_SYSTEM_DIALOGSTART = 0x0010935EVENT_SYSTEM_DIALOGEND = 0x0011936EVENT_SYSTEM_SCROLLINGSTART = 0x0012937EVENT_SYSTEM_SCROLLINGEND = 0x0013938EVENT_SYSTEM_SWITCHSTART = 0x0014939EVENT_SYSTEM_SWITCHEND = 0x0015940EVENT_SYSTEM_MINIMIZESTART = 0x0016941EVENT_SYSTEM_MINIMIZEEND = 0x0017942EVENT_SYSTEM_DESKTOPSWITCH = 0x0020943EVENT_SYSTEM_SWITCHER_APPGRABBED = 0x0024944EVENT_SYSTEM_SWITCHER_APPOVERTARGET = 0x0025945EVENT_SYSTEM_SWITCHER_APPDROPPED = 0x0026946EVENT_SYSTEM_SWITCHER_CANCELLED = 0x0027947EVENT_SYSTEM_IME_KEY_NOTIFICATION = 0x0029948EVENT_SYSTEM_END = 0x00FF949
950EVENT_OEM_DEFINED_START = 0x0101951EVENT_OEM_DEFINED_END = 0x01FF952
953EVENT_CONSOLE_CARET = 0x4001954EVENT_CONSOLE_UPDATE_REGION = 0x4002955EVENT_CONSOLE_UPDATE_SIMPLE = 0x4003956EVENT_CONSOLE_UPDATE_SCROLL = 0x4004957EVENT_CONSOLE_LAYOUT = 0x4005958EVENT_CONSOLE_START_APPLICATION = 0x4006959EVENT_CONSOLE_END_APPLICATION = 0x4007960EVENT_CONSOLE_END = 0x40FF961
962EVENT_UIA_EVENTID_START = 0x4E00963EVENT_UIA_EVENTID_END = 0x4EFF964
965EVENT_UIA_PROPID_START = 0x7500966EVENT_UIA_PROPID_END = 0x75FF967
968EVENT_OBJECT_CREATE = 0x8000969EVENT_OBJECT_DESTROY = 0x8001970EVENT_OBJECT_SHOW = 0x8002971EVENT_OBJECT_HIDE = 0x8003972EVENT_OBJECT_REORDER = 0x8004973EVENT_OBJECT_FOCUS = 0x8005974EVENT_OBJECT_SELECTION = 0x8006975EVENT_OBJECT_SELECTIONADD = 0x8007976EVENT_OBJECT_SELECTIONREMOVE = 0x8008977EVENT_OBJECT_SELECTIONWITHIN = 0x8009978EVENT_OBJECT_STATECHANGE = 0x800A979EVENT_OBJECT_LOCATIONCHANGE = 0x800B980EVENT_OBJECT_NAMECHANGE = 0x800C981EVENT_OBJECT_DESCRIPTIONCHANGE = 0x800D982EVENT_OBJECT_VALUECHANGE = 0x800E983EVENT_OBJECT_PARENTCHANGE = 0x800F984EVENT_OBJECT_HELPCHANGE = 0x8010985EVENT_OBJECT_DEFACTIONCHANGE = 0x8011986EVENT_OBJECT_ACCELERATORCHANGE = 0x8012987EVENT_OBJECT_INVOKED = 0x8013988EVENT_OBJECT_TEXTSELECTIONCHANGED = 0x8014989EVENT_OBJECT_CONTENTSCROLLED = 0x8015990EVENT_SYSTEM_ARRANGMENTPREVIEW = 0x8016991EVENT_OBJECT_CLOAKED = 0x8017992EVENT_OBJECT_UNCLOAKED = 0x8018993EVENT_OBJECT_LIVEREGIONCHANGED = 0x8019994EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED = 0x8020995EVENT_OBJECT_DRAGSTART = 0x8021996EVENT_OBJECT_DRAGCANCEL = 0x8022997EVENT_OBJECT_DRAGCOMPLETE = 0x8023998EVENT_OBJECT_DRAGENTER = 0x8024999EVENT_OBJECT_DRAGLEAVE = 0x80251000EVENT_OBJECT_DRAGDROPPED = 0x80261001EVENT_OBJECT_IME_SHOW = 0x80271002EVENT_OBJECT_IME_HIDE = 0x80281003EVENT_OBJECT_IME_CHANGE = 0x80291004EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED = 0x80301005EVENT_OBJECT_END = 0x80FF1006
1007EVENT_AIA_START = 0xa0001008EVENT_AIA_END = 0xafff1009
1010WINEVENT_OUTOFCONTEXT = 0x00001011WINEVENT_SKIPOWNTHREAD = 0x00011012WINEVENT_SKIPOWNPROCESS = 0x00021013WINEVENT_INCONTEXT = 0x00041014)
1015
1016// mouse button constants
1017const (1018MK_CONTROL = 0x00081019MK_LBUTTON = 0x00011020MK_MBUTTON = 0x00101021MK_RBUTTON = 0x00021022MK_SHIFT = 0x00041023MK_XBUTTON1 = 0x00201024MK_XBUTTON2 = 0x00401025)
1026
1027// TrackPopupMenu[Ex] flags
1028const (1029TPM_CENTERALIGN = 0x00041030TPM_LEFTALIGN = 0x00001031TPM_RIGHTALIGN = 0x00081032TPM_BOTTOMALIGN = 0x00201033TPM_TOPALIGN = 0x00001034TPM_VCENTERALIGN = 0x00101035TPM_NONOTIFY = 0x00801036TPM_RETURNCMD = 0x01001037TPM_LEFTBUTTON = 0x00001038TPM_RIGHTBUTTON = 0x00021039TPM_HORNEGANIMATION = 0x08001040TPM_HORPOSANIMATION = 0x04001041TPM_NOANIMATION = 0x40001042TPM_VERNEGANIMATION = 0x20001043TPM_VERPOSANIMATION = 0x10001044TPM_HORIZONTAL = 0x00001045TPM_VERTICAL = 0x00401046)
1047
1048// WINDOWPLACEMENT flags
1049const (1050WPF_ASYNCWINDOWPLACEMENT = 0x00041051WPF_RESTORETOMAXIMIZED = 0x00021052WPF_SETMINPOSITION = 0x00011053)
1054
1055// DrawText[Ex] format flags
1056const (1057DT_TOP = 0x000000001058DT_LEFT = 0x000000001059DT_CENTER = 0x000000011060DT_RIGHT = 0x000000021061DT_VCENTER = 0x000000041062DT_BOTTOM = 0x000000081063DT_WORDBREAK = 0x000000101064DT_SINGLELINE = 0x000000201065DT_EXPANDTABS = 0x000000401066DT_TABSTOP = 0x000000801067DT_NOCLIP = 0x000001001068DT_EXTERNALLEADING = 0x000002001069DT_CALCRECT = 0x000004001070DT_NOPREFIX = 0x000008001071DT_INTERNAL = 0x000010001072DT_EDITCONTROL = 0x000020001073DT_PATH_ELLIPSIS = 0x000040001074DT_END_ELLIPSIS = 0x000080001075DT_MODIFYSTRING = 0x000100001076DT_RTLREADING = 0x000200001077DT_WORD_ELLIPSIS = 0x000400001078DT_NOFULLWIDTHCHARBREAK = 0x000800001079DT_HIDEPREFIX = 0x001000001080DT_PREFIXONLY = 0x002000001081)
1082
1083// Window class styles
1084const (1085CS_VREDRAW = 0x000000011086CS_HREDRAW = 0x000000021087CS_KEYCVTWINDOW = 0x000000041088CS_DBLCLKS = 0x000000081089CS_OWNDC = 0x000000201090CS_CLASSDC = 0x000000401091CS_PARENTDC = 0x000000801092CS_NOKEYCVT = 0x000001001093CS_NOCLOSE = 0x000002001094CS_SAVEBITS = 0x000008001095CS_BYTEALIGNCLIENT = 0x000010001096CS_BYTEALIGNWINDOW = 0x000020001097CS_GLOBALCLASS = 0x000040001098CS_IME = 0x000100001099CS_DROPSHADOW = 0x000200001100)
1101
1102// SystemParametersInfo actions
1103const (1104SPI_GETNONCLIENTMETRICS = 0x00291105SPI_GETHIGHCONTRAST = 0x00421106)
1107
1108// Dialog styles
1109const (1110DS_ABSALIGN = 0x00011111DS_SYSMODAL = 0x00021112DS_3DLOOK = 0x00041113DS_FIXEDSYS = 0x00081114DS_NOFAILCREATE = 0x00101115DS_LOCALEDIT = 0x00201116DS_SETFONT = 0x00401117DS_MODALFRAME = 0x00801118DS_NOIDLEMSG = 0x01001119DS_SETFOREGROUND = 0x02001120DS_CONTROL = 0x04001121DS_CENTER = 0x08001122DS_CENTERMOUSE = 0x10001123DS_CONTEXTHELP = 0x20001124DS_USEPIXELS = 0x80001125DS_SHELLFONT = (DS_SETFONT | DS_FIXEDSYS)1126)
1127
1128// WM_GETDLGCODE return values
1129const (1130DLGC_BUTTON = 0x20001131DLGC_DEFPUSHBUTTON = 0x00101132DLGC_HASSETSEL = 0x00081133DLGC_RADIOBUTTON = 0x00401134DLGC_STATIC = 0x01001135DLGC_UNDEFPUSHBUTTON = 0x00201136DLGC_WANTALLKEYS = 0x00041137DLGC_WANTARROWS = 0x00011138DLGC_WANTCHARS = 0x00801139DLGC_WANTMESSAGE = 0x00041140DLGC_WANTTAB = 0x00021141)
1142
1143// WM_ACTIVATE codes
1144const (1145WA_ACTIVE = 11146WA_CLICKACTIVE = 21147WA_INACTIVE = 01148)
1149
1150// Owner drawing actions
1151const (1152ODA_DRAWENTIRE = 0x00011153ODA_FOCUS = 0x00021154ODA_SELECT = 0x00041155)
1156
1157// Owner drawing states
1158const (1159ODS_CHECKED = 0x00011160ODS_COMBOBOXEDIT = 0x00021161ODS_DEFAULT = 0x00041162ODS_DISABLED = 0x00081163ODS_FOCUS = 0x00101164ODS_GRAYED = 0x00201165ODS_SELECTED = 0x00401166)
1167
1168// Raw input device flags
1169const (1170RIDEV_APPKEYS = 0x000004001171RIDEV_CAPTUREMOUSE = 0x000002001172RIDEV_DEVNOTIFY = 0x000020001173RIDEV_EXCLUDE = 0x000000101174RIDEV_EXINPUTSINK = 0x000010001175RIDEV_INPUTSINK = 0x000001001176RIDEV_NOHOTKEYS = 0x000002001177RIDEV_NOLEGACY = 0x000000301178RIDEV_PAGEONLY = 0x000000201179RIDEV_REMOVE = 0x000000011180)
1181
1182// Raw input device command flags
1183const (1184RID_HEADER = 0x100000051185RID_INPUT = 0x100000031186)
1187
1188// Raw input type
1189const (1190RIM_TYPEHID = 21191RIM_TYPEKEYBOARD = 11192RIM_TYPEMOUSE = 01193)
1194
1195// Raw input scan code information
1196const (1197RI_KEY_MAKE = 01198RI_KEY_BREAK = 11199RI_KEY_E0 = 21200RI_KEY_E1 = 41201)
1202
1203// Raw input mouse state
1204const (1205MOUSE_MOVE_RELATIVE = 0x001206MOUSE_MOVE_ABSOLUTE = 0x011207MOUSE_VIRTUAL_DESKTOP = 0x021208MOUSE_ATTRIBUTES_CHANGED = 0x041209)
1210
1211// Raw input transistion state of mouse buttons
1212const (1213RI_MOUSE_LEFT_BUTTON_DOWN = 0x00011214RI_MOUSE_LEFT_BUTTON_UP = 0x00021215RI_MOUSE_MIDDLE_BUTTON_DOWN = 0x00101216RI_MOUSE_MIDDLE_BUTTON_UP = 0x00201217RI_MOUSE_RIGHT_BUTTON_DOWN = 0x00041218RI_MOUSE_RIGHT_BUTTON_UP = 0x00081219RI_MOUSE_BUTTON_1_DOWN = 0x00011220RI_MOUSE_BUTTON_1_UP = 0x00021221RI_MOUSE_BUTTON_2_DOWN = 0x00041222RI_MOUSE_BUTTON_2_UP = 0x00081223RI_MOUSE_BUTTON_3_DOWN = 0x00101224RI_MOUSE_BUTTON_3_UP = 0x00201225RI_MOUSE_BUTTON_4_DOWN = 0x00401226RI_MOUSE_BUTTON_4_UP = 0x00801227RI_MOUSE_BUTTON_5_DOWN = 0x01001228RI_MOUSE_BUTTON_5_UP = 0x02001229RI_MOUSE_WHEEL = 0x04001230)
1231
1232// Multi monitor constants
1233const (1234MONITOR_DEFAULTTONULL = 0x01235MONITOR_DEFAULTTOPRIMARY = 0x11236MONITOR_DEFAULTTONEAREST = 0x21237)
1238
1239// MONITORINFO flags
1240const (1241MONITORINFOF_PRIMARY = 0x11242)
1243
1244// INPUT Type
1245const (1246INPUT_MOUSE = 01247INPUT_KEYBOARD = 11248INPUT_HARDWARE = 21249)
1250
1251// MOUSEINPUT MouseData
1252const (1253XBUTTON1 = 0x00011254XBUTTON2 = 0x00021255)
1256
1257// MOUSEINPUT DwFlags
1258const (1259MOUSEEVENTF_ABSOLUTE = 0x80001260MOUSEEVENTF_HWHEEL = 0x10001261MOUSEEVENTF_MOVE = 0x00011262MOUSEEVENTF_MOVE_NOCOALESCE = 0x20001263MOUSEEVENTF_LEFTDOWN = 0x00021264MOUSEEVENTF_LEFTUP = 0x00041265MOUSEEVENTF_RIGHTDOWN = 0x00081266MOUSEEVENTF_RIGHTUP = 0x00101267MOUSEEVENTF_MIDDLEDOWN = 0x00201268MOUSEEVENTF_MIDDLEUP = 0x00401269MOUSEEVENTF_VIRTUALDESK = 0x40001270MOUSEEVENTF_WHEEL = 0x08001271MOUSEEVENTF_XDOWN = 0x00801272MOUSEEVENTF_XUP = 0x01001273)
1274
1275// KEYBDINPUT DwFlags
1276const (1277KEYEVENTF_EXTENDEDKEY = 0x00011278KEYEVENTF_KEYUP = 0x00021279KEYEVENTF_SCANCODE = 0x00081280KEYEVENTF_UNICODE = 0x00041281)
1282
1283// GetWindow uCmd constants
1284const (1285GW_CHILD = 51286GW_ENABLEDPOPUP = 61287GW_HWNDFIRST = 01288GW_HWNDLAST = 11289GW_HWNDNEXT = 21290GW_HWNDPREV = 31291GW_OWNER = 41292)
1293
1294// Standard clipboard formats
1295const (1296CF_BITMAP = 21297CF_DIB = 81298CF_DIBV5 = 171299CF_DIF = 51300CF_DSPBITMAP = 0x00821301CF_DSPENHMETAFILE = 0x008E1302CF_DSPMETAFILEPICT = 0x00831303CF_DSPTEXT = 0x00811304CF_ENHMETAFILE = 141305CF_GDIOBJFIRST = 0x03001306CF_GDIOBJLAST = 0x03FF1307CF_HDROP = 151308CF_LOCALE = 161309CF_METAFILEPICT = 31310CF_OEMTEXT = 71311CF_OWNERDISPLAY = 0x00801312CF_PALETTE = 91313CF_PENDATA = 101314CF_PRIVATEFIRST = 0x02001315CF_PRIVATELAST = 0x02FF1316CF_RIFF = 111317CF_SYLK = 41318CF_TEXT = 11319CF_TIFF = 61320CF_UNICODETEXT = 131321CF_WAVE = 121322)
1323
1324// ScrollBar constants
1325const (1326SB_HORZ = 01327SB_VERT = 11328SB_CTL = 21329SB_BOTH = 31330)
1331
1332// ScrollBar commands
1333const (1334SB_LINEUP = 01335SB_LINELEFT = 01336SB_LINEDOWN = 11337SB_LINERIGHT = 11338SB_PAGEUP = 21339SB_PAGELEFT = 21340SB_PAGEDOWN = 31341SB_PAGERIGHT = 31342SB_THUMBPOSITION = 41343SB_THUMBTRACK = 51344SB_TOP = 61345SB_LEFT = 61346SB_BOTTOM = 71347SB_RIGHT = 71348SB_ENDSCROLL = 81349)
1350
1351// [Get|Set]ScrollInfo mask constants
1352const (1353SIF_RANGE = 11354SIF_PAGE = 21355SIF_POS = 41356SIF_DISABLENOSCROLL = 81357SIF_TRACKPOS = 161358SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS1359)
1360
1361// DrawIconEx flags
1362const (1363DI_COMPAT = 0x00041364DI_DEFAULTSIZE = 0x00081365DI_IMAGE = 0x00021366DI_MASK = 0x00011367DI_NOMIRROR = 0x00101368DI_NORMAL = DI_IMAGE | DI_MASK1369)
1370
1371// WM_NCHITTEST constants
1372const (1373HTBORDER = 181374HTBOTTOM = 151375HTBOTTOMLEFT = 161376HTBOTTOMRIGHT = 171377HTCAPTION = 21378HTCLIENT = 11379HTCLOSE = 201380HTERROR = -21381HTGROWBOX = 41382HTHELP = 211383HTHSCROLL = 61384HTLEFT = 101385HTMENU = 51386HTMAXBUTTON = 91387HTMINBUTTON = 81388HTNOWHERE = 01389HTREDUCE = 81390HTRIGHT = 111391HTSIZE = 41392HTSYSMENU = 31393HTTOP = 121394HTTOPLEFT = 131395HTTOPRIGHT = 141396HTTRANSPARENT = -11397HTVSCROLL = 71398HTZOOM = 91399)
1400
1401// AnimateWindow flags
1402const (1403AW_ACTIVATE = 0x000200001404AW_BLEND = 0x000800001405AW_CENTER = 0x000000101406AW_HIDE = 0x000100001407AW_HOR_POSITIVE = 0x000000011408AW_HOR_NEGATIVE = 0x000000021409AW_SLIDE = 0x000400001410AW_VER_POSITIVE = 0x000000041411AW_VER_NEGATIVE = 0x000000081412)
1413
1414// Session ending constants
1415const (1416ENDSESSION_CLOSEAPP = 0x000000011417ENDSESSION_CRITICAL = 0x400000001418ENDSESSION_LOGOFF = 0x800000001419)
1420
1421// ChangeWindowMessageFilterEx constants
1422const (1423MSGFLT_RESET = 01424MSGFLT_ALLOW = 11425MSGFLT_DISALLOW = 21426
1427MSGFLTINFO_NONE = 01428MSGFLTINFO_ALREADYALLOWED_FORWND = 11429MSGFLTINFO_ALREADYDISALLOWED_FORWND = 21430MSGFLTINFO_ALLOWED_HIGHER = 31431)
1432
1433// TRACKMOUSEEVENT flags
1434const (1435TME_CANCEL = 0x800000001436TME_HOVER = 0x000000011437TME_LEAVE = 0x000000021438TME_NONCLIENT = 0x000000101439TME_QUERY = 0x400000001440)
1441
1442// HIGHCONTRAST flags
1443const (1444HCF_HIGHCONTRASTON = 0x000000011445HCF_AVAILABLE = 0x000000021446HCF_HOTKEYACTIVE = 0x000000041447HCF_CONFIRMHOTKEY = 0x000000081448HCF_HOTKEYSOUND = 0x000000101449HCF_INDICATOR = 0x000000201450HCF_HOTKEYAVAILABLE = 0x000000401451)
1452
1453// EDITWORDBREAKPROC codes
1454const (1455WB_LEFT = 01456WB_RIGHT = 11457WB_ISDELIMITER = 21458)
1459
1460type NMBCDROPDOWN struct {1461Hdr NMHDR
1462RcButton RECT
1463}
1464
1465type MONITORINFO struct {1466CbSize uint321467RcMonitor RECT
1468RcWork RECT
1469DwFlags uint321470}
1471
1472type (1473HACCEL HANDLE
1474HCURSOR HANDLE
1475HDWP HANDLE
1476HICON HANDLE
1477HMENU HANDLE
1478HMONITOR HANDLE
1479HRAWINPUT HANDLE
1480HWND HANDLE
1481)
1482
1483type MSG struct {1484HWnd HWND
1485Message uint321486WParam uintptr1487LParam uintptr1488Time uint321489Pt POINT
1490}
1491
1492type RAWINPUTDEVICE struct {1493UsUsagePage uint161494UsUsage uint161495DwFlags uint321496HwndTarget HWND
1497}
1498
1499type RAWINPUTHEADER struct {1500DwType uint321501DwSize uint321502HDevice HANDLE
1503WParam uintptr1504}
1505
1506type RAWINPUTMOUSE struct {1507Header RAWINPUTHEADER
1508Data RAWMOUSE
1509}
1510
1511type RAWINPUTKEYBOARD struct {1512Header RAWINPUTHEADER
1513Data RAWKEYBOARD
1514}
1515
1516type RAWINPUTHID struct {1517Header RAWINPUTHEADER
1518Data RAWHID
1519}
1520
1521type RAWMOUSE struct {1522UsFlags uint161523UsButtonFlags uint161524UsButtonData uint161525Pad_cgo_0 [2]byte1526UlRawButtons uint321527LLastX int321528LLastY int321529UlExtraInformation uint321530}
1531
1532type RAWKEYBOARD struct {1533MakeCode uint161534Flags uint161535Reserved int161536VKey uint161537Message uint321538ExtraInformation uint321539}
1540
1541type RAWHID struct {1542DwSizeHid uint321543DwCount uint321544BRawData [1]byte1545}
1546
1547type NMHDR struct {1548HwndFrom HWND
1549IdFrom uintptr1550Code uint321551}
1552
1553type CREATESTRUCT struct {1554CreateParams uintptr1555Instance HINSTANCE
1556Menu HMENU
1557Parent HWND
1558Cy int321559Cx int321560Y int321561X int321562Style int321563Name, ClassName uintptr1564ExStyle uint321565}
1566
1567type CHANGEFILTERSTRUCT struct {1568size uint321569extStatus uint321570}
1571
1572type WNDCLASSEX struct {1573CbSize uint321574Style uint321575LpfnWndProc uintptr1576CbClsExtra int321577CbWndExtra int321578HInstance HINSTANCE
1579HIcon HICON
1580HCursor HCURSOR
1581HbrBackground HBRUSH
1582LpszMenuName *uint161583LpszClassName *uint161584HIconSm HICON
1585}
1586
1587type TPMPARAMS struct {1588CbSize uint321589RcExclude RECT
1590}
1591
1592type WINDOWPLACEMENT struct {1593Length uint321594Flags uint321595ShowCmd uint321596PtMinPosition POINT
1597PtMaxPosition POINT
1598RcNormalPosition RECT
1599}
1600
1601type DRAWTEXTPARAMS struct {1602CbSize uint321603ITabLength int321604ILeftMargin int321605IRightMargin int321606UiLengthDrawn uint321607}
1608
1609type PAINTSTRUCT struct {1610Hdc HDC
1611FErase BOOL
1612RcPaint RECT
1613FRestore BOOL
1614FIncUpdate BOOL
1615RgbReserved [32]byte1616}
1617
1618type MINMAXINFO struct {1619PtReserved POINT
1620PtMaxSize POINT
1621PtMaxPosition POINT
1622PtMinTrackSize POINT
1623PtMaxTrackSize POINT
1624}
1625
1626type NONCLIENTMETRICS struct {1627CbSize uint321628IBorderWidth int321629IScrollWidth int321630IScrollHeight int321631ICaptionWidth int321632ICaptionHeight int321633LfCaptionFont LOGFONT
1634ISmCaptionWidth int321635ISmCaptionHeight int321636LfSmCaptionFont LOGFONT
1637IMenuWidth int321638IMenuHeight int321639LfMenuFont LOGFONT
1640LfStatusFont LOGFONT
1641LfMessageFont LOGFONT
1642}
1643
1644type MEASUREITEMSTRUCT struct {1645CtlType uint321646CtlID uint321647ItemID int321648ItemWidth uint321649ItemHeight uint321650ItemData uintptr1651}
1652
1653type DRAWITEMSTRUCT struct {1654CtlType uint321655CtlID uint321656ItemID int321657ItemAction uint321658ItemState uint321659HwndItem HWND
1660HDC HDC
1661RcItem RECT
1662ItemData uintptr1663}
1664
1665type ICONINFO struct {1666FIcon BOOL
1667XHotspot uint321668YHotspot uint321669HbmMask HBITMAP
1670HbmColor HBITMAP
1671}
1672
1673type MOUSE_INPUT struct {1674Type uint321675Mi MOUSEINPUT
1676}
1677
1678type MOUSEINPUT struct {1679Dx int321680Dy int321681MouseData uint321682DwFlags uint321683Time uint321684DwExtraInfo uintptr1685}
1686
1687type KEYBD_INPUT struct {1688Type uint321689Ki KEYBDINPUT
1690}
1691
1692type KEYBDINPUT struct {1693WVk uint161694WScan uint161695DwFlags uint321696Time uint321697DwExtraInfo uintptr1698Unused [8]byte1699}
1700
1701type HARDWARE_INPUT struct {1702Type uint321703Hi HARDWAREINPUT
1704}
1705
1706type HARDWAREINPUT struct {1707UMsg uint321708WParamL uint161709WParamH uint161710Unused [16]byte1711}
1712
1713type SCROLLINFO struct {1714CbSize uint321715FMask uint321716NMin int321717NMax int321718NPage uint321719NPos int321720NTrackPos int321721}
1722
1723type WINDOWPOS struct {1724Hwnd HWND
1725HwndInsertAfter HWND
1726X int321727Y int321728Cx int321729Cy int321730Flags uint321731}
1732
1733type TRACKMOUSEEVENT struct {1734CbSize uint321735DwFlags uint321736HwndTrack HWND
1737DwHoverTime uint321738}
1739
1740type HIGHCONTRAST struct {1741CbSize uint321742DwFlags uint321743LpszDefaultScheme *uint161744}
1745
1746func GET_X_LPARAM(lp uintptr) int32 {1747return int32(int16(LOWORD(uint32(lp))))1748}
1749
1750func GET_Y_LPARAM(lp uintptr) int32 {1751return int32(int16(HIWORD(uint32(lp))))1752}
1753
1754var (1755// Library1756libuser32 *windows.LazyDLL1757
1758// Functions1759addClipboardFormatListener *windows.LazyProc1760adjustWindowRect *windows.LazyProc1761attachThreadInput *windows.LazyProc1762animateWindow *windows.LazyProc1763beginDeferWindowPos *windows.LazyProc1764beginPaint *windows.LazyProc1765bringWindowToTop *windows.LazyProc1766callWindowProc *windows.LazyProc1767changeWindowMessageFilterEx *windows.LazyProc1768checkMenuRadioItem *windows.LazyProc1769clientToScreen *windows.LazyProc1770closeClipboard *windows.LazyProc1771createDialogParam *windows.LazyProc1772createIconIndirect *windows.LazyProc1773createMenu *windows.LazyProc1774createPopupMenu *windows.LazyProc1775createWindowEx *windows.LazyProc1776deferWindowPos *windows.LazyProc1777defWindowProc *windows.LazyProc1778deleteMenu *windows.LazyProc1779destroyIcon *windows.LazyProc1780destroyMenu *windows.LazyProc1781destroyWindow *windows.LazyProc1782dialogBoxParam *windows.LazyProc1783dispatchMessage *windows.LazyProc1784drawIconEx *windows.LazyProc1785drawMenuBar *windows.LazyProc1786drawFocusRect *windows.LazyProc1787drawTextEx *windows.LazyProc1788emptyClipboard *windows.LazyProc1789enableMenuItem *windows.LazyProc1790enableWindow *windows.LazyProc1791endDeferWindowPos *windows.LazyProc1792endDialog *windows.LazyProc1793endPaint *windows.LazyProc1794enumChildWindows *windows.LazyProc1795findWindow *windows.LazyProc1796getActiveWindow *windows.LazyProc1797getAncestor *windows.LazyProc1798getCaretPos *windows.LazyProc1799getClassName *windows.LazyProc1800getClientRect *windows.LazyProc1801getClipboardData *windows.LazyProc1802getCursorPos *windows.LazyProc1803getDC *windows.LazyProc1804getDesktopWindow *windows.LazyProc1805getDlgItem *windows.LazyProc1806getDpiForWindow *windows.LazyProc1807getFocus *windows.LazyProc1808getForegroundWindow *windows.LazyProc1809getIconInfo *windows.LazyProc1810getKeyState *windows.LazyProc1811getMenuCheckMarkDimensions *windows.LazyProc1812getMenuInfo *windows.LazyProc1813getMenuItemCount *windows.LazyProc1814getMenuItemID *windows.LazyProc1815getMenuItemInfo *windows.LazyProc1816getMessage *windows.LazyProc1817getMonitorInfo *windows.LazyProc1818getParent *windows.LazyProc1819getRawInputData *windows.LazyProc1820getScrollInfo *windows.LazyProc1821getSubMenu *windows.LazyProc1822getSysColor *windows.LazyProc1823getSysColorBrush *windows.LazyProc1824getSystemMenu *windows.LazyProc1825getSystemMetrics *windows.LazyProc1826getSystemMetricsForDpi *windows.LazyProc1827getWindow *windows.LazyProc1828getWindowLong *windows.LazyProc1829getWindowLongPtr *windows.LazyProc1830getWindowPlacement *windows.LazyProc1831getWindowRect *windows.LazyProc1832getWindowThreadProcessId *windows.LazyProc1833insertMenuItem *windows.LazyProc1834invalidateRect *windows.LazyProc1835isChild *windows.LazyProc1836isClipboardFormatAvailable *windows.LazyProc1837isDialogMessage *windows.LazyProc1838isIconic *windows.LazyProc1839isWindowEnabled *windows.LazyProc1840isWindowVisible *windows.LazyProc1841isZoomed *windows.LazyProc1842killTimer *windows.LazyProc1843loadCursor *windows.LazyProc1844loadIcon *windows.LazyProc1845loadImage *windows.LazyProc1846loadMenu *windows.LazyProc1847loadString *windows.LazyProc1848messageBeep *windows.LazyProc1849messageBox *windows.LazyProc1850monitorFromWindow *windows.LazyProc1851moveWindow *windows.LazyProc1852notifyWinEvent *windows.LazyProc1853unregisterClass *windows.LazyProc1854openClipboard *windows.LazyProc1855peekMessage *windows.LazyProc1856postMessage *windows.LazyProc1857postQuitMessage *windows.LazyProc1858redrawWindow *windows.LazyProc1859registerClassEx *windows.LazyProc1860registerRawInputDevices *windows.LazyProc1861registerWindowMessage *windows.LazyProc1862releaseCapture *windows.LazyProc1863releaseDC *windows.LazyProc1864removeMenu *windows.LazyProc1865screenToClient *windows.LazyProc1866sendDlgItemMessage *windows.LazyProc1867sendInput *windows.LazyProc1868sendMessage *windows.LazyProc1869setActiveWindow *windows.LazyProc1870setCapture *windows.LazyProc1871setClipboardData *windows.LazyProc1872setCursor *windows.LazyProc1873setCursorPos *windows.LazyProc1874setFocus *windows.LazyProc1875setForegroundWindow *windows.LazyProc1876setMenu *windows.LazyProc1877setMenuDefaultItem *windows.LazyProc1878setMenuInfo *windows.LazyProc1879setMenuItemBitmaps *windows.LazyProc1880setMenuItemInfo *windows.LazyProc1881setParent *windows.LazyProc1882setRect *windows.LazyProc1883setScrollInfo *windows.LazyProc1884setTimer *windows.LazyProc1885setWinEventHook *windows.LazyProc1886setWindowLong *windows.LazyProc1887setWindowLongPtr *windows.LazyProc1888setWindowPlacement *windows.LazyProc1889setWindowPos *windows.LazyProc1890showWindow *windows.LazyProc1891systemParametersInfo *windows.LazyProc1892trackMouseEvent *windows.LazyProc1893trackPopupMenu *windows.LazyProc1894trackPopupMenuEx *windows.LazyProc1895translateMessage *windows.LazyProc1896unhookWinEvent *windows.LazyProc1897updateWindow *windows.LazyProc1898windowFromDC *windows.LazyProc1899windowFromPoint *windows.LazyProc1900)
1901
1902func init() {1903is64bit := unsafe.Sizeof(uintptr(0)) == 81904
1905// Library1906libuser32 = windows.NewLazySystemDLL("user32.dll")1907
1908// Functions1909addClipboardFormatListener = libuser32.NewProc("AddClipboardFormatListener")1910adjustWindowRect = libuser32.NewProc("AdjustWindowRect")1911attachThreadInput = libuser32.NewProc("AttachThreadInput")1912animateWindow = libuser32.NewProc("AnimateWindow")1913beginDeferWindowPos = libuser32.NewProc("BeginDeferWindowPos")1914beginPaint = libuser32.NewProc("BeginPaint")1915bringWindowToTop = libuser32.NewProc("BringWindowToTop")1916callWindowProc = libuser32.NewProc("CallWindowProcW")1917changeWindowMessageFilterEx = libuser32.NewProc("ChangeWindowMessageFilterEx")1918checkMenuRadioItem = libuser32.NewProc("CheckMenuRadioItem")1919clientToScreen = libuser32.NewProc("ClientToScreen")1920closeClipboard = libuser32.NewProc("CloseClipboard")1921createDialogParam = libuser32.NewProc("CreateDialogParamW")1922createIconIndirect = libuser32.NewProc("CreateIconIndirect")1923createMenu = libuser32.NewProc("CreateMenu")1924createPopupMenu = libuser32.NewProc("CreatePopupMenu")1925createWindowEx = libuser32.NewProc("CreateWindowExW")1926deferWindowPos = libuser32.NewProc("DeferWindowPos")1927defWindowProc = libuser32.NewProc("DefWindowProcW")1928deleteMenu = libuser32.NewProc("DeleteMenu")1929destroyIcon = libuser32.NewProc("DestroyIcon")1930destroyMenu = libuser32.NewProc("DestroyMenu")1931destroyWindow = libuser32.NewProc("DestroyWindow")1932dialogBoxParam = libuser32.NewProc("DialogBoxParamW")1933dispatchMessage = libuser32.NewProc("DispatchMessageW")1934drawIconEx = libuser32.NewProc("DrawIconEx")1935drawFocusRect = libuser32.NewProc("DrawFocusRect")1936drawMenuBar = libuser32.NewProc("DrawMenuBar")1937drawTextEx = libuser32.NewProc("DrawTextExW")1938emptyClipboard = libuser32.NewProc("EmptyClipboard")1939enableMenuItem = libuser32.NewProc("EnableMenuItem")1940enableWindow = libuser32.NewProc("EnableWindow")1941endDeferWindowPos = libuser32.NewProc("EndDeferWindowPos")1942endDialog = libuser32.NewProc("EndDialog")1943endPaint = libuser32.NewProc("EndPaint")1944enumChildWindows = libuser32.NewProc("EnumChildWindows")1945findWindow = libuser32.NewProc("FindWindowW")1946getActiveWindow = libuser32.NewProc("GetActiveWindow")1947getAncestor = libuser32.NewProc("GetAncestor")1948getCaretPos = libuser32.NewProc("GetCaretPos")1949getClassName = libuser32.NewProc("GetClassNameW")1950getClientRect = libuser32.NewProc("GetClientRect")1951getClipboardData = libuser32.NewProc("GetClipboardData")1952getCursorPos = libuser32.NewProc("GetCursorPos")1953getDC = libuser32.NewProc("GetDC")1954getDesktopWindow = libuser32.NewProc("GetDesktopWindow")1955getDlgItem = libuser32.NewProc("GetDlgItem")1956getDpiForWindow = libuser32.NewProc("GetDpiForWindow")1957getFocus = libuser32.NewProc("GetFocus")1958getForegroundWindow = libuser32.NewProc("GetForegroundWindow")1959getIconInfo = libuser32.NewProc("GetIconInfo")1960getKeyState = libuser32.NewProc("GetKeyState")1961getMenuCheckMarkDimensions = libuser32.NewProc("GetMenuCheckMarkDimensions")1962getMenuInfo = libuser32.NewProc("GetMenuInfo")1963getMenuItemCount = libuser32.NewProc("GetMenuItemCount")1964getMenuItemID = libuser32.NewProc("GetMenuItemID")1965getMenuItemInfo = libuser32.NewProc("GetMenuItemInfoW")1966getMessage = libuser32.NewProc("GetMessageW")1967getMonitorInfo = libuser32.NewProc("GetMonitorInfoW")1968getParent = libuser32.NewProc("GetParent")1969getRawInputData = libuser32.NewProc("GetRawInputData")1970getScrollInfo = libuser32.NewProc("GetScrollInfo")1971getSubMenu = libuser32.NewProc("GetSubMenu")1972getSysColor = libuser32.NewProc("GetSysColor")1973getSysColorBrush = libuser32.NewProc("GetSysColorBrush")1974getSystemMenu = libuser32.NewProc("GetSystemMenu")1975getSystemMetrics = libuser32.NewProc("GetSystemMetrics")1976getSystemMetricsForDpi = libuser32.NewProc("GetSystemMetricsForDpi")1977getWindow = libuser32.NewProc("GetWindow")1978getWindowLong = libuser32.NewProc("GetWindowLongW")1979// On 32 bit GetWindowLongPtrW is not available1980if is64bit {1981getWindowLongPtr = libuser32.NewProc("GetWindowLongPtrW")1982} else {1983getWindowLongPtr = libuser32.NewProc("GetWindowLongW")1984}1985getWindowPlacement = libuser32.NewProc("GetWindowPlacement")1986getWindowRect = libuser32.NewProc("GetWindowRect")1987getWindowThreadProcessId = libuser32.NewProc("GetWindowThreadProcessId")1988insertMenuItem = libuser32.NewProc("InsertMenuItemW")1989invalidateRect = libuser32.NewProc("InvalidateRect")1990isChild = libuser32.NewProc("IsChild")1991isClipboardFormatAvailable = libuser32.NewProc("IsClipboardFormatAvailable")1992isDialogMessage = libuser32.NewProc("IsDialogMessageW")1993isIconic = libuser32.NewProc("IsIconic")1994isWindowEnabled = libuser32.NewProc("IsWindowEnabled")1995isWindowVisible = libuser32.NewProc("IsWindowVisible")1996isZoomed = libuser32.NewProc("IsZoomed")1997killTimer = libuser32.NewProc("KillTimer")1998loadCursor = libuser32.NewProc("LoadCursorW")1999loadIcon = libuser32.NewProc("LoadIconW")2000loadImage = libuser32.NewProc("LoadImageW")2001loadMenu = libuser32.NewProc("LoadMenuW")2002loadString = libuser32.NewProc("LoadStringW")2003messageBeep = libuser32.NewProc("MessageBeep")2004messageBox = libuser32.NewProc("MessageBoxW")2005monitorFromWindow = libuser32.NewProc("MonitorFromWindow")2006moveWindow = libuser32.NewProc("MoveWindow")2007notifyWinEvent = libuser32.NewProc("NotifyWinEvent")2008unregisterClass = libuser32.NewProc("UnregisterClassW")2009openClipboard = libuser32.NewProc("OpenClipboard")2010peekMessage = libuser32.NewProc("PeekMessageW")2011postMessage = libuser32.NewProc("PostMessageW")2012postQuitMessage = libuser32.NewProc("PostQuitMessage")2013redrawWindow = libuser32.NewProc("RedrawWindow")2014registerClassEx = libuser32.NewProc("RegisterClassExW")2015registerRawInputDevices = libuser32.NewProc("RegisterRawInputDevices")2016registerWindowMessage = libuser32.NewProc("RegisterWindowMessageW")2017releaseCapture = libuser32.NewProc("ReleaseCapture")2018releaseDC = libuser32.NewProc("ReleaseDC")2019removeMenu = libuser32.NewProc("RemoveMenu")2020screenToClient = libuser32.NewProc("ScreenToClient")2021sendDlgItemMessage = libuser32.NewProc("SendDlgItemMessageW")2022sendInput = libuser32.NewProc("SendInput")2023sendMessage = libuser32.NewProc("SendMessageW")2024setActiveWindow = libuser32.NewProc("SetActiveWindow")2025setCapture = libuser32.NewProc("SetCapture")2026setClipboardData = libuser32.NewProc("SetClipboardData")2027setCursor = libuser32.NewProc("SetCursor")2028setCursorPos = libuser32.NewProc("SetCursorPos")2029setFocus = libuser32.NewProc("SetFocus")2030setForegroundWindow = libuser32.NewProc("SetForegroundWindow")2031setMenu = libuser32.NewProc("SetMenu")2032setMenuDefaultItem = libuser32.NewProc("SetMenuDefaultItem")2033setMenuInfo = libuser32.NewProc("SetMenuInfo")2034setMenuItemBitmaps = libuser32.NewProc("SetMenuItemBitmaps")2035setMenuItemInfo = libuser32.NewProc("SetMenuItemInfoW")2036setRect = libuser32.NewProc("SetRect")2037setParent = libuser32.NewProc("SetParent")2038setScrollInfo = libuser32.NewProc("SetScrollInfo")2039setTimer = libuser32.NewProc("SetTimer")2040setWinEventHook = libuser32.NewProc("SetWinEventHook")2041setWindowLong = libuser32.NewProc("SetWindowLongW")2042// On 32 bit SetWindowLongPtrW is not available2043if is64bit {2044setWindowLongPtr = libuser32.NewProc("SetWindowLongPtrW")2045} else {2046setWindowLongPtr = libuser32.NewProc("SetWindowLongW")2047}2048setWindowPlacement = libuser32.NewProc("SetWindowPlacement")2049setWindowPos = libuser32.NewProc("SetWindowPos")2050showWindow = libuser32.NewProc("ShowWindow")2051systemParametersInfo = libuser32.NewProc("SystemParametersInfoW")2052trackMouseEvent = libuser32.NewProc("TrackMouseEvent")2053trackPopupMenu = libuser32.NewProc("TrackPopupMenu")2054trackPopupMenuEx = libuser32.NewProc("TrackPopupMenuEx")2055translateMessage = libuser32.NewProc("TranslateMessage")2056unhookWinEvent = libuser32.NewProc("UnhookWinEvent")2057updateWindow = libuser32.NewProc("UpdateWindow")2058windowFromDC = libuser32.NewProc("WindowFromDC")2059windowFromPoint = libuser32.NewProc("WindowFromPoint")2060}
2061
2062func AddClipboardFormatListener(hwnd HWND) bool {2063if addClipboardFormatListener.Find() != nil {2064return false2065}2066
2067ret, _, _ := syscall.Syscall(addClipboardFormatListener.Addr(), 1,2068uintptr(hwnd),20690,20700)2071
2072return ret != 02073}
2074
2075func AdjustWindowRect(lpRect *RECT, dwStyle uint32, bMenu bool) bool {2076ret, _, _ := syscall.Syscall(adjustWindowRect.Addr(), 3,2077uintptr(unsafe.Pointer(lpRect)),2078uintptr(dwStyle),2079uintptr(BoolToBOOL(bMenu)))2080
2081return ret != 02082}
2083
2084func AttachThreadInput(idAttach int32, idAttachTo int32, fAttach bool) bool {2085ret, _, _ := syscall.Syscall(attachThreadInput.Addr(), 3,2086uintptr(idAttach),2087uintptr(idAttachTo),2088uintptr(BoolToBOOL(fAttach)))2089
2090return ret != 02091}
2092
2093func AnimateWindow(hwnd HWND, dwTime, dwFlags uint32) bool {2094ret, _, _ := syscall.Syscall(animateWindow.Addr(), 3,2095uintptr(hwnd),2096uintptr(dwTime),2097uintptr(dwFlags))2098
2099return ret != 02100}
2101
2102func BeginDeferWindowPos(nNumWindows int32) HDWP {2103ret, _, _ := syscall.Syscall(beginDeferWindowPos.Addr(), 1,2104uintptr(nNumWindows),21050,21060)2107
2108return HDWP(ret)2109}
2110
2111func GetWindowThreadProcessId(hwnd HWND, processId *uint32) uint32 {2112ret, _, _ := syscall.Syscall(getWindowThreadProcessId.Addr(), 2,2113uintptr(hwnd),2114uintptr(unsafe.Pointer(processId)),21150)2116
2117return uint32(ret)2118}
2119
2120func BeginPaint(hwnd HWND, lpPaint *PAINTSTRUCT) HDC {2121ret, _, _ := syscall.Syscall(beginPaint.Addr(), 2,2122uintptr(hwnd),2123uintptr(unsafe.Pointer(lpPaint)),21240)2125
2126return HDC(ret)2127}
2128
2129func BringWindowToTop(hwnd HWND) bool {2130ret, _, _ := syscall.Syscall(bringWindowToTop.Addr(), 1,2131uintptr(hwnd),21320,21330)2134return ret != 02135}
2136
2137func CallWindowProc(lpPrevWndFunc uintptr, hWnd HWND, Msg uint32, wParam, lParam uintptr) uintptr {2138ret, _, _ := syscall.Syscall6(callWindowProc.Addr(), 5,2139lpPrevWndFunc,2140uintptr(hWnd),2141uintptr(Msg),2142wParam,2143lParam,21440)2145
2146return ret2147}
2148
2149func ChangeWindowMessageFilterEx(hwnd HWND, msg uint32, action uint32, changeFilterStruct *CHANGEFILTERSTRUCT) bool {2150ret, _, _ := syscall.Syscall6(changeWindowMessageFilterEx.Addr(), 4,2151uintptr(hwnd),2152uintptr(msg),2153uintptr(action),2154uintptr(unsafe.Pointer(changeFilterStruct)),21550,21560)2157return ret != 02158}
2159
2160func CheckMenuRadioItem(hmenu HMENU, first, last, check, flags uint32) bool {2161ret, _, _ := syscall.Syscall6(checkMenuRadioItem.Addr(), 5,2162uintptr(hmenu),2163uintptr(first),2164uintptr(last),2165uintptr(check),2166uintptr(flags),21670)2168
2169return ret != 02170}
2171
2172func ClientToScreen(hwnd HWND, lpPoint *POINT) bool {2173ret, _, _ := syscall.Syscall(clientToScreen.Addr(), 2,2174uintptr(hwnd),2175uintptr(unsafe.Pointer(lpPoint)),21760)2177
2178return ret != 02179}
2180
2181func CloseClipboard() bool {2182ret, _, _ := syscall.Syscall(closeClipboard.Addr(), 0,21830,21840,21850)2186
2187return ret != 02188}
2189
2190func CreateDialogParam(instRes HINSTANCE, name *uint16, parent HWND,2191proc, param uintptr) HWND {2192ret, _, _ := syscall.Syscall6(createDialogParam.Addr(), 5,2193uintptr(instRes),2194uintptr(unsafe.Pointer(name)),2195uintptr(parent),2196proc,2197param,21980)2199
2200return HWND(ret)2201}
2202
2203func CreateIconIndirect(lpiconinfo *ICONINFO) HICON {2204ret, _, _ := syscall.Syscall(createIconIndirect.Addr(), 1,2205uintptr(unsafe.Pointer(lpiconinfo)),22060,22070)2208
2209return HICON(ret)2210}
2211
2212func CreateMenu() HMENU {2213ret, _, _ := syscall.Syscall(createMenu.Addr(), 0,22140,22150,22160)2217
2218return HMENU(ret)2219}
2220
2221func CreatePopupMenu() HMENU {2222ret, _, _ := syscall.Syscall(createPopupMenu.Addr(), 0,22230,22240,22250)2226
2227return HMENU(ret)2228}
2229
2230func CreateWindowEx(dwExStyle uint32, lpClassName, lpWindowName *uint16, dwStyle uint32, x, y, nWidth, nHeight int32, hWndParent HWND, hMenu HMENU, hInstance HINSTANCE, lpParam unsafe.Pointer) HWND {2231ret, _, _ := syscall.Syscall12(createWindowEx.Addr(), 12,2232uintptr(dwExStyle),2233uintptr(unsafe.Pointer(lpClassName)),2234uintptr(unsafe.Pointer(lpWindowName)),2235uintptr(dwStyle),2236uintptr(x),2237uintptr(y),2238uintptr(nWidth),2239uintptr(nHeight),2240uintptr(hWndParent),2241uintptr(hMenu),2242uintptr(hInstance),2243uintptr(lpParam))2244
2245return HWND(ret)2246}
2247
2248func DeferWindowPos(hWinPosInfo HDWP, hWnd, hWndInsertAfter HWND, x, y, cx, cy int32, uFlags uint32) HDWP {2249ret, _, _ := syscall.Syscall9(deferWindowPos.Addr(), 8,2250uintptr(hWinPosInfo),2251uintptr(hWnd),2252uintptr(hWndInsertAfter),2253uintptr(x),2254uintptr(y),2255uintptr(cx),2256uintptr(cy),2257uintptr(uFlags),22580)2259
2260return HDWP(ret)2261}
2262
2263func DefWindowProc(hWnd HWND, Msg uint32, wParam, lParam uintptr) uintptr {2264ret, _, _ := syscall.Syscall6(defWindowProc.Addr(), 4,2265uintptr(hWnd),2266uintptr(Msg),2267wParam,2268lParam,22690,22700)2271
2272return ret2273}
2274
2275func DeleteMenu(hMenu HMENU, uPosition uint32, uFlags uint32) bool {2276ret, _, _ := syscall.Syscall(deleteMenu.Addr(), 3,2277uintptr(hMenu),2278uintptr(uPosition),2279uintptr(uFlags))2280
2281return ret != 02282}
2283
2284func DestroyIcon(hIcon HICON) bool {2285ret, _, _ := syscall.Syscall(destroyIcon.Addr(), 1,2286uintptr(hIcon),22870,22880)2289
2290return ret != 02291}
2292
2293func DestroyMenu(hMenu HMENU) bool {2294ret, _, _ := syscall.Syscall(destroyMenu.Addr(), 1,2295uintptr(hMenu),22960,22970)2298
2299return ret != 02300}
2301
2302func DestroyWindow(hWnd HWND) bool {2303ret, _, _ := syscall.Syscall(destroyWindow.Addr(), 1,2304uintptr(hWnd),23050,23060)2307
2308return ret != 02309}
2310
2311func DialogBoxParam(instRes HINSTANCE, name *uint16, parent HWND, proc, param uintptr) int {2312ret, _, _ := syscall.Syscall6(dialogBoxParam.Addr(), 5,2313uintptr(instRes),2314uintptr(unsafe.Pointer(name)),2315uintptr(parent),2316proc,2317param,23180)2319
2320return int(ret)2321}
2322
2323func DispatchMessage(msg *MSG) uintptr {2324ret, _, _ := syscall.Syscall(dispatchMessage.Addr(), 1,2325uintptr(unsafe.Pointer(msg)),23260,23270)2328
2329return ret2330}
2331
2332func DrawFocusRect(hDC HDC, lprc *RECT) bool {2333ret, _, _ := syscall.Syscall(drawFocusRect.Addr(), 2,2334uintptr(hDC),2335uintptr(unsafe.Pointer(lprc)),23360)2337
2338return ret != 02339}
2340
2341func DrawIconEx(hdc HDC, xLeft, yTop int32, hIcon HICON, cxWidth, cyWidth int32, istepIfAniCur uint32, hbrFlickerFreeDraw HBRUSH, diFlags uint32) bool {2342ret, _, _ := syscall.Syscall9(drawIconEx.Addr(), 9,2343uintptr(hdc),2344uintptr(xLeft),2345uintptr(yTop),2346uintptr(hIcon),2347uintptr(cxWidth),2348uintptr(cyWidth),2349uintptr(istepIfAniCur),2350uintptr(hbrFlickerFreeDraw),2351uintptr(diFlags))2352
2353return ret != 02354}
2355
2356func DrawMenuBar(hWnd HWND) bool {2357ret, _, _ := syscall.Syscall(drawMenuBar.Addr(), 1,2358uintptr(hWnd),23590,23600)2361
2362return ret != 02363}
2364
2365func DrawTextEx(hdc HDC, lpchText *uint16, cchText int32, lprc *RECT, dwDTFormat uint32, lpDTParams *DRAWTEXTPARAMS) int32 {2366ret, _, _ := syscall.Syscall6(drawTextEx.Addr(), 6,2367uintptr(hdc),2368uintptr(unsafe.Pointer(lpchText)),2369uintptr(cchText),2370uintptr(unsafe.Pointer(lprc)),2371uintptr(dwDTFormat),2372uintptr(unsafe.Pointer(lpDTParams)))2373
2374return int32(ret)2375}
2376
2377func EmptyClipboard() bool {2378ret, _, _ := syscall.Syscall(emptyClipboard.Addr(), 0,23790,23800,23810)2382
2383return ret != 02384}
2385
2386func EnableMenuItem(hMenu HMENU, uIDEnableItem uint32, uEnable uint32) bool {2387ret, _, _ := syscall.Syscall(enableMenuItem.Addr(), 3,2388uintptr(hMenu),2389uintptr(uIDEnableItem),2390uintptr(uEnable))2391
2392return ret != 02393}
2394
2395func EnableWindow(hWnd HWND, bEnable bool) bool {2396ret, _, _ := syscall.Syscall(enableWindow.Addr(), 2,2397uintptr(hWnd),2398uintptr(BoolToBOOL(bEnable)),23990)2400
2401return ret != 02402}
2403
2404func EndDeferWindowPos(hWinPosInfo HDWP) bool {2405ret, _, _ := syscall.Syscall(endDeferWindowPos.Addr(), 1,2406uintptr(hWinPosInfo),24070,24080)2409
2410return ret != 02411}
2412
2413func EndDialog(hwnd HWND, result int) bool {2414ret, _, _ := syscall.Syscall(endDialog.Addr(), 2,2415uintptr(hwnd),2416uintptr(result),24170)2418
2419return ret != 02420}
2421
2422func EndPaint(hwnd HWND, lpPaint *PAINTSTRUCT) bool {2423ret, _, _ := syscall.Syscall(endPaint.Addr(), 2,2424uintptr(hwnd),2425uintptr(unsafe.Pointer(lpPaint)),24260)2427
2428return ret != 02429}
2430
2431func EnumChildWindows(hWndParent HWND, lpEnumFunc, lParam uintptr) bool {2432ret, _, _ := syscall.Syscall(enumChildWindows.Addr(), 3,2433uintptr(hWndParent),2434lpEnumFunc,2435lParam)2436
2437return ret != 02438}
2439
2440func FindWindow(lpClassName, lpWindowName *uint16) HWND {2441ret, _, _ := syscall.Syscall(findWindow.Addr(), 2,2442uintptr(unsafe.Pointer(lpClassName)),2443uintptr(unsafe.Pointer(lpWindowName)),24440)2445
2446return HWND(ret)2447}
2448
2449func GetActiveWindow() HWND {2450ret, _, _ := syscall.Syscall(getActiveWindow.Addr(), 0,24510,24520,24530)2454
2455return HWND(ret)2456}
2457
2458func GetAncestor(hWnd HWND, gaFlags uint32) HWND {2459ret, _, _ := syscall.Syscall(getAncestor.Addr(), 2,2460uintptr(hWnd),2461uintptr(gaFlags),24620)2463
2464return HWND(ret)2465}
2466
2467func GetCaretPos(lpPoint *POINT) bool {2468ret, _, _ := syscall.Syscall(getCaretPos.Addr(), 1,2469uintptr(unsafe.Pointer(lpPoint)),24700,24710)2472
2473return ret != 02474}
2475
2476func GetClassName(hWnd HWND, className *uint16, maxCount int) (int, error) {2477ret, _, e := syscall.Syscall(getClassName.Addr(), 3,2478uintptr(hWnd),2479uintptr(unsafe.Pointer(className)),2480uintptr(maxCount))2481if ret == 0 {2482return 0, e2483}2484return int(ret), nil2485}
2486
2487func GetClientRect(hWnd HWND, rect *RECT) bool {2488ret, _, _ := syscall.Syscall(getClientRect.Addr(), 2,2489uintptr(hWnd),2490uintptr(unsafe.Pointer(rect)),24910)2492
2493return ret != 02494}
2495
2496func GetClipboardData(uFormat uint32) HANDLE {2497ret, _, _ := syscall.Syscall(getClipboardData.Addr(), 1,2498uintptr(uFormat),24990,25000)2501
2502return HANDLE(ret)2503}
2504
2505func GetCursorPos(lpPoint *POINT) bool {2506ret, _, _ := syscall.Syscall(getCursorPos.Addr(), 1,2507uintptr(unsafe.Pointer(lpPoint)),25080,25090)2510
2511return ret != 02512}
2513
2514func GetDesktopWindow() HWND {2515ret, _, _ := syscall.Syscall(getDesktopWindow.Addr(), 0,25160,25170,25180)2519
2520return HWND(ret)2521}
2522
2523func GetDC(hWnd HWND) HDC {2524ret, _, _ := syscall.Syscall(getDC.Addr(), 1,2525uintptr(hWnd),25260,25270)2528
2529return HDC(ret)2530}
2531
2532func GetDlgItem(hDlg HWND, nIDDlgItem int32) HWND {2533ret, _, _ := syscall.Syscall(getDlgItem.Addr(), 2,2534uintptr(hDlg),2535uintptr(nIDDlgItem),25360)2537
2538return HWND(ret)2539}
2540
2541func GetDpiForWindow(hwnd HWND) uint32 {2542if getDpiForWindow.Find() != nil {2543hdc := GetDC(hwnd)2544defer ReleaseDC(hwnd, hdc)2545
2546return uint32(GetDeviceCaps(hdc, LOGPIXELSY))2547}2548
2549ret, _, _ := syscall.Syscall(getDpiForWindow.Addr(), 1,2550uintptr(hwnd),25510,25520)2553
2554return uint32(ret)2555}
2556
2557func GetFocus() HWND {2558ret, _, _ := syscall.Syscall(getFocus.Addr(), 0,25590,25600,25610)2562
2563return HWND(ret)2564}
2565
2566func GetForegroundWindow() HWND {2567ret, _, _ := syscall.Syscall(getForegroundWindow.Addr(), 0,25680,25690,25700)2571
2572return HWND(ret)2573}
2574
2575func GetIconInfo(hicon HICON, piconinfo *ICONINFO) bool {2576ret, _, _ := syscall.Syscall(getIconInfo.Addr(), 2,2577uintptr(hicon),2578uintptr(unsafe.Pointer(piconinfo)),25790)2580
2581return ret != 02582}
2583
2584func GetKeyState(nVirtKey int32) int16 {2585ret, _, _ := syscall.Syscall(getKeyState.Addr(), 1,2586uintptr(nVirtKey),25870,25880)2589
2590return int16(ret)2591}
2592
2593func GetMenuCheckMarkDimensions() int32 {2594ret, _, _ := syscall.Syscall(getMenuCheckMarkDimensions.Addr(), 0,25950,25960,25970)2598
2599return int32(ret)2600}
2601
2602func GetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {2603ret, _, _ := syscall.Syscall(getMenuInfo.Addr(), 2,2604uintptr(hmenu),2605uintptr(unsafe.Pointer(lpcmi)),26060)2607
2608return ret != 02609}
2610
2611func GetMenuItemCount(hMenu HMENU) int32 {2612ret, _, _ := syscall.Syscall(getMenuItemCount.Addr(), 1,2613uintptr(hMenu),26140,26150)2616
2617return int32(ret)2618}
2619
2620func GetMenuItemID(hMenu HMENU, nPos int32) uint32 {2621ret, _, _ := syscall.Syscall(getMenuItemID.Addr(), 2,2622uintptr(hMenu),2623uintptr(nPos),26240)2625
2626return uint32(ret)2627}
2628
2629func GetMenuItemInfo(hmenu HMENU, item uint32, fByPosition BOOL, lpmii *MENUITEMINFO) bool {2630ret, _, _ := syscall.Syscall6(getMenuItemInfo.Addr(), 4,2631uintptr(hmenu),2632uintptr(item),2633uintptr(fByPosition),2634uintptr(unsafe.Pointer(lpmii)),26350,26360)2637
2638return ret != 02639}
2640
2641func GetMessage(msg *MSG, hWnd HWND, msgFilterMin, msgFilterMax uint32) BOOL {2642ret, _, _ := syscall.Syscall6(getMessage.Addr(), 4,2643uintptr(unsafe.Pointer(msg)),2644uintptr(hWnd),2645uintptr(msgFilterMin),2646uintptr(msgFilterMax),26470,26480)2649
2650return BOOL(ret)2651}
2652
2653func GetMonitorInfo(hMonitor HMONITOR, lpmi *MONITORINFO) bool {2654ret, _, _ := syscall.Syscall(getMonitorInfo.Addr(), 2,2655uintptr(hMonitor),2656uintptr(unsafe.Pointer(lpmi)),26570)2658
2659return ret != 02660}
2661
2662func GetParent(hWnd HWND) HWND {2663ret, _, _ := syscall.Syscall(getParent.Addr(), 1,2664uintptr(hWnd),26650,26660)2667
2668return HWND(ret)2669}
2670
2671func GetRawInputData(hRawInput HRAWINPUT, uiCommand uint32, pData unsafe.Pointer, pcbSize *uint32, cBSizeHeader uint32) uint32 {2672ret, _, _ := syscall.Syscall6(getRawInputData.Addr(), 5,2673uintptr(hRawInput),2674uintptr(uiCommand),2675uintptr(pData),2676uintptr(unsafe.Pointer(pcbSize)),2677uintptr(cBSizeHeader),26780)2679
2680return uint32(ret)2681}
2682
2683func GetScrollInfo(hwnd HWND, fnBar int32, lpsi *SCROLLINFO) bool {2684ret, _, _ := syscall.Syscall(getScrollInfo.Addr(), 3,2685uintptr(hwnd),2686uintptr(fnBar),2687uintptr(unsafe.Pointer(lpsi)))2688
2689return ret != 02690}
2691
2692func GetSubMenu(hMenu HMENU, nPos int32) HMENU {2693ret, _, _ := syscall.Syscall(getSubMenu.Addr(), 2,2694uintptr(hMenu),2695uintptr(nPos),26960)2697
2698return HMENU(ret)2699}
2700
2701func GetSysColor(nIndex int) uint32 {2702ret, _, _ := syscall.Syscall(getSysColor.Addr(), 1,2703uintptr(nIndex),27040,27050)2706
2707return uint32(ret)2708}
2709
2710func GetSysColorBrush(nIndex int) HBRUSH {2711ret, _, _ := syscall.Syscall(getSysColorBrush.Addr(), 1,2712uintptr(nIndex),27130,27140)2715
2716return HBRUSH(ret)2717}
2718
2719func GetSystemMenu(hWnd HWND, revert bool) HMENU {2720ret, _, _ := syscall.Syscall(getSystemMenu.Addr(), 2,2721uintptr(hWnd),2722uintptr(BoolToBOOL(revert)),27230)2724return HMENU(ret)2725}
2726
2727func GetSystemMetrics(nIndex int32) int32 {2728ret, _, _ := syscall.Syscall(getSystemMetrics.Addr(), 1,2729uintptr(nIndex),27300,27310)2732
2733return int32(ret)2734}
2735
2736func GetSystemMetricsForDpi(nIndex int32, dpi uint32) int32 {2737if getSystemMetricsForDpi.Find() != nil {2738return GetSystemMetrics(nIndex)2739}2740
2741ret, _, _ := syscall.Syscall(getSystemMetricsForDpi.Addr(), 2,2742uintptr(nIndex),2743uintptr(dpi),27440)2745
2746return int32(ret)2747}
2748
2749func GetWindow(hWnd HWND, uCmd uint32) HWND {2750ret, _, _ := syscall.Syscall(getWindow.Addr(), 2,2751uintptr(hWnd),2752uintptr(uCmd),27530)2754
2755return HWND(ret)2756}
2757
2758func GetWindowLong(hWnd HWND, index int32) int32 {2759ret, _, _ := syscall.Syscall(getWindowLong.Addr(), 2,2760uintptr(hWnd),2761uintptr(index),27620)2763
2764return int32(ret)2765}
2766
2767func GetWindowLongPtr(hWnd HWND, index int32) uintptr {2768ret, _, _ := syscall.Syscall(getWindowLongPtr.Addr(), 2,2769uintptr(hWnd),2770uintptr(index),27710)2772
2773return ret2774}
2775
2776func GetWindowPlacement(hWnd HWND, lpwndpl *WINDOWPLACEMENT) bool {2777ret, _, _ := syscall.Syscall(getWindowPlacement.Addr(), 2,2778uintptr(hWnd),2779uintptr(unsafe.Pointer(lpwndpl)),27800)2781
2782return ret != 02783}
2784
2785func GetWindowRect(hWnd HWND, rect *RECT) bool {2786ret, _, _ := syscall.Syscall(getWindowRect.Addr(), 2,2787uintptr(hWnd),2788uintptr(unsafe.Pointer(rect)),27890)2790
2791return ret != 02792}
2793
2794func InsertMenuItem(hMenu HMENU, uItem uint32, fByPosition bool, lpmii *MENUITEMINFO) bool {2795ret, _, _ := syscall.Syscall6(insertMenuItem.Addr(), 4,2796uintptr(hMenu),2797uintptr(uItem),2798uintptr(BoolToBOOL(fByPosition)),2799uintptr(unsafe.Pointer(lpmii)),28000,28010)2802
2803return ret != 02804}
2805
2806func InvalidateRect(hWnd HWND, lpRect *RECT, bErase bool) bool {2807ret, _, _ := syscall.Syscall(invalidateRect.Addr(), 3,2808uintptr(hWnd),2809uintptr(unsafe.Pointer(lpRect)),2810uintptr(BoolToBOOL(bErase)))2811
2812return ret != 02813}
2814
2815func IsChild(hWndParent, hWnd HWND) bool {2816ret, _, _ := syscall.Syscall(isChild.Addr(), 2,2817uintptr(hWndParent),2818uintptr(hWnd),28190)2820
2821return ret != 02822}
2823
2824func IsClipboardFormatAvailable(format uint32) bool {2825ret, _, _ := syscall.Syscall(isClipboardFormatAvailable.Addr(), 1,2826uintptr(format),28270,28280)2829
2830return ret != 02831}
2832
2833func IsDialogMessage(hWnd HWND, msg *MSG) bool {2834ret, _, _ := syscall.Syscall(isDialogMessage.Addr(), 2,2835uintptr(hWnd),2836uintptr(unsafe.Pointer(msg)),28370)2838
2839return ret != 02840}
2841
2842func IsIconic(hWnd HWND) bool {2843ret, _, _ := syscall.Syscall(isIconic.Addr(), 1,2844uintptr(hWnd),28450,28460)2847
2848return ret != 02849}
2850
2851func IsWindowEnabled(hWnd HWND) bool {2852ret, _, _ := syscall.Syscall(isWindowEnabled.Addr(), 1,2853uintptr(hWnd),28540,28550)2856
2857return ret != 02858}
2859
2860func IsWindowVisible(hWnd HWND) bool {2861ret, _, _ := syscall.Syscall(isWindowVisible.Addr(), 1,2862uintptr(hWnd),28630,28640)2865
2866return ret != 02867}
2868
2869func IsZoomed(hWnd HWND) bool {2870ret, _, _ := syscall.Syscall(isZoomed.Addr(), 1,2871uintptr(hWnd),28720,28730)2874
2875return ret != 02876}
2877
2878func KillTimer(hWnd HWND, uIDEvent uintptr) bool {2879ret, _, _ := syscall.Syscall(killTimer.Addr(), 2,2880uintptr(hWnd),2881uIDEvent,28820)2883
2884return ret != 02885}
2886
2887func LoadCursor(hInstance HINSTANCE, lpCursorName *uint16) HCURSOR {2888ret, _, _ := syscall.Syscall(loadCursor.Addr(), 2,2889uintptr(hInstance),2890uintptr(unsafe.Pointer(lpCursorName)),28910)2892
2893return HCURSOR(ret)2894}
2895
2896func LoadIcon(hInstance HINSTANCE, lpIconName *uint16) HICON {2897ret, _, _ := syscall.Syscall(loadIcon.Addr(), 2,2898uintptr(hInstance),2899uintptr(unsafe.Pointer(lpIconName)),29000)2901
2902return HICON(ret)2903}
2904
2905func LoadImage(hinst HINSTANCE, lpszName *uint16, uType uint32, cxDesired, cyDesired int32, fuLoad uint32) HANDLE {2906ret, _, _ := syscall.Syscall6(loadImage.Addr(), 6,2907uintptr(hinst),2908uintptr(unsafe.Pointer(lpszName)),2909uintptr(uType),2910uintptr(cxDesired),2911uintptr(cyDesired),2912uintptr(fuLoad))2913
2914return HANDLE(ret)2915}
2916
2917func LoadMenu(hinst HINSTANCE, name *uint16) HMENU {2918ret, _, _ := syscall.Syscall(loadMenu.Addr(), 2,2919uintptr(hinst),2920uintptr(unsafe.Pointer(name)),29210)2922
2923return HMENU(ret)2924}
2925
2926func LoadString(instRes HINSTANCE, id uint32, buf *uint16, length int32) int32 {2927ret, _, _ := syscall.Syscall6(loadString.Addr(), 4,2928uintptr(instRes),2929uintptr(id),2930uintptr(unsafe.Pointer(buf)),2931uintptr(length),29320,29330)2934
2935return int32(ret)2936}
2937
2938// Plays a waveform sound. uType is the sound to be played. The sounds are set by the user through the Sound control panel application.
2939// The following values can be used as a sound:
2940//
2941// MB_ICONASTERISK (see MB_ICONINFORMATION)
2942// MB_ICONEXCLAMATION (see MB_ICONWARNING)
2943// MB_ICONERROR (The sound specified as the Windows Critical Stop sound)
2944// MB_ICONHAND (See MB_ICONERROR)
2945// MB_ICONINFORMATION (The sounds specified as the Windows Asterisk sound)
2946// MB_ICONQUESTION (The sound specified as the Windows Question sound)
2947// MB_ICONSTOP (See MB_ICONERROR)
2948// MB_ICONWARNING (The sounds specified as the Windows Exclamation sound)
2949// MB_OK (The sound specified as the Windows Default Beep sound)
2950//
2951// The function will return true if the function succeeds, false if otherwise.
2952func MessageBeep(uType uint32) bool {2953ret, _, _ := syscall.Syscall(messageBeep.Addr(), 2,2954uintptr(uType),29550,29560)2957
2958return ret != 02959}
2960
2961func MessageBox(hWnd HWND, lpText, lpCaption *uint16, uType uint32) int32 {2962ret, _, _ := syscall.Syscall6(messageBox.Addr(), 4,2963uintptr(hWnd),2964uintptr(unsafe.Pointer(lpText)),2965uintptr(unsafe.Pointer(lpCaption)),2966uintptr(uType),29670,29680)2969
2970return int32(ret)2971}
2972
2973func MonitorFromWindow(hwnd HWND, dwFlags uint32) HMONITOR {2974ret, _, _ := syscall.Syscall(monitorFromWindow.Addr(), 2,2975uintptr(hwnd),2976uintptr(dwFlags),29770)2978
2979return HMONITOR(ret)2980}
2981
2982func MoveWindow(hWnd HWND, x, y, width, height int32, repaint bool) bool {2983ret, _, _ := syscall.Syscall6(moveWindow.Addr(), 6,2984uintptr(hWnd),2985uintptr(x),2986uintptr(y),2987uintptr(width),2988uintptr(height),2989uintptr(BoolToBOOL(repaint)))2990
2991return ret != 02992}
2993
2994func NotifyWinEvent(event uint32, hwnd HWND, idObject, idChild int32) {2995syscall.Syscall6(notifyWinEvent.Addr(), 4,2996uintptr(event),2997uintptr(hwnd),2998uintptr(idObject),2999uintptr(idChild),30000,30010)3002}
3003
3004func UnregisterClass(name *uint16) bool {3005ret, _, _ := syscall.Syscall(unregisterClass.Addr(), 1,3006uintptr(unsafe.Pointer(name)),30070,30080)3009
3010return ret != 03011}
3012
3013func OpenClipboard(hWndNewOwner HWND) bool {3014ret, _, _ := syscall.Syscall(openClipboard.Addr(), 1,3015uintptr(hWndNewOwner),30160,30170)3018
3019return ret != 03020}
3021
3022func PeekMessage(lpMsg *MSG, hWnd HWND, wMsgFilterMin, wMsgFilterMax, wRemoveMsg uint32) bool {3023ret, _, _ := syscall.Syscall6(peekMessage.Addr(), 5,3024uintptr(unsafe.Pointer(lpMsg)),3025uintptr(hWnd),3026uintptr(wMsgFilterMin),3027uintptr(wMsgFilterMax),3028uintptr(wRemoveMsg),30290)3030
3031return ret != 03032}
3033
3034func PostMessage(hWnd HWND, msg uint32, wParam, lParam uintptr) uintptr {3035ret, _, _ := syscall.Syscall6(postMessage.Addr(), 4,3036uintptr(hWnd),3037uintptr(msg),3038wParam,3039lParam,30400,30410)3042
3043return ret3044}
3045
3046func PostQuitMessage(exitCode int32) {3047syscall.Syscall(postQuitMessage.Addr(), 1,3048uintptr(exitCode),30490,30500)3051}
3052
3053const (3054// RedrawWindow() flags3055RDW_INVALIDATE = 0x00013056RDW_INTERNALPAINT = 0x00023057RDW_ERASE = 0x00043058
3059RDW_VALIDATE = 0x00083060RDW_NOINTERNALPAINT = 0x00103061RDW_NOERASE = 0x00203062
3063RDW_NOCHILDREN = 0x00403064RDW_ALLCHILDREN = 0x00803065
3066RDW_UPDATENOW = 0x01003067RDW_ERASENOW = 0x02003068
3069RDW_FRAME = 0x04003070RDW_NOFRAME = 0x08003071)
3072
3073func RedrawWindow(hWnd HWND, lprcUpdate *RECT, hrgnUpdate HRGN, flags uint32) bool {3074ret, _, _ := syscall.Syscall6(redrawWindow.Addr(), 4,3075uintptr(hWnd),3076uintptr(unsafe.Pointer(lprcUpdate)),3077uintptr(hrgnUpdate),3078uintptr(flags),30790,30800)3081
3082return ret != 03083}
3084
3085func RegisterClassEx(windowClass *WNDCLASSEX) ATOM {3086ret, _, _ := syscall.Syscall(registerClassEx.Addr(), 1,3087uintptr(unsafe.Pointer(windowClass)),30880,30890)3090
3091return ATOM(ret)3092}
3093
3094func RegisterRawInputDevices(pRawInputDevices *RAWINPUTDEVICE, uiNumDevices uint32, cbSize uint32) bool {3095ret, _, _ := syscall.Syscall(registerRawInputDevices.Addr(), 3,3096uintptr(unsafe.Pointer(pRawInputDevices)),3097uintptr(uiNumDevices),3098uintptr(cbSize))3099
3100return ret != 03101}
3102
3103func RegisterWindowMessage(lpString *uint16) uint32 {3104ret, _, _ := syscall.Syscall(registerWindowMessage.Addr(), 1,3105uintptr(unsafe.Pointer(lpString)),31060,31070)3108
3109return uint32(ret)3110}
3111
3112func ReleaseCapture() bool {3113ret, _, _ := syscall.Syscall(releaseCapture.Addr(), 0,31140,31150,31160)3117
3118return ret != 03119}
3120
3121func ReleaseDC(hWnd HWND, hDC HDC) bool {3122ret, _, _ := syscall.Syscall(releaseDC.Addr(), 2,3123uintptr(hWnd),3124uintptr(hDC),31250)3126
3127return ret != 03128}
3129
3130func RemoveMenu(hMenu HMENU, uPosition, uFlags uint32) bool {3131ret, _, _ := syscall.Syscall(removeMenu.Addr(), 3,3132uintptr(hMenu),3133uintptr(uPosition),3134uintptr(uFlags))3135
3136return ret != 03137}
3138
3139func ScreenToClient(hWnd HWND, point *POINT) bool {3140ret, _, _ := syscall.Syscall(screenToClient.Addr(), 2,3141uintptr(hWnd),3142uintptr(unsafe.Pointer(point)),31430)3144
3145return ret != 03146}
3147
3148func SendDlgItemMessage(hWnd HWND, id int32, msg uint32, wParam, lParam uintptr) uintptr {3149ret, _, _ := syscall.Syscall6(sendDlgItemMessage.Addr(), 5,3150uintptr(hWnd),3151uintptr(id),3152uintptr(msg),3153wParam,3154lParam,31550)3156
3157return ret3158}
3159
3160// pInputs expects a unsafe.Pointer to a slice of MOUSE_INPUT or KEYBD_INPUT or HARDWARE_INPUT structs.
3161func SendInput(nInputs uint32, pInputs unsafe.Pointer, cbSize int32) uint32 {3162ret, _, _ := syscall.Syscall(sendInput.Addr(), 3,3163uintptr(nInputs),3164uintptr(pInputs),3165uintptr(cbSize))3166
3167return uint32(ret)3168}
3169
3170func SendMessage(hWnd HWND, msg uint32, wParam, lParam uintptr) uintptr {3171ret, _, _ := syscall.Syscall6(sendMessage.Addr(), 4,3172uintptr(hWnd),3173uintptr(msg),3174wParam,3175lParam,31760,31770)3178
3179return ret3180}
3181
3182func SetActiveWindow(hWnd HWND) HWND {3183ret, _, _ := syscall.Syscall(setActiveWindow.Addr(), 1,3184uintptr(hWnd),31850,31860)3187
3188return HWND(ret)3189}
3190
3191func SetCapture(hWnd HWND) HWND {3192ret, _, _ := syscall.Syscall(setCapture.Addr(), 1,3193uintptr(hWnd),31940,31950)3196
3197return HWND(ret)3198}
3199
3200func SetClipboardData(uFormat uint32, hMem HANDLE) HANDLE {3201ret, _, _ := syscall.Syscall(setClipboardData.Addr(), 2,3202uintptr(uFormat),3203uintptr(hMem),32040)3205
3206return HANDLE(ret)3207}
3208
3209func SetCursor(hCursor HCURSOR) HCURSOR {3210ret, _, _ := syscall.Syscall(setCursor.Addr(), 1,3211uintptr(hCursor),32120,32130)3214
3215return HCURSOR(ret)3216}
3217
3218func SetCursorPos(X, Y int32) bool {3219ret, _, _ := syscall.Syscall(setCursorPos.Addr(), 2,3220uintptr(X),3221uintptr(Y),32220)3223
3224return ret != 03225}
3226
3227func SetFocus(hWnd HWND) HWND {3228ret, _, _ := syscall.Syscall(setFocus.Addr(), 1,3229uintptr(hWnd),32300,32310)3232
3233return HWND(ret)3234}
3235
3236func SetForegroundWindow(hWnd HWND) bool {3237ret, _, _ := syscall.Syscall(setForegroundWindow.Addr(), 1,3238uintptr(hWnd),32390,32400)3241
3242return ret != 03243}
3244
3245func SetMenu(hWnd HWND, hMenu HMENU) bool {3246ret, _, _ := syscall.Syscall(setMenu.Addr(), 2,3247uintptr(hWnd),3248uintptr(hMenu),32490)3250
3251return ret != 03252}
3253
3254func SetMenuDefaultItem(hMenu HMENU, uItem uint32, fByPosition bool) bool {3255ret, _, _ := syscall.Syscall(setMenuDefaultItem.Addr(), 3,3256uintptr(hMenu),3257uintptr(uItem),3258uintptr(BoolToBOOL(fByPosition)))3259
3260return ret != 03261}
3262
3263func SetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {3264ret, _, _ := syscall.Syscall(setMenuInfo.Addr(), 2,3265uintptr(hmenu),3266uintptr(unsafe.Pointer(lpcmi)),32670)3268
3269return ret != 03270}
3271
3272func SetMenuItemBitmaps(hMenu HMENU, uPosition uint32, uFlags uint32, hBitmapUnchecked HBITMAP, hBitmapChecked HBITMAP) bool {3273ret, _, _ := syscall.Syscall6(setMenuItemBitmaps.Addr(), 5,3274uintptr(hMenu),3275uintptr(uPosition),3276uintptr(uFlags),3277uintptr(hBitmapUnchecked),3278uintptr(hBitmapChecked),32790)3280
3281return ret != 03282}
3283
3284func SetMenuItemInfo(hMenu HMENU, uItem uint32, fByPosition bool, lpmii *MENUITEMINFO) bool {3285ret, _, _ := syscall.Syscall6(setMenuItemInfo.Addr(), 4,3286uintptr(hMenu),3287uintptr(uItem),3288uintptr(BoolToBOOL(fByPosition)),3289uintptr(unsafe.Pointer(lpmii)),32900,32910)3292
3293return ret != 03294}
3295
3296func SetParent(hWnd HWND, parentHWnd HWND) HWND {3297ret, _, _ := syscall.Syscall(setParent.Addr(), 2,3298uintptr(hWnd),3299uintptr(parentHWnd),33000)3301
3302return HWND(ret)3303}
3304
3305func SetRect(lprc *RECT, xLeft, yTop, xRight, yBottom uint32) BOOL {3306ret, _, _ := syscall.Syscall6(setRect.Addr(), 5,3307uintptr(unsafe.Pointer(lprc)),3308uintptr(xLeft),3309uintptr(yTop),3310uintptr(xRight),3311uintptr(yBottom),33120)3313
3314return BOOL(ret)3315}
3316
3317func SetScrollInfo(hwnd HWND, fnBar int32, lpsi *SCROLLINFO, fRedraw bool) int32 {3318ret, _, _ := syscall.Syscall6(setScrollInfo.Addr(), 4,3319uintptr(hwnd),3320uintptr(fnBar),3321uintptr(unsafe.Pointer(lpsi)),3322uintptr(BoolToBOOL(fRedraw)),33230,33240)3325
3326return int32(ret)3327}
3328
3329func SetTimer(hWnd HWND, nIDEvent uintptr, uElapse uint32, lpTimerFunc uintptr) uintptr {3330ret, _, _ := syscall.Syscall6(setTimer.Addr(), 4,3331uintptr(hWnd),3332nIDEvent,3333uintptr(uElapse),3334lpTimerFunc,33350,33360)3337
3338return ret3339}
3340
3341type WINEVENTPROC func(hWinEventHook HWINEVENTHOOK, event uint32, hwnd HWND, idObject int32, idChild int32, idEventThread uint32, dwmsEventTime uint32) uintptr3342
3343func SetWinEventHook(eventMin uint32, eventMax uint32, hmodWinEventProc HMODULE, callbackFunction WINEVENTPROC, idProcess uint32, idThread uint32, dwFlags uint32) (HWINEVENTHOOK, error) {3344ret, _, err := syscall.Syscall9(setWinEventHook.Addr(), 7,3345uintptr(eventMin),3346uintptr(eventMax),3347uintptr(hmodWinEventProc),3348windows.NewCallback(callbackFunction),3349uintptr(idProcess),3350uintptr(idThread),3351uintptr(dwFlags),33520, 0)3353
3354if ret == 0 {3355return 0, err3356}3357
3358return HWINEVENTHOOK(ret), nil3359}
3360
3361func SetWindowLong(hWnd HWND, index, value int32) int32 {3362ret, _, _ := syscall.Syscall(setWindowLong.Addr(), 3,3363uintptr(hWnd),3364uintptr(index),3365uintptr(value))3366
3367return int32(ret)3368}
3369
3370func SetWindowLongPtr(hWnd HWND, index int, value uintptr) uintptr {3371ret, _, _ := syscall.Syscall(setWindowLongPtr.Addr(), 3,3372uintptr(hWnd),3373uintptr(index),3374value)3375
3376return ret3377}
3378
3379func SetWindowPlacement(hWnd HWND, lpwndpl *WINDOWPLACEMENT) bool {3380ret, _, _ := syscall.Syscall(setWindowPlacement.Addr(), 2,3381uintptr(hWnd),3382uintptr(unsafe.Pointer(lpwndpl)),33830)3384
3385return ret != 03386}
3387
3388func SetWindowPos(hWnd, hWndInsertAfter HWND, x, y, width, height int32, flags uint32) bool {3389ret, _, _ := syscall.Syscall9(setWindowPos.Addr(), 7,3390uintptr(hWnd),3391uintptr(hWndInsertAfter),3392uintptr(x),3393uintptr(y),3394uintptr(width),3395uintptr(height),3396uintptr(flags),33970,33980)3399
3400return ret != 03401}
3402
3403func ShowWindow(hWnd HWND, nCmdShow int32) bool {3404ret, _, _ := syscall.Syscall(showWindow.Addr(), 2,3405uintptr(hWnd),3406uintptr(nCmdShow),34070)3408
3409return ret != 03410}
3411
3412func SystemParametersInfo(uiAction, uiParam uint32, pvParam unsafe.Pointer, fWinIni uint32) bool {3413ret, _, _ := syscall.Syscall6(systemParametersInfo.Addr(), 4,3414uintptr(uiAction),3415uintptr(uiParam),3416uintptr(pvParam),3417uintptr(fWinIni),34180,34190)3420
3421return ret != 03422}
3423
3424func TrackMouseEvent(lpEventTrack *TRACKMOUSEEVENT) bool {3425ret, _, _ := syscall.Syscall(trackMouseEvent.Addr(), 1,3426uintptr(unsafe.Pointer(lpEventTrack)),34270,34280)3429
3430return ret != 03431}
3432
3433func TrackPopupMenu(hMenu HMENU, uFlags uint32, x, y int32, nReserved int32, hWnd HWND, prcRect *RECT) uint32 {3434ret, _, _ := syscall.Syscall9(trackPopupMenu.Addr(), 7,3435uintptr(hMenu),3436uintptr(uFlags),3437uintptr(x),3438uintptr(y),3439uintptr(nReserved),3440uintptr(hWnd),3441uintptr(unsafe.Pointer(prcRect)),34420,34430)3444
3445return uint32(ret)3446}
3447
3448func TrackPopupMenuEx(hMenu HMENU, fuFlags uint32, x, y int32, hWnd HWND, lptpm *TPMPARAMS) BOOL {3449ret, _, _ := syscall.Syscall6(trackPopupMenuEx.Addr(), 6,3450uintptr(hMenu),3451uintptr(fuFlags),3452uintptr(x),3453uintptr(y),3454uintptr(hWnd),3455uintptr(unsafe.Pointer(lptpm)))3456
3457return BOOL(ret)3458}
3459
3460func TranslateMessage(msg *MSG) bool {3461ret, _, _ := syscall.Syscall(translateMessage.Addr(), 1,3462uintptr(unsafe.Pointer(msg)),34630,34640)3465
3466return ret != 03467}
3468
3469func UnhookWinEvent(hWinHookEvent HWINEVENTHOOK) bool {3470ret, _, _ := syscall.Syscall(unhookWinEvent.Addr(), 1, uintptr(hWinHookEvent), 0, 0)3471return ret != 03472}
3473
3474func UpdateWindow(hwnd HWND) bool {3475ret, _, _ := syscall.Syscall(updateWindow.Addr(), 1,3476uintptr(hwnd),34770,34780)3479
3480return ret != 03481}
3482
3483func WindowFromDC(hDC HDC) HWND {3484ret, _, _ := syscall.Syscall(windowFromDC.Addr(), 1,3485uintptr(hDC),34860,34870)3488
3489return HWND(ret)3490}
3491
3492func WindowFromPoint(Point POINT) HWND {3493ret, _, _ := syscall.Syscall(windowFromPoint.Addr(), 2,3494uintptr(Point.X),3495uintptr(Point.Y),34960)3497
3498return HWND(ret)3499}
3500