How to increase the tooltip display time

21 01 2018

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.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;



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: