diff --git a/user32.go b/user32.go index fd5eb4e..831620a 100644 --- a/user32.go +++ b/user32.go @@ -1795,6 +1795,7 @@ var ( findWindow *windows.LazyProc getActiveWindow *windows.LazyProc getAncestor *windows.LazyProc + getCapture *windows.LazyProc getCaretPos *windows.LazyProc getClassName *windows.LazyProc getClientRect *windows.LazyProc @@ -1845,6 +1846,7 @@ var ( loadImage *windows.LazyProc loadMenu *windows.LazyProc loadString *windows.LazyProc + mapWindowPoints *windows.LazyProc messageBeep *windows.LazyProc messageBox *windows.LazyProc monitorFromWindow *windows.LazyProc @@ -1945,6 +1947,7 @@ func init() { findWindow = libuser32.NewProc("FindWindowW") getActiveWindow = libuser32.NewProc("GetActiveWindow") getAncestor = libuser32.NewProc("GetAncestor") + getCapture = libuser32.NewProc("GetCapture") getCaretPos = libuser32.NewProc("GetCaretPos") getClassName = libuser32.NewProc("GetClassNameW") getClientRect = libuser32.NewProc("GetClientRect") @@ -2000,6 +2003,7 @@ func init() { loadImage = libuser32.NewProc("LoadImageW") loadMenu = libuser32.NewProc("LoadMenuW") loadString = libuser32.NewProc("LoadStringW") + mapWindowPoints = libuser32.NewProc("MapWindowPoints") messageBeep = libuser32.NewProc("MessageBeep") messageBox = libuser32.NewProc("MessageBoxW") monitorFromWindow = libuser32.NewProc("MonitorFromWindow") @@ -2464,6 +2468,14 @@ func GetAncestor(hWnd HWND, gaFlags uint32) HWND { return HWND(ret) } +func GetCapture() HWND { + ret, _, _ := syscall.Syscall(getCapture.Addr(), 0, + 0, + 0, + 0) + return HWND(ret) +} + func GetCaretPos(lpPoint *POINT) bool { ret, _, _ := syscall.Syscall(getCaretPos.Addr(), 1, uintptr(unsafe.Pointer(lpPoint)), @@ -2935,6 +2947,18 @@ func LoadString(instRes HINSTANCE, id uint32, buf *uint16, length int32) int32 { return int32(ret) } +func MapWindowPoints(hWndFrom, hWndTo HWND, lpPoints *POINT, cPoints uint32) int32 { + ret, _, _ := syscall.Syscall6(mapWindowPoints.Addr(), 4, + uintptr(hWndFrom), + uintptr(hWndTo), + uintptr(unsafe.Pointer(lpPoints)), + uintptr(cPoints), + 0, + 0) + + return int32(ret) +} + // Plays a waveform sound. uType is the sound to be played. The sounds are set by the user through the Sound control panel application. // The following values can be used as a sound: //