Solved

TOOLTIP Question

Posted on 1997-04-22
5
516 Views
Last Modified: 2013-12-04
When a tooltip goes active (it's window shows and displays the tooltext), I need to find out that window rect (the one for the tooltip). I tried calling GetWindowRect for the tooltip hwnd when TTN_SHOW comes in but it returns bogus values (maybe cause the window hasn't been shown yet - i don't know). Thanks for your help!
0
Comment
Question by:overworked
[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
5 Comments
 

Expert Comment

by:markusk
ID: 1334726
The TTN_SHOW notification message notifies the owner window that a tooltip is about to be displayed. At this time the window handle is not valid.You should catch TTN_POP rather than TTN_SHOW. The TTN_POP notification message notifies the owner window that a tooltip is about to be hidden.
0
 

Author Comment

by:overworked
ID: 1334727
Ya, I'm aware of TTN_POP. However, as I indicated in my question:

"When a tooltip goes active (it's window shows and displays the tooltext), I need to find out that window rect (the one for the tooltip)".

Therefore, knowing the window rect at the time of TTN_POP wouldn't be useful to me. -Thanks for trying.
0
 
LVL 15

Accepted Solution

by:
NickRepin earned 100 total points
ID: 1334728
I have check following code and did not find any problem:
and GetClientRect, and GetWindowrect returns right values

if (notifyInfo.code == TTN_SHOW) {
   HWND w=notifyInfo.hwndFrom;
    RECT r;
    ::GetClientRect(w,&r);      // returns TRUE
    ::GetWindowRect(w,&r);  // returns TRUE
  }

0
 

Author Comment

by:overworked
ID: 1334729
I'm in 1024x768 video mode, and after receiving TTN_SHOW message, GetWindowRect returns a rect that is 768 pixels high and 115 wide. GetClientRect returns a rect that is 762 pixels high and 115 wide. Those aren't valid results of the tooltip message window. I called both GetWindow/ClientRect with the hwndFrom and my hwndFrom is valid. Both return TRUE. Also, these are the dimensions returned for any tooltip I stop on.
0
 

Author Comment

by:overworked
ID: 1334730
You're right. I found my error. -overworked
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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