Solved

How to set a tooltip's delay time?

Posted on 2000-03-09
3
853 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 31

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

919 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

16 Experts available now in Live!

Get 1:1 Help Now