#Include Gdip.ahk
#Include Gdip_ImageSearch.ahk
if(IsImageCheck(imgsearch_x, imgsearch_y, "123.bmp",50,0))
{
click(imgsearch_x, imgsearch_y)
Sleep, 500
}
IsImageCheck(ByRef ClickX, ByRef ClickY, CKImage, errorRange, trans, sX = 0, sY = 0, eX = 0, eY = 0)
{
WinGet, Title, ID, [MOMO]앱플레이어
If(Gdip_ImageSearchWithdHwnd(Title, ClickX, ClickY, CKImage, errorRange, trans, sX, sY, eX, eY))
{
return true
}
}
Gdip_ImageSearchWithdHwnd(Hwnd,Byref X,Byref Y,Image,Variation=0,Trans="",sX = 0,sY = 0,eX = 0,eY = 0)
{
Sleep, 500
SysGet, wFrame, 7
SysGet, wCaption, 4
gdipToken := Gdip_Startup()
bmpHaystack := Gdip_BitmapFromHwnd(Hwnd)
bmpNeedle := Gdip_CreateBitmapFromFile(Image)
if( sX!= 0 || sY!= 0 || eX!= 0 || eY != 0)
{
sX := sX + wFrame
sY := sY + wCaption + wFrame
eX := eX + wFrame
eY := eY + wCaption + wFrame
}
RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,sX,sY,eX,eY,Variation,Trans,1,1)
Gdip_DisposeImage(bmpHaystack)
Gdip_DisposeImage(bmpNeedle)
Gdip_Shutdown(gdipToken)
StringSplit, LISTArray, LIST, `,
;X := LISTArray1
;Y := LISTArray2
X := LISTArray1 - wFrame
Y := LISTArray2 - wCaption - wFrame
check_reg := RET
;GuiControl,,로그, %bmpHaystack%||%bmpNeedle%||%RET%
msgbox, %bmpHaystack% , %bmpNeedle% , %RET%
; msgbox, %X%,%Y%,%RET%
if(RET = 1)
{
return true
}
else
{
return false
}
}
해당 부분에서 자꾸 1001이 나오면서 서치가 안되네요
뭐가 문제인지 모르겠습니다
고수분들 조언 좀 부탁드려요
ahk 문제였네요 ㅠ
64bit로 하니 해결되었습니다.
그런데 이번엔 리턴값이 0 이네요 ㅠ