The CToolTipCtrl class provides the functionality of the Windows common tool tip control, a small pop-up window that displays the text describing the purpose of a tool in an application. Sometime you may need to increase the display duration of the tool tip if it contains a lengthy text.
CToolTipCtrl provides SetDelayTime function to sets the initial, pop-up, and reshow durations for a tool tip control.
void SetDelayTime(DWORD dwDuration, int iTime);
dwDuration – DWORD that specifies the type of duration that you want to set.
iTime – Integer that specifies the length of the delay time, in milliseconds.
The type of duration for increasing the tool tip display time is TTDT_AUTOPOP.
CToolTipCtrl m_tooltip; m_tooltip.Create(this); m_tooltip.Activate(TRUE); m_tooltip.SetDelayTime (TTDT_AUTOPOP, 10000); //Set tooltip display time to 10s
The default display duation is based on the double-click time of mouse, which can be calculated using windows API GetDoubleClickTime as shown below:
GetDoubleClickTime() * 10;