Hi. I tried to detect all running user applications (no all processes) and
close them all. Obviously this is a usual function that has been existing in
many programs.
I used the ::EnumWindows API to enumerate all the windows. There are a lot
of irrelevant result so I have to use some filters. One of them is to filter
out the invisible windows.
But unfortunately this filter also filters out the applications that was
minimized in to a tray icon. But if I turn off this filter, a lot of
irrelevant system processes and other hidden windows will get through as
well. I have no way to tell which one among them is user application, which
one is not.
I noticed that the taskmgr program in windows has the same problem. It
doesn't display the tray icon programs. Instead, it only displays their
processes in the processes list.
I have imagined that if there is API to enumerate the applications that has
a tray icon, it would solve my problem. Or maybe there is a better way to get
the list of user applications rather than using ::EnumWindows, but I have no
clue about it.
So anyone of you has a thought?
Thanks very much!