diff --git a/doc.md b/doc.md
index 9cd4d0b..3854980 100644
--- a/doc.md
+++ b/doc.md
@@ -51,6 +51,7 @@
#####[IsValid](#IsValid)
#####[SetActive](#SetActive)
#####[GetActive](#GetActive)
+#####[SetHandle](#SetHandle)
#####[GetHandle](#GetHandle)
#####[GetTitle](#GetTitle)
@@ -460,6 +461,16 @@ func main() {
####Return:
Returns hwnd
+###
.SetHandle()
+
+ Set the Window Handle
+
+####Arguments:
+ int
+
+####Return:
+ bool
+
###.GetHandle()
Get the Window Handle
diff --git a/robotgo.go b/robotgo.go
index 7da4c0d..85e5462 100644
--- a/robotgo.go
+++ b/robotgo.go
@@ -582,10 +582,10 @@ func GetHandle() int {
return ghwnd
}
-// func SetHandle(hwnd int) {
-// chwnd := C.uintptr(hwnd)
-// C.aSetHandle(chwnd)
-// }
+func SetHandle(hwnd int) {
+ chwnd := C.uintptr(hwnd)
+ C.aSetHandle(chwnd)
+}
func GetTitle() string {
title := C.aGetTitle()
diff --git a/window/goWindow.h b/window/goWindow.h
index a37f79d..fa10f52 100644
--- a/window/goWindow.h
+++ b/window/goWindow.h
@@ -32,6 +32,11 @@ void aCloseWindow(void){
CloseWin();
}
+bool aSetHandle (uintptr handle){
+ bool hwnd=setHandle(handle);
+ return hwnd;
+}
+
uintptr aGetHandle(){
uintptr hwnd=getHandle();
return hwnd;
diff --git a/zh_doc.md b/zh_doc.md
index 90009cd..383eece 100644
--- a/zh_doc.md
+++ b/zh_doc.md
@@ -51,6 +51,7 @@
#####[IsValid](#IsValid)
#####[SetActive](#SetActive)
#####[GetActive](#GetActive)
+#####[SetHandle](#SetHandle)
#####[GetHandle](#GetHandle)
#####[GetTitle](#GetTitle)
@@ -473,6 +474,16 @@ func main() {
####返回值:
Returns hwnd
+###.SetHandle()
+
+ Set the Window Handle
+
+####参数:
+ int
+
+####返回值:
+ bool
+
###.GetHandle()
获取窗口 Handle