Every window class requires an instance handle to identify the application or DLL that registered the class. The system requires instance handles to keep track of all of modules. The system assigns a handle to each copy of a running executable or DLL.
The system passes an instance handle to the entry-point function of each executable (see WinMain) and DLL (see DllMain). The executable or DLL assigns this instance handle to the class by copying it to the hInstance member of the WNDCLASSEX structure.
Windows 95 and Windows 98: Multiple instances of the same application or DLL use the same code segment, but each has its own data segment. The system uses an instance handle to identify the data segment that corresponds to a particular instance of an application or DLL.