summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-09-09 12:49:27 +0200
committerSimon Rozman <simon@rozman.si>2019-09-09 12:49:27 +0200
commitfdaad66018acd7c4b0d94d9d9fab70f1f42edb5a (patch)
tree42813a458f6ea18c1ab91f29a3e77a639bb56b5c
parentAdd various user32 constants (diff)
downloadwireguard-windows-fdaad66018acd7c4b0d94d9d9fab70f1f42edb5a.tar.xz
wireguard-windows-fdaad66018acd7c4b0d94d9d9fab70f1f42edb5a.zip
Add NotifyWinEvent
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r--user32.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/user32.go b/user32.go
index d19e2548..478813db 100644
--- a/user32.go
+++ b/user32.go
@@ -1841,6 +1841,7 @@ var (
messageBox *windows.LazyProc
monitorFromWindow *windows.LazyProc
moveWindow *windows.LazyProc
+ notifyWinEvent *windows.LazyProc
unregisterClass *windows.LazyProc
openClipboard *windows.LazyProc
peekMessage *windows.LazyProc
@@ -1985,6 +1986,7 @@ func init() {
messageBox = libuser32.NewProc("MessageBoxW")
monitorFromWindow = libuser32.NewProc("MonitorFromWindow")
moveWindow = libuser32.NewProc("MoveWindow")
+ notifyWinEvent = libuser32.NewProc("NotifyWinEvent")
unregisterClass = libuser32.NewProc("UnregisterClassW")
openClipboard = libuser32.NewProc("OpenClipboard")
peekMessage = libuser32.NewProc("PeekMessageW")
@@ -2902,6 +2904,16 @@ func MoveWindow(hWnd HWND, x, y, width, height int32, repaint bool) bool {
return ret != 0
}
+func NotifyWinEvent(event uint32, hwnd HWND, idObject, idChild int32) {
+ syscall.Syscall6(notifyWinEvent.Addr(), 4,
+ uintptr(event),
+ uintptr(hwnd),
+ uintptr(idObject),
+ uintptr(idChild),
+ 0,
+ 0)
+}
+
func UnregisterClass(name *uint16) bool {
ret, _, _ := syscall.Syscall(unregisterClass.Addr(), 1,
uintptr(unsafe.Pointer(name)),