From: Sam Davis on
Anynone know of a way to take a class derived from a CStatic and have it add
a tooltip? I have tried the EnableToolTip(TRUE) and look for several messages
but just can't get it to happen.... Anyideas?
From: AliR on
You need to handle the TTN_NEEDTEXT notification message.

Read this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Tool_Tips.asp

AliR.

"Sam Davis" <SamDavis(a)discussions.microsoft.com> wrote in message
news:16BF7660-BEA6-446E-81A9-AC0D621B97DA(a)microsoft.com...
> Anynone know of a way to take a class derived from a CStatic and have it
add
> a tooltip? I have tried the EnableToolTip(TRUE) and look for several
messages
> but just can't get it to happen.... Anyideas?


From: Sam Davis on
I have done this. I am not sure why the message isn't getting to the control.
Does this HAVE to be done on the dialog that is hosting the control?

"AliR" wrote:

> You need to handle the TTN_NEEDTEXT notification message.
>
> Read this:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Tool_Tips.asp
>
> AliR.
>
> "Sam Davis" <SamDavis(a)discussions.microsoft.com> wrote in message
> news:16BF7660-BEA6-446E-81A9-AC0D621B97DA(a)microsoft.com...
> > Anynone know of a way to take a class derived from a CStatic and have it
> add
> > a tooltip? I have tried the EnableToolTip(TRUE) and look for several
> messages
> > but just can't get it to happen.... Anyideas?
>
>
>
From: AliR on
You can do it either way, the most common way and the easiest way is to do
it through the parent dialog
But here is how you would do it through the control itself
You need to take over OnToolHitTest and do something like this.

INT_PTR CMyStatic::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
pTI->hwnd = m_hWnd;
pTI->uId = (UINT)m_hWnd;
pTI->uFlags |= TTF_IDISHWND;
pTI->lpszText = LPSTR_TEXTCALLBACK;
return GetDlgCtrlID();
}

This will allow your control to receive TTN_NEEDTEXT

AliR.

"Sam Davis" <SamDavis(a)discussions.microsoft.com> wrote in message
news:46335167-A842-4D87-B13B-6BB868C08D24(a)microsoft.com...
> I have done this. I am not sure why the message isn't getting to the
control.
> Does this HAVE to be done on the dialog that is hosting the control?
>
> "AliR" wrote:
>
> > You need to handle the TTN_NEEDTEXT notification message.
> >
> > Read this:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Tool_Tips.asp
> >
> > AliR.
> >
> > "Sam Davis" <SamDavis(a)discussions.microsoft.com> wrote in message
> > news:16BF7660-BEA6-446E-81A9-AC0D621B97DA(a)microsoft.com...
> > > Anynone know of a way to take a class derived from a CStatic and have
it
> > add
> > > a tooltip? I have tried the EnableToolTip(TRUE) and look for several
> > messages
> > > but just can't get it to happen.... Anyideas?
> >
> >
> >


From: RainMan on
Follow this link and see article. Maybe this will help you.
http://www.codeguru.com/Cpp/controls/combobox/tooltips/article.php/c9283/
You will most likely have to modify a code to meet your needs.


"Sam Davis" wrote:

> Anynone know of a way to take a class derived from a CStatic and have it add
> a tooltip? I have tried the EnableToolTip(TRUE) and look for several messages
> but just can't get it to happen.... Anyideas?