Sign in to follow this  
Followers 0
picea892

Get handle of not active window under mouse cursor

4 posts in this topic

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

Share this post


Link to post
Share on other sites



_WinAPI_WindowFromPoint().

1 person likes this

Share this post


Link to post
Share on other sites

Ah...Excellent. I knew there had to be a way.

I've meddled with these $tagPOINT structures before and am pretty sure I can muddle my way through the rest of this.

Much appreciated. Thanks again.

Picea

Share this post


Link to post
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)

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  
Followers 0