Re: Getting mouse events in disabled buttons

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: George Quievryn (GeorgeQuievryn_at_discussions.microsoft.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 06:33:03 -0800

Thanks for the suggestion. I considered this, but I am trying to avoid this
solution. I am concerned that other message that I really want to disable
will get through and I may miss some. The system is slightly more complex
then I explained in the initial post, and I have several other controls that
are not CButton but CWnd-derived that I need to do the same for. Had I known
all the requirements in advance, this is the solution I would have taken.
Instead, I am attempting to modify an existing system.

On solution that I know I can use is to use a mouse hook (I already have one
in my application). However, I notice that in other applications disabled
windows seem to be able to display tooltips and thought this might be a
possibility. I have not used tooltips directly before, so I had some trouble
getting this to work. Do the tooltips come from the child window that is
disabled or from the parent window that contains the CButton?

Any suggestion are greatly appreciated.

"Mark Randall" wrote:

> When Disabled, MS Windows blocks any user input (keyboard / mouse) from
> being sent to that particular window (as noted in the MSDN).
>
> The only possible workaround I can think of is to further derive your own
> button and instead of actually disabling it, change its display so it simply
> looks disabled, but still recieves events.
>
> - MR
>
>
> "George Quievryn" <GeorgeQuievryn@discussions.microsoft.com> wrote:
> 7B009D13DC95@microsoft.com...
> >I have a class derived from CButton that I need to send notification to the
> > parent when the mouse hovers over it. I was able to achieve this by
> > tracking
> > mouse events, but this presented a problem: it does not work if the button
> > is
> > disabled. Any suggestions on how to do this?
> >
> > I thought maybe some trick hooking into tooltips might work, but I wasn't
> > successful here. I tried EnableTooltips() then handled the TTN_NEEDTEXT
> > notification -- my member function was never called.
>
>
>


Quantcast