update godoc and deprecated GetBHandle

This commit is contained in:
vcaesar 2018-04-11 21:14:57 +08:00
parent 5957e315c9
commit 722b2b07e0
3 changed files with 9 additions and 12 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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
}