Re: Tooltip display fails
Picture control? :confused: are you refering to a canvas control or Any other like a Bitmap blittted on Static or so??
Anyways, you've defined the function, and it seems Okay for me.... (I havent compiled)..
You should need to display the Tooltip, when a Mousehover is occured on the Picture('s) Control.. right?
If so, you should have to Call this function from the WM_MOUSEHOVER mesage handler of the Picture('s) Control :)
Re: Tooltip display fails
static control that is to hold a bitmap with frame/etch/bitmap etc or say a bitmap control
I have declared a variable m_pic and I get the handle to this bitmap easily m_pic.hWnd hehehe
Handling mouse messages is fine, only the tooltip doesn't show up and I am really LONG long for it.
What is wrong ?
Re: Tooltip display fails
Check your if statement in your InitToolTip.
Re: Tooltip display fails
Thanks I see m_hWnd=0x0000000
How should I fix this ?
Re: Tooltip display fails
Your "m_toolTip.Create" creates the tooltip, so you want something like:
Code:
void CMyToolTip::InitToolTip(HWND hParentWnd)
{
if(!m_toolTip.m_hWnd)
{
m_toolTip.Create(CWnd::FromHandle(hParentWnd),WS_POPUP|TTS_BALLOON);
m_toolTip.Activate(FALSE);
}
}
Re: Tooltip display fails
Sorry,
if(!m_toolTip.m_hWnd)
was what I had in my original source code, the above snip was copied incorrectly. I dont see the balloon display when mouse is over. I don't know why.
Re: Tooltip display fails
Can you post a small demo project with the problem? Remove temporary files.
Re: Tooltip display fails
I will send you in email Ok ? :) no other information except deed for help on this problem is included :)
Re: Tooltip display fails
ok, but why not post it on the forum, so other members might also take a look at it?
Re: Tooltip display fails
Ok, I will but not now, because I am very far away from home and I don't have the source code included in my usb to extract up here. :)
Later! :)
Re: Tooltip display fails
One other thing, did you add a call to RelayEvent?
Something along the lines like:
Code:
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
{
m_toolTip.RelayEvent(pMsg);
return CWnd::PreTranslateMessage(pMsg);
}
Re: Tooltip display fails
Thank you very much for your help
But I have to tell you that your help is yet to be sufficient to make the program work. I have to save my class's handle for use in my dialog. That is 1:1 I mean.