Microsoft KB Archive/80382

{|
 * width="100%"|

INFO: Global Classes in Win32

 * }

Q80382

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SUMMARY
Under 16-bit Windows, when an application wants to check whether or not a window class has been previously registered in the system, it typically checks hPrevInstance. Under 32-bit Windows and Windows NT, hPreviousInstance is always FALSE, because a class definition is not available outside the process context of the process that registers it. Thus, code that checks hPreviousInstance will always register the window class.

MORE INFORMATION
Under 32-bit Windows and Windows NT, a style of CS_GLOBALCLASS indicates that the class is available to every DLL in the process, not every application and DLL in the system, as it does in Windows 3.1.

To have a class registered for every process in the system under Windows NT:


 * 1) Register the class in a DLL.
 * 2) Use a style of CS_GLOBALCLASS.
 * 3) List the DLL in the following registry key.

This will force the DLL to be loaded into every process in the system, thereby registering the class in each and every process.

NOTE: This technique does not work under Windows 95.

Additional query words:

Keywords : kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin95 kbOSWin98 kbWndw kbWndwClass

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch