OIO
OIO

Reputation: 363

Implications of Minimizing to System Tray

I have an UI application that serves several functions (<800KB). I wanted to allow minimizing it to the system tray, and continue to decode data coming from the serial port and sending network messages.

Can I simply hide the main form and create a NotifyIcon in the system tray, or are there other considerations for system tray applications? Does the application use less resources while hidden? Or is it best to make a light version of the application for the system tray (with duplication of code)?

My application does what 2 different applications do (related functions). I'm trying to foresee the implications before I finish coding it.

Upvotes: 1

Views: 311

Answers (2)

Antonio Bakula
Antonio Bakula

Reputation: 20693

IMO best way in your case is to make windows service that will decode data from serial port and send messages. And other winforms app that will only set preferences and watch service state, that one can go to tray. Maybe you don't really need this tray app, just windows service, you can set preferences trough config file and watch state trough EventLog.

Of course if is possible to run from windows service, eg. your serial port and network code doesn't need logged user or desktop.

Upvotes: 1

Nate
Nate

Reputation: 5407

I've written a couple apps that use NotifyIcon. Putting it in the notification area (system tray) isn't anything special. It's just not visible on the toolbar anymore.

Upvotes: 2

Related Questions