read in Relative mode from a visible window that is not 'activated' ??

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
James9491
Posts: 34
Joined: 18 Feb 2016, 12:10

read in Relative mode from a visible window that is not 'activated' ??

Post by James9491 » 27 Jun 2022, 05:56

I am familiar with the 'winActivate' function and use it.

But now I would like to ask if it possible to read data from a visible window in Relative mode without it being activated in front of the other windows?

I added a Screenshot.

In the picture, you see three windows. The middle one is the "top" and has the focus. I want to read the yellow line position using 'pixelSearch' function in Relative mode also from the bottom window (which I have its data in terms of 'title', 'width', 'height', and its maximum X, Y values) without Activate it..

If it is possible, which function should I use?

James
Attachments
Screenshot_2022-06-27_13-31-21(1).png
Screenshot_2022-06-27_13-31-21(1).png (83.1 KiB) Viewed 329 times
Last edited by James9491 on 27 Jun 2022, 09:40, edited 2 times in total.

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: read in Relative mode from a visible window that is not 'activated' ??

Post by mikeyww » 27 Jun 2022, 06:13

Perhaps:

Code: Select all

ControlGetText, text, Edit1, ahk_exe notepad.exe
MsgBox, 64, Text, %text%
Or:

Code: Select all

WinGetText, text, ahk_exe notepad.exe
MsgBox, 64, Text, %text%
There is also ACC and now UIA (search forum).

David4
Posts: 27
Joined: 12 Jul 2016, 14:28

Re: read in Relative mode from a visible window that is not 'activated' ??

Post by David4 » 30 Jun 2022, 14:18

James9491 wrote:
27 Jun 2022, 05:56
I want to read the yellow line position using 'pixelSearch' function in Relative mode also from the bottom window (which I have its data in terms of 'title', 'width', 'height', and its maximum X, Y values) without Activate it..
When you use the output of WinGetPos of the inactive window as the input of PixelSearch, what is the problem? You can limit the search (overlapping active window), when you use WinGetPos of the active window and combine its output to the PixelSearch command. Provided, that you don't need to read invisible parts of the window.

Post Reply

Return to “Ask for Help (v1)”