Error Creating Window Handle Asp.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “Error Creating Window Handle” up vote 16 down vote favorite 3 We're working on a very large .NET WinForms composite application - not CAB, but a similar home grown framework. We're running in a Citrix and RDP environment running on Windows Server 2003. We're starting to run into random and difficult to reproduct "Error creating window handle" error that seems to be an old fashion handle leak in our application. We're making heavy use of 3rd Party controls (Janus GridEX, Infralution VirtualTree, and .NET Magic docking) and we do a lot of dynamic loading and rendering of content based on metadata in our database. There's a lot of info on Google about this error, but not a lot of solid guidance about how to avoid issues in this area. Does the stackoverflow community have any good guidance for me for building handle-friendly winforms apps? .net winforms handles share|improve this question edited Feb 27 '13 at 8:15 Kiquenet 5,0672486148 asked Sep 18 '08 at 0:26 user8133 141125 See also [this post of mine about "Error creating window handle"][1] and how it relates to USER Objects and the Desktop Heap. I provide some solutions. [1]: weblogs.asp.net/fmarguerie/archive/2009/08/07/… –Fabrice Aug 8 '09 at 0:41 add a comment| 5 Answers 5 active oldest votes up vote 21 down vot
on for a client is used actively, users often get "Error creating window handle" exceptions. Aside from the fact that the application consumes too much resources, which is a separate issue altogether that we are already addressing, we had difficulties with determining what resources were getting exhausted as well as what the limits are for these resources.We first thought about keeping an eye on the Handles counter in the Windows Task Manager. That was because we noticed http://stackoverflow.com/questions/88904/error-creating-window-handle that some processes tended to consume more of these resources than they normally should. However, this counter is not the good one because it keeps track of resources such as files, sockets, processes and threads. These resources are named Kernel Objects. The other kinds of resources that we should keep an eye on are the GDI Objects http://weblogs.asp.net/fmarguerie/cannot-create-window-handle-desktop-heap and the User Objects. You can get an overview of the three categories of resources on MSDN. User Objects Window creation issues are directly related to User Objects. We tried to determine what the limit is in terms of User Objects an application can use.There is a quota of 10,000 user handles per process. This value can be changed in the registry, however this limit was not the real show-stopper in our case. The other limit is 66,536 user handles per Windows session. This limit is theoretical. In practice, you'll notice that it can't be reached. In our case, we were getting the dreaded "Error creating window handle" exception before the total number of User Objects in the current session reached 11,000. Desktop Heap We then discovered which limit was the real culprit: it was the "Desktop Heap".By default, all the graphical applications of an interactive user session execute in what is named a "desktop". The resources allocated to such a desktop are limited (but configurable). Note: User Ob
Products INDIVIDUAL PLATFORMS WinForms ASP.NET MVC WPF Windows 10 Apps CROSS-PLATFORM Reporting Document Generation ENTERPRISE TOOLS Report Server Analytics Dashboard https://www.devexpress.com/Support/Center/Question/Details/Q491719 FRAMEWORKS eXpressApp Framework CODE-DEBUG-REFACTOR CodeRush for Visual Studio Explore Our http://www.dxsdata.com/2013/07/solving-win32exception-error-creating-window-handle/ Newest Features HTML JS Products HYBRID APPS DevExtreme Mobile DevExtreme Web Xamarin.Forms UI CONTROLS Free Data Grid iOS NATIVE DataExplorer Testing Tools WEB TESTING TestCafe Delphi & C++Builder Products DELPHI & C++BUILDER VCL Free Trials & Demos (includes all DevExpress .NET products and free error creating technical support) .NET Product Demos BY PLATFORMS WinForms ASP.NET MVC WPF Windows 10 Apps CROSS-PLATFORM Reporting Document Generation ENTERPRISE TOOLS Report Server Analytics Dashboard FRAMEWORKS eXpressApp Framework HTML Java Script Downloads MOBILE DevExtreme Mobile HTML5 JS WIDGETS DevExtreme Web Testing Tools Downloads WEB TESTING TestCafe Delphi & C++Builder Downloads CONTROLS VCL Buy Compare Features and error creating window Pricing Buy a New Product Subscription Renew an Existing Subscription Need help or require more information? Email us at info@devexpress.com or call +1 (818) 844-3383 between 7:30AM and 4:30PM Pacific Time. Support Support Center Search the KB My Questions Code Examples Resources Getting Started Documentation Demos Training Webinars Contact our Developer Advocates anytime. My Account ManageYour Profile Change your addressemail and password Assign Licenses Manage licensesfor your dev team Renew anExisting SubscriptionPurchaseHistory New order statusand previous purchases DownloadYour Products Need help or require more information?Email us at clientservices@devexpress.com or call +1 (818) 844-3383 between 7:30AM and 4:30PM Pacific Time. About Us Connect with DevExpress BlogsUpcomingEventsTrainingWebinars Learn More about DevExpress About Us News User Comments Case Studies Our Awards Reviews & Publications MVP Program Contact Us Support Center FAQ Training Events Localization Version History Examples Tickets Submit a Support Ticket Type search string and press Enter 0 solutions System.ComponentModel.Win32Exception (0x80004005): Error creating window handle. Tags: .NET, WinForms, XtraGrid Suite 0 yang wulong 04.
AccountShipping MethodsCartPower of RevocationPayment MethodsBlogCookie PolicyShopSupport 0,00€ 0 items Home/C# .Net/Solving Win32Exception: Error creating window handle Posted on Wednesday July 17th, 2013Solving Win32Exception: Error creating window handle Written byds Posted inC# .Net Comments 1 Comment These exceptions are hardly reproducable if they only appear at the customer's workstation who cannot explain exactly what they did to get this message - and if it is quite a large project. Long story short - Don't forget to dispose controls and other objects if this is not done automatically, e.g. if the controls were not created in the VS Designer. It you create a control instance in your source code, it might stay there until you close the form (or even longer). So if you remove a control, also make sure you call the Dispose() method of it. Also make sure that timers really stop after closing a form. In huge projects, it is not easy to locate the reason for this Win32Exception. So I will try to explain here how I got rid of these errors. Task Manager is your friend In Windows Task Manager details, add the counter colums for handles, threads, user objects and GDI objects. Watch your application if any of these values get very high, e.g. over 1000. They shouldn't get over 10000 (or near 10000, in most cases), otherwise you get the Win32Exception. You can test this behaviour with a sample project which includes a loop, e.g. to create new forms which never close etc. If the exception appears only on other computers in your network, a Remote Task Manager is also available. Methods via C# You also get the handle count values in your C# software. Handle count: Process.GetCurrentProcess().HandleCount GDI objects count: [DllImport("User32")] extern public static int GetGuiResources(IntPtr hProcess, int uiFlags); public static int GetGuiResourcesGDICount() { //Return the count of GDI objects. return GetGuiResources