Job Savers System Tray AppWizard

This was the first wizard I ever wrote, basicly it generates an MFC Tray Application, that being a program that sits in the little window down by the clock on windows 95/NT. Its important to note that portions of the generated code in this appwizard are written by and used with permision by CodeGuru Chris Maunder.

Instruction

This Tray App wizard is pretty simple to use, you only have to privide:
  • Internal name - Which should be unique, and not include spaces.
  • Display name - The string that you see in the list of the services manager.
  • Comments - You have to decide what level of source code comments you want.

Install/Uninstall

To install any wizard, you must simply copy the wizard (any .awx file) it to your devstudio/sharedide/template directory.
Conversly, to remove a wizard, simply deleting the .awx file from your template directory while DevStudio isnt running will do it.

Download System Tray AppWizard - 14.8KB



Comments

  • Modifying an application to run in systray

    Posted by Legacy on 02/23/2000 12:00am

    Originally posted by: Richard Madden

    Just wondering how to take a dialog application, and have it sometimes run as an icon in the systray (say, when user minimizes or presses OK)
    If anyone can point me to the location of documentation on this subject, i'd be much appreciated

    Reply
  • Tray Icon disappearing

    Posted by Legacy on 12/17/1999 12:00am

    Originally posted by: Martin Roth

    Great Work!
    
    The only problem that I have is that the tray icon
    disappears when NT switches to another desktop, e.g.
    the screensaver, or the log-on screen. When
    the user screen comes back (e.g. the screen saver
    is switched off), the application is still running,
    but the icon is gone :(

    This happens only when I set my own icon. I do this in
    CMainFrame::OnCreate(...) {
    ...
    m_TrayIcon.SetIcon(MAKEINTRESOURCE(IDI_ICON1));
    ...

    Anybody knows a fix to this? Thanks.

    - Martin

    Reply
  • Icon Fix

    Posted by Legacy on 08/02/1999 12:00am

    Originally posted by: Laurent Dupuy

    This wizard is wonderful thanks a lot..
    
    but a little fix...

    The fonction SetStandardIcon
    BOOL CTrayIcon::SetStandardIcon(UINT nIDResource)
    {
    HICON hIcon = LoadIcon(NULL, MAKEINTRESOURCE(nIDResource));

    return SetIcon(hIcon);
    }
    Change to
    BOOL CTrayIcon::SetStandardIcon(UINT nIDResource)
    {
    HICON hIcon = ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(nIDResource));

    return SetIcon(hIcon);
    }

    on my NT

    Reply
  • Use a 16x16 icon in the system tray

    Posted by Legacy on 07/30/1999 12:00am

    Originally posted by: Todd Barlow

    The code for designating the icon to appear in the system tray takes the 32x32 icon instead of the 16x16 icon.  You might notice some degradation in the image as a result.
    
    

    If you want to use a 16x16 icon use LoadImage instead of LoadIcon.

    For example, replace this:

    BOOL CTrayIcon::SetIcon(UINT nIDResource)
    {
    HICON hIcon = AfxGetApp()->LoadIcon(nIDResource);
    return SetIcon(hIcon);
    }


    with this:

    BOOL CTrayIcon::SetIcon(UINT nIDResource)
    {
    HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle),MAKEINTRESOURCE(nIDResource), IMAGE_ICON,16,16,0);
    return SetIcon(hIcon);
    }

    Reply
  • Great Job but..

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

    Originally posted by: Nicolas LeBlanc

    Great job for the app wizard, this should save me a lot of work, but it would be nice to have some more details on how to use the Icon...

    That would be nice.

    Reply
  • declaration fix VC6

    Posted by Legacy on 05/15/1999 12:00am

    Originally posted by: Klaus Melchior

    Following fixed declaration should be in mainfrm.h:

    afx_msg LONG OnTrayNotification(WPARAM wParam, LPARAM lParam);

    and this in TrayIcon.h:

    virtual LRESULT OnTrayNotification(UINT wParam, LONG lParam);

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

Top White Papers and Webcasts

  • Employees must exchange sensitive emails with customers and partners. These emails might contain protected health information, protected financial information, or corporate information that should not be made public. Globalscape® Mail Express® allows you to encrypt the emails that it manages so that no one but the sender and recipient--not even the administrator--can view the contents of the email. "Secure the Transfer of Sensitive Emails" is the property of GlobalSCAPE

  • On-demand Event Event Date: March 19, 2015 The 2015 Enterprise Mobile Application Survey asked 250 mobility professionals what their biggest mobile challenges are, how many employees they are equipping with mobile apps, and their methods for driving value with mobility. Join Dan Woods, Editor and CTO of CITO Research, and Alan Murray, SVP of Products at Apperian, as they break down the results of this survey and discuss how enterprises are using mobile application management and private app stores to …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date