|
-
Sep 13th, 2005, 05:34 AM
#1
Thread Starter
Addicted Member
mouse tracking
which namespace should i use so that i can track the mouse position on complete window. Not just the screen. If some one has some codes to share it would be of more help.
What i intend to do is get the application's title on which mouse is released (mouse up) after a in drag drop. So I want to know the application name/title on which the item is being dropped.
Thanks
- cha0s4u ENJOI
Do Remember to RATE a post if it helps u,
Ratings encrougage those who Know enough,to help others 
-
Sep 13th, 2005, 07:48 AM
#2
Re: mouse tracking
You can use a combination of API Calls in order to do it...
VB Code:
Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As Point) As Integer
Declare Function WindowFromPoint Lib "user32.dll" (ByVal xPoint As Integer,
ByVal yPoint As Integer) As Integer
Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" _
ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
In your sub...
VB Code:
Dim rPoint as Point
Dim hWnd as Integer
'string needs to be assigned a buffer.. not sure the right way but I do this
Dim rString as String = " "
'call this on mouseup
GetCursorPos(RPoint)
hWnd = WindowFromPoint(RPoint.X, RPoint.Y)
'returns window text
GetWindowText(hWnd, rString, 35)
MsgBox rString
-
Sep 13th, 2005, 07:51 AM
#3
Thread Starter
Addicted Member
Re: mouse tracking
i have this code, but was having trouble converting it to VB.NET so i asked for the namespace....
- cha0s4u ENJOI
Do Remember to RATE a post if it helps u,
Ratings encrougage those who Know enough,to help others 
-
Sep 13th, 2005, 08:35 AM
#4
Re: mouse tracking
Then post the code hard to "guess" the code you're workin with
-
Sep 15th, 2005, 01:19 AM
#5
Thread Starter
Addicted Member
Re: mouse tracking
dude what i need is just the namespace that contains the class that cna be used to get the mouse properties.
i dont know the namespace... that is what i asked in my initial question..
and the code that ur asking me for is quite the same as uses GetCursorPos and WindowFromPoint APIs to track the mouse pos.... its the generic code that we use to track the mouse on screen.
any ways thanks for ur time and inputs... if u have anything more to share.. im waiting
- cha0s4u ENJOI
Do Remember to RATE a post if it helps u,
Ratings encrougage those who Know enough,to help others 
-
Sep 15th, 2005, 02:21 AM
#6
-
Sep 15th, 2005, 02:30 AM
#7
Fanatic Member
Re: mouse tracking
You dont even neet to type the whole thing...
You can just use cursor.
And still,an API is a good choice for getting full control of the mouse..To get the API's,use...
www.pinvoke.net
Godwin
Help someone else with what someone helped you! 
-
Sep 15th, 2005, 02:38 AM
#8
Thread Starter
Addicted Member
Re: mouse tracking
thanks i will check in some time... lil busy rt now with some other things...
thanks for ur inputs.
- cha0s4u ENJOI
Do Remember to RATE a post if it helps u,
Ratings encrougage those who Know enough,to help others 
-
Sep 15th, 2005, 03:16 AM
#9
-
Sep 15th, 2005, 04:24 AM
#10
Thread Starter
Addicted Member
Re: mouse tracking
Thanks a lot... it works.. fine. I will try to incorporate this with getting the name of the window under it
Thanks alot.
PS: i was busy in another project. .so cudt test it that time.. so thanked u coz i felt that shud work. i dont think u shud mind that :-)
- cha0s4u ENJOI
Do Remember to RATE a post if it helps u,
Ratings encrougage those who Know enough,to help others 
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
|