Solved

Get CWnd* pWnd, of ToolTipCtrl

Posted on 2001-06-26
10
523 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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