Documentation
¶
Overview ¶
Package autoit is a AutoItX Go wrapper
Dependencies
AutoItX (http://www.autoitscript.com/site/autoit/downloads/)
Example
package main import ( "fmt" "github.com/brunoqc/go-autoit" ) func main() { success, pid := autoit.Run("notepad.exe", "", autoit.SwNormal) if !success { panic("can't run process") } fmt.Println("pid", pid) }
Build
set CGO_CFLAGS=-Ic:/AutoItX set CGO_LDFLAGS=-lAutoItX3_DLL set CGO_LDFLAGS=-lAutoItX3_x64_DLL # for 64-bit go build
Index ¶
- Constants
- func ControlClick(title, text, controlID, button string, clicks, x, y int) int
- func MouseMove(x, y, speed int)
- func Opt(option string, param int) int
- func PixelChecksum(left, top, right, bottom int32, step int) int64
- func PixelGetColor(x, y int) int
- func Run(filename, workingdir string, flag int) (bool, int)
- func Send(keys string, flag int)
- func WinActivate(title, text string)
- func WinActive(title, text string) bool
- func WinClose(title, text string)
- func WinExists(title, text string) bool
- func WinGetState(title, text string) (bool, int)
- func WinGetText(title, text string, bufSize int) (result string)
- func WinSetState(title, text string, flag int)
Constants ¶
View Source
const ( EnableUserInput = 0 DisabelUserInput = 1 )
View Source
const ( StateExists = 1 StateVisible = 2 StateEnabled = 4 StateActive = 8 StateMinimized = 16 StateMaximized = 32 )
Variables ¶
This section is empty.
Functions ¶
func ControlClick ¶
ControlClick clicks on a control without using the mouse pointer TODO: x, y should be center by defaut
func MouseMove ¶
func MouseMove(x, y, speed int)
MouseMove moves the mouse's pointer to a specific location
func PixelChecksum ¶
PixelChecksum returns a checksum of the pixel in a region
func PixelGetColor ¶
PixelGetColor returns the color of the pixel at the specified location return -1 if the location is invalid
func Run ¶
Run a program and don't wait Possibles flags are SwHide, SwMinimize, SwMaximize and SwNormal returns true on success with the pid
func WinGetState ¶
WinGetState returns a window's state
func WinGetText ¶
WinGetText returns the text contained in a window
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.