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

  • Not all enterprise applications are created equal. Sophisticated applications need developer support but other more basic apps do not. With the right tools, everyone is a potential app developer with ideas and a perspective to share. Trends such as low-code development and model driven development are fundamentally changing how and who creates applications. Is your organization ready? Read this report and learn: The seven personas of enterprise app delivery How application ownership is spreading to the …

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds