In some cases, after upgrading to a newer version, Windows 10 causes crashes or other issues when it calls CreateWindowEx function of msctf.dll when windows are created in some 32-bit applications. In this article, we will understand what CreateWindowEx The function is: explore the possible causes of this function error, then provide the recommended solution to alleviate the problem.
Understanding the CreateWindowEx function
Windows applications, including .NET applications that use Windows Forms or Windows Presentation Foundation (WPF), create their windows by calling the CreateWindowExA or CreateWindowExW the functions.
The two functions internally call for a common USER32 which will validate parameters, such as window styles and descriptors specified in the call, manage the creation of an MDI child window if the WS_EX_MDICHILD the extended window style is specified and processes the current activation context for the calling thread. If everything goes well USER32-side of the CreateWindowEx call, it then calls into the kernel mode implementation (WIN32K) of CreateWindowEx.
CreateWindowEx will perform the following tasks when attempting to create a new window object:
- Determine if creating a descriptor for the new window object will exceed the user descriptor quota limit for the calling process.
- Allocate memory for the new window object from the desktop heap.
- Initializes the memory of the new window object.
- Creates a descriptor for the new window object in the user descriptor table.
Causes of CreateWindowEx failures
Some conditions that can trigger the CreateWindowEx function problem are listed as follows:
- The specified window class does not exist.
- Using invalid window styles or extended window styles.
- Using invalid user handles, such as window handles and menu handles.
- Attempted to create a child window without specifying a parent window.
- An attempt was made to create a child window or an owned window and the specified parent / owner belongs to a different desktop than the calling thread.
- Creating a child or owned window will exceed the nested window limit.
- Creating a new window object will exceed the quota of descriptors for the calling process.
- There is not enough segment available in the desktop segment to allocate memory for the new window object.
- There is no entry available in the user descriptor table.
Troubleshoot CreateWindowEx function for 32-bit apps in Windows 10
Microsoft has provided a workaround for the problems with the CreateWindowEx function.
To work around this problem, you will need to restore your Windows 10 installation to the previous version.
The restore option in Windows 10 is available for 10 days (in most cases) after upgrading your Windows 10 installation.
This keeps your personal files, but removes the applications and drivers that were installed after the upgrade, and also discards any changes you made to the settings.
If the restore option is not available – back up your personal files, then you can contact your IT support or helpdesk or Microsoft support for help restoring your device to the previous version of Windows 10.
That's it!
PS: Microsoft is working on a resolution and will provide an update in the next version of Windows 10.