mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-03 23:53:54 +00:00
update godoc and deprecated GetBHandle
This commit is contained in:
parent
5957e315c9
commit
722b2b07e0
@ -1318,7 +1318,7 @@ func GetHandle() int {
|
|||||||
return ghwnd
|
return ghwnd
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBHandle get the window handle
|
// GetBHandle get the window handle, Wno-deprecated
|
||||||
func GetBHandle() int {
|
func GetBHandle() int {
|
||||||
hwnd := C.bget_handle()
|
hwnd := C.bget_handle()
|
||||||
ghwnd := int(hwnd)
|
ghwnd := int(hwnd)
|
||||||
@ -1437,7 +1437,7 @@ func FindNames() ([]string, error) {
|
|||||||
return strArr, err
|
return strArr, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindIds find the process id by the process name
|
// FindIds find the all process id by the process name
|
||||||
func FindIds(name string) ([]int32, error) {
|
func FindIds(name string) ([]int32, error) {
|
||||||
var pids []int32
|
var pids []int32
|
||||||
nps, err := Process()
|
nps, err := Process()
|
||||||
@ -1457,7 +1457,7 @@ func FindIds(name string) ([]int32, error) {
|
|||||||
return pids, err
|
return pids, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ActivePID active window by PID,
|
// ActivePID active window by PID,
|
||||||
// If args[0] > 0 on the Windows platform via a window handle to active
|
// If args[0] > 0 on the Windows platform via a window handle to active
|
||||||
func ActivePID(pid int32, args ...int) {
|
func ActivePID(pid int32, args ...int) {
|
||||||
var hwnd int
|
var hwnd int
|
||||||
|
@ -38,11 +38,6 @@ bool set_handle(uintptr handle){
|
|||||||
}
|
}
|
||||||
|
|
||||||
uintptr get_handle(){
|
uintptr get_handle(){
|
||||||
uintptr hwnd = getHandle();
|
|
||||||
return hwnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
uintptr bget_handle(){
|
|
||||||
MData mData = GetActive();
|
MData mData = GetActive();
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
return (uintptr)mData.CgID;
|
return (uintptr)mData.CgID;
|
||||||
@ -53,6 +48,11 @@ uintptr bget_handle(){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uintptr bget_handle(){
|
||||||
|
uintptr hwnd = getHandle();
|
||||||
|
return hwnd;
|
||||||
|
}
|
||||||
|
|
||||||
void set_active(const MData win){
|
void set_active(const MData win){
|
||||||
SetActive(win);
|
SetActive(win);
|
||||||
}
|
}
|
||||||
|
@ -475,17 +475,14 @@ bool setHandle(uintptr handle){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//uint32 uintptr
|
// uint32 uintptr
|
||||||
uintptr getHandle(){
|
uintptr getHandle(){
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
return (uintptr)mData.CgID;
|
return (uintptr)mData.CgID;
|
||||||
|
|
||||||
#elif defined(USE_X11)
|
#elif defined(USE_X11)
|
||||||
return (uintptr)mData.XWin;
|
return (uintptr)mData.XWin;
|
||||||
|
|
||||||
#elif defined(IS_WINDOWS)
|
#elif defined(IS_WINDOWS)
|
||||||
return (uintptr)mData.HWnd;
|
return (uintptr)mData.HWnd;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user