Batch file close/kill a System Tray/systray program

2

2

I use a program for hosting multiple forms.

Each form leaves a systray program of said program. In Processing they all use the same same.

But Window wise/mouse over name while in tray they use the name of the form.

I can close all four at once but I wish to close certain ones with a batch file.

If anyone could help hat would be great.

Gunder

Posted 2011-04-09T13:03:39.297

Reputation: 21

By "systray", do you mean the taskbar (window list) or the notification area (icons in bottom-right corner, near the clock)? – user1686 – 2011-04-09T20:53:50.137

I mean the Notification area. – Gunder – 2011-04-10T01:29:42.060

Answers

2

NirCmd can close windows by title, class name, or hwnd.

nircmd win close title "Calculator"

nircmd win close class "IEFrame"

You can write your own program using EnumWindows() and SendMessage(hwnd, WM_CLOSE, NULL, NULL).

user1686

Posted 2011-04-09T13:03:39.297

Reputation: 283 655

@Joey: Post that as a separate answer. – user1686 – 2011-04-09T23:36:03.630

Having slight troubles with nircmd, I think it's because I'm not getting the right hwnd. Is that a bat I can right to determine that it's hwnd is? I assumed it was the name in the little hover over bubble. – Gunder – 2011-04-10T11:36:49.080