Add GetBHandle

This commit is contained in:
vCaesar 2017-02-06 19:10:10 +08:00
parent 97e20fce9d
commit 06659511d2
2 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import "C"
import (
// . "fmt"
"reflect"
"unsafe"
// "runtime"
@ -763,6 +764,14 @@ func GetHandle() int {
return ghwnd
}
//GetBHandle Get the window handle
func GetBHandle() int {
hwnd := C.bGetHandle()
ghwnd := int(hwnd)
//Println("gethwnd---", ghwnd)
return ghwnd
}
//GetTitle Get the window title
func GetTitle() string {
title := C.aGetTitle()

View File

@ -42,6 +42,17 @@ uintptr aGetHandle(){
return hwnd;
}
uintptr bGetHandle(){
MData mData=GetActive();
#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
}
void aSetActive(const MData win){
SetActive(win);
}