Solved

How to set a tooltip's delay time?

Posted on 2000-03-09
3
858 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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