Re: Mouse events

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




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

.



Relevant Pages

  • Re: Transparent window
    ... > I'm looking for a way to make transparent a form's client area while ... > dragging it onto the desktop. ... the client area content disappears and instead we see what there is ... > under the window, ...
    (alt.comp.lang.borland-delphi)
  • Transparent window
    ... I'm looking for a way to make transparent a form's client area while ... dragging it onto the desktop. ... when I click down on the window ...
    (alt.comp.lang.borland-delphi)
  • Re: Mouse events
    ... 'renderMode' to GL_SELECT whenever my mouse is moving(only moving not ... dragging) over the client area of window, ...
    (microsoft.public.vc.mfc)
  • Mouse events
    ... 'renderMode' to GL_SELECT whenever my mouse is moving(only moving not ... dragging) over the client area of window, ...
    (microsoft.public.vc.mfc)
  • Re: Calculating the client area
    ... for some reason my mainframe window is getting created a little bit ... The real client area is 536x480. ... is bigger than after the first WM_SIZE message? ...
    (microsoft.public.pocketpc.developer)