The GUI is set to be AlwaysOnTop as I want to see if it receives the correct information at all time. When I press the c button (hotkey) then I want the GUI to display the value it has received from the OCR.
The code below works whenever I have the GUI as my current active window, but as soon as my game session is the active window (as it should be) the GUI will not update the information.
Code: Select all
#include <Vis2> ; Equivalent to #include .\lib\Vis2.ahk #SingleInstance, force Gui, +AlwaysOnTop +LastFound Gui, Add, Edit, x10 w200 r5 vEdit2, Gui, Show, w500 h600, The GUI return c:: text:= OCR([579, 1033, 37, 21]) GuiControl,,Edit2, %text% return GuiClose: ExitApp