;버튼
Gui, Add, Button, x150 y40 w80 h30 vStart, 시작
Gui, Add, Button, x240 y40 w80 h30 vStop, 정지
Gui, Add, Button, x150 y80 w80 h30 vOption, 설정
;상태줄
Gui, Add, Text, x180 y17 w50 h15 vState, 정지
Gui, Show
global macrostate :=false
CoordMode,Pixel, Screen
CoordMode, Mouse, Screen
WinGetPos, pos_x, pos_y, width, height, ahk_class Qt5QWindowIcon
x_right := width + pos_x
y_bottom := height + pos_y
;정지 버튼
Button정지:
{
macrostate := false
Gui, submit,nohide
GuiControl, , State, 정지
}
return
;시작 버튼
Button시작:
{
macrostate := true
Gui, submit,nohide
GuiControl, , State, 시작
Loop
{
CoordMode,Pixel, Screen
WinGetPos, pos_x, pos_y, width, height, ahk_class Qt5QWindowIcon
x_right := width + pos_x
y_bottom := height + pos_y
ImageSearch, rex, rey, %pos_x%, %pos_y%, %x_right%, %y_bottom%, Image\senastart.bmp
if(ErrorLevel= 0)
{
ImageClick(rex,rey)
MsgBox,찾음
}
else
{
MsgBox,못찾음
}
return
}
}
return
; 변수 모음
ImageClick(x,y)
{
WinGetPos, w_x, w_y, w_w, w_h, , ahk_class Qt5QWindowIcon
n_x := x - w_x
n_y := y - w_y
ram := n_x | n_y<<16
PostMessage, 0x201, 1, %ram%, , ahk_class Qt5QWindowIcon
PostMessage, 0x202, 0, %ram%, , ahk_class Qt5QWindowIcon
}
ahk_class Qt5QWindowIcon는 녹스입니다. 근데 이미지를 찾는것까진하는데 클릭을 안합니다..
도움을 구합니다 !