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 481583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:00:33+00:00 2026-05-13T01:00:33+00:00

I use the following code in the FormCreate event handler to create a system

  • 0

I use the following code in the FormCreate event handler to create a system tray icon. When I run my program the system tray icon appears fine.

I set my application be started automatically on windows start up. When I restart the computer my application’s process is started but the system tray icon never appears.

I think it might be something to do with the timing of when the code is run, that perhaps the system tray isn’t ready to be populated.

I get my app to run at start up via it’s NSIS installer :
WriteRegStr HKLM “Software\Microsoft\Windows\CurrentVersion\Run” “MyApp” “$INSTDIR\ MyApp.exe”

Code to create system tray icon :

with TrayIconData do
  begin
    cbSize := SizeOf(TrayIconData);
    Wnd := Handle;
    uID := 0;
    uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
    uCallbackMessage := WM_ICONTRAY;
    hIcon := Application.Icon.Handle;
    StrPCopy(szTip, Application.Title);
  end;

  Shell_NotifyIcon(NIM_ADD, @TrayIconData);
  • 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-05-13T01:00:33+00:00Added an answer on May 13, 2026 at 1:00 am

    You’re attempting to create the icon before Explorer has fully started. You should handle errors gracefully (scroll down to “Handling Shell_NotifyIcon failure”).

    You should also handle the TaskbarCreated notification — it enables you to recreate your icons after Explorer crashes and restarts.

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

Sidebar

Related Questions

I use following code: Create a retry policy, when error, retry after 1 second,
I use the following code try to create an array of string vectors, I
I know that to create a file in c++ we use following code #include
I use following code to populate a Combo Box. It displays: System.Data.DataRowView instead of
To find form element from the element which triggered event. I use following code.
I use the following code to set an alarm. struct itimerval timer; struct sigaction
I use the following code to create countdowns in Javascript. n is the number
I use following code for guarantee startTime variable set once only: public class Processor
I'm trying to use following code with System.nanoTime() to measure the elapsed time of
Hi When i use following code: myManualResetEvent.Dispose(); Compiler gives this error: 'System.Threading.WaitHandle.Dispose(bool)' is inaccessible

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.