Solved

Get CWnd* pWnd, of ToolTipCtrl

Posted on 2001-06-26
10
512 Views
Last Modified: 2013-11-20
Hi I've made a ToolTipCtrl

..
m_ToolTip.UpdateTipText("GoGo", ??? , this);
..

Whatever, I can't get the Hwnd ID of the ToolTip.. I need to get the CWnd* pWnd, of the ToolTipCtrl,, How can I get that ?

CB
0
Comment
Question by:win32
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 50 total points
ID: 6226700
you don't need the Hwnd of the tooltip

m_ToolTip.UpdateTipText("GOGO",this,IDOK);

0
 
LVL 4

Expert Comment

by:IainHere
ID: 6226911
ShaunWilde is, of course, correct.  His method works because CToolTipCtrl is derived from CWnd, and can therefore be used in all situations where a CWnd is required.  The 'this' pointer therefore points to the correct CWnd.
0
 
LVL 32

Expert Comment

by:jhance
ID: 6227210
I haven't checked this but if m_ToolTip is an instance of a CWnd derived class, the m_hWnd member of it would be the HWND, right?

So you should be able to do:

HWND hWnd = m_ToolTip.m_hWnd;
0
 
LVL 4

Expert Comment

by:IainHere
ID: 6227340
jhance:

Yup, that would get the handle.  But win32 is trying to get the handle in order to set the text, and ShaunWilde gave him/her a better method.
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6228063
> HWND hWnd = m_ToolTip.m_hWnd;

yes they did seem to ask for the HWND of the tooltip but the method they gave as a sample is used to set a tooltip for a particular control - I am guessing that we had a bit of alanguage problem here in phrasing the question or that win32 didn't realise that a CTooltipCtrl can be used to show tooltips for more than one control at a time - I am also guessing that the CToolTipCtrl is also being hosted by a class that is derived from CWnd (eg CWnd,CDialog or CView etc) - a reasonable assumption I hope
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 32

Expert Comment

by:jhance
ID: 6228091
Could be.  As you and I both know, users don't always say what they mean or mean what they say...  

I'm not 100% clear on what the point is here in this Q.

It would be nice in win32 would come back online and clarify a bit.
0
 

Author Comment

by:win32
ID: 6234611
Year, now it works fine, so thanks :-)
0
 
LVL 32

Expert Comment

by:jhance
ID: 6235003
What works?  Inquiring minds want to know....

You stated a problem and there were several comments.  What was the proper solution....
0
 

Author Comment

by:win32
ID: 6258891
True, the trick is to write "this", to get the ToolTip attacked to the window I wanna work with. Thats it!
0
 

Author Comment

by:win32
ID: 6258893
Simply writing it like this:
m_ToolTip.UpdateTipText(ToolText.c_str(), this, 0);
works fine!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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 (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

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

11 Experts available now in Live!

Get 1:1 Help Now