Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I was trying to make a simple version of windows task manager. I want to list working applications in my program. Not all of them, only programs listing on taskbar.

Try to eliminate with IsWindowVisible or IsIconic. But this code listing like TextInputHost, ApplicationFrameHost etc. But I only want to see like task manager not detailed one. I need good ideas and if anyone help me I would be glad.

My Task Manager showing that programs:
https://prioteknik.com/docs/bad_task_manager.jpg
But I want to list that ones:
https://prioteknik.com/docs/task_manager.jpg

What I have tried:

[DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool IsWindowVisible(IntPtr hWnd);
        [DllImport("user32.dll")]
        public static extern bool IsIconic(IntPtr hWnd);

C#
Process[] processes = Process.GetProcesses();
foreach (var proc in Process.GetProcesses())
{
if (proc.MainWindowHandle != IntPtr.Zero && proc.MainWindowTitle != "")
{
}
}
Posted
Updated 5-May-21 7:17am
v2
Comments
OriginalGriff 5-May-21 11:54am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
Member 10660489 5-May-21 12:47pm    
Actually this is a simple question if you try to list working applications on your computer. But there is a problem I want to eliminate hidden ones or unnecessary ones. I added some more informations.

1 solution

 
Share this answer
 
Comments
Maciej Los 5-May-21 15:37pm    
5ed!
BillWoodruff 6-May-21 1:04am    
+5
Member 10660489 6-May-21 3:55am    
I checked it but that one explaining how to list all details of working process of windows. I need simple one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900