Jump to content

Get handle of not active window under mouse cursor


Recommended Posts

Hi again

I'm wondering how I would go about getting the title or handle of the topmost non-active window under my mouse cursor. I would like to get this information in order to complete a drag and drop of a file. The window I would be dragging from and the window receiving the drag would both be autoit created (but run under seperate processes) if that matters to the solution.

There has to be a way to do this but I'm at a loss. If I can't do this, then I'm stuck merging two listviews using onevent mode. I have problems using one, can't imagine two in one window.....

Thanks for any help

Picea

Link to comment
Share on other sites

Okay, I think I have it

It appears that _WinAPI_WindowFromPoint() gets the handle of the control it is over (in the window it's hovering).

So there were a couple more steps then I expected. So others who come searching, this is how I got the window title

$pos = _WinAPI_GetMousePos()

$hwnd = _WinAPI_WindowFromPoint($pos)

$rer=_WinAPI_GetParent($hwnd)

$rer2=WinGetTitle($rer)

MsgBox(0,"",$rer2)

Link to comment
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
 Share

  • Recently Browsing   0 members

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