Which Windows API will get you the number of handles in use by a process?
Printable View
Which Windows API will get you the number of handles in use by a process?
Use EnumWindows/EnumChildWindowsQuote:
Originally Posted by kberson
what kind of handles -- all handles such as gdi objects, file handles, windows handles, etc. or just windows handles. jayender's suggestion only returns windows handles.
Take a look at this thread,
http://www.codeguru.com/forum/showthread.php?t=391752
Good question! I'm looking for the value that the Task Manager displays when you check the handle countQuote:
Originally Posted by stober
Well, that count is for the whole system and not for a process.Quote:
Originally Posted by kberson
However, to help starting let's open the list:
- GetGuiResources - the count of handles to graphical user interface (GUI) objects in use by the specified process.
- EnumProcessModules - retrieves a handle for each module in the specified process
NOTE: when the list will be completed, do not forget toa add the process (handle) itself. :D ;)
You can use Performance monitoring API's to get that,
See the Process objects Handle Count property,
One sample on CodeProject,
http://www.codeproject.com/atl/desktop_perf_mon.asp
http://www.devx.com/cplus/Article/7951/1954?pf=true
http://msdn.microsoft.com/library/de...perfmonpt2.asp
http://msdn.microsoft.com/library/de...ngoverview.asp
http://technet2.microsoft.com/Window....mspx?mfr=true