473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how can I tell how many window handles are free

ngr
I have come across a problem because I have too many controls on a form.

It says that it cannot create a handle.

Now I know that there is a limit of how many windows handles which can be
used in any one process, but would like to know in VB.NET 2005 how I can
tell at any one point in code how many window handles are free.

I would like something on a timer control which reported to a textbox how
many handles are remaining.
Alternatively something I can run from a button to report to a messagebox
how many handles remain unused.

Thanks in advance for any feedback

Terry
Mar 8 '07 #1
2 1654
I would try the system.diagnostics namesapace

mabye the process object

Mike.
"ngr" <ng*@tdrd.karoo.co.ukwrote in message
news:iv******************************@eclipse.net. uk...
>I have come across a problem because I have too many controls on a form.

It says that it cannot create a handle.

Now I know that there is a limit of how many windows handles which can be
used in any one process, but would like to know in VB.NET 2005 how I can
tell at any one point in code how many window handles are free.

I would like something on a timer control which reported to a textbox how
many handles are remaining.
Alternatively something I can run from a button to report to a messagebox
how many handles remain unused.

Thanks in advance for any feedback

Terry


Mar 8 '07 #2
On Mar 8, 1:53 pm, "ngr" <n...@tdrd.karoo.co.ukwrote:
I have come across a problem because I have too many controls on a form.

It says that it cannot create a handle.

Now I know that there is a limit of how many windows handles which can be
used in any one process, but would like to know in VB.NET 2005 how I can
tell at any one point in code how many window handles are free.

I would like something on a timer control which reported to a textbox how
many handles are remaining.
Alternatively something I can run from a button to report to a messagebox
how many handles remain unused.

Thanks in advance for any feedback

Terry
I think you can get that information via wmi. You'll need to check.
But, the issue here is why do you have so many controls? XP I believe
allows something like 10000 hWnds per process. Are you showing forms
with tons of controls and then not disposing of them? If that isn't
the case - then you might want to rethink your interface some...
Maybe use a grid type interface, etc. This is one problem with
windows forms - there is no concept of a windowless control, as we had
in vb6.

--
Tom Shelton

Mar 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
6
by: David Allison | last post by:
Relationship problem ~ How to tell Owner his db is crap. His db was made in 1999 - 12 tables - none normalised - none with relationships.(YES REALLY) He only knows about inputing data - 22,000...
1
by: Chris Uwins | last post by:
Hi there, i know theres a number of ways I can achieve this but want to know the best, (but still quite simple). Up until a year ago I never used Access but have designed a few databases for...
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
0
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code...
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
1
by: mela | last post by:
it seems quite stupid but i am building up my web site and i am stocked with this problem: i download this photoslider script and wanted to have two on the same page but they are interfering one each...
8
by: Phil | last post by:
Is it possible to find the size of the MDIClient area, excluding the space already used by docked controls? I have thought I could perhaps create a new control, set it's Dock property to Fill and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.