Click here to Skip to main content
13,447,249 members (37,746 online)
Click here to Skip to main content
Add your own
alternative version


34 bookmarked
Posted 15 Oct 2001

Tool tip on window

, 16 Oct 2001
Rate this:
Please Sign up or sign in to vote.
Tooltips for window according to specified rectangular areas of that window


In windows world ToolTips are very important from users point of view and developers used to provide this facility to user. As we know that MFC does not provide tool tip for a part of window (It provides tool tips for controls) so this source will help to give tool tip for specified regions of window. This is very useful for those people who deals with drawings because through this they can give tool tip to their drawings.

How to use the source code

Include the following files in your project

  1. WindowTip.h
  2. WindowTip.cpp

First Create the ToolTip window as soon as you create your parent window on that you want to display the tool tip

CWindowTip m_MyTip; // Create the object
m_MyTip.SetDelay(1000); // Set the Display delay
m_MyTip.CreateTipWnd(this); // Create the Window

Now call ShowTip function in mouse move of parent window

m_MyTip.ShowTip(point); // Pass current mouse position

And now add as much tips you want to add by using Following method.

1. Create an object of CTipInfo

2. Set region and text for tip using SetReagion and


3. Finally add this using AddTip method of CWindowTip

CTipInfo info(CRect(0, 0, 100, 100),
              "Top Left corner of Window");

// specifies bottom right corner of window
CRect t_rect;
GetClientRect(&t_rect); // Gets the Parent 
                        // Window Client area = t_rect.bottom - 100 ;
t_rect.left = t_rect.right - 100 ;
info.SetText("Bottom Right corner of Window");

// specifies middle area of window  = t_rect.bottom / 2 - 50;
t_rect.left = t_rect.right / 2 - 50;
t_rect.bottom = + 100;
t_rect.right = t_rect.left + 100;
info.SetText("Middle area of window");

How to use Demo project

  • Just double click on ToolTip.exe
  • Double click on window to set the ToolTips
  • Move the mouse to top left, middle and right corner of window and wait for a second.

Future Work ...

  1. Use Region instead of Rectangle
  2. Provide Font, Pen and Brush customization
  3. To Give a small link on tip


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
I am a Software Professional and Currently working in C-DAC (Centre For Development of Advanced Computing). This is a Scientific Socity under ministry of india of Information Technology.
I have completed My B.C.A. Degree with 77% marks, I am certified by microsofr as Microsoft Certified Professional in Visual Basic 6.0(70-176). Currently working on Visual C++ 6.0 and Using MFC support in my Applicaitons.
For Future Studying 3D graphics desinging like OpenGL and DirectX.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 2 Pin
Member 200757013-Jun-11 23:19
memberMember 200757013-Jun-11 23:19 
GeneralTool l tip on window Pin
elemella lavanya19-Mar-09 1:21
memberelemella lavanya19-Mar-09 1:21 
Window is flickering
QuestionHow can I make It work with CScrollView ? Pin
Laan8222-Oct-08 21:44
memberLaan8222-Oct-08 21:44 
QuestionCan the class show the tips in "multi-line" style? Pin
laohubinbin30-Mar-05 0:52
memberlaohubinbin30-Mar-05 0:52 
AnswerRe: Can the class show the tips in "multi-line" style? Pin
chris17511-Nov-05 0:36
memberchris17511-Nov-05 0:36 
GeneralRe: Can the class show the tips in "multi-line" style? Pin
urb012324-Nov-07 15:49
memberurb012324-Nov-07 15:49 
GeneralTool tip doesn't show in Dialog application. Pin
Andrew Fox29-Jan-04 23:07
memberAndrew Fox29-Jan-04 23:07 
GeneralRe: Tool tip doesn't show in Dialog application. Pin
Andrew Fox29-Jan-04 23:17
memberAndrew Fox29-Jan-04 23:17 
Generalprevious window blink Pin
IvanhoeJugger3-Feb-03 1:39
memberIvanhoeJugger3-Feb-03 1:39 
GeneralRe: previous window blink Pin
ags19914-Aug-03 5:29
memberags19914-Aug-03 5:29 
GeneralMouse trails Pin
Anonymous31-Oct-02 17:31
sussAnonymous31-Oct-02 17:31 
GeneralTooltip disappears if bottom right corner Pin
Craig Miller20-Mar-02 9:00
memberCraig Miller20-Mar-02 9:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04-2016 | 2.8.180318.3 | Last Updated 17 Oct 2001
Article Copyright 2001 by onlyrakesh
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid