this is my script
Code: Select all
SetWorkingDir, %a_scriptdir%
settitlematchmode 2
#Include Gdip_all.ahk
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
title=mygame hehe
IfWinNotExist, %title%
{
msgbox %title% not found
Gdip_Shutdown(pToken)
ExitApp,
}
winget,hwnd,ID,%title%
pBitmapHayStack :=Gdip_BitmapFromHWND(hwnd)
Gdip_SaveBitmapToFile(pBitmapHayStack, "haystack.png")
sleep 3000
Gui, add,picture,,haystack.png
Gui, show,autosize
Gdip_DisposeImage(pBitmapHayStack)
return
Guiclose:
Gdip_Shutdown(pToken)
exitapp