Re: Mouse events
- From: "Adrian" <richard.the.lionheart@xxxxxxxxx>
- Date: 4 Sep 2006 00:27:00 -0700
Doug Harrison [MVP] wrote:
On 2 Sep 2006 00:43:42 -0700, "Adrian" <richard.the.lionheart@xxxxxxxxx>
wrote:
I am working on a 3D model viewer using MFC. I want to set a variable -
'renderMode' to GL_SELECT whenever my mouse is moving(only moving not
dragging) over the client area of window, and to GL_RENDER when the
mouse is either dragging in client area or is in the non client area of
my window. How could I achieve it, I mean what code should go in which
event handler?
You would need to handle WM_MOUSEMOVE and WM_NCMOUSEMOVE. Concerning the
dragging, you should be using SetCapture when the dragging is initiated
(typically WM_LBUTTONDOWN) and ReleaseCapture when the dragging is
terminated (typically WM_LBUTTONUP and WM_CANCELMODE).
--
Doug Harrison
Visual C++ MVP
Thanks for all the help.
There is but a new problem,
Whenever I click a menu and then click on some entry in the menu a
mouse move event is generated because when the menu is open it
partially convers the window's client area and when an entry in the
menu is clicked the menu disappears but the mouse pointer stays where
it is i.e. in the winow's client area and this generates a
WM_MOUSEMOVE. I dont want this behaviour. Can I somehow detect that the
mouse move event was generated because the menu disappeared and left
the mouse pointer marooned in the client area island?
Thank you
.
- Follow-Ups:
- Re: Mouse events
- From: Doug Harrison [MVP]
- Re: Mouse events
- References:
- Mouse events
- From: Adrian
- Re: Mouse events
- From: Doug Harrison [MVP]
- Mouse events
- Prev by Date: Re: Window painting
- Next by Date: Re: When I change the DPI setting to 125% of Normal font size.
- Previous by thread: Re: Mouse events
- Next by thread: Re: Mouse events
- Index(es):
Relevant Pages
|