go-tg-screenshot-bot

Форк
0
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

7
package win
8

9
import (
10
	"syscall"
11
	"unsafe"
12

13
	"golang.org/x/sys/windows"
14
)
15

16
const CW_USEDEFAULT = ^0x7fffffff
17

18
// MessageBox constants
19
const (
20
	MB_OK                   = 0x00000000
21
	MB_OKCANCEL             = 0x00000001
22
	MB_ABORTRETRYIGNORE     = 0x00000002
23
	MB_YESNOCANCEL          = 0x00000003
24
	MB_YESNO                = 0x00000004
25
	MB_RETRYCANCEL          = 0x00000005
26
	MB_CANCELTRYCONTINUE    = 0x00000006
27
	MB_ICONHAND             = 0x00000010
28
	MB_ICONQUESTION         = 0x00000020
29
	MB_ICONEXCLAMATION      = 0x00000030
30
	MB_ICONASTERISK         = 0x00000040
31
	MB_USERICON             = 0x00000080
32
	MB_ICONWARNING          = MB_ICONEXCLAMATION
33
	MB_ICONERROR            = MB_ICONHAND
34
	MB_ICONINFORMATION      = MB_ICONASTERISK
35
	MB_ICONSTOP             = MB_ICONHAND
36
	MB_DEFBUTTON1           = 0x00000000
37
	MB_DEFBUTTON2           = 0x00000100
38
	MB_DEFBUTTON3           = 0x00000200
39
	MB_DEFBUTTON4           = 0x00000300
40
	MB_APPLMODAL            = 0x00000000
41
	MB_SYSTEMMODAL          = 0x00001000
42
	MB_TASKMODAL            = 0x00002000
43
	MB_HELP                 = 0x00004000
44
	MB_SETFOREGROUND        = 0x00010000
45
	MB_DEFAULT_DESKTOP_ONLY = 0x00020000
46
	MB_TOPMOST              = 0x00040000
47
	MB_RIGHT                = 0x00080000
48
	MB_RTLREADING           = 0x00100000
49
	MB_SERVICE_NOTIFICATION = 0x00200000
50
)
51

52
// Dialog box command ids
53
const (
54
	IDOK       = 1
55
	IDCANCEL   = 2
56
	IDABORT    = 3
57
	IDRETRY    = 4
58
	IDIGNORE   = 5
59
	IDYES      = 6
60
	IDNO       = 7
61
	IDCLOSE    = 8
62
	IDHELP     = 9
63
	IDTRYAGAIN = 10
64
	IDCONTINUE = 11
65
	IDTIMEOUT  = 32000
66
)
67

68
// System commands
69
const (
70
	SC_SIZE         = 0xF000
71
	SC_MOVE         = 0xF010
72
	SC_MINIMIZE     = 0xF020
73
	SC_MAXIMIZE     = 0xF030
74
	SC_NEXTWINDOW   = 0xF040
75
	SC_PREVWINDOW   = 0xF050
76
	SC_CLOSE        = 0xF060
77
	SC_VSCROLL      = 0xF070
78
	SC_HSCROLL      = 0xF080
79
	SC_MOUSEMENU    = 0xF090
80
	SC_KEYMENU      = 0xF100
81
	SC_ARRANGE      = 0xF110
82
	SC_RESTORE      = 0xF120
83
	SC_TASKLIST     = 0xF130
84
	SC_SCREENSAVE   = 0xF140
85
	SC_HOTKEY       = 0xF150
86
	SC_DEFAULT      = 0xF160
87
	SC_MONITORPOWER = 0xF170
88
	SC_CONTEXTHELP  = 0xF180
89
	SC_SEPARATOR    = 0xF00F
90
)
91

92
// Static control styles
93
const (
94
	SS_BITMAP          = 14
95
	SS_BLACKFRAME      = 7
96
	SS_BLACKRECT       = 4
97
	SS_CENTER          = 1
98
	SS_CENTERIMAGE     = 512
99
	SS_EDITCONTROL     = 0x2000
100
	SS_ENHMETAFILE     = 15
101
	SS_ETCHEDFRAME     = 18
102
	SS_ETCHEDHORZ      = 16
103
	SS_ETCHEDVERT      = 17
104
	SS_GRAYFRAME       = 8
105
	SS_GRAYRECT        = 5
106
	SS_ICON            = 3
107
	SS_LEFT            = 0
108
	SS_LEFTNOWORDWRAP  = 0xc
109
	SS_NOPREFIX        = 128
110
	SS_NOTIFY          = 256
111
	SS_OWNERDRAW       = 0xd
112
	SS_REALSIZECONTROL = 0x040
113
	SS_REALSIZEIMAGE   = 0x800
114
	SS_RIGHT           = 2
115
	SS_RIGHTJUST       = 0x400
116
	SS_SIMPLE          = 11
117
	SS_SUNKEN          = 4096
118
	SS_WHITEFRAME      = 9
119
	SS_WHITERECT       = 6
120
	SS_USERITEM        = 10
121
	SS_TYPEMASK        = 0x0000001F
122
	SS_ENDELLIPSIS     = 0x00004000
123
	SS_PATHELLIPSIS    = 0x00008000
124
	SS_WORDELLIPSIS    = 0x0000C000
125
	SS_ELLIPSISMASK    = 0x0000C000
126
)
127

128
// Button message constants
129
const (
130
	BM_CLICK    = 245
131
	BM_GETCHECK = 240
132
	BM_GETIMAGE = 246
133
	BM_GETSTATE = 242
134
	BM_SETCHECK = 241
135
	BM_SETIMAGE = 247
136
	BM_SETSTATE = 243
137
	BM_SETSTYLE = 244
138
)
139

140
// Button notifications
141
const (
142
	BCN_DROPDOWN     = 0xfffffb20
143
	BN_CLICKED       = 0
144
	BN_PAINT         = 1
145
	BN_HILITE        = 2
146
	BN_PUSHED        = BN_HILITE
147
	BN_UNHILITE      = 3
148
	BN_UNPUSHED      = BN_UNHILITE
149
	BN_DISABLE       = 4
150
	BN_DOUBLECLICKED = 5
151
	BN_DBLCLK        = BN_DOUBLECLICKED
152
	BN_SETFOCUS      = 6
153
	BN_KILLFOCUS     = 7
154
)
155

156
const (
157
	IMAGE_BITMAP      = 0
158
	IMAGE_ICON        = 1
159
	IMAGE_CURSOR      = 2
160
	IMAGE_ENHMETAFILE = 3
161
)
162

163
const (
164
	LR_DEFAULTCOLOR     = 0
165
	LR_MONOCHROME       = 1
166
	LR_COLOR            = 2
167
	LR_COPYRETURNORG    = 4
168
	LR_COPYDELETEORG    = 8
169
	LR_LOADFROMFILE     = 16
170
	LR_LOADTRANSPARENT  = 32
171
	LR_LOADREALSIZE     = 128
172
	LR_DEFAULTSIZE      = 0x0040
173
	LR_VGACOLOR         = 0x0080
174
	LR_LOADMAP3DCOLORS  = 4096
175
	LR_CREATEDIBSECTION = 8192
176
	LR_COPYFROMRESOURCE = 0x4000
177
	LR_SHARED           = 32768
178
)
179

180
// Button style constants
181
const (
182
	BS_3STATE          = 5
183
	BS_AUTO3STATE      = 6
184
	BS_AUTOCHECKBOX    = 3
185
	BS_AUTORADIOBUTTON = 9
186
	BS_BITMAP          = 128
187
	BS_BOTTOM          = 0X800
188
	BS_CENTER          = 0X300
189
	BS_CHECKBOX        = 2
190
	BS_DEFPUSHBUTTON   = 1
191
	BS_GROUPBOX        = 7
192
	BS_ICON            = 64
193
	BS_LEFT            = 256
194
	BS_LEFTTEXT        = 32
195
	BS_MULTILINE       = 0X2000
196
	BS_NOTIFY          = 0X4000
197
	BS_OWNERDRAW       = 0XB
198
	BS_PUSHBUTTON      = 0
199
	BS_PUSHLIKE        = 4096
200
	BS_RADIOBUTTON     = 4
201
	BS_RIGHT           = 512
202
	BS_RIGHTBUTTON     = 32
203
	BS_SPLITBUTTON     = 0x0000000c
204
	BS_TEXT            = 0
205
	BS_TOP             = 0X400
206
	BS_USERBUTTON      = 8
207
	BS_VCENTER         = 0XC00
208
	BS_FLAT            = 0X8000
209
)
210

211
const (
212
	PM_NOREMOVE = 0x0000
213
	PM_REMOVE   = 0x0001
214
	PM_NOYIELD  = 0x0002
215
)
216

217
// Button state constants
218
const (
219
	BST_CHECKED       = 1
220
	BST_INDETERMINATE = 2
221
	BST_UNCHECKED     = 0
222
	BST_FOCUS         = 8
223
	BST_PUSHED        = 4
224
)
225

226
// Predefined brushes constants
227
const (
228
	COLOR_3DDKSHADOW              = 21
229
	COLOR_3DFACE                  = 15
230
	COLOR_3DHILIGHT               = 20
231
	COLOR_3DHIGHLIGHT             = 20
232
	COLOR_3DLIGHT                 = 22
233
	COLOR_BTNHILIGHT              = 20
234
	COLOR_3DSHADOW                = 16
235
	COLOR_ACTIVEBORDER            = 10
236
	COLOR_ACTIVECAPTION           = 2
237
	COLOR_APPWORKSPACE            = 12
238
	COLOR_BACKGROUND              = 1
239
	COLOR_DESKTOP                 = 1
240
	COLOR_BTNFACE                 = 15
241
	COLOR_BTNHIGHLIGHT            = 20
242
	COLOR_BTNSHADOW               = 16
243
	COLOR_BTNTEXT                 = 18
244
	COLOR_CAPTIONTEXT             = 9
245
	COLOR_GRAYTEXT                = 17
246
	COLOR_HIGHLIGHT               = 13
247
	COLOR_HIGHLIGHTTEXT           = 14
248
	COLOR_INACTIVEBORDER          = 11
249
	COLOR_INACTIVECAPTION         = 3
250
	COLOR_INACTIVECAPTIONTEXT     = 19
251
	COLOR_INFOBK                  = 24
252
	COLOR_INFOTEXT                = 23
253
	COLOR_MENU                    = 4
254
	COLOR_MENUTEXT                = 7
255
	COLOR_SCROLLBAR               = 0
256
	COLOR_WINDOW                  = 5
257
	COLOR_WINDOWFRAME             = 6
258
	COLOR_WINDOWTEXT              = 8
259
	COLOR_HOTLIGHT                = 26
260
	COLOR_GRADIENTACTIVECAPTION   = 27
261
	COLOR_GRADIENTINACTIVECAPTION = 28
262
)
263

264
// GetAncestor flags
265
const (
266
	GA_PARENT    = 1
267
	GA_ROOT      = 2
268
	GA_ROOTOWNER = 3
269
)
270

271
// GetWindowLong and GetWindowLongPtr constants
272
const (
273
	GWL_EXSTYLE     = -20
274
	GWL_STYLE       = -16
275
	GWL_WNDPROC     = -4
276
	GWLP_WNDPROC    = -4
277
	GWL_HINSTANCE   = -6
278
	GWLP_HINSTANCE  = -6
279
	GWL_HWNDPARENT  = -8
280
	GWLP_HWNDPARENT = -8
281
	GWL_ID          = -12
282
	GWLP_ID         = -12
283
	GWL_USERDATA    = -21
284
	GWLP_USERDATA   = -21
285
)
286

287
// Predefined window handles
288
const (
289
	HWND_BROADCAST = HWND(0xFFFF)
290
	HWND_BOTTOM    = HWND(1)
291
	HWND_NOTOPMOST = ^HWND(1) // -2
292
	HWND_TOP       = HWND(0)
293
	HWND_TOPMOST   = ^HWND(0) // -1
294
	HWND_DESKTOP   = HWND(0)
295
	HWND_MESSAGE   = ^HWND(2) // -3
296
)
297

298
// Predefined icon constants
299
const (
300
	IDI_APPLICATION = 32512
301
	IDI_HAND        = 32513
302
	IDI_QUESTION    = 32514
303
	IDI_EXCLAMATION = 32515
304
	IDI_ASTERISK    = 32516
305
	IDI_WINLOGO     = 32517
306
	IDI_SHIELD      = 32518
307
	IDI_WARNING     = IDI_EXCLAMATION
308
	IDI_ERROR       = IDI_HAND
309
	IDI_INFORMATION = IDI_ASTERISK
310
)
311

312
// Predefined cursor constants
313
const (
314
	IDC_ARROW       = 32512
315
	IDC_IBEAM       = 32513
316
	IDC_WAIT        = 32514
317
	IDC_CROSS       = 32515
318
	IDC_UPARROW     = 32516
319
	IDC_SIZENWSE    = 32642
320
	IDC_SIZENESW    = 32643
321
	IDC_SIZEWE      = 32644
322
	IDC_SIZENS      = 32645
323
	IDC_SIZEALL     = 32646
324
	IDC_NO          = 32648
325
	IDC_HAND        = 32649
326
	IDC_APPSTARTING = 32650
327
	IDC_HELP        = 32651
328
	IDC_ICON        = 32641
329
	IDC_SIZE        = 32640
330
)
331

332
// GetSystemMetrics constants
333
const (
334
	SM_CXSCREEN             = 0
335
	SM_CYSCREEN             = 1
336
	SM_CXVSCROLL            = 2
337
	SM_CYHSCROLL            = 3
338
	SM_CYCAPTION            = 4
339
	SM_CXBORDER             = 5
340
	SM_CYBORDER             = 6
341
	SM_CXDLGFRAME           = 7
342
	SM_CYDLGFRAME           = 8
343
	SM_CYVTHUMB             = 9
344
	SM_CXHTHUMB             = 10
345
	SM_CXICON               = 11
346
	SM_CYICON               = 12
347
	SM_CXCURSOR             = 13
348
	SM_CYCURSOR             = 14
349
	SM_CYMENU               = 15
350
	SM_CXFULLSCREEN         = 16
351
	SM_CYFULLSCREEN         = 17
352
	SM_CYKANJIWINDOW        = 18
353
	SM_MOUSEPRESENT         = 19
354
	SM_CYVSCROLL            = 20
355
	SM_CXHSCROLL            = 21
356
	SM_DEBUG                = 22
357
	SM_SWAPBUTTON           = 23
358
	SM_RESERVED1            = 24
359
	SM_RESERVED2            = 25
360
	SM_RESERVED3            = 26
361
	SM_RESERVED4            = 27
362
	SM_CXMIN                = 28
363
	SM_CYMIN                = 29
364
	SM_CXSIZE               = 30
365
	SM_CYSIZE               = 31
366
	SM_CXFRAME              = 32
367
	SM_CYFRAME              = 33
368
	SM_CXMINTRACK           = 34
369
	SM_CYMINTRACK           = 35
370
	SM_CXDOUBLECLK          = 36
371
	SM_CYDOUBLECLK          = 37
372
	SM_CXICONSPACING        = 38
373
	SM_CYICONSPACING        = 39
374
	SM_MENUDROPALIGNMENT    = 40
375
	SM_PENWINDOWS           = 41
376
	SM_DBCSENABLED          = 42
377
	SM_CMOUSEBUTTONS        = 43
378
	SM_CXFIXEDFRAME         = SM_CXDLGFRAME
379
	SM_CYFIXEDFRAME         = SM_CYDLGFRAME
380
	SM_CXSIZEFRAME          = SM_CXFRAME
381
	SM_CYSIZEFRAME          = SM_CYFRAME
382
	SM_SECURE               = 44
383
	SM_CXEDGE               = 45
384
	SM_CYEDGE               = 46
385
	SM_CXMINSPACING         = 47
386
	SM_CYMINSPACING         = 48
387
	SM_CXSMICON             = 49
388
	SM_CYSMICON             = 50
389
	SM_CYSMCAPTION          = 51
390
	SM_CXSMSIZE             = 52
391
	SM_CYSMSIZE             = 53
392
	SM_CXMENUSIZE           = 54
393
	SM_CYMENUSIZE           = 55
394
	SM_ARRANGE              = 56
395
	SM_CXMINIMIZED          = 57
396
	SM_CYMINIMIZED          = 58
397
	SM_CXMAXTRACK           = 59
398
	SM_CYMAXTRACK           = 60
399
	SM_CXMAXIMIZED          = 61
400
	SM_CYMAXIMIZED          = 62
401
	SM_NETWORK              = 63
402
	SM_CLEANBOOT            = 67
403
	SM_CXDRAG               = 68
404
	SM_CYDRAG               = 69
405
	SM_SHOWSOUNDS           = 70
406
	SM_CXMENUCHECK          = 71
407
	SM_CYMENUCHECK          = 72
408
	SM_SLOWMACHINE          = 73
409
	SM_MIDEASTENABLED       = 74
410
	SM_MOUSEWHEELPRESENT    = 75
411
	SM_XVIRTUALSCREEN       = 76
412
	SM_YVIRTUALSCREEN       = 77
413
	SM_CXVIRTUALSCREEN      = 78
414
	SM_CYVIRTUALSCREEN      = 79
415
	SM_CMONITORS            = 80
416
	SM_SAMEDISPLAYFORMAT    = 81
417
	SM_IMMENABLED           = 82
418
	SM_CXFOCUSBORDER        = 83
419
	SM_CYFOCUSBORDER        = 84
420
	SM_TABLETPC             = 86
421
	SM_MEDIACENTER          = 87
422
	SM_STARTER              = 88
423
	SM_SERVERR2             = 89
424
	SM_CMETRICS             = 91
425
	SM_REMOTESESSION        = 0x1000
426
	SM_SHUTTINGDOWN         = 0x2000
427
	SM_REMOTECONTROL        = 0x2001
428
	SM_CARETBLINKINGENABLED = 0x2002
429
)
430

431
// ShowWindow constants
432
const (
433
	SW_HIDE            = 0
434
	SW_NORMAL          = 1
435
	SW_SHOWNORMAL      = 1
436
	SW_SHOWMINIMIZED   = 2
437
	SW_MAXIMIZE        = 3
438
	SW_SHOWMAXIMIZED   = 3
439
	SW_SHOWNOACTIVATE  = 4
440
	SW_SHOW            = 5
441
	SW_MINIMIZE        = 6
442
	SW_SHOWMINNOACTIVE = 7
443
	SW_SHOWNA          = 8
444
	SW_RESTORE         = 9
445
	SW_SHOWDEFAULT     = 10
446
	SW_FORCEMINIMIZE   = 11
447
)
448

449
// SetWindowPos flags
450
const (
451
	SWP_DRAWFRAME      = 0x0020
452
	SWP_FRAMECHANGED   = 0x0020
453
	SWP_HIDEWINDOW     = 0x0080
454
	SWP_NOACTIVATE     = 0x0010
455
	SWP_NOCOPYBITS     = 0x0100
456
	SWP_NOMOVE         = 0x0002
457
	SWP_NOSIZE         = 0x0001
458
	SWP_NOREDRAW       = 0x0008
459
	SWP_NOZORDER       = 0x0004
460
	SWP_SHOWWINDOW     = 0x0040
461
	SWP_NOOWNERZORDER  = 0x0200
462
	SWP_NOREPOSITION   = SWP_NOOWNERZORDER
463
	SWP_NOSENDCHANGING = 0x0400
464
	SWP_DEFERERASE     = 0x2000
465
	SWP_ASYNCWINDOWPOS = 0x4000
466
)
467

468
// UI state constants
469
const (
470
	UIS_SET        = 1
471
	UIS_CLEAR      = 2
472
	UIS_INITIALIZE = 3
473
)
474

475
// UI state constants
476
const (
477
	UISF_HIDEFOCUS = 0x1
478
	UISF_HIDEACCEL = 0x2
479
	UISF_ACTIVE    = 0x4
480
)
481

482
// Virtual key codes
483
const (
484
	VK_LBUTTON             = 1
485
	VK_RBUTTON             = 2
486
	VK_CANCEL              = 3
487
	VK_MBUTTON             = 4
488
	VK_XBUTTON1            = 5
489
	VK_XBUTTON2            = 6
490
	VK_BACK                = 8
491
	VK_TAB                 = 9
492
	VK_CLEAR               = 12
493
	VK_RETURN              = 13
494
	VK_SHIFT               = 16
495
	VK_CONTROL             = 17
496
	VK_MENU                = 18
497
	VK_PAUSE               = 19
498
	VK_CAPITAL             = 20
499
	VK_KANA                = 0x15
500
	VK_HANGEUL             = 0x15
501
	VK_HANGUL              = 0x15
502
	VK_JUNJA               = 0x17
503
	VK_FINAL               = 0x18
504
	VK_HANJA               = 0x19
505
	VK_KANJI               = 0x19
506
	VK_ESCAPE              = 0x1B
507
	VK_CONVERT             = 0x1C
508
	VK_NONCONVERT          = 0x1D
509
	VK_ACCEPT              = 0x1E
510
	VK_MODECHANGE          = 0x1F
511
	VK_SPACE               = 32
512
	VK_PRIOR               = 33
513
	VK_NEXT                = 34
514
	VK_END                 = 35
515
	VK_HOME                = 36
516
	VK_LEFT                = 37
517
	VK_UP                  = 38
518
	VK_RIGHT               = 39
519
	VK_DOWN                = 40
520
	VK_SELECT              = 41
521
	VK_PRINT               = 42
522
	VK_EXECUTE             = 43
523
	VK_SNAPSHOT            = 44
524
	VK_INSERT              = 45
525
	VK_DELETE              = 46
526
	VK_HELP                = 47
527
	VK_LWIN                = 0x5B
528
	VK_RWIN                = 0x5C
529
	VK_APPS                = 0x5D
530
	VK_SLEEP               = 0x5F
531
	VK_NUMPAD0             = 0x60
532
	VK_NUMPAD1             = 0x61
533
	VK_NUMPAD2             = 0x62
534
	VK_NUMPAD3             = 0x63
535
	VK_NUMPAD4             = 0x64
536
	VK_NUMPAD5             = 0x65
537
	VK_NUMPAD6             = 0x66
538
	VK_NUMPAD7             = 0x67
539
	VK_NUMPAD8             = 0x68
540
	VK_NUMPAD9             = 0x69
541
	VK_MULTIPLY            = 0x6A
542
	VK_ADD                 = 0x6B
543
	VK_SEPARATOR           = 0x6C
544
	VK_SUBTRACT            = 0x6D
545
	VK_DECIMAL             = 0x6E
546
	VK_DIVIDE              = 0x6F
547
	VK_F1                  = 0x70
548
	VK_F2                  = 0x71
549
	VK_F3                  = 0x72
550
	VK_F4                  = 0x73
551
	VK_F5                  = 0x74
552
	VK_F6                  = 0x75
553
	VK_F7                  = 0x76
554
	VK_F8                  = 0x77
555
	VK_F9                  = 0x78
556
	VK_F10                 = 0x79
557
	VK_F11                 = 0x7A
558
	VK_F12                 = 0x7B
559
	VK_F13                 = 0x7C
560
	VK_F14                 = 0x7D
561
	VK_F15                 = 0x7E
562
	VK_F16                 = 0x7F
563
	VK_F17                 = 0x80
564
	VK_F18                 = 0x81
565
	VK_F19                 = 0x82
566
	VK_F20                 = 0x83
567
	VK_F21                 = 0x84
568
	VK_F22                 = 0x85
569
	VK_F23                 = 0x86
570
	VK_F24                 = 0x87
571
	VK_NUMLOCK             = 0x90
572
	VK_SCROLL              = 0x91
573
	VK_LSHIFT              = 0xA0
574
	VK_RSHIFT              = 0xA1
575
	VK_LCONTROL            = 0xA2
576
	VK_RCONTROL            = 0xA3
577
	VK_LMENU               = 0xA4
578
	VK_RMENU               = 0xA5
579
	VK_BROWSER_BACK        = 0xA6
580
	VK_BROWSER_FORWARD     = 0xA7
581
	VK_BROWSER_REFRESH     = 0xA8
582
	VK_BROWSER_STOP        = 0xA9
583
	VK_BROWSER_SEARCH      = 0xAA
584
	VK_BROWSER_FAVORITES   = 0xAB
585
	VK_BROWSER_HOME        = 0xAC
586
	VK_VOLUME_MUTE         = 0xAD
587
	VK_VOLUME_DOWN         = 0xAE
588
	VK_VOLUME_UP           = 0xAF
589
	VK_MEDIA_NEXT_TRACK    = 0xB0
590
	VK_MEDIA_PREV_TRACK    = 0xB1
591
	VK_MEDIA_STOP          = 0xB2
592
	VK_MEDIA_PLAY_PAUSE    = 0xB3
593
	VK_LAUNCH_MAIL         = 0xB4
594
	VK_LAUNCH_MEDIA_SELECT = 0xB5
595
	VK_LAUNCH_APP1         = 0xB6
596
	VK_LAUNCH_APP2         = 0xB7
597
	VK_OEM_1               = 0xBA
598
	VK_OEM_PLUS            = 0xBB
599
	VK_OEM_COMMA           = 0xBC
600
	VK_OEM_MINUS           = 0xBD
601
	VK_OEM_PERIOD          = 0xBE
602
	VK_OEM_2               = 0xBF
603
	VK_OEM_3               = 0xC0
604
	VK_OEM_4               = 0xDB
605
	VK_OEM_5               = 0xDC
606
	VK_OEM_6               = 0xDD
607
	VK_OEM_7               = 0xDE
608
	VK_OEM_8               = 0xDF
609
	VK_OEM_102             = 0xE2
610
	VK_PROCESSKEY          = 0xE5
611
	VK_PACKET              = 0xE7
612
	VK_ATTN                = 0xF6
613
	VK_CRSEL               = 0xF7
614
	VK_EXSEL               = 0xF8
615
	VK_EREOF               = 0xF9
616
	VK_PLAY                = 0xFA
617
	VK_ZOOM                = 0xFB
618
	VK_NONAME              = 0xFC
619
	VK_PA1                 = 0xFD
620
	VK_OEM_CLEAR           = 0xFE
621
)
622

623
// Window style constants
624
const (
625
	WS_OVERLAPPED       = 0X00000000
626
	WS_POPUP            = 0X80000000
627
	WS_CHILD            = 0X40000000
628
	WS_MINIMIZE         = 0X20000000
629
	WS_VISIBLE          = 0X10000000
630
	WS_DISABLED         = 0X08000000
631
	WS_CLIPSIBLINGS     = 0X04000000
632
	WS_CLIPCHILDREN     = 0X02000000
633
	WS_MAXIMIZE         = 0X01000000
634
	WS_CAPTION          = 0X00C00000
635
	WS_BORDER           = 0X00800000
636
	WS_DLGFRAME         = 0X00400000
637
	WS_VSCROLL          = 0X00200000
638
	WS_HSCROLL          = 0X00100000
639
	WS_SYSMENU          = 0X00080000
640
	WS_THICKFRAME       = 0X00040000
641
	WS_GROUP            = 0X00020000
642
	WS_TABSTOP          = 0X00010000
643
	WS_MINIMIZEBOX      = 0X00020000
644
	WS_MAXIMIZEBOX      = 0X00010000
645
	WS_TILED            = 0X00000000
646
	WS_ICONIC           = 0X20000000
647
	WS_SIZEBOX          = 0X00040000
648
	WS_OVERLAPPEDWINDOW = 0X00000000 | 0X00C00000 | 0X00080000 | 0X00040000 | 0X00020000 | 0X00010000
649
	WS_POPUPWINDOW      = 0X80000000 | 0X00800000 | 0X00080000
650
	WS_CHILDWINDOW      = 0X40000000
651
)
652

653
// Extended window style constants
654
const (
655
	WS_EX_DLGMODALFRAME    = 0X00000001
656
	WS_EX_NOPARENTNOTIFY   = 0X00000004
657
	WS_EX_TOPMOST          = 0X00000008
658
	WS_EX_ACCEPTFILES      = 0X00000010
659
	WS_EX_TRANSPARENT      = 0X00000020
660
	WS_EX_MDICHILD         = 0X00000040
661
	WS_EX_TOOLWINDOW       = 0X00000080
662
	WS_EX_WINDOWEDGE       = 0X00000100
663
	WS_EX_CLIENTEDGE       = 0X00000200
664
	WS_EX_CONTEXTHELP      = 0X00000400
665
	WS_EX_RIGHT            = 0X00001000
666
	WS_EX_LEFT             = 0X00000000
667
	WS_EX_RTLREADING       = 0X00002000
668
	WS_EX_LTRREADING       = 0X00000000
669
	WS_EX_LEFTSCROLLBAR    = 0X00004000
670
	WS_EX_RIGHTSCROLLBAR   = 0X00000000
671
	WS_EX_CONTROLPARENT    = 0X00010000
672
	WS_EX_STATICEDGE       = 0X00020000
673
	WS_EX_APPWINDOW        = 0X00040000
674
	WS_EX_OVERLAPPEDWINDOW = 0X00000100 | 0X00000200
675
	WS_EX_PALETTEWINDOW    = 0X00000100 | 0X00000080 | 0X00000008
676
	WS_EX_LAYERED          = 0X00080000
677
	WS_EX_NOINHERITLAYOUT  = 0X00100000
678
	WS_EX_LAYOUTRTL        = 0X00400000
679
	WS_EX_COMPOSITED       = 0X02000000
680
	WS_EX_NOACTIVATE       = 0X08000000
681
)
682

683
// Window message constants
684
const (
685
	WM_APP                    = 32768
686
	WM_ACTIVATE               = 6
687
	WM_ACTIVATEAPP            = 28
688
	WM_AFXFIRST               = 864
689
	WM_AFXLAST                = 895
690
	WM_ASKCBFORMATNAME        = 780
691
	WM_CANCELJOURNAL          = 75
692
	WM_CANCELMODE             = 31
693
	WM_CAPTURECHANGED         = 533
694
	WM_CHANGECBCHAIN          = 781
695
	WM_CHAR                   = 258
696
	WM_CHARTOITEM             = 47
697
	WM_CHILDACTIVATE          = 34
698
	WM_CLEAR                  = 771
699
	WM_CLOSE                  = 16
700
	WM_COMMAND                = 273
701
	WM_COMMNOTIFY             = 68 /* OBSOLETE */
702
	WM_COMPACTING             = 65
703
	WM_COMPAREITEM            = 57
704
	WM_CONTEXTMENU            = 123
705
	WM_COPY                   = 769
706
	WM_COPYDATA               = 74
707
	WM_CREATE                 = 1
708
	WM_CTLCOLORBTN            = 309
709
	WM_CTLCOLORDLG            = 310
710
	WM_CTLCOLOREDIT           = 307
711
	WM_CTLCOLORLISTBOX        = 308
712
	WM_CTLCOLORMSGBOX         = 306
713
	WM_CTLCOLORSCROLLBAR      = 311
714
	WM_CTLCOLORSTATIC         = 312
715
	WM_CUT                    = 768
716
	WM_DEADCHAR               = 259
717
	WM_DELETEITEM             = 45
718
	WM_DESTROY                = 2
719
	WM_DESTROYCLIPBOARD       = 775
720
	WM_DEVICECHANGE           = 537
721
	WM_DEVMODECHANGE          = 27
722
	WM_DISPLAYCHANGE          = 126
723
	WM_DPICHANGED             = 0x02E0
724
	WM_DRAWCLIPBOARD          = 776
725
	WM_DRAWITEM               = 43
726
	WM_DROPFILES              = 563
727
	WM_ENABLE                 = 10
728
	WM_ENDSESSION             = 22
729
	WM_ENTERIDLE              = 289
730
	WM_ENTERMENULOOP          = 529
731
	WM_ENTERSIZEMOVE          = 561
732
	WM_ERASEBKGND             = 20
733
	WM_EXITMENULOOP           = 530
734
	WM_EXITSIZEMOVE           = 562
735
	WM_FONTCHANGE             = 29
736
	WM_GETDLGCODE             = 135
737
	WM_GETFONT                = 49
738
	WM_GETHOTKEY              = 51
739
	WM_GETICON                = 127
740
	WM_GETMINMAXINFO          = 36
741
	WM_GETTEXT                = 13
742
	WM_GETTEXTLENGTH          = 14
743
	WM_HANDHELDFIRST          = 856
744
	WM_HANDHELDLAST           = 863
745
	WM_HELP                   = 83
746
	WM_HOTKEY                 = 786
747
	WM_HSCROLL                = 276
748
	WM_HSCROLLCLIPBOARD       = 782
749
	WM_ICONERASEBKGND         = 39
750
	WM_INITDIALOG             = 272
751
	WM_INITMENU               = 278
752
	WM_INITMENUPOPUP          = 279
753
	WM_INPUT                  = 0X00FF
754
	WM_INPUTLANGCHANGE        = 81
755
	WM_INPUTLANGCHANGEREQUEST = 80
756
	WM_KEYDOWN                = 256
757
	WM_KEYUP                  = 257
758
	WM_KILLFOCUS              = 8
759
	WM_MDIACTIVATE            = 546
760
	WM_MDICASCADE             = 551
761
	WM_MDICREATE              = 544
762
	WM_MDIDESTROY             = 545
763
	WM_MDIGETACTIVE           = 553
764
	WM_MDIICONARRANGE         = 552
765
	WM_MDIMAXIMIZE            = 549
766
	WM_MDINEXT                = 548
767
	WM_MDIREFRESHMENU         = 564
768
	WM_MDIRESTORE             = 547
769
	WM_MDISETMENU             = 560
770
	WM_MDITILE                = 550
771
	WM_MEASUREITEM            = 44
772
	WM_GETOBJECT              = 0X003D
773
	WM_CHANGEUISTATE          = 0X0127
774
	WM_UPDATEUISTATE          = 0X0128
775
	WM_QUERYUISTATE           = 0X0129
776
	WM_UNINITMENUPOPUP        = 0X0125
777
	WM_MENURBUTTONUP          = 290
778
	WM_MENUCOMMAND            = 0X0126
779
	WM_MENUGETOBJECT          = 0X0124
780
	WM_MENUDRAG               = 0X0123
781
	WM_APPCOMMAND             = 0X0319
782
	WM_MENUCHAR               = 288
783
	WM_MENUSELECT             = 287
784
	WM_MOVE                   = 3
785
	WM_MOVING                 = 534
786
	WM_NCACTIVATE             = 134
787
	WM_NCCALCSIZE             = 131
788
	WM_NCCREATE               = 129
789
	WM_NCDESTROY              = 130
790
	WM_NCHITTEST              = 132
791
	WM_NCLBUTTONDBLCLK        = 163
792
	WM_NCLBUTTONDOWN          = 161
793
	WM_NCLBUTTONUP            = 162
794
	WM_NCMBUTTONDBLCLK        = 169
795
	WM_NCMBUTTONDOWN          = 167
796
	WM_NCMBUTTONUP            = 168
797
	WM_NCXBUTTONDOWN          = 171
798
	WM_NCXBUTTONUP            = 172
799
	WM_NCXBUTTONDBLCLK        = 173
800
	WM_NCMOUSEHOVER           = 0X02A0
801
	WM_NCMOUSELEAVE           = 0X02A2
802
	WM_NCMOUSEMOVE            = 160
803
	WM_NCPAINT                = 133
804
	WM_NCRBUTTONDBLCLK        = 166
805
	WM_NCRBUTTONDOWN          = 164
806
	WM_NCRBUTTONUP            = 165
807
	WM_NEXTDLGCTL             = 40
808
	WM_NEXTMENU               = 531
809
	WM_NOTIFY                 = 78
810
	WM_NOTIFYFORMAT           = 85
811
	WM_NULL                   = 0
812
	WM_PAINT                  = 15
813
	WM_PAINTCLIPBOARD         = 777
814
	WM_PAINTICON              = 38
815
	WM_PALETTECHANGED         = 785
816
	WM_PALETTEISCHANGING      = 784
817
	WM_PARENTNOTIFY           = 528
818
	WM_PASTE                  = 770
819
	WM_PENWINFIRST            = 896
820
	WM_PENWINLAST             = 911
821
	WM_POWER                  = 72
822
	WM_POWERBROADCAST         = 536
823
	WM_PRINT                  = 791
824
	WM_PRINTCLIENT            = 792
825
	WM_QUERYDRAGICON          = 55
826
	WM_QUERYENDSESSION        = 17
827
	WM_QUERYNEWPALETTE        = 783
828
	WM_QUERYOPEN              = 19
829
	WM_QUEUESYNC              = 35
830
	WM_QUIT                   = 18
831
	WM_RENDERALLFORMATS       = 774
832
	WM_RENDERFORMAT           = 773
833
	WM_SETCURSOR              = 32
834
	WM_SETFOCUS               = 7
835
	WM_SETFONT                = 48
836
	WM_SETHOTKEY              = 50
837
	WM_SETICON                = 128
838
	WM_SETREDRAW              = 11
839
	WM_SETTEXT                = 12
840
	WM_SETTINGCHANGE          = 26
841
	WM_SHOWWINDOW             = 24
842
	WM_SIZE                   = 5
843
	WM_SIZECLIPBOARD          = 779
844
	WM_SIZING                 = 532
845
	WM_SPOOLERSTATUS          = 42
846
	WM_STYLECHANGED           = 125
847
	WM_STYLECHANGING          = 124
848
	WM_SYSCHAR                = 262
849
	WM_SYSCOLORCHANGE         = 21
850
	WM_SYSCOMMAND             = 274
851
	WM_SYSDEADCHAR            = 263
852
	WM_SYSKEYDOWN             = 260
853
	WM_SYSKEYUP               = 261
854
	WM_TCARD                  = 82
855
	WM_THEMECHANGED           = 794
856
	WM_TIMECHANGE             = 30
857
	WM_TIMER                  = 275
858
	WM_UNDO                   = 772
859
	WM_USER                   = 1024
860
	WM_USERCHANGED            = 84
861
	WM_VKEYTOITEM             = 46
862
	WM_VSCROLL                = 277
863
	WM_VSCROLLCLIPBOARD       = 778
864
	WM_WINDOWPOSCHANGED       = 71
865
	WM_WINDOWPOSCHANGING      = 70
866
	WM_WININICHANGE           = 26
867
	WM_KEYFIRST               = 256
868
	WM_KEYLAST                = 264
869
	WM_SYNCPAINT              = 136
870
	WM_MOUSEACTIVATE          = 33
871
	WM_MOUSEMOVE              = 512
872
	WM_LBUTTONDOWN            = 513
873
	WM_LBUTTONUP              = 514
874
	WM_LBUTTONDBLCLK          = 515
875
	WM_RBUTTONDOWN            = 516
876
	WM_RBUTTONUP              = 517
877
	WM_RBUTTONDBLCLK          = 518
878
	WM_MBUTTONDOWN            = 519
879
	WM_MBUTTONUP              = 520
880
	WM_MBUTTONDBLCLK          = 521
881
	WM_MOUSEWHEEL             = 522
882
	WM_MOUSEFIRST             = 512
883
	WM_XBUTTONDOWN            = 523
884
	WM_XBUTTONUP              = 524
885
	WM_XBUTTONDBLCLK          = 525
886
	WM_MOUSELAST              = 525
887
	WM_MOUSEHOVER             = 0X2A1
888
	WM_MOUSELEAVE             = 0X2A3
889
	WM_CLIPBOARDUPDATE        = 0x031D
890
	WM_UNICHAR                = 0x0109
891
)
892

893
const (
894
	CHILDID_SELF      = 0
895
	INDEXID_OBJECT    = 0
896
	INDEXID_CONTAINER = 0
897

898
	OBJID_WINDOW            = int32(0x00000000)
899
	OBJID_SYSMENU           = int32(-((0xFFFFFFFF ^ 0xFFFFFFFF) + 1))
900
	OBJID_TITLEBAR          = int32(-((0xFFFFFFFE ^ 0xFFFFFFFF) + 1))
901
	OBJID_MENU              = int32(-((0xFFFFFFFD ^ 0xFFFFFFFF) + 1))
902
	OBJID_CLIENT            = int32(-((0xFFFFFFFC ^ 0xFFFFFFFF) + 1))
903
	OBJID_VSCROLL           = int32(-((0xFFFFFFFB ^ 0xFFFFFFFF) + 1))
904
	OBJID_HSCROLL           = int32(-((0xFFFFFFFA ^ 0xFFFFFFFF) + 1))
905
	OBJID_SIZEGRIP          = int32(-((0xFFFFFFF9 ^ 0xFFFFFFFF) + 1))
906
	OBJID_CARET             = int32(-((0xFFFFFFF8 ^ 0xFFFFFFFF) + 1))
907
	OBJID_CURSOR            = int32(-((0xFFFFFFF7 ^ 0xFFFFFFFF) + 1))
908
	OBJID_ALERT             = int32(-((0xFFFFFFF6 ^ 0xFFFFFFFF) + 1))
909
	OBJID_SOUND             = int32(-((0xFFFFFFF5 ^ 0xFFFFFFFF) + 1))
910
	OBJID_QUERYCLASSNAMEIDX = int32(-((0xFFFFFFF4 ^ 0xFFFFFFFF) + 1))
911
	OBJID_NATIVEOM          = int32(-((0xFFFFFFF0 ^ 0xFFFFFFFF) + 1))
912
)
913

914
// event constants
915
const (
916
	EVENT_MIN = 0x00000001
917
	EVENT_MAX = 0x7FFFFFFF
918

919
	EVENT_SYSTEM_SOUND                  = 0x0001
920
	EVENT_SYSTEM_ALERT                  = 0x0002
921
	EVENT_SYSTEM_FOREGROUND             = 0x0003
922
	EVENT_SYSTEM_MENUSTART              = 0x0004
923
	EVENT_SYSTEM_MENUEND                = 0x0005
924
	EVENT_SYSTEM_MENUPOPUPSTART         = 0x0006
925
	EVENT_SYSTEM_MENUPOPUPEND           = 0x0007
926
	EVENT_SYSTEM_CAPTURESTART           = 0x0008
927
	EVENT_SYSTEM_CAPTUREEND             = 0x0009
928
	EVENT_SYSTEM_MOVESIZESTART          = 0x000A
929
	EVENT_SYSTEM_MOVESIZEEND            = 0x000B
930
	EVENT_SYSTEM_CONTEXTHELPSTART       = 0x000C
931
	EVENT_SYSTEM_CONTEXTHELPEND         = 0x000D
932
	EVENT_SYSTEM_DRAGDROPSTART          = 0x000E
933
	EVENT_SYSTEM_DRAGDROPEND            = 0x000F
934
	EVENT_SYSTEM_DIALOGSTART            = 0x0010
935
	EVENT_SYSTEM_DIALOGEND              = 0x0011
936
	EVENT_SYSTEM_SCROLLINGSTART         = 0x0012
937
	EVENT_SYSTEM_SCROLLINGEND           = 0x0013
938
	EVENT_SYSTEM_SWITCHSTART            = 0x0014
939
	EVENT_SYSTEM_SWITCHEND              = 0x0015
940
	EVENT_SYSTEM_MINIMIZESTART          = 0x0016
941
	EVENT_SYSTEM_MINIMIZEEND            = 0x0017
942
	EVENT_SYSTEM_DESKTOPSWITCH          = 0x0020
943
	EVENT_SYSTEM_SWITCHER_APPGRABBED    = 0x0024
944
	EVENT_SYSTEM_SWITCHER_APPOVERTARGET = 0x0025
945
	EVENT_SYSTEM_SWITCHER_APPDROPPED    = 0x0026
946
	EVENT_SYSTEM_SWITCHER_CANCELLED     = 0x0027
947
	EVENT_SYSTEM_IME_KEY_NOTIFICATION   = 0x0029
948
	EVENT_SYSTEM_END                    = 0x00FF
949

950
	EVENT_OEM_DEFINED_START = 0x0101
951
	EVENT_OEM_DEFINED_END   = 0x01FF
952

953
	EVENT_CONSOLE_CARET             = 0x4001
954
	EVENT_CONSOLE_UPDATE_REGION     = 0x4002
955
	EVENT_CONSOLE_UPDATE_SIMPLE     = 0x4003
956
	EVENT_CONSOLE_UPDATE_SCROLL     = 0x4004
957
	EVENT_CONSOLE_LAYOUT            = 0x4005
958
	EVENT_CONSOLE_START_APPLICATION = 0x4006
959
	EVENT_CONSOLE_END_APPLICATION   = 0x4007
960
	EVENT_CONSOLE_END               = 0x40FF
961

962
	EVENT_UIA_EVENTID_START = 0x4E00
963
	EVENT_UIA_EVENTID_END   = 0x4EFF
964

965
	EVENT_UIA_PROPID_START = 0x7500
966
	EVENT_UIA_PROPID_END   = 0x75FF
967

968
	EVENT_OBJECT_CREATE                           = 0x8000
969
	EVENT_OBJECT_DESTROY                          = 0x8001
970
	EVENT_OBJECT_SHOW                             = 0x8002
971
	EVENT_OBJECT_HIDE                             = 0x8003
972
	EVENT_OBJECT_REORDER                          = 0x8004
973
	EVENT_OBJECT_FOCUS                            = 0x8005
974
	EVENT_OBJECT_SELECTION                        = 0x8006
975
	EVENT_OBJECT_SELECTIONADD                     = 0x8007
976
	EVENT_OBJECT_SELECTIONREMOVE                  = 0x8008
977
	EVENT_OBJECT_SELECTIONWITHIN                  = 0x8009
978
	EVENT_OBJECT_STATECHANGE                      = 0x800A
979
	EVENT_OBJECT_LOCATIONCHANGE                   = 0x800B
980
	EVENT_OBJECT_NAMECHANGE                       = 0x800C
981
	EVENT_OBJECT_DESCRIPTIONCHANGE                = 0x800D
982
	EVENT_OBJECT_VALUECHANGE                      = 0x800E
983
	EVENT_OBJECT_PARENTCHANGE                     = 0x800F
984
	EVENT_OBJECT_HELPCHANGE                       = 0x8010
985
	EVENT_OBJECT_DEFACTIONCHANGE                  = 0x8011
986
	EVENT_OBJECT_ACCELERATORCHANGE                = 0x8012
987
	EVENT_OBJECT_INVOKED                          = 0x8013
988
	EVENT_OBJECT_TEXTSELECTIONCHANGED             = 0x8014
989
	EVENT_OBJECT_CONTENTSCROLLED                  = 0x8015
990
	EVENT_SYSTEM_ARRANGMENTPREVIEW                = 0x8016
991
	EVENT_OBJECT_CLOAKED                          = 0x8017
992
	EVENT_OBJECT_UNCLOAKED                        = 0x8018
993
	EVENT_OBJECT_LIVEREGIONCHANGED                = 0x8019
994
	EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED         = 0x8020
995
	EVENT_OBJECT_DRAGSTART                        = 0x8021
996
	EVENT_OBJECT_DRAGCANCEL                       = 0x8022
997
	EVENT_OBJECT_DRAGCOMPLETE                     = 0x8023
998
	EVENT_OBJECT_DRAGENTER                        = 0x8024
999
	EVENT_OBJECT_DRAGLEAVE                        = 0x8025
1000
	EVENT_OBJECT_DRAGDROPPED                      = 0x8026
1001
	EVENT_OBJECT_IME_SHOW                         = 0x8027
1002
	EVENT_OBJECT_IME_HIDE                         = 0x8028
1003
	EVENT_OBJECT_IME_CHANGE                       = 0x8029
1004
	EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED = 0x8030
1005
	EVENT_OBJECT_END                              = 0x80FF
1006

1007
	EVENT_AIA_START = 0xa000
1008
	EVENT_AIA_END   = 0xafff
1009

1010
	WINEVENT_OUTOFCONTEXT   = 0x0000
1011
	WINEVENT_SKIPOWNTHREAD  = 0x0001
1012
	WINEVENT_SKIPOWNPROCESS = 0x0002
1013
	WINEVENT_INCONTEXT      = 0x0004
1014
)
1015

1016
// mouse button constants
1017
const (
1018
	MK_CONTROL  = 0x0008
1019
	MK_LBUTTON  = 0x0001
1020
	MK_MBUTTON  = 0x0010
1021
	MK_RBUTTON  = 0x0002
1022
	MK_SHIFT    = 0x0004
1023
	MK_XBUTTON1 = 0x0020
1024
	MK_XBUTTON2 = 0x0040
1025
)
1026

1027
// TrackPopupMenu[Ex] flags
1028
const (
1029
	TPM_CENTERALIGN     = 0x0004
1030
	TPM_LEFTALIGN       = 0x0000
1031
	TPM_RIGHTALIGN      = 0x0008
1032
	TPM_BOTTOMALIGN     = 0x0020
1033
	TPM_TOPALIGN        = 0x0000
1034
	TPM_VCENTERALIGN    = 0x0010
1035
	TPM_NONOTIFY        = 0x0080
1036
	TPM_RETURNCMD       = 0x0100
1037
	TPM_LEFTBUTTON      = 0x0000
1038
	TPM_RIGHTBUTTON     = 0x0002
1039
	TPM_HORNEGANIMATION = 0x0800
1040
	TPM_HORPOSANIMATION = 0x0400
1041
	TPM_NOANIMATION     = 0x4000
1042
	TPM_VERNEGANIMATION = 0x2000
1043
	TPM_VERPOSANIMATION = 0x1000
1044
	TPM_HORIZONTAL      = 0x0000
1045
	TPM_VERTICAL        = 0x0040
1046
)
1047

1048
// WINDOWPLACEMENT flags
1049
const (
1050
	WPF_ASYNCWINDOWPLACEMENT = 0x0004
1051
	WPF_RESTORETOMAXIMIZED   = 0x0002
1052
	WPF_SETMINPOSITION       = 0x0001
1053
)
1054

1055
// DrawText[Ex] format flags
1056
const (
1057
	DT_TOP                  = 0x00000000
1058
	DT_LEFT                 = 0x00000000
1059
	DT_CENTER               = 0x00000001
1060
	DT_RIGHT                = 0x00000002
1061
	DT_VCENTER              = 0x00000004
1062
	DT_BOTTOM               = 0x00000008
1063
	DT_WORDBREAK            = 0x00000010
1064
	DT_SINGLELINE           = 0x00000020
1065
	DT_EXPANDTABS           = 0x00000040
1066
	DT_TABSTOP              = 0x00000080
1067
	DT_NOCLIP               = 0x00000100
1068
	DT_EXTERNALLEADING      = 0x00000200
1069
	DT_CALCRECT             = 0x00000400
1070
	DT_NOPREFIX             = 0x00000800
1071
	DT_INTERNAL             = 0x00001000
1072
	DT_EDITCONTROL          = 0x00002000
1073
	DT_PATH_ELLIPSIS        = 0x00004000
1074
	DT_END_ELLIPSIS         = 0x00008000
1075
	DT_MODIFYSTRING         = 0x00010000
1076
	DT_RTLREADING           = 0x00020000
1077
	DT_WORD_ELLIPSIS        = 0x00040000
1078
	DT_NOFULLWIDTHCHARBREAK = 0x00080000
1079
	DT_HIDEPREFIX           = 0x00100000
1080
	DT_PREFIXONLY           = 0x00200000
1081
)
1082

1083
// Window class styles
1084
const (
1085
	CS_VREDRAW         = 0x00000001
1086
	CS_HREDRAW         = 0x00000002
1087
	CS_KEYCVTWINDOW    = 0x00000004
1088
	CS_DBLCLKS         = 0x00000008
1089
	CS_OWNDC           = 0x00000020
1090
	CS_CLASSDC         = 0x00000040
1091
	CS_PARENTDC        = 0x00000080
1092
	CS_NOKEYCVT        = 0x00000100
1093
	CS_NOCLOSE         = 0x00000200
1094
	CS_SAVEBITS        = 0x00000800
1095
	CS_BYTEALIGNCLIENT = 0x00001000
1096
	CS_BYTEALIGNWINDOW = 0x00002000
1097
	CS_GLOBALCLASS     = 0x00004000
1098
	CS_IME             = 0x00010000
1099
	CS_DROPSHADOW      = 0x00020000
1100
)
1101

1102
// SystemParametersInfo actions
1103
const (
1104
	SPI_GETNONCLIENTMETRICS = 0x0029
1105
	SPI_GETHIGHCONTRAST     = 0x0042
1106
)
1107

1108
// Dialog styles
1109
const (
1110
	DS_ABSALIGN      = 0x0001
1111
	DS_SYSMODAL      = 0x0002
1112
	DS_3DLOOK        = 0x0004
1113
	DS_FIXEDSYS      = 0x0008
1114
	DS_NOFAILCREATE  = 0x0010
1115
	DS_LOCALEDIT     = 0x0020
1116
	DS_SETFONT       = 0x0040
1117
	DS_MODALFRAME    = 0x0080
1118
	DS_NOIDLEMSG     = 0x0100
1119
	DS_SETFOREGROUND = 0x0200
1120
	DS_CONTROL       = 0x0400
1121
	DS_CENTER        = 0x0800
1122
	DS_CENTERMOUSE   = 0x1000
1123
	DS_CONTEXTHELP   = 0x2000
1124
	DS_USEPIXELS     = 0x8000
1125
	DS_SHELLFONT     = (DS_SETFONT | DS_FIXEDSYS)
1126
)
1127

1128
// WM_GETDLGCODE return values
1129
const (
1130
	DLGC_BUTTON          = 0x2000
1131
	DLGC_DEFPUSHBUTTON   = 0x0010
1132
	DLGC_HASSETSEL       = 0x0008
1133
	DLGC_RADIOBUTTON     = 0x0040
1134
	DLGC_STATIC          = 0x0100
1135
	DLGC_UNDEFPUSHBUTTON = 0x0020
1136
	DLGC_WANTALLKEYS     = 0x0004
1137
	DLGC_WANTARROWS      = 0x0001
1138
	DLGC_WANTCHARS       = 0x0080
1139
	DLGC_WANTMESSAGE     = 0x0004
1140
	DLGC_WANTTAB         = 0x0002
1141
)
1142

1143
// WM_ACTIVATE codes
1144
const (
1145
	WA_ACTIVE      = 1
1146
	WA_CLICKACTIVE = 2
1147
	WA_INACTIVE    = 0
1148
)
1149

1150
// Owner drawing actions
1151
const (
1152
	ODA_DRAWENTIRE = 0x0001
1153
	ODA_FOCUS      = 0x0002
1154
	ODA_SELECT     = 0x0004
1155
)
1156

1157
// Owner drawing states
1158
const (
1159
	ODS_CHECKED      = 0x0001
1160
	ODS_COMBOBOXEDIT = 0x0002
1161
	ODS_DEFAULT      = 0x0004
1162
	ODS_DISABLED     = 0x0008
1163
	ODS_FOCUS        = 0x0010
1164
	ODS_GRAYED       = 0x0020
1165
	ODS_SELECTED     = 0x0040
1166
)
1167

1168
// Raw input device flags
1169
const (
1170
	RIDEV_APPKEYS      = 0x00000400
1171
	RIDEV_CAPTUREMOUSE = 0x00000200
1172
	RIDEV_DEVNOTIFY    = 0x00002000
1173
	RIDEV_EXCLUDE      = 0x00000010
1174
	RIDEV_EXINPUTSINK  = 0x00001000
1175
	RIDEV_INPUTSINK    = 0x00000100
1176
	RIDEV_NOHOTKEYS    = 0x00000200
1177
	RIDEV_NOLEGACY     = 0x00000030
1178
	RIDEV_PAGEONLY     = 0x00000020
1179
	RIDEV_REMOVE       = 0x00000001
1180
)
1181

1182
// Raw input device command flags
1183
const (
1184
	RID_HEADER = 0x10000005
1185
	RID_INPUT  = 0x10000003
1186
)
1187

1188
// Raw input type
1189
const (
1190
	RIM_TYPEHID      = 2
1191
	RIM_TYPEKEYBOARD = 1
1192
	RIM_TYPEMOUSE    = 0
1193
)
1194

1195
// Raw input scan code information
1196
const (
1197
	RI_KEY_MAKE  = 0
1198
	RI_KEY_BREAK = 1
1199
	RI_KEY_E0    = 2
1200
	RI_KEY_E1    = 4
1201
)
1202

1203
// Raw input mouse state
1204
const (
1205
	MOUSE_MOVE_RELATIVE      = 0x00
1206
	MOUSE_MOVE_ABSOLUTE      = 0x01
1207
	MOUSE_VIRTUAL_DESKTOP    = 0x02
1208
	MOUSE_ATTRIBUTES_CHANGED = 0x04
1209
)
1210

1211
// Raw input transistion state of mouse buttons
1212
const (
1213
	RI_MOUSE_LEFT_BUTTON_DOWN   = 0x0001
1214
	RI_MOUSE_LEFT_BUTTON_UP     = 0x0002
1215
	RI_MOUSE_MIDDLE_BUTTON_DOWN = 0x0010
1216
	RI_MOUSE_MIDDLE_BUTTON_UP   = 0x0020
1217
	RI_MOUSE_RIGHT_BUTTON_DOWN  = 0x0004
1218
	RI_MOUSE_RIGHT_BUTTON_UP    = 0x0008
1219
	RI_MOUSE_BUTTON_1_DOWN      = 0x0001
1220
	RI_MOUSE_BUTTON_1_UP        = 0x0002
1221
	RI_MOUSE_BUTTON_2_DOWN      = 0x0004
1222
	RI_MOUSE_BUTTON_2_UP        = 0x0008
1223
	RI_MOUSE_BUTTON_3_DOWN      = 0x0010
1224
	RI_MOUSE_BUTTON_3_UP        = 0x0020
1225
	RI_MOUSE_BUTTON_4_DOWN      = 0x0040
1226
	RI_MOUSE_BUTTON_4_UP        = 0x0080
1227
	RI_MOUSE_BUTTON_5_DOWN      = 0x0100
1228
	RI_MOUSE_BUTTON_5_UP        = 0x0200
1229
	RI_MOUSE_WHEEL              = 0x0400
1230
)
1231

1232
// Multi monitor constants
1233
const (
1234
	MONITOR_DEFAULTTONULL    = 0x0
1235
	MONITOR_DEFAULTTOPRIMARY = 0x1
1236
	MONITOR_DEFAULTTONEAREST = 0x2
1237
)
1238

1239
// MONITORINFO flags
1240
const (
1241
	MONITORINFOF_PRIMARY = 0x1
1242
)
1243

1244
// INPUT Type
1245
const (
1246
	INPUT_MOUSE    = 0
1247
	INPUT_KEYBOARD = 1
1248
	INPUT_HARDWARE = 2
1249
)
1250

1251
// MOUSEINPUT MouseData
1252
const (
1253
	XBUTTON1 = 0x0001
1254
	XBUTTON2 = 0x0002
1255
)
1256

1257
// MOUSEINPUT DwFlags
1258
const (
1259
	MOUSEEVENTF_ABSOLUTE        = 0x8000
1260
	MOUSEEVENTF_HWHEEL          = 0x1000
1261
	MOUSEEVENTF_MOVE            = 0x0001
1262
	MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000
1263
	MOUSEEVENTF_LEFTDOWN        = 0x0002
1264
	MOUSEEVENTF_LEFTUP          = 0x0004
1265
	MOUSEEVENTF_RIGHTDOWN       = 0x0008
1266
	MOUSEEVENTF_RIGHTUP         = 0x0010
1267
	MOUSEEVENTF_MIDDLEDOWN      = 0x0020
1268
	MOUSEEVENTF_MIDDLEUP        = 0x0040
1269
	MOUSEEVENTF_VIRTUALDESK     = 0x4000
1270
	MOUSEEVENTF_WHEEL           = 0x0800
1271
	MOUSEEVENTF_XDOWN           = 0x0080
1272
	MOUSEEVENTF_XUP             = 0x0100
1273
)
1274

1275
// KEYBDINPUT DwFlags
1276
const (
1277
	KEYEVENTF_EXTENDEDKEY = 0x0001
1278
	KEYEVENTF_KEYUP       = 0x0002
1279
	KEYEVENTF_SCANCODE    = 0x0008
1280
	KEYEVENTF_UNICODE     = 0x0004
1281
)
1282

1283
// GetWindow uCmd constants
1284
const (
1285
	GW_CHILD        = 5
1286
	GW_ENABLEDPOPUP = 6
1287
	GW_HWNDFIRST    = 0
1288
	GW_HWNDLAST     = 1
1289
	GW_HWNDNEXT     = 2
1290
	GW_HWNDPREV     = 3
1291
	GW_OWNER        = 4
1292
)
1293

1294
// Standard clipboard formats
1295
const (
1296
	CF_BITMAP          = 2
1297
	CF_DIB             = 8
1298
	CF_DIBV5           = 17
1299
	CF_DIF             = 5
1300
	CF_DSPBITMAP       = 0x0082
1301
	CF_DSPENHMETAFILE  = 0x008E
1302
	CF_DSPMETAFILEPICT = 0x0083
1303
	CF_DSPTEXT         = 0x0081
1304
	CF_ENHMETAFILE     = 14
1305
	CF_GDIOBJFIRST     = 0x0300
1306
	CF_GDIOBJLAST      = 0x03FF
1307
	CF_HDROP           = 15
1308
	CF_LOCALE          = 16
1309
	CF_METAFILEPICT    = 3
1310
	CF_OEMTEXT         = 7
1311
	CF_OWNERDISPLAY    = 0x0080
1312
	CF_PALETTE         = 9
1313
	CF_PENDATA         = 10
1314
	CF_PRIVATEFIRST    = 0x0200
1315
	CF_PRIVATELAST     = 0x02FF
1316
	CF_RIFF            = 11
1317
	CF_SYLK            = 4
1318
	CF_TEXT            = 1
1319
	CF_TIFF            = 6
1320
	CF_UNICODETEXT     = 13
1321
	CF_WAVE            = 12
1322
)
1323

1324
// ScrollBar constants
1325
const (
1326
	SB_HORZ = 0
1327
	SB_VERT = 1
1328
	SB_CTL  = 2
1329
	SB_BOTH = 3
1330
)
1331

1332
// ScrollBar commands
1333
const (
1334
	SB_LINEUP        = 0
1335
	SB_LINELEFT      = 0
1336
	SB_LINEDOWN      = 1
1337
	SB_LINERIGHT     = 1
1338
	SB_PAGEUP        = 2
1339
	SB_PAGELEFT      = 2
1340
	SB_PAGEDOWN      = 3
1341
	SB_PAGERIGHT     = 3
1342
	SB_THUMBPOSITION = 4
1343
	SB_THUMBTRACK    = 5
1344
	SB_TOP           = 6
1345
	SB_LEFT          = 6
1346
	SB_BOTTOM        = 7
1347
	SB_RIGHT         = 7
1348
	SB_ENDSCROLL     = 8
1349
)
1350

1351
// [Get|Set]ScrollInfo mask constants
1352
const (
1353
	SIF_RANGE           = 1
1354
	SIF_PAGE            = 2
1355
	SIF_POS             = 4
1356
	SIF_DISABLENOSCROLL = 8
1357
	SIF_TRACKPOS        = 16
1358
	SIF_ALL             = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS
1359
)
1360

1361
// DrawIconEx flags
1362
const (
1363
	DI_COMPAT      = 0x0004
1364
	DI_DEFAULTSIZE = 0x0008
1365
	DI_IMAGE       = 0x0002
1366
	DI_MASK        = 0x0001
1367
	DI_NOMIRROR    = 0x0010
1368
	DI_NORMAL      = DI_IMAGE | DI_MASK
1369
)
1370

1371
// WM_NCHITTEST constants
1372
const (
1373
	HTBORDER      = 18
1374
	HTBOTTOM      = 15
1375
	HTBOTTOMLEFT  = 16
1376
	HTBOTTOMRIGHT = 17
1377
	HTCAPTION     = 2
1378
	HTCLIENT      = 1
1379
	HTCLOSE       = 20
1380
	HTERROR       = -2
1381
	HTGROWBOX     = 4
1382
	HTHELP        = 21
1383
	HTHSCROLL     = 6
1384
	HTLEFT        = 10
1385
	HTMENU        = 5
1386
	HTMAXBUTTON   = 9
1387
	HTMINBUTTON   = 8
1388
	HTNOWHERE     = 0
1389
	HTREDUCE      = 8
1390
	HTRIGHT       = 11
1391
	HTSIZE        = 4
1392
	HTSYSMENU     = 3
1393
	HTTOP         = 12
1394
	HTTOPLEFT     = 13
1395
	HTTOPRIGHT    = 14
1396
	HTTRANSPARENT = -1
1397
	HTVSCROLL     = 7
1398
	HTZOOM        = 9
1399
)
1400

1401
// AnimateWindow flags
1402
const (
1403
	AW_ACTIVATE     = 0x00020000
1404
	AW_BLEND        = 0x00080000
1405
	AW_CENTER       = 0x00000010
1406
	AW_HIDE         = 0x00010000
1407
	AW_HOR_POSITIVE = 0x00000001
1408
	AW_HOR_NEGATIVE = 0x00000002
1409
	AW_SLIDE        = 0x00040000
1410
	AW_VER_POSITIVE = 0x00000004
1411
	AW_VER_NEGATIVE = 0x00000008
1412
)
1413

1414
// Session ending constants
1415
const (
1416
	ENDSESSION_CLOSEAPP = 0x00000001
1417
	ENDSESSION_CRITICAL = 0x40000000
1418
	ENDSESSION_LOGOFF   = 0x80000000
1419
)
1420

1421
// ChangeWindowMessageFilterEx constants
1422
const (
1423
	MSGFLT_RESET    = 0
1424
	MSGFLT_ALLOW    = 1
1425
	MSGFLT_DISALLOW = 2
1426

1427
	MSGFLTINFO_NONE                     = 0
1428
	MSGFLTINFO_ALREADYALLOWED_FORWND    = 1
1429
	MSGFLTINFO_ALREADYDISALLOWED_FORWND = 2
1430
	MSGFLTINFO_ALLOWED_HIGHER           = 3
1431
)
1432

1433
// TRACKMOUSEEVENT flags
1434
const (
1435
	TME_CANCEL    = 0x80000000
1436
	TME_HOVER     = 0x00000001
1437
	TME_LEAVE     = 0x00000002
1438
	TME_NONCLIENT = 0x00000010
1439
	TME_QUERY     = 0x40000000
1440
)
1441

1442
// HIGHCONTRAST flags
1443
const (
1444
	HCF_HIGHCONTRASTON  = 0x00000001
1445
	HCF_AVAILABLE       = 0x00000002
1446
	HCF_HOTKEYACTIVE    = 0x00000004
1447
	HCF_CONFIRMHOTKEY   = 0x00000008
1448
	HCF_HOTKEYSOUND     = 0x00000010
1449
	HCF_INDICATOR       = 0x00000020
1450
	HCF_HOTKEYAVAILABLE = 0x00000040
1451
)
1452

1453
// EDITWORDBREAKPROC codes
1454
const (
1455
	WB_LEFT        = 0
1456
	WB_RIGHT       = 1
1457
	WB_ISDELIMITER = 2
1458
)
1459

1460
type NMBCDROPDOWN struct {
1461
	Hdr      NMHDR
1462
	RcButton RECT
1463
}
1464

1465
type MONITORINFO struct {
1466
	CbSize    uint32
1467
	RcMonitor RECT
1468
	RcWork    RECT
1469
	DwFlags   uint32
1470
}
1471

1472
type (
1473
	HACCEL    HANDLE
1474
	HCURSOR   HANDLE
1475
	HDWP      HANDLE
1476
	HICON     HANDLE
1477
	HMENU     HANDLE
1478
	HMONITOR  HANDLE
1479
	HRAWINPUT HANDLE
1480
	HWND      HANDLE
1481
)
1482

1483
type MSG struct {
1484
	HWnd    HWND
1485
	Message uint32
1486
	WParam  uintptr
1487
	LParam  uintptr
1488
	Time    uint32
1489
	Pt      POINT
1490
}
1491

1492
type RAWINPUTDEVICE struct {
1493
	UsUsagePage uint16
1494
	UsUsage     uint16
1495
	DwFlags     uint32
1496
	HwndTarget  HWND
1497
}
1498

1499
type RAWINPUTHEADER struct {
1500
	DwType  uint32
1501
	DwSize  uint32
1502
	HDevice HANDLE
1503
	WParam  uintptr
1504
}
1505

1506
type RAWINPUTMOUSE struct {
1507
	Header RAWINPUTHEADER
1508
	Data   RAWMOUSE
1509
}
1510

1511
type RAWINPUTKEYBOARD struct {
1512
	Header RAWINPUTHEADER
1513
	Data   RAWKEYBOARD
1514
}
1515

1516
type RAWINPUTHID struct {
1517
	Header RAWINPUTHEADER
1518
	Data   RAWHID
1519
}
1520

1521
type RAWMOUSE struct {
1522
	UsFlags            uint16
1523
	UsButtonFlags      uint16
1524
	UsButtonData       uint16
1525
	Pad_cgo_0          [2]byte
1526
	UlRawButtons       uint32
1527
	LLastX             int32
1528
	LLastY             int32
1529
	UlExtraInformation uint32
1530
}
1531

1532
type RAWKEYBOARD struct {
1533
	MakeCode         uint16
1534
	Flags            uint16
1535
	Reserved         int16
1536
	VKey             uint16
1537
	Message          uint32
1538
	ExtraInformation uint32
1539
}
1540

1541
type RAWHID struct {
1542
	DwSizeHid uint32
1543
	DwCount   uint32
1544
	BRawData  [1]byte
1545
}
1546

1547
type NMHDR struct {
1548
	HwndFrom HWND
1549
	IdFrom   uintptr
1550
	Code     uint32
1551
}
1552

1553
type CREATESTRUCT struct {
1554
	CreateParams    uintptr
1555
	Instance        HINSTANCE
1556
	Menu            HMENU
1557
	Parent          HWND
1558
	Cy              int32
1559
	Cx              int32
1560
	Y               int32
1561
	X               int32
1562
	Style           int32
1563
	Name, ClassName uintptr
1564
	ExStyle         uint32
1565
}
1566

1567
type CHANGEFILTERSTRUCT struct {
1568
	size      uint32
1569
	extStatus uint32
1570
}
1571

1572
type WNDCLASSEX struct {
1573
	CbSize        uint32
1574
	Style         uint32
1575
	LpfnWndProc   uintptr
1576
	CbClsExtra    int32
1577
	CbWndExtra    int32
1578
	HInstance     HINSTANCE
1579
	HIcon         HICON
1580
	HCursor       HCURSOR
1581
	HbrBackground HBRUSH
1582
	LpszMenuName  *uint16
1583
	LpszClassName *uint16
1584
	HIconSm       HICON
1585
}
1586

1587
type TPMPARAMS struct {
1588
	CbSize    uint32
1589
	RcExclude RECT
1590
}
1591

1592
type WINDOWPLACEMENT struct {
1593
	Length           uint32
1594
	Flags            uint32
1595
	ShowCmd          uint32
1596
	PtMinPosition    POINT
1597
	PtMaxPosition    POINT
1598
	RcNormalPosition RECT
1599
}
1600

1601
type DRAWTEXTPARAMS struct {
1602
	CbSize        uint32
1603
	ITabLength    int32
1604
	ILeftMargin   int32
1605
	IRightMargin  int32
1606
	UiLengthDrawn uint32
1607
}
1608

1609
type PAINTSTRUCT struct {
1610
	Hdc         HDC
1611
	FErase      BOOL
1612
	RcPaint     RECT
1613
	FRestore    BOOL
1614
	FIncUpdate  BOOL
1615
	RgbReserved [32]byte
1616
}
1617

1618
type MINMAXINFO struct {
1619
	PtReserved     POINT
1620
	PtMaxSize      POINT
1621
	PtMaxPosition  POINT
1622
	PtMinTrackSize POINT
1623
	PtMaxTrackSize POINT
1624
}
1625

1626
type NONCLIENTMETRICS struct {
1627
	CbSize           uint32
1628
	IBorderWidth     int32
1629
	IScrollWidth     int32
1630
	IScrollHeight    int32
1631
	ICaptionWidth    int32
1632
	ICaptionHeight   int32
1633
	LfCaptionFont    LOGFONT
1634
	ISmCaptionWidth  int32
1635
	ISmCaptionHeight int32
1636
	LfSmCaptionFont  LOGFONT
1637
	IMenuWidth       int32
1638
	IMenuHeight      int32
1639
	LfMenuFont       LOGFONT
1640
	LfStatusFont     LOGFONT
1641
	LfMessageFont    LOGFONT
1642
}
1643

1644
type MEASUREITEMSTRUCT struct {
1645
	CtlType    uint32
1646
	CtlID      uint32
1647
	ItemID     int32
1648
	ItemWidth  uint32
1649
	ItemHeight uint32
1650
	ItemData   uintptr
1651
}
1652

1653
type DRAWITEMSTRUCT struct {
1654
	CtlType    uint32
1655
	CtlID      uint32
1656
	ItemID     int32
1657
	ItemAction uint32
1658
	ItemState  uint32
1659
	HwndItem   HWND
1660
	HDC        HDC
1661
	RcItem     RECT
1662
	ItemData   uintptr
1663
}
1664

1665
type ICONINFO struct {
1666
	FIcon    BOOL
1667
	XHotspot uint32
1668
	YHotspot uint32
1669
	HbmMask  HBITMAP
1670
	HbmColor HBITMAP
1671
}
1672

1673
type MOUSE_INPUT struct {
1674
	Type uint32
1675
	Mi   MOUSEINPUT
1676
}
1677

1678
type MOUSEINPUT struct {
1679
	Dx          int32
1680
	Dy          int32
1681
	MouseData   uint32
1682
	DwFlags     uint32
1683
	Time        uint32
1684
	DwExtraInfo uintptr
1685
}
1686

1687
type KEYBD_INPUT struct {
1688
	Type uint32
1689
	Ki   KEYBDINPUT
1690
}
1691

1692
type KEYBDINPUT struct {
1693
	WVk         uint16
1694
	WScan       uint16
1695
	DwFlags     uint32
1696
	Time        uint32
1697
	DwExtraInfo uintptr
1698
	Unused      [8]byte
1699
}
1700

1701
type HARDWARE_INPUT struct {
1702
	Type uint32
1703
	Hi   HARDWAREINPUT
1704
}
1705

1706
type HARDWAREINPUT struct {
1707
	UMsg    uint32
1708
	WParamL uint16
1709
	WParamH uint16
1710
	Unused  [16]byte
1711
}
1712

1713
type SCROLLINFO struct {
1714
	CbSize    uint32
1715
	FMask     uint32
1716
	NMin      int32
1717
	NMax      int32
1718
	NPage     uint32
1719
	NPos      int32
1720
	NTrackPos int32
1721
}
1722

1723
type WINDOWPOS struct {
1724
	Hwnd            HWND
1725
	HwndInsertAfter HWND
1726
	X               int32
1727
	Y               int32
1728
	Cx              int32
1729
	Cy              int32
1730
	Flags           uint32
1731
}
1732

1733
type TRACKMOUSEEVENT struct {
1734
	CbSize      uint32
1735
	DwFlags     uint32
1736
	HwndTrack   HWND
1737
	DwHoverTime uint32
1738
}
1739

1740
type HIGHCONTRAST struct {
1741
	CbSize            uint32
1742
	DwFlags           uint32
1743
	LpszDefaultScheme *uint16
1744
}
1745

1746
func GET_X_LPARAM(lp uintptr) int32 {
1747
	return int32(int16(LOWORD(uint32(lp))))
1748
}
1749

1750
func GET_Y_LPARAM(lp uintptr) int32 {
1751
	return int32(int16(HIWORD(uint32(lp))))
1752
}
1753

1754
var (
1755
	// Library
1756
	libuser32 *windows.LazyDLL
1757

1758
	// Functions
1759
	addClipboardFormatListener  *windows.LazyProc
1760
	adjustWindowRect            *windows.LazyProc
1761
	attachThreadInput           *windows.LazyProc
1762
	animateWindow               *windows.LazyProc
1763
	beginDeferWindowPos         *windows.LazyProc
1764
	beginPaint                  *windows.LazyProc
1765
	bringWindowToTop            *windows.LazyProc
1766
	callWindowProc              *windows.LazyProc
1767
	changeWindowMessageFilterEx *windows.LazyProc
1768
	checkMenuRadioItem          *windows.LazyProc
1769
	clientToScreen              *windows.LazyProc
1770
	closeClipboard              *windows.LazyProc
1771
	createDialogParam           *windows.LazyProc
1772
	createIconIndirect          *windows.LazyProc
1773
	createMenu                  *windows.LazyProc
1774
	createPopupMenu             *windows.LazyProc
1775
	createWindowEx              *windows.LazyProc
1776
	deferWindowPos              *windows.LazyProc
1777
	defWindowProc               *windows.LazyProc
1778
	deleteMenu                  *windows.LazyProc
1779
	destroyIcon                 *windows.LazyProc
1780
	destroyMenu                 *windows.LazyProc
1781
	destroyWindow               *windows.LazyProc
1782
	dialogBoxParam              *windows.LazyProc
1783
	dispatchMessage             *windows.LazyProc
1784
	drawIconEx                  *windows.LazyProc
1785
	drawMenuBar                 *windows.LazyProc
1786
	drawFocusRect               *windows.LazyProc
1787
	drawTextEx                  *windows.LazyProc
1788
	emptyClipboard              *windows.LazyProc
1789
	enableMenuItem              *windows.LazyProc
1790
	enableWindow                *windows.LazyProc
1791
	endDeferWindowPos           *windows.LazyProc
1792
	endDialog                   *windows.LazyProc
1793
	endPaint                    *windows.LazyProc
1794
	enumChildWindows            *windows.LazyProc
1795
	findWindow                  *windows.LazyProc
1796
	getActiveWindow             *windows.LazyProc
1797
	getAncestor                 *windows.LazyProc
1798
	getCaretPos                 *windows.LazyProc
1799
	getClassName                *windows.LazyProc
1800
	getClientRect               *windows.LazyProc
1801
	getClipboardData            *windows.LazyProc
1802
	getCursorPos                *windows.LazyProc
1803
	getDC                       *windows.LazyProc
1804
	getDesktopWindow            *windows.LazyProc
1805
	getDlgItem                  *windows.LazyProc
1806
	getDpiForWindow             *windows.LazyProc
1807
	getFocus                    *windows.LazyProc
1808
	getForegroundWindow         *windows.LazyProc
1809
	getIconInfo                 *windows.LazyProc
1810
	getKeyState                 *windows.LazyProc
1811
	getMenuCheckMarkDimensions  *windows.LazyProc
1812
	getMenuInfo                 *windows.LazyProc
1813
	getMenuItemCount            *windows.LazyProc
1814
	getMenuItemID               *windows.LazyProc
1815
	getMenuItemInfo             *windows.LazyProc
1816
	getMessage                  *windows.LazyProc
1817
	getMonitorInfo              *windows.LazyProc
1818
	getParent                   *windows.LazyProc
1819
	getRawInputData             *windows.LazyProc
1820
	getScrollInfo               *windows.LazyProc
1821
	getSubMenu                  *windows.LazyProc
1822
	getSysColor                 *windows.LazyProc
1823
	getSysColorBrush            *windows.LazyProc
1824
	getSystemMenu               *windows.LazyProc
1825
	getSystemMetrics            *windows.LazyProc
1826
	getSystemMetricsForDpi      *windows.LazyProc
1827
	getWindow                   *windows.LazyProc
1828
	getWindowLong               *windows.LazyProc
1829
	getWindowLongPtr            *windows.LazyProc
1830
	getWindowPlacement          *windows.LazyProc
1831
	getWindowRect               *windows.LazyProc
1832
	getWindowThreadProcessId    *windows.LazyProc
1833
	insertMenuItem              *windows.LazyProc
1834
	invalidateRect              *windows.LazyProc
1835
	isChild                     *windows.LazyProc
1836
	isClipboardFormatAvailable  *windows.LazyProc
1837
	isDialogMessage             *windows.LazyProc
1838
	isIconic                    *windows.LazyProc
1839
	isWindowEnabled             *windows.LazyProc
1840
	isWindowVisible             *windows.LazyProc
1841
	isZoomed                    *windows.LazyProc
1842
	killTimer                   *windows.LazyProc
1843
	loadCursor                  *windows.LazyProc
1844
	loadIcon                    *windows.LazyProc
1845
	loadImage                   *windows.LazyProc
1846
	loadMenu                    *windows.LazyProc
1847
	loadString                  *windows.LazyProc
1848
	messageBeep                 *windows.LazyProc
1849
	messageBox                  *windows.LazyProc
1850
	monitorFromWindow           *windows.LazyProc
1851
	moveWindow                  *windows.LazyProc
1852
	notifyWinEvent              *windows.LazyProc
1853
	unregisterClass             *windows.LazyProc
1854
	openClipboard               *windows.LazyProc
1855
	peekMessage                 *windows.LazyProc
1856
	postMessage                 *windows.LazyProc
1857
	postQuitMessage             *windows.LazyProc
1858
	redrawWindow                *windows.LazyProc
1859
	registerClassEx             *windows.LazyProc
1860
	registerRawInputDevices     *windows.LazyProc
1861
	registerWindowMessage       *windows.LazyProc
1862
	releaseCapture              *windows.LazyProc
1863
	releaseDC                   *windows.LazyProc
1864
	removeMenu                  *windows.LazyProc
1865
	screenToClient              *windows.LazyProc
1866
	sendDlgItemMessage          *windows.LazyProc
1867
	sendInput                   *windows.LazyProc
1868
	sendMessage                 *windows.LazyProc
1869
	setActiveWindow             *windows.LazyProc
1870
	setCapture                  *windows.LazyProc
1871
	setClipboardData            *windows.LazyProc
1872
	setCursor                   *windows.LazyProc
1873
	setCursorPos                *windows.LazyProc
1874
	setFocus                    *windows.LazyProc
1875
	setForegroundWindow         *windows.LazyProc
1876
	setMenu                     *windows.LazyProc
1877
	setMenuDefaultItem          *windows.LazyProc
1878
	setMenuInfo                 *windows.LazyProc
1879
	setMenuItemBitmaps          *windows.LazyProc
1880
	setMenuItemInfo             *windows.LazyProc
1881
	setParent                   *windows.LazyProc
1882
	setRect                     *windows.LazyProc
1883
	setScrollInfo               *windows.LazyProc
1884
	setTimer                    *windows.LazyProc
1885
	setWinEventHook             *windows.LazyProc
1886
	setWindowLong               *windows.LazyProc
1887
	setWindowLongPtr            *windows.LazyProc
1888
	setWindowPlacement          *windows.LazyProc
1889
	setWindowPos                *windows.LazyProc
1890
	showWindow                  *windows.LazyProc
1891
	systemParametersInfo        *windows.LazyProc
1892
	trackMouseEvent             *windows.LazyProc
1893
	trackPopupMenu              *windows.LazyProc
1894
	trackPopupMenuEx            *windows.LazyProc
1895
	translateMessage            *windows.LazyProc
1896
	unhookWinEvent              *windows.LazyProc
1897
	updateWindow                *windows.LazyProc
1898
	windowFromDC                *windows.LazyProc
1899
	windowFromPoint             *windows.LazyProc
1900
)
1901

1902
func init() {
1903
	is64bit := unsafe.Sizeof(uintptr(0)) == 8
1904

1905
	// Library
1906
	libuser32 = windows.NewLazySystemDLL("user32.dll")
1907

1908
	// Functions
1909
	addClipboardFormatListener = libuser32.NewProc("AddClipboardFormatListener")
1910
	adjustWindowRect = libuser32.NewProc("AdjustWindowRect")
1911
	attachThreadInput = libuser32.NewProc("AttachThreadInput")
1912
	animateWindow = libuser32.NewProc("AnimateWindow")
1913
	beginDeferWindowPos = libuser32.NewProc("BeginDeferWindowPos")
1914
	beginPaint = libuser32.NewProc("BeginPaint")
1915
	bringWindowToTop = libuser32.NewProc("BringWindowToTop")
1916
	callWindowProc = libuser32.NewProc("CallWindowProcW")
1917
	changeWindowMessageFilterEx = libuser32.NewProc("ChangeWindowMessageFilterEx")
1918
	checkMenuRadioItem = libuser32.NewProc("CheckMenuRadioItem")
1919
	clientToScreen = libuser32.NewProc("ClientToScreen")
1920
	closeClipboard = libuser32.NewProc("CloseClipboard")
1921
	createDialogParam = libuser32.NewProc("CreateDialogParamW")
1922
	createIconIndirect = libuser32.NewProc("CreateIconIndirect")
1923
	createMenu = libuser32.NewProc("CreateMenu")
1924
	createPopupMenu = libuser32.NewProc("CreatePopupMenu")
1925
	createWindowEx = libuser32.NewProc("CreateWindowExW")
1926
	deferWindowPos = libuser32.NewProc("DeferWindowPos")
1927
	defWindowProc = libuser32.NewProc("DefWindowProcW")
1928
	deleteMenu = libuser32.NewProc("DeleteMenu")
1929
	destroyIcon = libuser32.NewProc("DestroyIcon")
1930
	destroyMenu = libuser32.NewProc("DestroyMenu")
1931
	destroyWindow = libuser32.NewProc("DestroyWindow")
1932
	dialogBoxParam = libuser32.NewProc("DialogBoxParamW")
1933
	dispatchMessage = libuser32.NewProc("DispatchMessageW")
1934
	drawIconEx = libuser32.NewProc("DrawIconEx")
1935
	drawFocusRect = libuser32.NewProc("DrawFocusRect")
1936
	drawMenuBar = libuser32.NewProc("DrawMenuBar")
1937
	drawTextEx = libuser32.NewProc("DrawTextExW")
1938
	emptyClipboard = libuser32.NewProc("EmptyClipboard")
1939
	enableMenuItem = libuser32.NewProc("EnableMenuItem")
1940
	enableWindow = libuser32.NewProc("EnableWindow")
1941
	endDeferWindowPos = libuser32.NewProc("EndDeferWindowPos")
1942
	endDialog = libuser32.NewProc("EndDialog")
1943
	endPaint = libuser32.NewProc("EndPaint")
1944
	enumChildWindows = libuser32.NewProc("EnumChildWindows")
1945
	findWindow = libuser32.NewProc("FindWindowW")
1946
	getActiveWindow = libuser32.NewProc("GetActiveWindow")
1947
	getAncestor = libuser32.NewProc("GetAncestor")
1948
	getCaretPos = libuser32.NewProc("GetCaretPos")
1949
	getClassName = libuser32.NewProc("GetClassNameW")
1950
	getClientRect = libuser32.NewProc("GetClientRect")
1951
	getClipboardData = libuser32.NewProc("GetClipboardData")
1952
	getCursorPos = libuser32.NewProc("GetCursorPos")
1953
	getDC = libuser32.NewProc("GetDC")
1954
	getDesktopWindow = libuser32.NewProc("GetDesktopWindow")
1955
	getDlgItem = libuser32.NewProc("GetDlgItem")
1956
	getDpiForWindow = libuser32.NewProc("GetDpiForWindow")
1957
	getFocus = libuser32.NewProc("GetFocus")
1958
	getForegroundWindow = libuser32.NewProc("GetForegroundWindow")
1959
	getIconInfo = libuser32.NewProc("GetIconInfo")
1960
	getKeyState = libuser32.NewProc("GetKeyState")
1961
	getMenuCheckMarkDimensions = libuser32.NewProc("GetMenuCheckMarkDimensions")
1962
	getMenuInfo = libuser32.NewProc("GetMenuInfo")
1963
	getMenuItemCount = libuser32.NewProc("GetMenuItemCount")
1964
	getMenuItemID = libuser32.NewProc("GetMenuItemID")
1965
	getMenuItemInfo = libuser32.NewProc("GetMenuItemInfoW")
1966
	getMessage = libuser32.NewProc("GetMessageW")
1967
	getMonitorInfo = libuser32.NewProc("GetMonitorInfoW")
1968
	getParent = libuser32.NewProc("GetParent")
1969
	getRawInputData = libuser32.NewProc("GetRawInputData")
1970
	getScrollInfo = libuser32.NewProc("GetScrollInfo")
1971
	getSubMenu = libuser32.NewProc("GetSubMenu")
1972
	getSysColor = libuser32.NewProc("GetSysColor")
1973
	getSysColorBrush = libuser32.NewProc("GetSysColorBrush")
1974
	getSystemMenu = libuser32.NewProc("GetSystemMenu")
1975
	getSystemMetrics = libuser32.NewProc("GetSystemMetrics")
1976
	getSystemMetricsForDpi = libuser32.NewProc("GetSystemMetricsForDpi")
1977
	getWindow = libuser32.NewProc("GetWindow")
1978
	getWindowLong = libuser32.NewProc("GetWindowLongW")
1979
	// On 32 bit GetWindowLongPtrW is not available
1980
	if is64bit {
1981
		getWindowLongPtr = libuser32.NewProc("GetWindowLongPtrW")
1982
	} else {
1983
		getWindowLongPtr = libuser32.NewProc("GetWindowLongW")
1984
	}
1985
	getWindowPlacement = libuser32.NewProc("GetWindowPlacement")
1986
	getWindowRect = libuser32.NewProc("GetWindowRect")
1987
	getWindowThreadProcessId = libuser32.NewProc("GetWindowThreadProcessId")
1988
	insertMenuItem = libuser32.NewProc("InsertMenuItemW")
1989
	invalidateRect = libuser32.NewProc("InvalidateRect")
1990
	isChild = libuser32.NewProc("IsChild")
1991
	isClipboardFormatAvailable = libuser32.NewProc("IsClipboardFormatAvailable")
1992
	isDialogMessage = libuser32.NewProc("IsDialogMessageW")
1993
	isIconic = libuser32.NewProc("IsIconic")
1994
	isWindowEnabled = libuser32.NewProc("IsWindowEnabled")
1995
	isWindowVisible = libuser32.NewProc("IsWindowVisible")
1996
	isZoomed = libuser32.NewProc("IsZoomed")
1997
	killTimer = libuser32.NewProc("KillTimer")
1998
	loadCursor = libuser32.NewProc("LoadCursorW")
1999
	loadIcon = libuser32.NewProc("LoadIconW")
2000
	loadImage = libuser32.NewProc("LoadImageW")
2001
	loadMenu = libuser32.NewProc("LoadMenuW")
2002
	loadString = libuser32.NewProc("LoadStringW")
2003
	messageBeep = libuser32.NewProc("MessageBeep")
2004
	messageBox = libuser32.NewProc("MessageBoxW")
2005
	monitorFromWindow = libuser32.NewProc("MonitorFromWindow")
2006
	moveWindow = libuser32.NewProc("MoveWindow")
2007
	notifyWinEvent = libuser32.NewProc("NotifyWinEvent")
2008
	unregisterClass = libuser32.NewProc("UnregisterClassW")
2009
	openClipboard = libuser32.NewProc("OpenClipboard")
2010
	peekMessage = libuser32.NewProc("PeekMessageW")
2011
	postMessage = libuser32.NewProc("PostMessageW")
2012
	postQuitMessage = libuser32.NewProc("PostQuitMessage")
2013
	redrawWindow = libuser32.NewProc("RedrawWindow")
2014
	registerClassEx = libuser32.NewProc("RegisterClassExW")
2015
	registerRawInputDevices = libuser32.NewProc("RegisterRawInputDevices")
2016
	registerWindowMessage = libuser32.NewProc("RegisterWindowMessageW")
2017
	releaseCapture = libuser32.NewProc("ReleaseCapture")
2018
	releaseDC = libuser32.NewProc("ReleaseDC")
2019
	removeMenu = libuser32.NewProc("RemoveMenu")
2020
	screenToClient = libuser32.NewProc("ScreenToClient")
2021
	sendDlgItemMessage = libuser32.NewProc("SendDlgItemMessageW")
2022
	sendInput = libuser32.NewProc("SendInput")
2023
	sendMessage = libuser32.NewProc("SendMessageW")
2024
	setActiveWindow = libuser32.NewProc("SetActiveWindow")
2025
	setCapture = libuser32.NewProc("SetCapture")
2026
	setClipboardData = libuser32.NewProc("SetClipboardData")
2027
	setCursor = libuser32.NewProc("SetCursor")
2028
	setCursorPos = libuser32.NewProc("SetCursorPos")
2029
	setFocus = libuser32.NewProc("SetFocus")
2030
	setForegroundWindow = libuser32.NewProc("SetForegroundWindow")
2031
	setMenu = libuser32.NewProc("SetMenu")
2032
	setMenuDefaultItem = libuser32.NewProc("SetMenuDefaultItem")
2033
	setMenuInfo = libuser32.NewProc("SetMenuInfo")
2034
	setMenuItemBitmaps = libuser32.NewProc("SetMenuItemBitmaps")
2035
	setMenuItemInfo = libuser32.NewProc("SetMenuItemInfoW")
2036
	setRect = libuser32.NewProc("SetRect")
2037
	setParent = libuser32.NewProc("SetParent")
2038
	setScrollInfo = libuser32.NewProc("SetScrollInfo")
2039
	setTimer = libuser32.NewProc("SetTimer")
2040
	setWinEventHook = libuser32.NewProc("SetWinEventHook")
2041
	setWindowLong = libuser32.NewProc("SetWindowLongW")
2042
	// On 32 bit SetWindowLongPtrW is not available
2043
	if is64bit {
2044
		setWindowLongPtr = libuser32.NewProc("SetWindowLongPtrW")
2045
	} else {
2046
		setWindowLongPtr = libuser32.NewProc("SetWindowLongW")
2047
	}
2048
	setWindowPlacement = libuser32.NewProc("SetWindowPlacement")
2049
	setWindowPos = libuser32.NewProc("SetWindowPos")
2050
	showWindow = libuser32.NewProc("ShowWindow")
2051
	systemParametersInfo = libuser32.NewProc("SystemParametersInfoW")
2052
	trackMouseEvent = libuser32.NewProc("TrackMouseEvent")
2053
	trackPopupMenu = libuser32.NewProc("TrackPopupMenu")
2054
	trackPopupMenuEx = libuser32.NewProc("TrackPopupMenuEx")
2055
	translateMessage = libuser32.NewProc("TranslateMessage")
2056
	unhookWinEvent = libuser32.NewProc("UnhookWinEvent")
2057
	updateWindow = libuser32.NewProc("UpdateWindow")
2058
	windowFromDC = libuser32.NewProc("WindowFromDC")
2059
	windowFromPoint = libuser32.NewProc("WindowFromPoint")
2060
}
2061

2062
func AddClipboardFormatListener(hwnd HWND) bool {
2063
	if addClipboardFormatListener.Find() != nil {
2064
		return false
2065
	}
2066

2067
	ret, _, _ := syscall.Syscall(addClipboardFormatListener.Addr(), 1,
2068
		uintptr(hwnd),
2069
		0,
2070
		0)
2071

2072
	return ret != 0
2073
}
2074

2075
func AdjustWindowRect(lpRect *RECT, dwStyle uint32, bMenu bool) bool {
2076
	ret, _, _ := syscall.Syscall(adjustWindowRect.Addr(), 3,
2077
		uintptr(unsafe.Pointer(lpRect)),
2078
		uintptr(dwStyle),
2079
		uintptr(BoolToBOOL(bMenu)))
2080

2081
	return ret != 0
2082
}
2083

2084
func AttachThreadInput(idAttach int32, idAttachTo int32, fAttach bool) bool {
2085
	ret, _, _ := syscall.Syscall(attachThreadInput.Addr(), 3,
2086
		uintptr(idAttach),
2087
		uintptr(idAttachTo),
2088
		uintptr(BoolToBOOL(fAttach)))
2089

2090
	return ret != 0
2091
}
2092

2093
func AnimateWindow(hwnd HWND, dwTime, dwFlags uint32) bool {
2094
	ret, _, _ := syscall.Syscall(animateWindow.Addr(), 3,
2095
		uintptr(hwnd),
2096
		uintptr(dwTime),
2097
		uintptr(dwFlags))
2098

2099
	return ret != 0
2100
}
2101

2102
func BeginDeferWindowPos(nNumWindows int32) HDWP {
2103
	ret, _, _ := syscall.Syscall(beginDeferWindowPos.Addr(), 1,
2104
		uintptr(nNumWindows),
2105
		0,
2106
		0)
2107

2108
	return HDWP(ret)
2109
}
2110

2111
func GetWindowThreadProcessId(hwnd HWND, processId *uint32) uint32 {
2112
	ret, _, _ := syscall.Syscall(getWindowThreadProcessId.Addr(), 2,
2113
		uintptr(hwnd),
2114
		uintptr(unsafe.Pointer(processId)),
2115
		0)
2116

2117
	return uint32(ret)
2118
}
2119

2120
func BeginPaint(hwnd HWND, lpPaint *PAINTSTRUCT) HDC {
2121
	ret, _, _ := syscall.Syscall(beginPaint.Addr(), 2,
2122
		uintptr(hwnd),
2123
		uintptr(unsafe.Pointer(lpPaint)),
2124
		0)
2125

2126
	return HDC(ret)
2127
}
2128

2129
func BringWindowToTop(hwnd HWND) bool {
2130
	ret, _, _ := syscall.Syscall(bringWindowToTop.Addr(), 1,
2131
		uintptr(hwnd),
2132
		0,
2133
		0)
2134
	return ret != 0
2135
}
2136

2137
func CallWindowProc(lpPrevWndFunc uintptr, hWnd HWND, Msg uint32, wParam, lParam uintptr) uintptr {
2138
	ret, _, _ := syscall.Syscall6(callWindowProc.Addr(), 5,
2139
		lpPrevWndFunc,
2140
		uintptr(hWnd),
2141
		uintptr(Msg),
2142
		wParam,
2143
		lParam,
2144
		0)
2145

2146
	return ret
2147
}
2148

2149
func ChangeWindowMessageFilterEx(hwnd HWND, msg uint32, action uint32, changeFilterStruct *CHANGEFILTERSTRUCT) bool {
2150
	ret, _, _ := syscall.Syscall6(changeWindowMessageFilterEx.Addr(), 4,
2151
		uintptr(hwnd),
2152
		uintptr(msg),
2153
		uintptr(action),
2154
		uintptr(unsafe.Pointer(changeFilterStruct)),
2155
		0,
2156
		0)
2157
	return ret != 0
2158
}
2159

2160
func CheckMenuRadioItem(hmenu HMENU, first, last, check, flags uint32) bool {
2161
	ret, _, _ := syscall.Syscall6(checkMenuRadioItem.Addr(), 5,
2162
		uintptr(hmenu),
2163
		uintptr(first),
2164
		uintptr(last),
2165
		uintptr(check),
2166
		uintptr(flags),
2167
		0)
2168

2169
	return ret != 0
2170
}
2171

2172
func ClientToScreen(hwnd HWND, lpPoint *POINT) bool {
2173
	ret, _, _ := syscall.Syscall(clientToScreen.Addr(), 2,
2174
		uintptr(hwnd),
2175
		uintptr(unsafe.Pointer(lpPoint)),
2176
		0)
2177

2178
	return ret != 0
2179
}
2180

2181
func CloseClipboard() bool {
2182
	ret, _, _ := syscall.Syscall(closeClipboard.Addr(), 0,
2183
		0,
2184
		0,
2185
		0)
2186

2187
	return ret != 0
2188
}
2189

2190
func CreateDialogParam(instRes HINSTANCE, name *uint16, parent HWND,
2191
	proc, param uintptr) HWND {
2192
	ret, _, _ := syscall.Syscall6(createDialogParam.Addr(), 5,
2193
		uintptr(instRes),
2194
		uintptr(unsafe.Pointer(name)),
2195
		uintptr(parent),
2196
		proc,
2197
		param,
2198
		0)
2199

2200
	return HWND(ret)
2201
}
2202

2203
func CreateIconIndirect(lpiconinfo *ICONINFO) HICON {
2204
	ret, _, _ := syscall.Syscall(createIconIndirect.Addr(), 1,
2205
		uintptr(unsafe.Pointer(lpiconinfo)),
2206
		0,
2207
		0)
2208

2209
	return HICON(ret)
2210
}
2211

2212
func CreateMenu() HMENU {
2213
	ret, _, _ := syscall.Syscall(createMenu.Addr(), 0,
2214
		0,
2215
		0,
2216
		0)
2217

2218
	return HMENU(ret)
2219
}
2220

2221
func CreatePopupMenu() HMENU {
2222
	ret, _, _ := syscall.Syscall(createPopupMenu.Addr(), 0,
2223
		0,
2224
		0,
2225
		0)
2226

2227
	return HMENU(ret)
2228
}
2229

2230
func CreateWindowEx(dwExStyle uint32, lpClassName, lpWindowName *uint16, dwStyle uint32, x, y, nWidth, nHeight int32, hWndParent HWND, hMenu HMENU, hInstance HINSTANCE, lpParam unsafe.Pointer) HWND {
2231
	ret, _, _ := syscall.Syscall12(createWindowEx.Addr(), 12,
2232
		uintptr(dwExStyle),
2233
		uintptr(unsafe.Pointer(lpClassName)),
2234
		uintptr(unsafe.Pointer(lpWindowName)),
2235
		uintptr(dwStyle),
2236
		uintptr(x),
2237
		uintptr(y),
2238
		uintptr(nWidth),
2239
		uintptr(nHeight),
2240
		uintptr(hWndParent),
2241
		uintptr(hMenu),
2242
		uintptr(hInstance),
2243
		uintptr(lpParam))
2244

2245
	return HWND(ret)
2246
}
2247

2248
func DeferWindowPos(hWinPosInfo HDWP, hWnd, hWndInsertAfter HWND, x, y, cx, cy int32, uFlags uint32) HDWP {
2249
	ret, _, _ := syscall.Syscall9(deferWindowPos.Addr(), 8,
2250
		uintptr(hWinPosInfo),
2251
		uintptr(hWnd),
2252
		uintptr(hWndInsertAfter),
2253
		uintptr(x),
2254
		uintptr(y),
2255
		uintptr(cx),
2256
		uintptr(cy),
2257
		uintptr(uFlags),
2258
		0)
2259

2260
	return HDWP(ret)
2261
}
2262

2263
func DefWindowProc(hWnd HWND, Msg uint32, wParam, lParam uintptr) uintptr {
2264
	ret, _, _ := syscall.Syscall6(defWindowProc.Addr(), 4,
2265
		uintptr(hWnd),
2266
		uintptr(Msg),
2267
		wParam,
2268
		lParam,
2269
		0,
2270
		0)
2271

2272
	return ret
2273
}
2274

2275
func DeleteMenu(hMenu HMENU, uPosition uint32, uFlags uint32) bool {
2276
	ret, _, _ := syscall.Syscall(deleteMenu.Addr(), 3,
2277
		uintptr(hMenu),
2278
		uintptr(uPosition),
2279
		uintptr(uFlags))
2280

2281
	return ret != 0
2282
}
2283

2284
func DestroyIcon(hIcon HICON) bool {
2285
	ret, _, _ := syscall.Syscall(destroyIcon.Addr(), 1,
2286
		uintptr(hIcon),
2287
		0,
2288
		0)
2289

2290
	return ret != 0
2291
}
2292

2293
func DestroyMenu(hMenu HMENU) bool {
2294
	ret, _, _ := syscall.Syscall(destroyMenu.Addr(), 1,
2295
		uintptr(hMenu),
2296
		0,
2297
		0)
2298

2299
	return ret != 0
2300
}
2301

2302
func DestroyWindow(hWnd HWND) bool {
2303
	ret, _, _ := syscall.Syscall(destroyWindow.Addr(), 1,
2304
		uintptr(hWnd),
2305
		0,
2306
		0)
2307

2308
	return ret != 0
2309
}
2310

2311
func DialogBoxParam(instRes HINSTANCE, name *uint16, parent HWND, proc, param uintptr) int {
2312
	ret, _, _ := syscall.Syscall6(dialogBoxParam.Addr(), 5,
2313
		uintptr(instRes),
2314
		uintptr(unsafe.Pointer(name)),
2315
		uintptr(parent),
2316
		proc,
2317
		param,
2318
		0)
2319

2320
	return int(ret)
2321
}
2322

2323
func DispatchMessage(msg *MSG) uintptr {
2324
	ret, _, _ := syscall.Syscall(dispatchMessage.Addr(), 1,
2325
		uintptr(unsafe.Pointer(msg)),
2326
		0,
2327
		0)
2328

2329
	return ret
2330
}
2331

2332
func DrawFocusRect(hDC HDC, lprc *RECT) bool {
2333
	ret, _, _ := syscall.Syscall(drawFocusRect.Addr(), 2,
2334
		uintptr(hDC),
2335
		uintptr(unsafe.Pointer(lprc)),
2336
		0)
2337

2338
	return ret != 0
2339
}
2340

2341
func DrawIconEx(hdc HDC, xLeft, yTop int32, hIcon HICON, cxWidth, cyWidth int32, istepIfAniCur uint32, hbrFlickerFreeDraw HBRUSH, diFlags uint32) bool {
2342
	ret, _, _ := syscall.Syscall9(drawIconEx.Addr(), 9,
2343
		uintptr(hdc),
2344
		uintptr(xLeft),
2345
		uintptr(yTop),
2346
		uintptr(hIcon),
2347
		uintptr(cxWidth),
2348
		uintptr(cyWidth),
2349
		uintptr(istepIfAniCur),
2350
		uintptr(hbrFlickerFreeDraw),
2351
		uintptr(diFlags))
2352

2353
	return ret != 0
2354
}
2355

2356
func DrawMenuBar(hWnd HWND) bool {
2357
	ret, _, _ := syscall.Syscall(drawMenuBar.Addr(), 1,
2358
		uintptr(hWnd),
2359
		0,
2360
		0)
2361

2362
	return ret != 0
2363
}
2364

2365
func DrawTextEx(hdc HDC, lpchText *uint16, cchText int32, lprc *RECT, dwDTFormat uint32, lpDTParams *DRAWTEXTPARAMS) int32 {
2366
	ret, _, _ := syscall.Syscall6(drawTextEx.Addr(), 6,
2367
		uintptr(hdc),
2368
		uintptr(unsafe.Pointer(lpchText)),
2369
		uintptr(cchText),
2370
		uintptr(unsafe.Pointer(lprc)),
2371
		uintptr(dwDTFormat),
2372
		uintptr(unsafe.Pointer(lpDTParams)))
2373

2374
	return int32(ret)
2375
}
2376

2377
func EmptyClipboard() bool {
2378
	ret, _, _ := syscall.Syscall(emptyClipboard.Addr(), 0,
2379
		0,
2380
		0,
2381
		0)
2382

2383
	return ret != 0
2384
}
2385

2386
func EnableMenuItem(hMenu HMENU, uIDEnableItem uint32, uEnable uint32) bool {
2387
	ret, _, _ := syscall.Syscall(enableMenuItem.Addr(), 3,
2388
		uintptr(hMenu),
2389
		uintptr(uIDEnableItem),
2390
		uintptr(uEnable))
2391

2392
	return ret != 0
2393
}
2394

2395
func EnableWindow(hWnd HWND, bEnable bool) bool {
2396
	ret, _, _ := syscall.Syscall(enableWindow.Addr(), 2,
2397
		uintptr(hWnd),
2398
		uintptr(BoolToBOOL(bEnable)),
2399
		0)
2400

2401
	return ret != 0
2402
}
2403

2404
func EndDeferWindowPos(hWinPosInfo HDWP) bool {
2405
	ret, _, _ := syscall.Syscall(endDeferWindowPos.Addr(), 1,
2406
		uintptr(hWinPosInfo),
2407
		0,
2408
		0)
2409

2410
	return ret != 0
2411
}
2412

2413
func EndDialog(hwnd HWND, result int) bool {
2414
	ret, _, _ := syscall.Syscall(endDialog.Addr(), 2,
2415
		uintptr(hwnd),
2416
		uintptr(result),
2417
		0)
2418

2419
	return ret != 0
2420
}
2421

2422
func EndPaint(hwnd HWND, lpPaint *PAINTSTRUCT) bool {
2423
	ret, _, _ := syscall.Syscall(endPaint.Addr(), 2,
2424
		uintptr(hwnd),
2425
		uintptr(unsafe.Pointer(lpPaint)),
2426
		0)
2427

2428
	return ret != 0
2429
}
2430

2431
func EnumChildWindows(hWndParent HWND, lpEnumFunc, lParam uintptr) bool {
2432
	ret, _, _ := syscall.Syscall(enumChildWindows.Addr(), 3,
2433
		uintptr(hWndParent),
2434
		lpEnumFunc,
2435
		lParam)
2436

2437
	return ret != 0
2438
}
2439

2440
func FindWindow(lpClassName, lpWindowName *uint16) HWND {
2441
	ret, _, _ := syscall.Syscall(findWindow.Addr(), 2,
2442
		uintptr(unsafe.Pointer(lpClassName)),
2443
		uintptr(unsafe.Pointer(lpWindowName)),
2444
		0)
2445

2446
	return HWND(ret)
2447
}
2448

2449
func GetActiveWindow() HWND {
2450
	ret, _, _ := syscall.Syscall(getActiveWindow.Addr(), 0,
2451
		0,
2452
		0,
2453
		0)
2454

2455
	return HWND(ret)
2456
}
2457

2458
func GetAncestor(hWnd HWND, gaFlags uint32) HWND {
2459
	ret, _, _ := syscall.Syscall(getAncestor.Addr(), 2,
2460
		uintptr(hWnd),
2461
		uintptr(gaFlags),
2462
		0)
2463

2464
	return HWND(ret)
2465
}
2466

2467
func GetCaretPos(lpPoint *POINT) bool {
2468
	ret, _, _ := syscall.Syscall(getCaretPos.Addr(), 1,
2469
		uintptr(unsafe.Pointer(lpPoint)),
2470
		0,
2471
		0)
2472

2473
	return ret != 0
2474
}
2475

2476
func GetClassName(hWnd HWND, className *uint16, maxCount int) (int, error) {
2477
	ret, _, e := syscall.Syscall(getClassName.Addr(), 3,
2478
		uintptr(hWnd),
2479
		uintptr(unsafe.Pointer(className)),
2480
		uintptr(maxCount))
2481
	if ret == 0 {
2482
		return 0, e
2483
	}
2484
	return int(ret), nil
2485
}
2486

2487
func GetClientRect(hWnd HWND, rect *RECT) bool {
2488
	ret, _, _ := syscall.Syscall(getClientRect.Addr(), 2,
2489
		uintptr(hWnd),
2490
		uintptr(unsafe.Pointer(rect)),
2491
		0)
2492

2493
	return ret != 0
2494
}
2495

2496
func GetClipboardData(uFormat uint32) HANDLE {
2497
	ret, _, _ := syscall.Syscall(getClipboardData.Addr(), 1,
2498
		uintptr(uFormat),
2499
		0,
2500
		0)
2501

2502
	return HANDLE(ret)
2503
}
2504

2505
func GetCursorPos(lpPoint *POINT) bool {
2506
	ret, _, _ := syscall.Syscall(getCursorPos.Addr(), 1,
2507
		uintptr(unsafe.Pointer(lpPoint)),
2508
		0,
2509
		0)
2510

2511
	return ret != 0
2512
}
2513

2514
func GetDesktopWindow() HWND {
2515
	ret, _, _ := syscall.Syscall(getDesktopWindow.Addr(), 0,
2516
		0,
2517
		0,
2518
		0)
2519

2520
	return HWND(ret)
2521
}
2522

2523
func GetDC(hWnd HWND) HDC {
2524
	ret, _, _ := syscall.Syscall(getDC.Addr(), 1,
2525
		uintptr(hWnd),
2526
		0,
2527
		0)
2528

2529
	return HDC(ret)
2530
}
2531

2532
func GetDlgItem(hDlg HWND, nIDDlgItem int32) HWND {
2533
	ret, _, _ := syscall.Syscall(getDlgItem.Addr(), 2,
2534
		uintptr(hDlg),
2535
		uintptr(nIDDlgItem),
2536
		0)
2537

2538
	return HWND(ret)
2539
}
2540

2541
func GetDpiForWindow(hwnd HWND) uint32 {
2542
	if getDpiForWindow.Find() != nil {
2543
		hdc := GetDC(hwnd)
2544
		defer ReleaseDC(hwnd, hdc)
2545

2546
		return uint32(GetDeviceCaps(hdc, LOGPIXELSY))
2547
	}
2548

2549
	ret, _, _ := syscall.Syscall(getDpiForWindow.Addr(), 1,
2550
		uintptr(hwnd),
2551
		0,
2552
		0)
2553

2554
	return uint32(ret)
2555
}
2556

2557
func GetFocus() HWND {
2558
	ret, _, _ := syscall.Syscall(getFocus.Addr(), 0,
2559
		0,
2560
		0,
2561
		0)
2562

2563
	return HWND(ret)
2564
}
2565

2566
func GetForegroundWindow() HWND {
2567
	ret, _, _ := syscall.Syscall(getForegroundWindow.Addr(), 0,
2568
		0,
2569
		0,
2570
		0)
2571

2572
	return HWND(ret)
2573
}
2574

2575
func GetIconInfo(hicon HICON, piconinfo *ICONINFO) bool {
2576
	ret, _, _ := syscall.Syscall(getIconInfo.Addr(), 2,
2577
		uintptr(hicon),
2578
		uintptr(unsafe.Pointer(piconinfo)),
2579
		0)
2580

2581
	return ret != 0
2582
}
2583

2584
func GetKeyState(nVirtKey int32) int16 {
2585
	ret, _, _ := syscall.Syscall(getKeyState.Addr(), 1,
2586
		uintptr(nVirtKey),
2587
		0,
2588
		0)
2589

2590
	return int16(ret)
2591
}
2592

2593
func GetMenuCheckMarkDimensions() int32 {
2594
	ret, _, _ := syscall.Syscall(getMenuCheckMarkDimensions.Addr(), 0,
2595
		0,
2596
		0,
2597
		0)
2598

2599
	return int32(ret)
2600
}
2601

2602
func GetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {
2603
	ret, _, _ := syscall.Syscall(getMenuInfo.Addr(), 2,
2604
		uintptr(hmenu),
2605
		uintptr(unsafe.Pointer(lpcmi)),
2606
		0)
2607

2608
	return ret != 0
2609
}
2610

2611
func GetMenuItemCount(hMenu HMENU) int32 {
2612
	ret, _, _ := syscall.Syscall(getMenuItemCount.Addr(), 1,
2613
		uintptr(hMenu),
2614
		0,
2615
		0)
2616

2617
	return int32(ret)
2618
}
2619

2620
func GetMenuItemID(hMenu HMENU, nPos int32) uint32 {
2621
	ret, _, _ := syscall.Syscall(getMenuItemID.Addr(), 2,
2622
		uintptr(hMenu),
2623
		uintptr(nPos),
2624
		0)
2625

2626
	return uint32(ret)
2627
}
2628

2629
func GetMenuItemInfo(hmenu HMENU, item uint32, fByPosition BOOL, lpmii *MENUITEMINFO) bool {
2630
	ret, _, _ := syscall.Syscall6(getMenuItemInfo.Addr(), 4,
2631
		uintptr(hmenu),
2632
		uintptr(item),
2633
		uintptr(fByPosition),
2634
		uintptr(unsafe.Pointer(lpmii)),
2635
		0,
2636
		0)
2637

2638
	return ret != 0
2639
}
2640

2641
func GetMessage(msg *MSG, hWnd HWND, msgFilterMin, msgFilterMax uint32) BOOL {
2642
	ret, _, _ := syscall.Syscall6(getMessage.Addr(), 4,
2643
		uintptr(unsafe.Pointer(msg)),
2644
		uintptr(hWnd),
2645
		uintptr(msgFilterMin),
2646
		uintptr(msgFilterMax),
2647
		0,
2648
		0)
2649

2650
	return BOOL(ret)
2651
}
2652

2653
func GetMonitorInfo(hMonitor HMONITOR, lpmi *MONITORINFO) bool {
2654
	ret, _, _ := syscall.Syscall(getMonitorInfo.Addr(), 2,
2655
		uintptr(hMonitor),
2656
		uintptr(unsafe.Pointer(lpmi)),
2657
		0)
2658

2659
	return ret != 0
2660
}
2661

2662
func GetParent(hWnd HWND) HWND {
2663
	ret, _, _ := syscall.Syscall(getParent.Addr(), 1,
2664
		uintptr(hWnd),
2665
		0,
2666
		0)
2667

2668
	return HWND(ret)
2669
}
2670

2671
func GetRawInputData(hRawInput HRAWINPUT, uiCommand uint32, pData unsafe.Pointer, pcbSize *uint32, cBSizeHeader uint32) uint32 {
2672
	ret, _, _ := syscall.Syscall6(getRawInputData.Addr(), 5,
2673
		uintptr(hRawInput),
2674
		uintptr(uiCommand),
2675
		uintptr(pData),
2676
		uintptr(unsafe.Pointer(pcbSize)),
2677
		uintptr(cBSizeHeader),
2678
		0)
2679

2680
	return uint32(ret)
2681
}
2682

2683
func GetScrollInfo(hwnd HWND, fnBar int32, lpsi *SCROLLINFO) bool {
2684
	ret, _, _ := syscall.Syscall(getScrollInfo.Addr(), 3,
2685
		uintptr(hwnd),
2686
		uintptr(fnBar),
2687
		uintptr(unsafe.Pointer(lpsi)))
2688

2689
	return ret != 0
2690
}
2691

2692
func GetSubMenu(hMenu HMENU, nPos int32) HMENU {
2693
	ret, _, _ := syscall.Syscall(getSubMenu.Addr(), 2,
2694
		uintptr(hMenu),
2695
		uintptr(nPos),
2696
		0)
2697

2698
	return HMENU(ret)
2699
}
2700

2701
func GetSysColor(nIndex int) uint32 {
2702
	ret, _, _ := syscall.Syscall(getSysColor.Addr(), 1,
2703
		uintptr(nIndex),
2704
		0,
2705
		0)
2706

2707
	return uint32(ret)
2708
}
2709

2710
func GetSysColorBrush(nIndex int) HBRUSH {
2711
	ret, _, _ := syscall.Syscall(getSysColorBrush.Addr(), 1,
2712
		uintptr(nIndex),
2713
		0,
2714
		0)
2715

2716
	return HBRUSH(ret)
2717
}
2718

2719
func GetSystemMenu(hWnd HWND, revert bool) HMENU {
2720
	ret, _, _ := syscall.Syscall(getSystemMenu.Addr(), 2,
2721
		uintptr(hWnd),
2722
		uintptr(BoolToBOOL(revert)),
2723
		0)
2724
	return HMENU(ret)
2725
}
2726

2727
func GetSystemMetrics(nIndex int32) int32 {
2728
	ret, _, _ := syscall.Syscall(getSystemMetrics.Addr(), 1,
2729
		uintptr(nIndex),
2730
		0,
2731
		0)
2732

2733
	return int32(ret)
2734
}
2735

2736
func GetSystemMetricsForDpi(nIndex int32, dpi uint32) int32 {
2737
	if getSystemMetricsForDpi.Find() != nil {
2738
		return GetSystemMetrics(nIndex)
2739
	}
2740

2741
	ret, _, _ := syscall.Syscall(getSystemMetricsForDpi.Addr(), 2,
2742
		uintptr(nIndex),
2743
		uintptr(dpi),
2744
		0)
2745

2746
	return int32(ret)
2747
}
2748

2749
func GetWindow(hWnd HWND, uCmd uint32) HWND {
2750
	ret, _, _ := syscall.Syscall(getWindow.Addr(), 2,
2751
		uintptr(hWnd),
2752
		uintptr(uCmd),
2753
		0)
2754

2755
	return HWND(ret)
2756
}
2757

2758
func GetWindowLong(hWnd HWND, index int32) int32 {
2759
	ret, _, _ := syscall.Syscall(getWindowLong.Addr(), 2,
2760
		uintptr(hWnd),
2761
		uintptr(index),
2762
		0)
2763

2764
	return int32(ret)
2765
}
2766

2767
func GetWindowLongPtr(hWnd HWND, index int32) uintptr {
2768
	ret, _, _ := syscall.Syscall(getWindowLongPtr.Addr(), 2,
2769
		uintptr(hWnd),
2770
		uintptr(index),
2771
		0)
2772

2773
	return ret
2774
}
2775

2776
func GetWindowPlacement(hWnd HWND, lpwndpl *WINDOWPLACEMENT) bool {
2777
	ret, _, _ := syscall.Syscall(getWindowPlacement.Addr(), 2,
2778
		uintptr(hWnd),
2779
		uintptr(unsafe.Pointer(lpwndpl)),
2780
		0)
2781

2782
	return ret != 0
2783
}
2784

2785
func GetWindowRect(hWnd HWND, rect *RECT) bool {
2786
	ret, _, _ := syscall.Syscall(getWindowRect.Addr(), 2,
2787
		uintptr(hWnd),
2788
		uintptr(unsafe.Pointer(rect)),
2789
		0)
2790

2791
	return ret != 0
2792
}
2793

2794
func InsertMenuItem(hMenu HMENU, uItem uint32, fByPosition bool, lpmii *MENUITEMINFO) bool {
2795
	ret, _, _ := syscall.Syscall6(insertMenuItem.Addr(), 4,
2796
		uintptr(hMenu),
2797
		uintptr(uItem),
2798
		uintptr(BoolToBOOL(fByPosition)),
2799
		uintptr(unsafe.Pointer(lpmii)),
2800
		0,
2801
		0)
2802

2803
	return ret != 0
2804
}
2805

2806
func InvalidateRect(hWnd HWND, lpRect *RECT, bErase bool) bool {
2807
	ret, _, _ := syscall.Syscall(invalidateRect.Addr(), 3,
2808
		uintptr(hWnd),
2809
		uintptr(unsafe.Pointer(lpRect)),
2810
		uintptr(BoolToBOOL(bErase)))
2811

2812
	return ret != 0
2813
}
2814

2815
func IsChild(hWndParent, hWnd HWND) bool {
2816
	ret, _, _ := syscall.Syscall(isChild.Addr(), 2,
2817
		uintptr(hWndParent),
2818
		uintptr(hWnd),
2819
		0)
2820

2821
	return ret != 0
2822
}
2823

2824
func IsClipboardFormatAvailable(format uint32) bool {
2825
	ret, _, _ := syscall.Syscall(isClipboardFormatAvailable.Addr(), 1,
2826
		uintptr(format),
2827
		0,
2828
		0)
2829

2830
	return ret != 0
2831
}
2832

2833
func IsDialogMessage(hWnd HWND, msg *MSG) bool {
2834
	ret, _, _ := syscall.Syscall(isDialogMessage.Addr(), 2,
2835
		uintptr(hWnd),
2836
		uintptr(unsafe.Pointer(msg)),
2837
		0)
2838

2839
	return ret != 0
2840
}
2841

2842
func IsIconic(hWnd HWND) bool {
2843
	ret, _, _ := syscall.Syscall(isIconic.Addr(), 1,
2844
		uintptr(hWnd),
2845
		0,
2846
		0)
2847

2848
	return ret != 0
2849
}
2850

2851
func IsWindowEnabled(hWnd HWND) bool {
2852
	ret, _, _ := syscall.Syscall(isWindowEnabled.Addr(), 1,
2853
		uintptr(hWnd),
2854
		0,
2855
		0)
2856

2857
	return ret != 0
2858
}
2859

2860
func IsWindowVisible(hWnd HWND) bool {
2861
	ret, _, _ := syscall.Syscall(isWindowVisible.Addr(), 1,
2862
		uintptr(hWnd),
2863
		0,
2864
		0)
2865

2866
	return ret != 0
2867
}
2868

2869
func IsZoomed(hWnd HWND) bool {
2870
	ret, _, _ := syscall.Syscall(isZoomed.Addr(), 1,
2871
		uintptr(hWnd),
2872
		0,
2873
		0)
2874

2875
	return ret != 0
2876
}
2877

2878
func KillTimer(hWnd HWND, uIDEvent uintptr) bool {
2879
	ret, _, _ := syscall.Syscall(killTimer.Addr(), 2,
2880
		uintptr(hWnd),
2881
		uIDEvent,
2882
		0)
2883

2884
	return ret != 0
2885
}
2886

2887
func LoadCursor(hInstance HINSTANCE, lpCursorName *uint16) HCURSOR {
2888
	ret, _, _ := syscall.Syscall(loadCursor.Addr(), 2,
2889
		uintptr(hInstance),
2890
		uintptr(unsafe.Pointer(lpCursorName)),
2891
		0)
2892

2893
	return HCURSOR(ret)
2894
}
2895

2896
func LoadIcon(hInstance HINSTANCE, lpIconName *uint16) HICON {
2897
	ret, _, _ := syscall.Syscall(loadIcon.Addr(), 2,
2898
		uintptr(hInstance),
2899
		uintptr(unsafe.Pointer(lpIconName)),
2900
		0)
2901

2902
	return HICON(ret)
2903
}
2904

2905
func LoadImage(hinst HINSTANCE, lpszName *uint16, uType uint32, cxDesired, cyDesired int32, fuLoad uint32) HANDLE {
2906
	ret, _, _ := syscall.Syscall6(loadImage.Addr(), 6,
2907
		uintptr(hinst),
2908
		uintptr(unsafe.Pointer(lpszName)),
2909
		uintptr(uType),
2910
		uintptr(cxDesired),
2911
		uintptr(cyDesired),
2912
		uintptr(fuLoad))
2913

2914
	return HANDLE(ret)
2915
}
2916

2917
func LoadMenu(hinst HINSTANCE, name *uint16) HMENU {
2918
	ret, _, _ := syscall.Syscall(loadMenu.Addr(), 2,
2919
		uintptr(hinst),
2920
		uintptr(unsafe.Pointer(name)),
2921
		0)
2922

2923
	return HMENU(ret)
2924
}
2925

2926
func LoadString(instRes HINSTANCE, id uint32, buf *uint16, length int32) int32 {
2927
	ret, _, _ := syscall.Syscall6(loadString.Addr(), 4,
2928
		uintptr(instRes),
2929
		uintptr(id),
2930
		uintptr(unsafe.Pointer(buf)),
2931
		uintptr(length),
2932
		0,
2933
		0)
2934

2935
	return 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.
2952
func MessageBeep(uType uint32) bool {
2953
	ret, _, _ := syscall.Syscall(messageBeep.Addr(), 2,
2954
		uintptr(uType),
2955
		0,
2956
		0)
2957

2958
	return ret != 0
2959
}
2960

2961
func MessageBox(hWnd HWND, lpText, lpCaption *uint16, uType uint32) int32 {
2962
	ret, _, _ := syscall.Syscall6(messageBox.Addr(), 4,
2963
		uintptr(hWnd),
2964
		uintptr(unsafe.Pointer(lpText)),
2965
		uintptr(unsafe.Pointer(lpCaption)),
2966
		uintptr(uType),
2967
		0,
2968
		0)
2969

2970
	return int32(ret)
2971
}
2972

2973
func MonitorFromWindow(hwnd HWND, dwFlags uint32) HMONITOR {
2974
	ret, _, _ := syscall.Syscall(monitorFromWindow.Addr(), 2,
2975
		uintptr(hwnd),
2976
		uintptr(dwFlags),
2977
		0)
2978

2979
	return HMONITOR(ret)
2980
}
2981

2982
func MoveWindow(hWnd HWND, x, y, width, height int32, repaint bool) bool {
2983
	ret, _, _ := syscall.Syscall6(moveWindow.Addr(), 6,
2984
		uintptr(hWnd),
2985
		uintptr(x),
2986
		uintptr(y),
2987
		uintptr(width),
2988
		uintptr(height),
2989
		uintptr(BoolToBOOL(repaint)))
2990

2991
	return ret != 0
2992
}
2993

2994
func NotifyWinEvent(event uint32, hwnd HWND, idObject, idChild int32) {
2995
	syscall.Syscall6(notifyWinEvent.Addr(), 4,
2996
		uintptr(event),
2997
		uintptr(hwnd),
2998
		uintptr(idObject),
2999
		uintptr(idChild),
3000
		0,
3001
		0)
3002
}
3003

3004
func UnregisterClass(name *uint16) bool {
3005
	ret, _, _ := syscall.Syscall(unregisterClass.Addr(), 1,
3006
		uintptr(unsafe.Pointer(name)),
3007
		0,
3008
		0)
3009

3010
	return ret != 0
3011
}
3012

3013
func OpenClipboard(hWndNewOwner HWND) bool {
3014
	ret, _, _ := syscall.Syscall(openClipboard.Addr(), 1,
3015
		uintptr(hWndNewOwner),
3016
		0,
3017
		0)
3018

3019
	return ret != 0
3020
}
3021

3022
func PeekMessage(lpMsg *MSG, hWnd HWND, wMsgFilterMin, wMsgFilterMax, wRemoveMsg uint32) bool {
3023
	ret, _, _ := syscall.Syscall6(peekMessage.Addr(), 5,
3024
		uintptr(unsafe.Pointer(lpMsg)),
3025
		uintptr(hWnd),
3026
		uintptr(wMsgFilterMin),
3027
		uintptr(wMsgFilterMax),
3028
		uintptr(wRemoveMsg),
3029
		0)
3030

3031
	return ret != 0
3032
}
3033

3034
func PostMessage(hWnd HWND, msg uint32, wParam, lParam uintptr) uintptr {
3035
	ret, _, _ := syscall.Syscall6(postMessage.Addr(), 4,
3036
		uintptr(hWnd),
3037
		uintptr(msg),
3038
		wParam,
3039
		lParam,
3040
		0,
3041
		0)
3042

3043
	return ret
3044
}
3045

3046
func PostQuitMessage(exitCode int32) {
3047
	syscall.Syscall(postQuitMessage.Addr(), 1,
3048
		uintptr(exitCode),
3049
		0,
3050
		0)
3051
}
3052

3053
const (
3054
	// RedrawWindow() flags
3055
	RDW_INVALIDATE    = 0x0001
3056
	RDW_INTERNALPAINT = 0x0002
3057
	RDW_ERASE         = 0x0004
3058

3059
	RDW_VALIDATE        = 0x0008
3060
	RDW_NOINTERNALPAINT = 0x0010
3061
	RDW_NOERASE         = 0x0020
3062

3063
	RDW_NOCHILDREN  = 0x0040
3064
	RDW_ALLCHILDREN = 0x0080
3065

3066
	RDW_UPDATENOW = 0x0100
3067
	RDW_ERASENOW  = 0x0200
3068

3069
	RDW_FRAME   = 0x0400
3070
	RDW_NOFRAME = 0x0800
3071
)
3072

3073
func RedrawWindow(hWnd HWND, lprcUpdate *RECT, hrgnUpdate HRGN, flags uint32) bool {
3074
	ret, _, _ := syscall.Syscall6(redrawWindow.Addr(), 4,
3075
		uintptr(hWnd),
3076
		uintptr(unsafe.Pointer(lprcUpdate)),
3077
		uintptr(hrgnUpdate),
3078
		uintptr(flags),
3079
		0,
3080
		0)
3081

3082
	return ret != 0
3083
}
3084

3085
func RegisterClassEx(windowClass *WNDCLASSEX) ATOM {
3086
	ret, _, _ := syscall.Syscall(registerClassEx.Addr(), 1,
3087
		uintptr(unsafe.Pointer(windowClass)),
3088
		0,
3089
		0)
3090

3091
	return ATOM(ret)
3092
}
3093

3094
func RegisterRawInputDevices(pRawInputDevices *RAWINPUTDEVICE, uiNumDevices uint32, cbSize uint32) bool {
3095
	ret, _, _ := syscall.Syscall(registerRawInputDevices.Addr(), 3,
3096
		uintptr(unsafe.Pointer(pRawInputDevices)),
3097
		uintptr(uiNumDevices),
3098
		uintptr(cbSize))
3099

3100
	return ret != 0
3101
}
3102

3103
func RegisterWindowMessage(lpString *uint16) uint32 {
3104
	ret, _, _ := syscall.Syscall(registerWindowMessage.Addr(), 1,
3105
		uintptr(unsafe.Pointer(lpString)),
3106
		0,
3107
		0)
3108

3109
	return uint32(ret)
3110
}
3111

3112
func ReleaseCapture() bool {
3113
	ret, _, _ := syscall.Syscall(releaseCapture.Addr(), 0,
3114
		0,
3115
		0,
3116
		0)
3117

3118
	return ret != 0
3119
}
3120

3121
func ReleaseDC(hWnd HWND, hDC HDC) bool {
3122
	ret, _, _ := syscall.Syscall(releaseDC.Addr(), 2,
3123
		uintptr(hWnd),
3124
		uintptr(hDC),
3125
		0)
3126

3127
	return ret != 0
3128
}
3129

3130
func RemoveMenu(hMenu HMENU, uPosition, uFlags uint32) bool {
3131
	ret, _, _ := syscall.Syscall(removeMenu.Addr(), 3,
3132
		uintptr(hMenu),
3133
		uintptr(uPosition),
3134
		uintptr(uFlags))
3135

3136
	return ret != 0
3137
}
3138

3139
func ScreenToClient(hWnd HWND, point *POINT) bool {
3140
	ret, _, _ := syscall.Syscall(screenToClient.Addr(), 2,
3141
		uintptr(hWnd),
3142
		uintptr(unsafe.Pointer(point)),
3143
		0)
3144

3145
	return ret != 0
3146
}
3147

3148
func SendDlgItemMessage(hWnd HWND, id int32, msg uint32, wParam, lParam uintptr) uintptr {
3149
	ret, _, _ := syscall.Syscall6(sendDlgItemMessage.Addr(), 5,
3150
		uintptr(hWnd),
3151
		uintptr(id),
3152
		uintptr(msg),
3153
		wParam,
3154
		lParam,
3155
		0)
3156

3157
	return ret
3158
}
3159

3160
// pInputs expects a unsafe.Pointer to a slice of MOUSE_INPUT or KEYBD_INPUT or HARDWARE_INPUT structs.
3161
func SendInput(nInputs uint32, pInputs unsafe.Pointer, cbSize int32) uint32 {
3162
	ret, _, _ := syscall.Syscall(sendInput.Addr(), 3,
3163
		uintptr(nInputs),
3164
		uintptr(pInputs),
3165
		uintptr(cbSize))
3166

3167
	return uint32(ret)
3168
}
3169

3170
func SendMessage(hWnd HWND, msg uint32, wParam, lParam uintptr) uintptr {
3171
	ret, _, _ := syscall.Syscall6(sendMessage.Addr(), 4,
3172
		uintptr(hWnd),
3173
		uintptr(msg),
3174
		wParam,
3175
		lParam,
3176
		0,
3177
		0)
3178

3179
	return ret
3180
}
3181

3182
func SetActiveWindow(hWnd HWND) HWND {
3183
	ret, _, _ := syscall.Syscall(setActiveWindow.Addr(), 1,
3184
		uintptr(hWnd),
3185
		0,
3186
		0)
3187

3188
	return HWND(ret)
3189
}
3190

3191
func SetCapture(hWnd HWND) HWND {
3192
	ret, _, _ := syscall.Syscall(setCapture.Addr(), 1,
3193
		uintptr(hWnd),
3194
		0,
3195
		0)
3196

3197
	return HWND(ret)
3198
}
3199

3200
func SetClipboardData(uFormat uint32, hMem HANDLE) HANDLE {
3201
	ret, _, _ := syscall.Syscall(setClipboardData.Addr(), 2,
3202
		uintptr(uFormat),
3203
		uintptr(hMem),
3204
		0)
3205

3206
	return HANDLE(ret)
3207
}
3208

3209
func SetCursor(hCursor HCURSOR) HCURSOR {
3210
	ret, _, _ := syscall.Syscall(setCursor.Addr(), 1,
3211
		uintptr(hCursor),
3212
		0,
3213
		0)
3214

3215
	return HCURSOR(ret)
3216
}
3217

3218
func SetCursorPos(X, Y int32) bool {
3219
	ret, _, _ := syscall.Syscall(setCursorPos.Addr(), 2,
3220
		uintptr(X),
3221
		uintptr(Y),
3222
		0)
3223

3224
	return ret != 0
3225
}
3226

3227
func SetFocus(hWnd HWND) HWND {
3228
	ret, _, _ := syscall.Syscall(setFocus.Addr(), 1,
3229
		uintptr(hWnd),
3230
		0,
3231
		0)
3232

3233
	return HWND(ret)
3234
}
3235

3236
func SetForegroundWindow(hWnd HWND) bool {
3237
	ret, _, _ := syscall.Syscall(setForegroundWindow.Addr(), 1,
3238
		uintptr(hWnd),
3239
		0,
3240
		0)
3241

3242
	return ret != 0
3243
}
3244

3245
func SetMenu(hWnd HWND, hMenu HMENU) bool {
3246
	ret, _, _ := syscall.Syscall(setMenu.Addr(), 2,
3247
		uintptr(hWnd),
3248
		uintptr(hMenu),
3249
		0)
3250

3251
	return ret != 0
3252
}
3253

3254
func SetMenuDefaultItem(hMenu HMENU, uItem uint32, fByPosition bool) bool {
3255
	ret, _, _ := syscall.Syscall(setMenuDefaultItem.Addr(), 3,
3256
		uintptr(hMenu),
3257
		uintptr(uItem),
3258
		uintptr(BoolToBOOL(fByPosition)))
3259

3260
	return ret != 0
3261
}
3262

3263
func SetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {
3264
	ret, _, _ := syscall.Syscall(setMenuInfo.Addr(), 2,
3265
		uintptr(hmenu),
3266
		uintptr(unsafe.Pointer(lpcmi)),
3267
		0)
3268

3269
	return ret != 0
3270
}
3271

3272
func SetMenuItemBitmaps(hMenu HMENU, uPosition uint32, uFlags uint32, hBitmapUnchecked HBITMAP, hBitmapChecked HBITMAP) bool {
3273
	ret, _, _ := syscall.Syscall6(setMenuItemBitmaps.Addr(), 5,
3274
		uintptr(hMenu),
3275
		uintptr(uPosition),
3276
		uintptr(uFlags),
3277
		uintptr(hBitmapUnchecked),
3278
		uintptr(hBitmapChecked),
3279
		0)
3280

3281
	return ret != 0
3282
}
3283

3284
func SetMenuItemInfo(hMenu HMENU, uItem uint32, fByPosition bool, lpmii *MENUITEMINFO) bool {
3285
	ret, _, _ := syscall.Syscall6(setMenuItemInfo.Addr(), 4,
3286
		uintptr(hMenu),
3287
		uintptr(uItem),
3288
		uintptr(BoolToBOOL(fByPosition)),
3289
		uintptr(unsafe.Pointer(lpmii)),
3290
		0,
3291
		0)
3292

3293
	return ret != 0
3294
}
3295

3296
func SetParent(hWnd HWND, parentHWnd HWND) HWND {
3297
	ret, _, _ := syscall.Syscall(setParent.Addr(), 2,
3298
		uintptr(hWnd),
3299
		uintptr(parentHWnd),
3300
		0)
3301

3302
	return HWND(ret)
3303
}
3304

3305
func SetRect(lprc *RECT, xLeft, yTop, xRight, yBottom uint32) BOOL {
3306
	ret, _, _ := syscall.Syscall6(setRect.Addr(), 5,
3307
		uintptr(unsafe.Pointer(lprc)),
3308
		uintptr(xLeft),
3309
		uintptr(yTop),
3310
		uintptr(xRight),
3311
		uintptr(yBottom),
3312
		0)
3313

3314
	return BOOL(ret)
3315
}
3316

3317
func SetScrollInfo(hwnd HWND, fnBar int32, lpsi *SCROLLINFO, fRedraw bool) int32 {
3318
	ret, _, _ := syscall.Syscall6(setScrollInfo.Addr(), 4,
3319
		uintptr(hwnd),
3320
		uintptr(fnBar),
3321
		uintptr(unsafe.Pointer(lpsi)),
3322
		uintptr(BoolToBOOL(fRedraw)),
3323
		0,
3324
		0)
3325

3326
	return int32(ret)
3327
}
3328

3329
func SetTimer(hWnd HWND, nIDEvent uintptr, uElapse uint32, lpTimerFunc uintptr) uintptr {
3330
	ret, _, _ := syscall.Syscall6(setTimer.Addr(), 4,
3331
		uintptr(hWnd),
3332
		nIDEvent,
3333
		uintptr(uElapse),
3334
		lpTimerFunc,
3335
		0,
3336
		0)
3337

3338
	return ret
3339
}
3340

3341
type WINEVENTPROC func(hWinEventHook HWINEVENTHOOK, event uint32, hwnd HWND, idObject int32, idChild int32, idEventThread uint32, dwmsEventTime uint32) uintptr
3342

3343
func SetWinEventHook(eventMin uint32, eventMax uint32, hmodWinEventProc HMODULE, callbackFunction WINEVENTPROC, idProcess uint32, idThread uint32, dwFlags uint32) (HWINEVENTHOOK, error) {
3344
	ret, _, err := syscall.Syscall9(setWinEventHook.Addr(), 7,
3345
		uintptr(eventMin),
3346
		uintptr(eventMax),
3347
		uintptr(hmodWinEventProc),
3348
		windows.NewCallback(callbackFunction),
3349
		uintptr(idProcess),
3350
		uintptr(idThread),
3351
		uintptr(dwFlags),
3352
		0, 0)
3353

3354
	if ret == 0 {
3355
		return 0, err
3356
	}
3357

3358
	return HWINEVENTHOOK(ret), nil
3359
}
3360

3361
func SetWindowLong(hWnd HWND, index, value int32) int32 {
3362
	ret, _, _ := syscall.Syscall(setWindowLong.Addr(), 3,
3363
		uintptr(hWnd),
3364
		uintptr(index),
3365
		uintptr(value))
3366

3367
	return int32(ret)
3368
}
3369

3370
func SetWindowLongPtr(hWnd HWND, index int, value uintptr) uintptr {
3371
	ret, _, _ := syscall.Syscall(setWindowLongPtr.Addr(), 3,
3372
		uintptr(hWnd),
3373
		uintptr(index),
3374
		value)
3375

3376
	return ret
3377
}
3378

3379
func SetWindowPlacement(hWnd HWND, lpwndpl *WINDOWPLACEMENT) bool {
3380
	ret, _, _ := syscall.Syscall(setWindowPlacement.Addr(), 2,
3381
		uintptr(hWnd),
3382
		uintptr(unsafe.Pointer(lpwndpl)),
3383
		0)
3384

3385
	return ret != 0
3386
}
3387

3388
func SetWindowPos(hWnd, hWndInsertAfter HWND, x, y, width, height int32, flags uint32) bool {
3389
	ret, _, _ := syscall.Syscall9(setWindowPos.Addr(), 7,
3390
		uintptr(hWnd),
3391
		uintptr(hWndInsertAfter),
3392
		uintptr(x),
3393
		uintptr(y),
3394
		uintptr(width),
3395
		uintptr(height),
3396
		uintptr(flags),
3397
		0,
3398
		0)
3399

3400
	return ret != 0
3401
}
3402

3403
func ShowWindow(hWnd HWND, nCmdShow int32) bool {
3404
	ret, _, _ := syscall.Syscall(showWindow.Addr(), 2,
3405
		uintptr(hWnd),
3406
		uintptr(nCmdShow),
3407
		0)
3408

3409
	return ret != 0
3410
}
3411

3412
func SystemParametersInfo(uiAction, uiParam uint32, pvParam unsafe.Pointer, fWinIni uint32) bool {
3413
	ret, _, _ := syscall.Syscall6(systemParametersInfo.Addr(), 4,
3414
		uintptr(uiAction),
3415
		uintptr(uiParam),
3416
		uintptr(pvParam),
3417
		uintptr(fWinIni),
3418
		0,
3419
		0)
3420

3421
	return ret != 0
3422
}
3423

3424
func TrackMouseEvent(lpEventTrack *TRACKMOUSEEVENT) bool {
3425
	ret, _, _ := syscall.Syscall(trackMouseEvent.Addr(), 1,
3426
		uintptr(unsafe.Pointer(lpEventTrack)),
3427
		0,
3428
		0)
3429

3430
	return ret != 0
3431
}
3432

3433
func TrackPopupMenu(hMenu HMENU, uFlags uint32, x, y int32, nReserved int32, hWnd HWND, prcRect *RECT) uint32 {
3434
	ret, _, _ := syscall.Syscall9(trackPopupMenu.Addr(), 7,
3435
		uintptr(hMenu),
3436
		uintptr(uFlags),
3437
		uintptr(x),
3438
		uintptr(y),
3439
		uintptr(nReserved),
3440
		uintptr(hWnd),
3441
		uintptr(unsafe.Pointer(prcRect)),
3442
		0,
3443
		0)
3444

3445
	return uint32(ret)
3446
}
3447

3448
func TrackPopupMenuEx(hMenu HMENU, fuFlags uint32, x, y int32, hWnd HWND, lptpm *TPMPARAMS) BOOL {
3449
	ret, _, _ := syscall.Syscall6(trackPopupMenuEx.Addr(), 6,
3450
		uintptr(hMenu),
3451
		uintptr(fuFlags),
3452
		uintptr(x),
3453
		uintptr(y),
3454
		uintptr(hWnd),
3455
		uintptr(unsafe.Pointer(lptpm)))
3456

3457
	return BOOL(ret)
3458
}
3459

3460
func TranslateMessage(msg *MSG) bool {
3461
	ret, _, _ := syscall.Syscall(translateMessage.Addr(), 1,
3462
		uintptr(unsafe.Pointer(msg)),
3463
		0,
3464
		0)
3465

3466
	return ret != 0
3467
}
3468

3469
func UnhookWinEvent(hWinHookEvent HWINEVENTHOOK) bool {
3470
	ret, _, _ := syscall.Syscall(unhookWinEvent.Addr(), 1, uintptr(hWinHookEvent), 0, 0)
3471
	return ret != 0
3472
}
3473

3474
func UpdateWindow(hwnd HWND) bool {
3475
	ret, _, _ := syscall.Syscall(updateWindow.Addr(), 1,
3476
		uintptr(hwnd),
3477
		0,
3478
		0)
3479

3480
	return ret != 0
3481
}
3482

3483
func WindowFromDC(hDC HDC) HWND {
3484
	ret, _, _ := syscall.Syscall(windowFromDC.Addr(), 1,
3485
		uintptr(hDC),
3486
		0,
3487
		0)
3488

3489
	return HWND(ret)
3490
}
3491

3492
func WindowFromPoint(Point POINT) HWND {
3493
	ret, _, _ := syscall.Syscall(windowFromPoint.Addr(), 2,
3494
		uintptr(Point.X),
3495
		uintptr(Point.Y),
3496
		0)
3497

3498
	return HWND(ret)
3499
}
3500

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.