MSDN Magazine: Detect and Plug GDI Leaks

A more in-depth look at tracing GDI resources that my own simple GUI Resource Tracer. This article demonstrates not just how to determine which types of GDI resources are being used rather than a total (showing counts of brushes, pens, bitmaps etc separately) it also demonstrates how to install a local override for all GDI calls, thus enabling them to be instrumented. As as side effect, you can also hook into other processes on the system and examine the GDI objects they have in memory. Very interesting! For some reason the download contains all the symbolic debug files, meaning it is about 13Mb - the actual executable code is much smaller.

Link

http://msdn.microsoft.com/msdnmag/issues/03/01/GDILeaks/default.aspx