From 722b2b07e04b80e609f37037ffdeeeda8c30192e Mon Sep 17 00:00:00 2001 From: vcaesar Date: Wed, 11 Apr 2018 21:14:57 +0800 Subject: [PATCH] update godoc and deprecated GetBHandle --- robotgo.go | 6 +++--- window/goWindow.h | 10 +++++----- window/window.h | 5 +---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/robotgo.go b/robotgo.go index b82bfb9..a6b2c1f 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1318,7 +1318,7 @@ func GetHandle() int { return ghwnd } -// GetBHandle get the window handle +// GetBHandle get the window handle, Wno-deprecated func GetBHandle() int { hwnd := C.bget_handle() ghwnd := int(hwnd) @@ -1437,7 +1437,7 @@ func FindNames() ([]string, error) { 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) { var pids []int32 nps, err := Process() @@ -1457,7 +1457,7 @@ func FindIds(name string) ([]int32, error) { 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 func ActivePID(pid int32, args ...int) { var hwnd int diff --git a/window/goWindow.h b/window/goWindow.h index a704179..e0da2b4 100644 --- a/window/goWindow.h +++ b/window/goWindow.h @@ -38,11 +38,6 @@ bool set_handle(uintptr handle){ } uintptr get_handle(){ - uintptr hwnd = getHandle(); - return hwnd; -} - -uintptr bget_handle(){ MData mData = GetActive(); #if defined(IS_MACOSX) return (uintptr)mData.CgID; @@ -53,6 +48,11 @@ uintptr bget_handle(){ #endif } +uintptr bget_handle(){ + uintptr hwnd = getHandle(); + return hwnd; +} + void set_active(const MData win){ SetActive(win); } diff --git a/window/window.h b/window/window.h index 10d4cb0..8055fad 100644 --- a/window/window.h +++ b/window/window.h @@ -475,17 +475,14 @@ bool setHandle(uintptr handle){ #endif } -//uint32 uintptr +// uint32 uintptr uintptr getHandle(){ #if defined(IS_MACOSX) return (uintptr)mData.CgID; - #elif defined(USE_X11) return (uintptr)mData.XWin; - #elif defined(IS_WINDOWS) return (uintptr)mData.HWnd; - #endif }