mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43: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
|
// get current Window Active
|
||||||
mdata := robotgo.GetActive()
|
mdata := robotgo.GetActive()
|
||||||
|
|
||||||
|
// get current Window Active , return CMData
|
||||||
|
cmdata := robotgo.GetActiveCMData()
|
||||||
|
|
||||||
// get current Window Handle
|
// get current Window Handle
|
||||||
hwnd := robotgo.GetHandle()
|
hwnd := robotgo.GetHandle()
|
||||||
fmt.Println("hwnd---", hwnd)
|
fmt.Println("hwnd---", hwnd)
|
||||||
@ -44,6 +47,9 @@ func get() {
|
|||||||
|
|
||||||
// set Window Active
|
// set Window Active
|
||||||
robotgo.SetActive(mdata)
|
robotgo.SetActive(mdata)
|
||||||
|
|
||||||
|
// set Window Active by CMData
|
||||||
|
robotgo.SetActiveByCMData(cmdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
func findIds() {
|
func findIds() {
|
||||||
|
13
robotgo.go
13
robotgo.go
@ -90,6 +90,7 @@ type (
|
|||||||
CHex C.MMRGBHex
|
CHex C.MMRGBHex
|
||||||
// CBitmap define CBitmap as C.MMBitmapRef type
|
// CBitmap define CBitmap as C.MMBitmapRef type
|
||||||
CBitmap C.MMBitmapRef
|
CBitmap C.MMBitmapRef
|
||||||
|
CMData C.MData
|
||||||
)
|
)
|
||||||
|
|
||||||
// Bitmap define the go Bitmap struct
|
// Bitmap define the go Bitmap struct
|
||||||
@ -874,6 +875,11 @@ func SetActive(win C.MData) {
|
|||||||
C.set_active(win)
|
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
|
// GetActive get the active window
|
||||||
func GetActive() C.MData {
|
func GetActive() C.MData {
|
||||||
mdata := C.get_active()
|
mdata := C.get_active()
|
||||||
@ -881,6 +887,13 @@ func GetActive() C.MData {
|
|||||||
return 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
|
// MinWindow set the window min
|
||||||
func MinWindow(pid int, args ...interface{}) {
|
func MinWindow(pid int, args ...interface{}) {
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user