mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 15:13:55 +00:00
add more win32 function export
This commit is contained in:
parent
af1d0d2d00
commit
e26e811e6d
@ -14,6 +14,7 @@ package robotgo
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
"github.com/lxn/win"
|
"github.com/lxn/win"
|
||||||
)
|
)
|
||||||
@ -31,3 +32,23 @@ func GetHWND() win.HWND {
|
|||||||
|
|
||||||
return hwnd
|
return hwnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SendInput send n input event
|
||||||
|
func SendInput(nInputs uint32, pInputs unsafe.Pointer, cbSize int32) uint32 {
|
||||||
|
return win.SendInput(nInputs, pInputs, cbSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SendMsg send a message with hwnd
|
||||||
|
func SendMsg(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr {
|
||||||
|
return win.SendMessage(hwnd, msg, wParam, lParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetActiveWindow set window active with hwnd
|
||||||
|
func SetActiveWindow(hwnd win.HWND) win.HWND {
|
||||||
|
return win.SetActiveWindow(hwnd)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetFocus set window focus with hwnd
|
||||||
|
func SetFocus(hWnd win.HWND) win.HWND {
|
||||||
|
return win.SetFocus(hWnd)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user