 |
|
 |
First of All: Great Job!
Unfortunately your code isn't multi-monitor compatible. So Here is some additional code to do so:
1/ Add includes:
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
2/ Replace following code:
if(WRect.right>GetSystemMetrics(SM_CXSCREEN)-25)
{
WRect.OffsetRect(-(WRect.right-(GetSystemMetrics(SM_CXSCREEN)-25)),0);
}
by the following:
HMONITOR hMonitor;
hMonitor = MonitorFromRect (WRect, MONITOR_DEFAULTTONEAREST);
MONITORINFO monitorInfo;
memset (&monitorInfo, 0, sizeof (monitorInfo));
monitorInfo.cbSize = sizeof(monitorInfo);
GetMonitorInfo(hMonitor, &monitorInfo);
if(WRect.right > monitorInfo.rcWork.right - 25)
{
WRect.OffsetRect(-(WRect.right-(monitorInfo.rcWork.right - 25)), 0);
if (Orient == SE) {
Orient = SW;
}
if (Orient == NE) {
Orient = NW;
}
}
if (WRect.bottom > monitorInfo.rcWork.bottom - 25)
{
WRect.OffsetRect(0, -(WRect.bottom-(monitorInfo.rcWork.bottom - 25)));
if (Orient == SE) {
Orient = NE;
}
if (Orient == SW) {
Orient = NW;
}
}
Enjoy!
modified on Tuesday, December 30, 2008 5:34 AM
|
|
|
|
 |
|
 |
I was wondering how i can use this tool-tip control for displaying tool-tip of toolbars in SDI/MDI applications.
Keep Smiling,
Hemant Jangid
“A professional programmer is an amateur who never quit.”
- Morendil
|
|
|
|
 |
|
 |
I have a MSFlexGrid control in my application inserted as an activex control.
It is non editable. I want to set tooltips for each cell in first row and first column. Please help.
|
|
|
|
 |
|
 |
I have a MSFlexGrid control in my application inserted as an activex control.
It is non editable. I want to set tooltips for each cell in first row and first column. Please help.
|
|
|
|
 |
|
 |
did u get the solution? even i want it desperately..plz help
|
|
|
|
 |
|
 |
it just like draw twice border but second border draw is uncompleted, only top of border and 1/5 of left and right. if i put return CToolTipCtrl::OnNcPaint(); on ,then it has a bold border. looks not good. how can i fix this?
|
|
|
|
 |
|
 |
I don`t have such issues . It`s rather strange .
But I don`t have XP . I`m on W2K .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
Under XP / 2000 tooltips use WM_PRINT / WM_PRINTCLIENT to do the drawing. I figured this out after a half a day of tracing through Windows events by hand.
Add this to the CTooTipCtrlEx and it fixes the problem:
LRESULT CToolTipCtrlEx::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch ( message )
{
case WM_PRINT: return 0; break; case WM_PRINTCLIENT:
return 0; break;
default:
break;
}
return CToolTipCtrl::WindowProc( message, wParam, lParam );
}
Thanks for the great work!
-
Void
|
|
|
|
 |
|
 |
( appologies for the horrible formatting... first post here )
-
Void
|
|
|
|
 |
|
 |
Thanks for the fix . I`m currently in vacation but as soon as I get back I`ll test it .
Thank you also for you feedback and interest .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
Most welcome... can I have my book of knowledge now?
-
Void
|
|
|
|
 |
|
 |
This solution is great. But it will make the tooltip
not shown for the first time the mouse move over
the control. Therefore, I add on command as
LRESULT CToolTipCtrlAdv::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
switch(message) {
case WM_PRINT: // eat this message, tooltips under XP / 2000 use WM_PRINT + WM_PRINTCLIENT to draw
SendMessage(WM_PAINT);
return 0; // if we eat this message, the WM_PRINTCLIENT will be skipped and WM_PAINT will be used
// which is what we expect with our overloaded CToolTipCtrlAdv - SLC
break;
case WM_PRINTCLIENT:
return 0; // we should never get this... but just in case - SLC
break;
default:
//TRACE( _T("OTHER :0x%x\r\n"), message );
break;
}
return CToolTipCtrl::WindowProc(message, wParam, lParam);
}
And it work well.
Spock Peng
|
|
|
|
 |
 | Help  |  | alexwinx | 21:42 17 Feb '04 |
|
 |
What about Unicode? Macedonian languange for exmpl
|
|
|
|
 |
|
 |
what do you mean ?
i never worked with any language but english but it is unicode compatible .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
Unicode works great, my app uses Unicode fonts for everything, and is translated to multiple languages. This was actually a double fix for me... Multiline tooltips and tooltips that support Chinese ( among other things ).
Again, thank you!
-
Void
|
|
|
|
 |
|
 |
OnNCPaint(...)
{
//because i removed the onnncpaint i removed the border .
//this reenables the border and works good .
return CToolTipCtrl::OnNCPaint(...);
}
//to remove the border work on onnccalcsize messages .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
Yes, it's really nice and looks cool but on the first popup both tooltips are shown. The standard one and the new style one. When this is shown once, the old one is never shown again.
Anyway great work!
bye, gri
Goodbye and thanks for the fish!
|
|
|
|
 |
|
 |
It never happened to me .
It always worked perfectly . Try my free tols > Image list gen . You`ll see it working .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
I have taken a screen capture, but I cannot click so fast that you can see this very well.
If you look good enaugh you will see a small part of the "original" tooltip.
Link to picture
Edit: Forgot to say that I didnt edit your demo app
Goodbye and thanks for the fish!
|
|
|
|
 |
|
|
 |
|
 |
It also happens to me in vs2005 but vc6 or vs2003 no this problem.
I like c++
|
|
|
|
 |
|
 |
i never used it on xp . it might ... do what you say .
I am the MIGHTY KEEPER of the BOOK OF KNOWLEDGE . Contact me to get your copy .
|
|
|
|
 |
|
 |
It happens under 2000 as well!
|
|
|
|
 |
|
 |
There is also problem.Why?
|
|
|
|
 |
|
 |
I have the same.... any fix ??
Vtt
|
|
|
|
 |