Re: Lock the mouse over buttons
- From: videomanlib <videomanlib@xxxxxxxxx>
- Date: Tue, 23 Sep 2008 09:27:35 -0700 (PDT)
On 23 sep, 16:58, Joseph M. Newcomer <newco...@xxxxxxxxxxxx> wrote:
Not clear what you mean by this question.
If you want to "lock" the mouse so that it cannot be moved from a control, you can
ClipCursor to the GetWindowRect value of that window. But then you say you want to "ask
Windows if there is any kind of control under the mouse". That's a totally different and
completely unrelated question.
In that case, you would typically do a hook function and hook mouse events, and when you
got a WM_MOUSEMOVE/WM_NCMOUSEMOVE you would do a GetWindowFromPoint or
GetChildWindowFromPoint. But this is unrelated to "locking" the mouse so it cannot be
moved from a button (which, I might add, is also consider a highly unsocial act).
If you only care about the controls on your app, you can look for WM_MOUSEMOVE or
WM_NCMOUSEMOVE messages using a PreTranslateMessage function (one of the few actual
legitimate uses of this function) and therefore won't need a hook.
On Tue, 23 Sep 2008 03:50:55 -0700 (PDT), videomanlib <videoman...@xxxxxxxxx> wrote:
I need to lock the mouse over all the buttons, menus and icons
presented in the screen, not just the controls of my app but all the
controls. What I mean is that I have to ask windows if there is any
kind of control (button,menu,icon, combo box) in the point of the
screen under the mouse pointer?
Do you know if this can be done and how?
I don't know how to search for that, I tried to search with these
lock mouse buttons
Joseph M. Newcomer [MVP]
Yes you are right, may be I was not very sure about what I wanted to
do. Now I know the way to go.
I was thinking on an accessibility option to help an eye tracking
system. This way it would be easier for the user to fix the mouse over
small icons or buttons. Not an unsocial act at all :).
- Prev by Date: Re: How to display messages to the user during long processes!!
- Next by Date: Re: Lock the mouse over buttons
- Previous by thread: Re: Lock the mouse over buttons
- Next by thread: Re: Lock the mouse over buttons