I am trying to make a Windows 8 Alt-Tab replacement type program in C# to handle a few windows automation tasks such as moving an open window from one screen to another and am struggling to find a good solution to get a list of all the open windows, essentially filtered down to the list windows provides when you use alt tab. I have tried using EnumWindows as well as Process.GetProcesses() but both provide lists of over 100 items when I only have a few windows open. Does anyone have a solution to getting this list within C# on Windows 8?
Asked
Active
Viewed 177 times
1
-
Apply a condition, to get the windows that are visible. There are some back ground processes too. – Afzaal Ahmad Zeeshan Aug 08 '14 at 04:28
-
A condition to what? Process.GetProcesses() has no argument options for filtering, and the ones I have tried to do with EnumWindows still didn't filter out most of the results. – Gabriel Graitzer Aug 08 '14 at 04:32
-
1maybe `Process.GetProcesses().Where(w => w.MainWindowHandle != IntPtr.Zero)` – sa_ddam213 Aug 08 '14 at 04:36