-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdll_user32_windows.go
673 lines (606 loc) · 21.8 KB
/
dll_user32_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
// -----------------------------------------------------------------------------
// ZR Library: Windows 32 API zr-win/[dll_user32_windows.go]
// (c) [email protected] License: MIT
// -----------------------------------------------------------------------------
package win
import (
"syscall"
"unsafe"
)
var (
user32 = syscall.NewLazyDLL("user32.dll")
userAppendMenuW = user32.NewProc("AppendMenuW")
userBeginPaint = user32.NewProc("BeginPaint")
userChangeWindowMessageFilter = user32.NewProc("ChangeWindowMessageFilter")
userCheckMenuItem = user32.NewProc("CheckMenuItem")
userCloseClipboard = user32.NewProc("CloseClipboard")
userCreateCaret = user32.NewProc("CreateCaret")
userCreateMenu = user32.NewProc("CreateMenu")
userCreateWindowExW = user32.NewProc("CreateWindowExW")
userDefWindowProcW = user32.NewProc("DefWindowProcW")
userDestroyCaret = user32.NewProc("DestroyCaret")
userDestroyMenu = user32.NewProc("DestroyMenu")
userDestroyWindow = user32.NewProc("DestroyWindow")
userDialogBoxIndirectParamW = user32.NewProc("DialogBoxIndirectParamW")
userDialogBoxParamW = user32.NewProc("DialogBoxParamW")
userDispatchMessageW = user32.NewProc("DispatchMessageW")
userDrawTextW = user32.NewProc("DrawTextW")
userEmptyClipboard = user32.NewProc("EmptyClipboard")
userEndDialog = user32.NewProc("EndDialog")
userEndPaint = user32.NewProc("EndPaint")
userFillRect = user32.NewProc("FillRect")
userGetActiveWindow = user32.NewProc("GetActiveWindow")
userGetClientRect = user32.NewProc("GetClientRect")
userGetClipboardData = user32.NewProc("GetClipboardData")
userGetDC = user32.NewProc("GetDC")
userGetDlgItem = user32.NewProc("GetDlgItem")
userGetDlgItemTextW = user32.NewProc("GetDlgItemTextW")
userGetKeyState = user32.NewProc("GetKeyState")
userGetMenu = user32.NewProc("GetMenu")
userGetMessageW = user32.NewProc("GetMessageW")
userHideCaret = user32.NewProc("HideCaret")
userInvalidateRect = user32.NewProc("InvalidateRect")
userIsMenu = user32.NewProc("IsMenu")
userIsWindow = user32.NewProc("IsWindow")
userLoadAcceleratorsW = user32.NewProc("LoadAcceleratorsW")
userLoadCursorW = user32.NewProc("LoadCursorW")
userLoadIconW = user32.NewProc("LoadIconW")
userMapVirtualKeyW = user32.NewProc("MapVirtualKeyW")
userMessageBoxW = user32.NewProc("MessageBoxW")
userOpenClipboard = user32.NewProc("OpenClipboard")
userPeekMessageW = user32.NewProc("PeekMessageW")
userPostQuitMessage = user32.NewProc("PostQuitMessage")
userRegisterClassExW = user32.NewProc("RegisterClassExW")
userReleaseDC = user32.NewProc("ReleaseDC")
userSendMessageW = user32.NewProc("SendMessageW")
userSetCaretPos = user32.NewProc("SetCaretPos")
userSetClipboardData = user32.NewProc("SetClipboardData")
userSetCursor = user32.NewProc("SetCursor")
userSetDlgItemTextW = user32.NewProc("SetDlgItemTextW")
userSetMenu = user32.NewProc("SetMenu")
userSetMenuItemInfoW = user32.NewProc("SetMenuItemInfoW")
userSetRect = user32.NewProc("SetRect")
userSetWindowPos = user32.NewProc("SetWindowPos")
userSetWindowTextW = user32.NewProc("SetWindowTextW")
userShowCaret = user32.NewProc("ShowCaret")
userShowWindow = user32.NewProc("ShowWindow")
userTranslateAccelerator = user32.NewProc("TranslateAccelerator")
userTranslateMessage = user32.NewProc("TranslateMessage")
userUnregisterHotKey = user32.NewProc("UnregisterHotKey")
userUpdateWindow = user32.NewProc("UpdateWindow")
userWindowFromDC = user32.NewProc("WindowFromDC")
userIsClipboardFormatAvailable = user32.NewProc(
"IsClipboardFormatAvailable")
)
// unused for now:
// userRedrawWindow = user32.NewProc("RedrawWindow")
// AppendMenu library: user32.dll
func AppendMenu(
hMenu HMENU,
uFlags UINT,
uIDNewItem UINT_PTR,
NewItem string,
) BOOL {
ret, _, _ := userAppendMenuW.Call(
uintptr(hMenu),
uintptr(uFlags),
uintptr(uIDNewItem),
UintptrFromString(&NewItem))
return BOOLResult(ret)
} // AppendMenu
// BeginPaint library: user32.dll
func BeginPaint(hWnd HWND, lpPaint *PAINTSTRUCT) HDC {
ret, _, _ := userBeginPaint.Call(
uintptr(hWnd),
uintptr(unsafe.Pointer(lpPaint)))
return HDC(ret)
} // BeginPaint
// CheckMenuItem library: user32.dll
func CheckMenuItem(hMenu HMENU, uIDCheckItem, uCheck UINT) DWORD {
ret, _, _ := userCheckMenuItem.Call(
uintptr(hMenu),
uintptr(uIDCheckItem),
uintptr(uCheck))
return DWORD(ret)
} // CheckMenuItem
// CloseClipboard library: user32.dll
func CloseClipboard() BOOL {
ret, _, _ := userCloseClipboard.Call()
return BOOLResult(ret)
} // CloseClipboard
// CreateCaret library: user32.dll
func CreateCaret(
hWnd HWND,
hBitmap HBITMAP,
nWidth INT,
nHeight INT,
) BOOL {
ret, _, _ := userCreateCaret.Call(
uintptr(hWnd),
uintptr(hBitmap),
uintptr(nWidth),
uintptr(nHeight))
return BOOLResult(ret)
} // CreateCaret
// CreateMenu library: user32.dll
func CreateMenu() HMENU {
ret, _, _ := userCreateMenu.Call()
return HMENU(ret)
} // CreateMenu
// CreateWindowEx library: user32.dll
func CreateWindowEx(
dwExStyle DWORD,
ClassName string,
WindowName string,
dwStyle DWORD,
x INT,
y INT,
nWidth INT,
nHeight INT,
hWndParent HWND,
hMenu HMENU,
HInstance HINSTANCE,
lpParam LPVOID,
) HWND {
ret, _, _ := userCreateWindowExW.Call(
uintptr(dwExStyle),
UintptrFromString(&ClassName),
UintptrFromString(&WindowName),
uintptr(dwStyle),
uintptr(x),
uintptr(y),
uintptr(nWidth),
uintptr(nHeight),
uintptr(hWndParent),
uintptr(hMenu),
uintptr(HInstance),
uintptr(unsafe.Pointer(lpParam)))
return HWND(ret)
} // CreateWindowEx
// DefWindowProc library: user32.dll
func DefWindowProc(hWnd HWND, Msg UINT, wParam WPARAM, lParam LPARAM) LRESULT {
ret, _, _ := userDefWindowProcW.Call(
uintptr(hWnd),
uintptr(Msg),
uintptr(wParam),
uintptr(lParam),
)
return LRESULT(ret)
} // DefWindowProc
// DestroyCaret library: user32.dll
func DestroyCaret() BOOL {
ret, _, _ := userDestroyCaret.Call()
return BOOLResult(ret)
} // DestroyCaret
// DestroyMenu library: user32.dll
func DestroyMenu(hMenu HMENU) BOOL {
ret, _, _ := userDestroyMenu.Call(uintptr(hMenu))
return BOOLResult(ret)
} // DestroyMenu
// DestroyWindow library: user32.dll
func DestroyWindow(hWnd HWND) BOOL {
ret, _, _ := userDestroyWindow.Call(uintptr(hWnd))
return BOOLResult(ret)
} // DestroyWindow
// DialogBoxIndirectParam library: user32.dll
func DialogBoxIndirectParam(
hInstance HINSTANCE,
hDialogTemplate *DLGTEMPLATE,
hWndParent HWND,
lpDialogFunc DLGPROC,
dwInitParam LPARAM,
) INT_PTR {
ret, _, _ := userDialogBoxIndirectParamW.Call(
uintptr(hInstance),
uintptr(unsafe.Pointer(hDialogTemplate)),
uintptr(hWndParent),
uintptr(lpDialogFunc),
uintptr(dwInitParam),
)
return INT_PTR(ret)
} // DialogBoxIndirectParam
// DispatchMessage library: user32.dll
func DispatchMessage(lpmsg *MSG) LRESULT {
ret, _, _ := userDispatchMessageW.Call(
uintptr(unsafe.Pointer(lpmsg)),
)
return LRESULT(ret)
} // DispatchMessage
// DrawText library: user32.dll
func DrawText(
hDC HDC,
lpString string,
nCount INT,
lpRect *RECT,
uFormat UINT,
) INT {
ret, _, _ := userDrawTextW.Call(
uintptr(hDC), // handle to DC
UintptrFromString(&lpString), // text to draw
uintptr(nCount), // text length
uintptr(unsafe.Pointer(lpRect)), // formatting dimensions
uintptr(uFormat), // text-drawing options
)
return INT(ret)
} // DrawText
// EmptyClipboard library: user32.dll
func EmptyClipboard() BOOL {
ret, _, _ := userEmptyClipboard.Call()
return BOOLResult(ret)
} // EmptyClipboard
// EndDialog library: user32.dll
func EndDialog(hDlg HWND, nResult INT_PTR) BOOL {
ret, _, _ := userEndDialog.Call(
uintptr(hDlg),
uintptr(nResult),
)
return BOOLResult(ret)
} // EndDialog
// EndPaint library: user32.dll
func EndPaint(hWnd HWND, lpPaint *PAINTSTRUCT) BOOL {
ret, _, _ := userEndPaint.Call(
uintptr(hWnd),
uintptr(unsafe.Pointer(lpPaint)),
)
return BOOLResult(ret)
} // EndPaint
// FillRect library: user32.dll
func FillRect(hDC HDC, lprc *RECT, hbr HBRUSH) INT {
ret, _, _ := userFillRect.Call(
uintptr(hDC),
uintptr(unsafe.Pointer(lprc)),
uintptr(hbr),
)
return INT(ret)
} // FillRect
// GetActiveWindow library: user32.dll
func GetActiveWindow() HWND {
ret, _, _ := userGetActiveWindow.Call()
return HWND(ret)
} // GetActiveWindow
// GetClientRect library: user32.dll
func GetClientRect(hWnd HWND, lpRect *RECT) BOOL {
ret, _, _ := userGetClientRect.Call(
uintptr(hWnd),
uintptr(unsafe.Pointer(lpRect)),
)
return BOOLResult(ret)
} // GetClientRect
// GetClipboardData library: user32.dll
func GetClipboardData(uFormat UINT) HANDLE {
ret, _, _ := userGetClipboardData.Call(uintptr(uFormat))
return HANDLE(ret)
} // GetClipboardData
// GetDC library: user32.dll
func GetDC(hWnd HWND) HDC {
ret, _, _ := userGetDC.Call(uintptr(hWnd))
return HDC(ret)
} // GetDC
// GetDlgItem library: user32.dll
func GetDlgItem(hDlg HWND, nIDDlgItem int) HWND {
ret, _, _ := userGetDlgItem.Call(
uintptr(hDlg),
uintptr(nIDDlgItem),
)
return HWND(ret)
} // GetDlgItem
// GetDlgItemText library: user32.dll
func GetDlgItemText(
hDlg HWND,
nIDDlgItem INT,
lpString LPWSTR,
nMaxCount INT,
) UINT {
ret, _, _ := userGetDlgItemTextW.Call(
uintptr(hDlg),
uintptr(nIDDlgItem),
uintptr(unsafe.Pointer(lpString)),
uintptr(nMaxCount),
)
return UINT(ret)
} // GetDlgItemText
// GetKeyState library: user32.dll
func GetKeyState(nVirtKey INT) SHORT {
ret, _, _ := userGetKeyState.Call(uintptr(nVirtKey)) // [in] int
return SHORT(ret)
} // GetKeyState
// GetMenu library: user32.dll
func GetMenu(hWnd HWND) HMENU {
ret, _, _ := userGetMenu.Call(uintptr(hWnd))
return HMENU(ret)
} // GetMenu
// GetMessage library: user32.dll
func GetMessage(
lpMsg *MSG,
hWnd HWND,
wMsgFilterMin UINT,
wMsgFilterMax UINT,
) BOOL {
ret, _, _ := userGetMessageW.Call(
uintptr(unsafe.Pointer(lpMsg)),
uintptr(hWnd),
uintptr(wMsgFilterMin),
uintptr(wMsgFilterMax),
)
return BOOLResult(ret)
} // GetMessage
// HideCaret library: user32.dll
func HideCaret(hWnd HWND) BOOL {
ret, _, _ := userHideCaret.Call(uintptr(hWnd)) // [in] HWND
return BOOLResult(ret)
} // HideCaret
// InvalidateRect library: user32.dll
func InvalidateRect(hWnd HWND, lpRect *RECT, bErase BOOL) BOOL {
ret, _, _ := userInvalidateRect.Call(
uintptr(hWnd), // handle to window
uintptr(unsafe.Pointer(lpRect)), // rectangle coordinates
uintptr(bErase), // erase state
)
return BOOLResult(ret)
} // InvalidateRect
// IsClipboardFormatAvailable library: user32.dll
func IsClipboardFormatAvailable(format UINT) BOOL {
ret, _, _ := userIsClipboardFormatAvailable.Call(uintptr(format))
return BOOLResult(ret)
} // IsClipboardFormatAvailable
// IsMenu library: user32.dll
func IsMenu(hMenu HMENU) BOOL {
ret, _, _ := userIsMenu.Call(uintptr(hMenu))
return BOOLResult(ret)
} // IsMenu
// IsWindow library: user32.dll
func IsWindow(hWnd HWND) BOOL {
ret, _, _ := userIsWindow.Call(uintptr(hWnd))
return BOOLResult(ret)
} // IsWindow
// LoadAccelerators library: user32.dll
func LoadAccelerators(hInstance HINSTANCE, TableName string) HACCEL {
ret, _, _ := userLoadAcceleratorsW.Call(
uintptr(hInstance),
UintptrFromString(&TableName),
)
return HACCEL(ret)
} // LoadAccelerators
// LoadCursor library: user32.dll
func LoadCursor(hInstance HINSTANCE, lpCursorName LPCWSTR) HCURSOR {
ret, _, _ := userLoadCursorW.Call(
uintptr(hInstance),
uintptr(unsafe.Pointer(lpCursorName)),
)
return HCURSOR(ret)
} // LoadCursor
// LoadIcon library: user32.dll
func LoadIcon(hInstance HINSTANCE, lpIconName LPCWSTR) HICON {
ret, _, _ := userLoadIconW.Call(
uintptr(hInstance),
uintptr(unsafe.Pointer(lpIconName)),
)
return HICON(ret)
} // LoadIcon
// MapVirtualKey library: user32.dll
func MapVirtualKey(nCode, uMapType uint) uint {
ret, _, _ := userMapVirtualKeyW.Call(
uintptr(nCode),
uintptr(uMapType),
)
return uint(ret)
} // MapVirtualKey
// MessageBox library: user32.dll
func MessageBox(hWnd HWND, title, caption string, flags uint) int {
ret, _, _ := userMessageBoxW.Call(
uintptr(hWnd),
UintptrFromString(&title),
UintptrFromString(&caption),
uintptr(flags),
)
return int(ret)
} // MessageBox
// OpenClipboard library: user32.dll
func OpenClipboard(hWnd HWND) BOOL {
ret, _, _ := userOpenClipboard.Call(uintptr(hWnd))
return BOOLResult(ret)
} // OpenClipboard
// PeekMessage library: user32.dll
func PeekMessage(
lpMsg *MSG,
hWnd HWND,
wMsgFilterMin UINT,
wMsgFilterMax UINT,
wRemoveMsg UINT,
) BOOL {
ret, _, _ := userPeekMessageW.Call(
uintptr(unsafe.Pointer(lpMsg)),
uintptr(hWnd),
uintptr(wMsgFilterMin),
uintptr(wMsgFilterMax),
uintptr(wRemoveMsg),
)
return BOOLResult(ret)
} // PeekMessage
// PostQuitMessage library: user32.dll
func PostQuitMessage(nExitCode INT) {
userPostQuitMessage.Call(uintptr(nExitCode))
} // PostQuitMessage
// unused for now:
// // RedrawWindow library: user32.dll
// func RedrawWindow(
// hWnd HWND,
// lprcUpdate *RECT,
// hrgnUpdate HRGN,
// flags UINT,
// ) BOOL {
// ret, _, _ := userRedrawWindow.Call(
// uintptr(hWnd),
// uintptr(unsafe.Pointer(lprcUpdate)),
// uintptr(hrgnUpdate),
// uintptr(flags),
// )
// return BOOLResult(ret)
// }
// RegisterClassEx library: user32.dll
func RegisterClassEx(lpWndClass *WNDCLASSEX) ATOM {
ret, _, _ := userRegisterClassExW.Call(
uintptr(unsafe.Pointer(lpWndClass)),
)
return ATOM(ret)
} // RegisterClassEx
// ReleaseDC library: user32.dll
func ReleaseDC(hWnd HWND, hDC HDC) INT {
ret, _, _ := userReleaseDC.Call(
uintptr(hWnd),
uintptr(hDC),
)
return INT(ret)
} // ReleaseDC
// SendMessage library: user32.dll
func SendMessage(hWnd HWND, Msg UINT, wParam WPARAM, lParam LPARAM) LRESULT {
ret, _, _ := userSendMessageW.Call(
uintptr(hWnd),
uintptr(Msg),
uintptr(wParam),
uintptr(lParam),
)
return LRESULT(ret)
} // SendMessage
// SetCaretPos library: user32.dll
func SetCaretPos(x, y INT) BOOL {
ret, _, _ := userSetCaretPos.Call(uintptr(x), uintptr(y))
return BOOLResult(ret)
} // SetCaretPos
// SetClipboardData library: user32.dll
func SetClipboardData(uFormat UINT, hMem HANDLE) HANDLE {
ret, _, _ := userSetClipboardData.Call(uintptr(uFormat), uintptr(hMem))
return HANDLE(ret)
} // SetClipboardData
// SetCursor library: user32.dll
func SetCursor(hCursor HCURSOR) HCURSOR {
ret, _, _ := userSetCursor.Call(uintptr(hCursor))
return HCURSOR(ret)
} // SetCursor
// SetDlgItemText library: user32.dll
func SetDlgItemText(
hDlg HWND,
nIDDlgItem INT,
Text string,
) BOOL {
ret, _, _ := userSetDlgItemTextW.Call(
uintptr(hDlg),
uintptr(nIDDlgItem),
UintptrFromString(&Text),
)
return BOOLResult(ret)
} // SetDlgItemText
// SetMenu library: user32.dll
func SetMenu(hWnd HWND, hMenu HMENU) BOOL {
ret, _, _ := userSetMenu.Call(
uintptr(hWnd),
uintptr(hMenu),
)
return BOOLResult(ret)
} // SetMenu
// SetMenuItemInfo library: user32.dll
func SetMenuItemInfo(
hMenu HMENU,
uItem UINT,
fByPosition BOOL,
lpmii *MENUITEMINFO,
) BOOL {
ret, _, _ := userSetMenuItemInfoW.Call(
uintptr(hMenu),
uintptr(uItem),
uintptr(fByPosition),
uintptr(unsafe.Pointer(lpmii)),
)
return BOOLResult(ret)
} // SetMenuItemInfo
// SetRect library: user32.dll
func SetRect(lprc *RECT, xLeft, yTop, xRight, yBottom INT) BOOL {
ret, _, _ := userSetRect.Call(
uintptr(unsafe.Pointer(lprc)),
uintptr(xLeft),
uintptr(yTop),
uintptr(xRight),
uintptr(yBottom),
)
return BOOLResult(ret)
} // SetRect
// SetWindowPos library: user32.dll
func SetWindowPos(
hWnd HWND,
hWndInsertAfter HWND,
X INT,
Y INT,
cx INT,
cy INT,
uFlags UINT,
) BOOL {
ret, _, _ := userSetWindowPos.Call(
uintptr(hWnd),
uintptr(hWndInsertAfter),
uintptr(X),
uintptr(Y),
uintptr(cx),
uintptr(cy),
uintptr(uFlags),
)
return BOOLResult(ret)
} // SetWindowPos
// SetWindowText library: user32.dll
func SetWindowText(hWnd HWND, Text string) BOOL {
ret, _, _ := userSetWindowTextW.Call(
uintptr(hWnd),
UintptrFromString(&Text),
)
return BOOLResult(ret)
} // SetWindowText
// ShowCaret library: user32.dll
func ShowCaret(hWnd HWND) BOOL {
ret, _, _ := userShowCaret.Call(uintptr(hWnd))
return BOOLResult(ret)
} // ShowCaret
// ShowWindow library: user32.dll
func ShowWindow(hWnd HWND, nCmdShow INT) BOOL {
ret, _, _ := userShowWindow.Call(
uintptr(hWnd),
uintptr(nCmdShow),
)
return BOOLResult(ret)
} // ShowWindow
// TranslateAccelerator library: user32.dll
func TranslateAccelerator(hWnd HWND, hAccTable HACCEL, lpMsg *MSG) INT {
ret, _, _ := userTranslateMessage.Call(
uintptr(hWnd),
uintptr(hAccTable),
uintptr(unsafe.Pointer(lpMsg)),
)
return INT(ret)
} // TranslateAccelerator
// TranslateMessage library: user32.dll
func TranslateMessage(lpmsg *MSG) BOOL {
ret, _, _ := userTranslateMessage.Call(uintptr(unsafe.Pointer(lpmsg)))
if ret == 0 {
return FALSE
}
return TRUE
// If message is translated (posted to thread's message que) returns TRUE
// Always returns TRUE for WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
} // TranslateMessage
// UnregisterHotKey library: user32.dll
func UnregisterHotKey(hWnd HWND, id INT) BOOL {
ret, _, _ := userUnregisterHotKey.Call(
uintptr(hWnd),
uintptr(id),
)
return BOOLResult(ret)
} // UnregisterHotKey
// UpdateWindow library: user32.dll
func UpdateWindow(hWnd HWND) BOOL {
ret, _, _ := userUpdateWindow.Call(uintptr(hWnd))
return BOOLResult(ret)
} // UpdateWindow
// WindowFromDC library: user32.dll
func WindowFromDC(hDC HDC) HWND {
ret, _, _ := userWindowFromDC.Call(uintptr(hDC))
return HWND(ret)
} // WindowFromDC
// end