Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:01+00:00 2026-06-17T09:42:01+00:00

i wrote an little application which does some operations in the background. because it

  • 0

i wrote an little application which does some operations in the background.

because it doesnt needs attention of the user, i want to send the application into system tray, and when someone clicks on it, the window should popup again.

the problem is, I’ve wrote an MFC program (dialog) which does everything I want it to do. And now i need to find a way to send it into the tray.

type: MFC (Dialog-Window)
lnguage: C++
IDE: Visual Studio 2012

do you have any ideas of how i can do this? or do you maybe know a nice tutorial or the function/classes i need?

i already searched at codeprojects.com and google but there seems not to be much about this.
thanks.

EDIT 1:

I tried something like this:

HWND hMainWindow = this->GetSafeHwnd();
HICON hProgramIcon = this->GetIcon(false);
char szTip[16] = "Tracker"; 
nidTrayIcon.cbSize = sizeof(nidTrayIcon); 
nidTrayIcon.hIcon = hProgramIcon; 
nidTrayIcon.hWnd = hMainWindow; 
nidTrayIcon.uCallbackMessage = (WM_USER + 1); 
nidTrayIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nidTrayIcon.uID = 0x0200; 
strcpy_s((char*)nidTrayIcon.szTip,16, szTip2);
nidTrayIcon.szTip[strlen(szTip)] = '\0'; 
Shell_NotifyIcon(NIM_ADD, &nidTrayIcon);

If i run this code, my application shuts down with code “0x03” (Path not found …)

EDIT 2:

this->ShowWindow(SW_HIDE);

also doesnt work. same problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:42:02+00:00Added an answer on June 17, 2026 at 9:42 am

    You are looking for the NotifyIcon class:
    http://msdn.microsoft.com/en-gb/library/system.windows.forms.notifyicon.aspx

    and here is a tutorial:
    http://alanbondo.wordpress.com/2008/06/22/creating-a-system-tray-app-with-c/

    That said just adding your application to the system tray is a really bad UI idea. It used to be very popular during the windows 95/98 days and Microsoft helpfully provided a working code example that everyone copied and pasted. Soon we had fish and eyes swimming in our system trays. And the tray got fuller and fuller and hence completely useless.

    If your application is doing something that does not need user attention, make it a service, or just let the user minimize the dialog to the taskbar and show a progress bar on the dialog. That way hovering over the taskbar icon will allow the user to check progress.

    Use the system try to show helpful notifications. Add an icon only if the icon will convey a system level activity that could effect the users current work (like network connectivity). Otherwise, don’t clutter my system tray. I don’t want to take my eyes off the work that needs my attention (you said yours doesn’t) to look at a bouncing bunny in my system tray.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i wrote a little addin, which does some formatting of my C# code. in
I wrote little WPF application with 2 threads - main thread is GUI thread
i wrote a little test programm which queries the status servlet of a tomcat
I wrote a little monkeypatch to the Rails MySQLAdapter and want to package it
I have a little sample application I was working on trying to get some
I'm currently doing some work on a silverlight LOB application i wrote for a
I'm writing a simple little application, which is a booking system. In the system
I wrote a little piece of code to expose my problem. public class date
I wrote a little program that use activemq embedded broker. Program run on one
I wrote a little daemon in Perl that calls up FFMpeg to encode a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.