Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding my program in the System Tray in Windows

I'd like my program to display an icon in the TaskBar Status Area near the clock in Windows and found a way to do so.

The thing is, I'd like my program to stay open in the Status Area if the "X" is pressed on the window, but not in the System Tray, but I have no idea how to do so and searching on Google didn't help (I'm probably not searching the right terms).

Edit: I think I used the wrong terms. I know how to have my program's icon in the notification area, what I'd like is to hide it in the area where it is normally displayed when you minimize a window.

like image 482
Adam Smith Avatar asked Jul 03 '11 13:07

Adam Smith


People also ask

How do I minimize a program to the system tray in Windows?

Press Alt + F1 and that window will minimize to the tray.

How do I pin a program to my system tray?

Select Start , scroll to the app you want to pin, then press and hold (or right-click) the app. Select More > Pin to taskbar. If the app is already open on the desktop, press and hold (or right click) the app's taskbar icon, and then select Pin to taskbar.

How do I hide a program in Windows 10?

Open the Local GPO editor ( gpedit. msc ), go to the section User Configuration –> Administrative Templates –> Control Panel –> Programs, and enable the policy Hide “Programs and Features” page.


2 Answers

I know how to have my program's icon in the notification area, what I'd like is to hide it in the area where it is normally displayed when you minimize a window.

Then don't use the system tray.

The thing is, I'd like my program to stay open in the Status Area if the "X" is pressed on the window,

frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
like image 99
camickr Avatar answered Oct 13 '22 10:10

camickr


System Tray support was added in JavaSE v 6.

you can see example here http://download.oracle.com/javase/7/docs/api/java/awt/SystemTray.html

like image 38
Vivek Goel Avatar answered Oct 13 '22 10:10

Vivek Goel