From: David Webber on

"Dan Bloomquist" <public21(a)lakeweb.com> wrote in message
news:i217h.5548$Ka1.4009(a)news01.roc.ny...

> For kicks, I pasted your code into a dialog and just used a "this is a
> test" for the tip. I get TRUE returned for both AddTool calls for all the
> controls. For some reason I don't get any tips?!

Sorry, I only gave you half the story. One also needs something like:

====
BOOL CTTDialog::PreTranslateMessage( MSG* pMsg )
{
if( m_bShowToolTips &&
pMsg->message >= WM_MOUSEFIRST &&
pMsg->message <= WM_MOUSELAST )
{
// Make a copy of the message:
MSG msgcopy;
::CopyMemory( &msgcopy, pMsg, sizeof(MSG) );

// May need to alter the copy subtly
// if it is meant for a control:

if( pMsg->hwnd != m_hWnd )
{
// Want to relay the message to the top-level control.
// [A child of the dialogue box.]
// If the message is sent to a child of the control
// (as can happen with combo boxes) then we need to
// work a bit harder:
HWND hWndParent = ::GetParent(msgcopy.hwnd);
while( hWndParent && hWndParent != m_hWnd )
{
msgcopy.hwnd = hWndParent;
hWndParent = ::GetParent(hWndParent);
}
}

// Relay the copied (and possibly butchered) message.

if( msgcopy.hwnd )
{
m_ToolTip.RelayEvent( &msgcopy );
}
}

BOOL bResult = CDialog::PreTranslateMessage( pMsg );
return bResult;
}
===

I should add that I didn't invent *all* of this - I got the basis from
CodeGuru somewhere! My contribution may have been adding tools to the
rectangles of the dialogue itself, to make it work with static and disabled
controls - ie the bit which works sometimes :-(

Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm


From: David Webber on

"David Webber" <dave(a)musical.demon.co.uk> wrote in message
news:e32xsPbCHHA.4844(a)TK2MSFTNGP02.phx.gbl...

>...
> I should add that I didn't invent *all* of this - I got the basis from
> CodeGuru somewhere! My contribution may have been adding tools to the
> rectangles of the dialogue itself, to make it work with static and
> disabled controls - ie the bit which works sometimes :-(

Bingo! [Light bulb illuminates above head!] Ignore my comments about it
only working sometimes!

If the disabled control is within a group box, then it has to be after the
group box in the tab order, and then it works fine. Doh! (As they say.)

Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm



From: Dan Bloomquist on


David Webber wrote:

> "David Webber" <dave(a)musical.demon.co.uk> wrote in message
> news:e32xsPbCHHA.4844(a)TK2MSFTNGP02.phx.gbl...
>
>
>>...
>>I should add that I didn't invent *all* of this - I got the basis from
>>CodeGuru somewhere! My contribution may have been adding tools to the
>>rectangles of the dialogue itself, to make it work with static and
>>disabled controls - ie the bit which works sometimes :-(
>
>
> Bingo! [Light bulb illuminates above head!] Ignore my comments about it
> only working sometimes!
>
> If the disabled control is within a group box, then it has to be after the
> group box in the tab order, and then it works fine. Doh! (As they say.)

Hi David,
I added your code back then and got tool tips. But I still didn't get
tips on disabled windows, no group box. I didn't have the time to dig.
The need tool tip method works fine for me.

Best, Dan.

From: David Webber on

"Dan Bloomquist" <public21(a)lakeweb.com> wrote in message
news:dIl8h.5819$Ka1.5456(a)news01.roc.ny...

>> If the disabled control is within a group box, then it has to be after
>> the group box in the tab order, and then it works fine. Doh! (As they
>> say.)
>
> Hi David,
> I added your code back then and got tool tips. But I still didn't get tips
> on disabled windows, no group box. I didn't have the time to dig. The need
> tool tip method works fine for me.

I am happy with both methods now. Thanks for tempting me to think about it
again!

Dave

--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
..