Jump to content
Sign in to follow this  
r84170

[solved] How can I check if an object is covered by a window?

Recommended Posts

r84170

In general:

How can I check if an object is covered by a window?

Example: Someone moves a window over another window or control.

Is there a function?

Special problem:

I want check if a systray-icon will cover by a window.

But how can i get this information?

The normal und UDF does not work.

Who can help?

Edited by r84170

Share this post


Link to post
Share on other sites
LarryDalooza

The control "ToolbarWindow321" of the window "CLASS:Shell_TrayWnd" is the systray...

Get it's WinGetPos/ControlGetPos ... a.k.a. find out where it exists on the screen.

Do a WindowFromPoint() on some of the coords where it exists. If WindowFromPoint() comes back with the HWND of the "ToolbarWindow321" then nothing is covering it...

It's all there /\ ... just have to try and error.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
r84170

solution #2 works fine!

thank you.

My example:

#Include <WinAPI.au3>
;....
;Create $tagPoint structure
Local $tPoint= DllStructCreate("int X;int Y")
DllStructSetData($tpoint, "X", 1174)
DllStructSetData($tpoint, "Y", 1009)

; endless loop for example
While 1
   $result= _WinAPI_WindowFromPoint($tPoint)
   ConsoleWrite("Return win handle: " & $result & @CR)
   sleep(200)
WEnd
Edited by r84170
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.