PixelGetColor in background?

04/26/2019 21:14 Napulé#1
I'm trying to make a bot that works in background (Not minimized). Someone know if its possible to make PixelGetColor works for a specific window(using getwindowhandle)? Thanks for who will help me.
04/26/2019 23:29 Moneypulation#2
You can use FastFind for that [Only registered and activated users can see links. Click Here To Register...]

Although as far as I remember, the window you'd want to take snapshots from may not be minimized, otherwise the library won't get an image. A workaround for that can be to move the window out of your screen
04/27/2019 03:04 elmarcia#3
Quote:
Originally Posted by Napulé View Post
I'm trying to make a bot that works in background (Not minimized). Someone know if its possible to make PixelGetColor works for a specific window(using getwindowhandle)? Thanks for who will help me.
You cannot get color of a window that isn't active or is hidden by another window, simply because won't be drawn if it is in background or would maintain previous state.

Example -> targetwindow.au3

getPixelfromTarget.au3

Compile first script and run the second one, try hidding parts of the window with other windows and see the results.
One way to solve this problem is by activating target window before pixelCapture, but will pop up every time is needed to be updated, the other way is to use memory reading for events combined with control click (that would work in background). Also if the task is simple you can just solve it with control clicks without knowing state, just click target spots for buttons that may match together (rpg mobile games).
And last but not that easy, packet sniffing and sending requests to server.