overworked
asked on
TOOLTIP 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). 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!
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.
ASKER
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.
"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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
ASKER
You're right. I found my error. -overworked