|
-
December 12th, 1999, 02:43 PM
#1
Mouse & Handles
I was wondering how to get the handle of a window that the mouse is currently over. If anyone has any ideas/suggestions i'd appreciate your response.
Thank You.
Lynx
-
December 13th, 1999, 12:54 PM
#2
Re: Mouse & Handles
You may try this code:
Paste into your module
public Type POINTAPI
x as Long
y as Long
End Type
public Declare Function WindowFromPoint Lib "user32" (byval xPoint as Long, byval yPoint as Long) as Long
public Declare Function GetCursorPos Lib "user32" (lpPoint as POINTAPI) as Long
This will get the handle of the window that the mouse is over, but how can i take this event? As a solution to this problem I use the MouseUp Event of the Form, as described above:
private Sub Form1_MouseUp(...)
Dim lhWnd as Long
Dim lDummy as Long
Dim xCursor as POINTAPI
lDummy=GetCursorPos(xCursor)
'This line will return the handle
lhWnd=WindowFromPoint(xCursor.x,xCursor.y)
End Sub
so, when the user click in your window and drag releasing the mouse over other window, the application will get the handle of window where are the mouse pointer.
(sorry about my english)
Vanclei Matheus
[email protected]
Techno Dreamer
-
December 13th, 1999, 04:39 PM
#3
Re: Mouse & Handles
Hey that worked, thanks!
now i just want to know how to be able to do that by dragging and releasing an icon over the desired window.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|