Solved

Get CWnd* pWnd, of ToolTipCtrl

Posted on 2001-06-26
10
528 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
Technology Partners: 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 215
sum13 challenge 24 146
wait notify demo infinite loop 3 148
Making an alias 7 121
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 …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

737 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