Solved

TOOLTIP Question

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
This video discusses moving either the default database or any database to a new volume.

746 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

10 Experts available now in Live!

Get 1:1 Help Now