Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to set a tooltip's delay time?

Posted on 2000-03-09
3
Medium Priority
?
861 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

618 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