You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
example:
// StringToUTF16PtrElseNil String To UTF16Ptr if empty string trans to nil
func StringToUTF16PtrElseNil(str string) *uint16 {
if str == "" {
return nil
}
return syscall.StringToUTF16Ptr(str)
}
// FindWindow find window hwnd by name class="" if nil,nil mean ignore it
func FindWindow(class, title string) win.HWND {
var hwnd win.HWND
hwnd = win.FindWindow(StringToUTF16PtrElseNil(class), StringToUTF16PtrElseNil(title))
return hwnd
}
// FindWindowEx find window hwnd by name class="" if nil,nil mean ignore it
func FindWindowEx(hWndParent, hWndChild win.HWND, class, title string) win.HWND {
var hwnd win.HWND
hwnd = win.FindWindowEx(hWndParent, hWndChild,
StringToUTF16PtrElseNil(class),
StringToUTF16PtrElseNil(title))
return hwnd
}
// here: findWindow *windows.LazyProc
findWindowEx *windows.LazyProc
// here: findWindow = libuser32.NewProc("FindWindowW")
findWindowEx = libuser32.NewProc("FindWindowExW")
//here: func FindWindow(lpClassName, lpWindowName *uint16) HWND {
// add by rhinosharp team
func FindWindowEx(hWndParent HWND, hWndChild HWND, lpClassName, lpWindowName *uint16) HWND {
ret, _, _ := syscall.Syscall6(findWindowEx.Addr(), 4,
uintptr(hWndParent),
uintptr(hWndChild),
uintptr(unsafe.Pointer(lpClassName)),
intptr(unsafe.Pointer(lpWindowName)),
0,
0)
return HWND(ret)
}
The text was updated successfully, but these errors were encountered: