diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..9b56be4 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 h1:5jaG59Zhd+8ZXe8C+lgiAGqkOaZBruqrWclLkgAww34= +golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/user32.go b/user32.go index fd5eb4e..5269e5b 100644 --- a/user32.go +++ b/user32.go @@ -1793,6 +1793,7 @@ var ( endPaint *windows.LazyProc enumChildWindows *windows.LazyProc findWindow *windows.LazyProc + findWindowEx *windows.LazyProc getActiveWindow *windows.LazyProc getAncestor *windows.LazyProc getCaretPos *windows.LazyProc @@ -1943,6 +1944,7 @@ func init() { endPaint = libuser32.NewProc("EndPaint") enumChildWindows = libuser32.NewProc("EnumChildWindows") findWindow = libuser32.NewProc("FindWindowW") + findWindowEx = libuser32.NewProc("FindWindowExW") getActiveWindow = libuser32.NewProc("GetActiveWindow") getAncestor = libuser32.NewProc("GetAncestor") getCaretPos = libuser32.NewProc("GetCaretPos") @@ -2446,6 +2448,18 @@ func FindWindow(lpClassName, lpWindowName *uint16) HWND { return HWND(ret) } +func FindWindowEx(hWndParent, hWndChildAfter HWND, lpszClass, lpszWindow *uint16) HWND { + ret, _, _ := syscall.Syscall6(findWindowEx.Addr(), 4, + uintptr(hWndParent), + uintptr(hWndChildAfter), + uintptr(unsafe.Pointer(lpszClass)), + uintptr(unsafe.Pointer(lpszWindow)), + 0, + 0) + + return HWND(ret) +} + func GetActiveWindow() HWND { ret, _, _ := syscall.Syscall(getActiveWindow.Addr(), 0, 0,