<p>What is the best way to determine how many window handles an application is using?  Is there a tool or a WMI performance counter that I could use?</p>

<p>I would like to run up an app and watch a counter of some sort and see that the number of window handles is increasing. </p>

<pre><code>for (int i=0; i &lt; 1000; i++)
{
    System.Threading.Thread.Sleep(1000);
    RichTextBox rt = new RichTextBox();
    rt.Text = "hi";
    this.Controls.Add(rt);
}
</code></pre>

<p>I am running the above code and watching the "Handle Count" counter on the process, and it does not seem to be increasing.  Is there something I am looking at incorrectly?</p>

Perfmon, which comes with your computer can do it.  You can also add a column to your task manager processes tab (Handle Count).
Instructions for Perfmon
Add a counter (click the +)
Choose Process under Performance object
Choose Handle Count under the counter list
Choose your process from the instance list
Click Add, click Close
To get the graph in range, you have to right-click it in the list, choose properties, and then choose the right scale (.1 or .01 would probably be right)
Edit (in response to added information): I think you just proved that creating RichTextBoxes doesn't result in Handles being allocated. I don't think it really needs one until you are editing the control and it might be smart enough to do that, since allocating too many resources for a control that isn't active would make it hard to have a lot of controls on a form (think about Excel, for example).