Friday, March 02, 2012 4:33 AM
Using code, I am intersted to get list of GDI object counts, user object counts for all processes,
System.Diagnostics.Process.Getprocesses() doesn't give these details.
GetGuiResources method return the count of user objects and GDI objects.
But when I use it in my codeProcess.GetProcessById(processId).Handle, 0).ToString(); //0 for GDI counts
Any other way to show objects of task managers in our programs ?Is
Friday, March 02, 2012 1:06 PM
You will likely never find a way to get information from these processes. But for these two processes it should be easy to figure out how many handles they have open anyway, 0 User handles and 0 GDI handles. User handles are handles to user mode stuff like windows, accelerator tables and stuff, GDI handles are handles to things like bitmaps and fonts. So both of these have no real use in kernel mode. For a bit of information on these two processes.
System Idle Process is a special process that does nothing but use up CPU time while there are no other threads waiting to execute. It literally does nothing but idles the processor to keep it cool. If you look at task manager you will notice that it always has 0 handles.
System as the description of the process says is the "NT Kernel & System", so this is the kernel mode component of Windows. So while it is possible that this is where the objects themselves end up, this will not have any User or GDI handles open.
This is a signature
Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
- Marked As Answer by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Monday, March 05, 2012 11:33 AM
Monday, March 05, 2012 11:35 AMModerator