|
-
June 17th, 2008, 03:29 AM
#1
Mouse operations in VB.NET when using opengl
We have developed a VB.Net application in which we are drawing 2D lines using opengl. We are unable to capture mouse events like mouse click, mouse move. How to handle mouse events in VB.Net using opengl?
-
June 17th, 2008, 08:39 AM
#2
Re: Mouse operations in VB.NET when using opengl
Have you tried API ¿
For example, these :
WM_LBUTTONDOWN, WM_RBUTTONDBLCLK, WM_MOUSEMOVE
with the GetMessage API should tell you The Left Mouse Button is down, The Right MouseButton was double clicked, or your Mouse has moved
Just a thought...
-
June 17th, 2008, 12:18 PM
#3
Re: Mouse operations in VB.NET when using opengl
The standard handling of Mouse click event in VB.Net doesn't help because the control doesn't go into it's handler function if he form is covered with opengl drawings.
I have overriden WndProc in our VB.Net application and trapped WM_LBUTTONDOWN message, but I am unable to obtain the coordinates of the mouse position in Window coordinates. According to the documentation in msdn, LParam contains the X and Y coordinates in it's lower and upper words(or vice-versa - I am not sure). The problem is that LParam is an IntPtr . I could not obtain the integer value stored at this location(i.e., LParam). LParam gives the same value irrespective of the location at which I press the left mouse button. Is there a way around this problem? If I can obtain the value stored in LParam location I can do the the standard bitwise left and right shift operations to retrieve the X and Y window coordinates
-
June 18th, 2008, 12:36 AM
#4
Re: Mouse operations in VB.NET when using opengl
Why not try the GetCursorPos API ¿
Also, do you have a copy of API Viewer 2004 ¿
-
June 18th, 2008, 08:13 AM
#5
Re: Mouse operations in VB.NET when using opengl
 Originally Posted by s_kannan55
We have developed a VB.Net application in which we are drawing 2D lines using opengl. We are unable to capture mouse events like mouse click, mouse move. How to handle mouse events in VB.Net using opengl?
I have done that on VB6, by drawing OpenGl to a picturebox window. Then, I simply handled the mouse events of the picturebox.
(PD: the VB6 OpenGl library was so bad, I decided down my head, and use Direct X in the future. Microsoft is watching you )
Last edited by Marraco; June 18th, 2008 at 04:30 PM.
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
|