?
Solved

TOOLTIP Question

Posted on 1997-04-22
5
Medium Priority
?
519 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

777 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