Limit to GDI Handles and User Handles
-
Hi, My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed. Due to the structure of the software, it is not possible to decrease the number of windows. Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term. To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system). I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources? Does such a function exist or is there another way of obtaining that value? Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)? Thanks in advance. Enjoy life, this is not a rehearsal !!!
-
Hi, My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed. Due to the structure of the software, it is not possible to decrease the number of windows. Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term. To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system). I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources? Does such a function exist or is there another way of obtaining that value? Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)? Thanks in advance. Enjoy life, this is not a rehearsal !!!
Simple Trick - Install video card with more Video RAM. Avoid using DDB, use DIB bitmaps isntead (they can reside in regular memory). 'Share' handles to objects - instead of duplicating a 1-pixel wide black pen 200 times, etc. No shirt, no shoes, no brains, no service.