Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Tooltip in popup tree control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tooltip in popup tree control

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Tooltip in popup tree control
    Posted: 20 November 2006 at 11:33am
Hi;
 
I have troubles in displaying a tooltip within a popup tree control.
See attached image.
 
Any ideas whats wrong?
 
Martin
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 1:58pm
It is known CTreeCtrl problem.
 
here is code we use in CXTTreeCtrl to fix it:
 
BOOL CXTTreeBase::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
 NMHDR* pNMHDR = (NMHDR*)lParam;
 switch (pNMHDR->code)
 {
 case TTN_SHOW:
  {
   // get a pointer to the tooltip control.
   HWND hWnd = TreeView_GetToolTips(m_pTreeCtrl->m_hWnd);
   if (hWnd != NULL)
   {
    // make sure the tooltip is at the top of the "Z" order, otherwise
    // it will appear behind popup windows....
    ::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
     SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
   }
  }
  break;
 }
 return m_pTreeCtrl->CTreeCtrl::OnNotify(wParam, lParam, pResult);
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2006 at 2:57am
Hi Oleg;
 
This happens with the CXTTreeCtrl! I'm not using the CTreeCtrl. I create the control in this way:

CXTTreeCtrl::CreateEx(WS_EX_TOOLWINDOW | (pParent->GetExStyle() & WS_EX_LAYOUTRTL), WS_CHILD | WS_BORDER | WS_VSCROLL | TVS_DISABLEDRAGDROP | TVS_TRACKSELECT, CRect(0, 0, 0, 0), pParent, 0)

Am I missing any necessary style?
 
Martin
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2006 at 3:46am

Hello Oleg;

I took your reply as a hint and wrote my own OnNotify() function. After changing the flag for the second parameter of SetWindowPos to HWND_TOPMOST it works as expected. Here are my small changes in my treectrl class function OnNotify() (perhaps this changes should also go into your CXTReeCtrlBase class:

if (hWnd != NULL)

{

// make sure the tooltip is at the top of the "Z" order, otherwise

// it will appear behind popup windows....

::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

}

Martin

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.