How to find the number of current window handles for a/my process. [modified]
-
Hello community, My problem is a Win32Exception, "Error creating window handle". I know, normally it's a sign of a bad designed GUI if this happens. (Maybe also here, who knows) But, I have a projects where a lot of controls on seperate UserControls and TabPages, have to stay in memory for the whole time. This is like it is and can not be changed. If I step threw all my GUI-"pages", at some point it crashes. I did some tests and can say, that it is not a problem of: too less memory too high GDI objects (which are normaly limited to 10000, but can also be set higher) I'm using a lot of selfe designed UserControls, which of corse can be redisigned in some cases. Maybe if I do some changes there I could kill some subControls (1000-2000). But this would mean that I'm always on the limit. So I would like to have a method which allows me to find the big "handle eater" in my project first. I'm also not sure if it is correct that the limit of max window handles in WinXP is fix 16bit, and can not be modified. Thanks for suggestions! Upps: Forgot to tell you, that I'm using .Net1.1, but I'm sure it will only be possible over an API. -- modified at 5:12 Friday 14th September, 2007 Also Note: The Controls and Pages are in memory from beginning (start) of the application. So stepping threw my pages are not effecting the used memory in any way.
All the best, Martin
-
Hello community, My problem is a Win32Exception, "Error creating window handle". I know, normally it's a sign of a bad designed GUI if this happens. (Maybe also here, who knows) But, I have a projects where a lot of controls on seperate UserControls and TabPages, have to stay in memory for the whole time. This is like it is and can not be changed. If I step threw all my GUI-"pages", at some point it crashes. I did some tests and can say, that it is not a problem of: too less memory too high GDI objects (which are normaly limited to 10000, but can also be set higher) I'm using a lot of selfe designed UserControls, which of corse can be redisigned in some cases. Maybe if I do some changes there I could kill some subControls (1000-2000). But this would mean that I'm always on the limit. So I would like to have a method which allows me to find the big "handle eater" in my project first. I'm also not sure if it is correct that the limit of max window handles in WinXP is fix 16bit, and can not be modified. Thanks for suggestions! Upps: Forgot to tell you, that I'm using .Net1.1, but I'm sure it will only be possible over an API. -- modified at 5:12 Friday 14th September, 2007 Also Note: The Controls and Pages are in memory from beginning (start) of the application. So stepping threw my pages are not effecting the used memory in any way.
All the best, Martin
Hi! You can p/invoke
GetGuiResources()
function from user32.dll to receive the number of GDI and USER objects currently used.Regards, mav -- Black holes are the places where God divided by 0...
-
Hi! You can p/invoke
GetGuiResources()
function from user32.dll to receive the number of GDI and USER objects currently used.Regards, mav -- Black holes are the places where God divided by 0...
Hello mav, Thanks a lot for you time! I will test the Method as soon as I'm back in office and let you know if it helped me! But from what I could found out of the documentation[^], it looks very promising! So thank you very much! Got my '5'!
All the best, Martin
-
Hi! You can p/invoke
GetGuiResources()
function from user32.dll to receive the number of GDI and USER objects currently used.Regards, mav -- Black holes are the places where God divided by 0...