Solved

TOOLTIP Question

Posted on 1997-04-22
5
508 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now