DxCK
DxCK

Reputation: 4552

NotifyIcon on startup

I trying to make a visible tray-icon of my program in windows startup, with the NotifyIcon component.

The program itself works great and the tray-icon showing up.

But, when i placing my program in computer startup, the tray icon not always showing up, while the program itself is running without any problems, and its main window is visible.

There is no custom code involved here, all code is auto-generated.

Running on Windows 7 Ultimate.

What can i do to make the tray icon to showing up in windows startup always?

Upvotes: 1

Views: 1530

Answers (2)

Hans Passant
Hans Passant

Reputation: 941217

You'll probably find it back in the hidden icons. On Win7 click the "Show hidden icons" arrow, click on Customize and override the behavior.

Upvotes: 0

Richard
Richard

Reputation: 108975

in windows startup

If you mean you are running a OS boot time (e.g. by adding an entry to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run or with a service) then the process is running in a different session and has no access to the UI.

If you want a process to be run on OS startup and to be interactive you will need two applications: one to run on startup and expose some form of inter-0process communications (IPC), and two a UI application that uses the first applications IPC to communicate with it.

You also (depending on your target users) may need to consider cases where (1) no-one logs on to the system (e.g. a headless server), and (2) where multiple users login (e.g. remote desktop connections to a shared system).

In the past services could be configured to add items to the console user's UI, but this was blocked in Vista (as it opened up security holes).

Upvotes: 2

Related Questions