?
Solved

Get CWnd* pWnd, of ToolTipCtrl

Posted on 2001-06-26
10
Medium Priority
?
541 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
[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
  • 3
  • 2
  • +1
10 Comments
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 200 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
Independent Software Vendors: 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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 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