Comments (11)
You should give more information,I do not know in which system to reproduce it.
from robotgo.
package main
import (
"fmt"
"time"
"github.com/go-vgo/robotgo"
)
func main() {
sum := 0
for {
sum++
if sum > 99999999 {
break
} else {
time.Sleep(5 * time.Second)
mdata := robotgo.GetActive()
fmt.Println("mdata--", mdata)
hwnd := robotgo.GetHandle() //获取当前窗口hwnd
fmt.Println("hwnd--", hwnd)
}
}
}
i can get mdata,but cannot get hwnd。win7 x64
from robotgo.
@appleatiger
"hwnd := robotgo.GetHandle()" and "
for i := 0; i < 3; i++ {
fhwnd := robotgo.GetHandle()
Println("fhwnd---", fhwnd)
}"
is normal, but in this can't get hwnd,Maybe the runtime error or cgo bug, I will troubleshoot it.
from robotgo.
you can use it in windows:
hwnd := mdata.HWnd
fmt.Println("hwnd--", hwnd)
from robotgo.
if use hwnd := mdata.HWnd,i can see a string like this :"&{6619242}",it cannot be used for "SetHandle(hwnd)"
from robotgo.
hwnd := int(mdata.HWnd), Type conversion.
from robotgo.
cannot convert mdata.HWnd (type robotgo._Ctype_HWND) to type int
from robotgo.
I see,I use Windows test it,I use mac test it before this.
from robotgo.
Because of golang not have Macro definition, Let me think about it.
from robotgo.
Please try GetBHandle.
from robotgo.
good job!
from robotgo.
Related Issues (20)
- robotgo is incompatible with Go 1.21 HOT 6
- GetHWNDByPid failed
- Feature Request: Screenshot background windows
- Mouse Location correct In Windows 11 laptop with a resolution of 2560x1600 HOT 1
- gcv.FindX 查找图像不存在时 程序会崩溃
- KeyTap capslock in ubuntu will cause panic
- Move mouse to wrong location on multiple monitor HOT 2
- -mthreads vs -pthread compile error HOT 1
- Support multi xvfb?
- Support for Wayland?
- "RobotGo: DragSmooth Operation Not Triggering hook.MouseDrag Event on macOS Sonoma" HOT 1
- Can not get latest version v1.0.0-rc3
- TypeStr writes wrong characters
- I'm having issues with cross-compiling. HOT 2
- 使用goroutine并发去bitmap.Find图片的时候大概率闪退
- The process ID is not available
- Wayland support?
- building Fails
- Multiple monitors on windows causes cursor relative movement issues
- undefined: Bitmap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotgo.