Solved

How to set a tooltip's delay time?

Posted on 2000-03-09
3
852 Views
Last Modified: 2013-11-20
Hi,all experts.
I have a dialog with some buttons.I want the tooltip of the buttons can still appear until mouse moves out.So I want to write the code like this:
      ::SendMessage(m_hWnd, TTM_SETDELAYTIME,TTDT_AUTOPOP, MAKELPARAM(30000, 0));
But how can I get m_hWnd of the tooltip window?
0
Comment
Question by:wang_gh
3 Comments
 
LVL 1

Expert Comment

by:mahno
ID: 2603919
Try GetSafeHwnd()
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2604026
Hi wang_gh,

you can try following:

handle the TTN_SHOW notification like this:

// in h file
class CMyDialog : public CDialog
{
 ...
 afx_msg void OnShowToolTip( UINT id, NMHDR* pNotifyStruct, LRESULT* result );
 ...
};

// in cpp file
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
....
 ON_NOTIFY_EX_RANGE( TTN_SHOW, 0, 0xFFFF, OnShowToolTip )
....
END_MESSAGE_MAP()
void
CMyDialog::OnShowToolTip( UINT id, NMHDR* pNotifyStruct, LRESULT* result )
{
 ::SendMessage( pNotifyStruct->hwndFrom, TTM_SETDELAYTIME, ... );
}

hope that helps,

ZOPPO
0
 

Author Comment

by:wang_gh
ID: 2605239
But the longest time is 30 seconds.Can I change it to unlimited?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now