MSN Messenger like Tray Balloon

This simple class CTBalloon which is derived from CWnd can be used to show the tray balloon similiar to the one that appears with MSN messenger. I have used the CGradiant class which appeard in the artile Enhanced ProgressBar Control v1.1 by Yury Goltsman.

The following snippet shows how easy it is to use the class and incorporate it into your applications.

CTBalloon * pballoon = new CTBalloon(150,100);
pballoon->SetText("Hello World - This is a sample message");
pballoon->SetLifeTime(4);
pballoon->CreateAndShow();

The following are the various functions of the class.

CTBalloon(UINT nWidth, UINT nHeight) : Constructor, nWidth and nHeight are the dimensions of the balloon window. void SetText(CString str) : Sets the text that will be shown on the balloon window void SetLifeTime(UINT secs) : Sets the life time in seconds of the window. BOOL CreateAndShow() : Creates the window and shows the animated balloon window. The window will be destroyed by itself.

Please let me know of any problems or improvements. Thanks and good luck.

Downloads

Download - 25 Kb


Comments

  • Rc2 problem

    Posted by Legacy on 04/26/2003 12:00am

    Originally posted by: autojack

    It compiles fine if you comment out the .rc2 in the main rc file and copy any old icon into res/trayballoon.ico.

    Good work.

    Reply
  • Good work

    Posted by Legacy on 03/31/2003 12:00am

    Originally posted by: Sambath

    U have done a good work ..
    But if there r more than one window, positioning is not proper and windows overlap.
    I suggest following code changes in CreateAndShow function
    Change these line to
    rect.left = m_screen_rect.right - m_nWidth - 10 - (m_sActiveCount * 10) ;
    rect.right = m_screen_rect.right - 10 - (m_sActiveCount * 10);

    rect.left = m_screen_rect.right - m_nWidth - 10 - ((m_sActiveCount * m_nWidth) + 10) ;
    rect.right = m_screen_rect.right - 10 - ((m_sActiveCount *m_nWidth) + 10);

    Reply
  • Not perfect

    Posted by Legacy on 12/20/2002 12:00am

    Originally posted by: Deepak

    If you move your taskbar to top of screen balloon still remains at down right corner

    Reply
  • how do u get this box to work with msn messenger

    Posted by Legacy on 04/01/2002 12:00am

    Originally posted by: avi

    how can i get this box to work with msn messenger and how can i change the size and text inside the box thnx

    Reply
  • APTECH Computer Education Sialkot

    Posted by Legacy on 03/06/2002 12:00am

    Originally posted by: APTECH

    Excellent work

    Reply
  • Great :)

    Posted by Legacy on 02/07/2002 12:00am

    Originally posted by: Farida

    Well I think that your work is great , but I have a question, do you know if is possible to add controls like buttons or maybe images ???? Thabks you for everything

    Reply
  • http://swebds.tripod.com

    Posted by Legacy on 01/22/2002 12:00am

    Originally posted by: Sajjad Tufail

    Excellent work and search regarding to these precion techniques
    

    Reply
  • How to htm view

    Posted by Legacy on 01/19/2002 12:00am

    Originally posted by: fatih

    Hi

    How can I add a folder or a html folder which is on internet on the CTBallon browser?

    Reply
  • Great Job

    Posted by Legacy on 11/06/2001 12:00am

    Originally posted by: Amarnath Yara

    Hi, This is just great. Congrats.

    Amar

    Reply
  • Need 'TrayBalloon.rc2' file

    Posted by Legacy on 11/05/2001 12:00am

    Originally posted by: faith Choi

    Can I get 'TrayBalloon.rc' file?

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • You probably have several goals for your patient portal of choice. Is "community" one of them? With a bevy of vendors offering portal solutions, it can be challenging for a hospital to know where to start. Fortunately, YourCareCommunity helps ease the decision-making process. Read this white paper to learn more. "3 Ways Clinicians can Leverage a Patient Portal to Craft a Healthcare Community" is a published document owned by www.medhost.com

  • When it comes to desktops – physical or virtual – it's all about the applications. Cloud-hosted virtual desktops are growing fast because you get local data center-class security and 24x7 access with the complete personalization and flexibility of your own desktop. Organizations make five common mistakes when it comes to planning and implementing their application management strategy. This eBook tells you what they are and how to avoid them, and offers real-life case studies on customers who didn't …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds