Leaks are possible, even in robust Windows-based applications. As bugs go, leaks are some of the most difficult to find, especially when they occur in graphics device interface (GDI) objects and menus. While free and third-party tools exist to detect such leaks, it is usually difficult to make the connection between the numeric handle value returned by the tool, and a bitmap or menu in your program. This can limit the usefulness of these tools. Custom tools can be built that detect, track down, and eradicate GDI and menu leaks. Here, three such tools are built using well-known and documented APIs.
MSDN Magazine March 2001
View Complete Post