Solved

Get CWnd* pWnd, of ToolTipCtrl

Posted on 2001-06-26
10
532 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 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
Industry Leaders: 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

690 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