mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
add CMData return and use
This commit is contained in:
parent
5b9871b063
commit
f32ae09772
@ -34,6 +34,9 @@ func get() {
|
||||
// get current Window Active
|
||||
mdata := robotgo.GetActive()
|
||||
|
||||
// get current Window Active , return CMData
|
||||
cmdata := robotgo.GetActiveCMData()
|
||||
|
||||
// get current Window Handle
|
||||
hwnd := robotgo.GetHandle()
|
||||
fmt.Println("hwnd---", hwnd)
|
||||
@ -44,6 +47,9 @@ func get() {
|
||||
|
||||
// set Window Active
|
||||
robotgo.SetActive(mdata)
|
||||
|
||||
// set Window Active by CMData
|
||||
robotgo.SetActiveByCMData(cmdata)
|
||||
}
|
||||
|
||||
func findIds() {
|
||||
|
13
robotgo.go
13
robotgo.go
@ -90,6 +90,7 @@ type (
|
||||
CHex C.MMRGBHex
|
||||
// CBitmap define CBitmap as C.MMBitmapRef type
|
||||
CBitmap C.MMBitmapRef
|
||||
CMData C.MData
|
||||
)
|
||||
|
||||
// Bitmap define the go Bitmap struct
|
||||
@ -874,6 +875,11 @@ func SetActive(win C.MData) {
|
||||
C.set_active(win)
|
||||
}
|
||||
|
||||
// SetActiveByCMData set the window active by CMData
|
||||
func SetActiveByCMData(win CMData) {
|
||||
C.set_active((C.MData)(win))
|
||||
}
|
||||
|
||||
// GetActive get the active window
|
||||
func GetActive() C.MData {
|
||||
mdata := C.get_active()
|
||||
@ -881,6 +887,13 @@ func GetActive() C.MData {
|
||||
return mdata
|
||||
}
|
||||
|
||||
// GetActiveCMData get the active window, return CMData
|
||||
func GetActiveCMData() CMData {
|
||||
mdata := C.get_active()
|
||||
// fmt.Println("active----", mdata)
|
||||
return (CMData)(mdata)
|
||||
}
|
||||
|
||||
// MinWindow set the window min
|
||||
func MinWindow(pid int, args ...interface{}) {
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user