Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

Posted (edited)

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...