Fix for GetClassInfo on Global Classes

Joshua Thielen thielen at netprince.net
Tue Oct 30 20:45:38 CST 2001


GetClassInfo should return an instance handle to USER for classes with 
the CS_GLOBALCLASS style (this is undocumented behavior). GetClassWord, 
however, still returns the handle to the instance that the global class 
was created with. I've tested this in Windows 95. Finale (a music 
notation app) depends on this behavior and this patch gets all of its 
dialog boxes working in wine.

Modified Files:
wine/windows/class.c

Changelog:
For global classes, GetClassInfo now returns a handle to USER

Josh Thielen
thielen at netprince.net

-------------- next part --------------
Index: wine/windows/class.c
===================================================================
RCS file: /home/wine/wine/windows/class.c,v
retrieving revision 1.40
diff -u -r1.40 class.c
--- wine/windows/class.c	2001/10/15 17:56:45	1.40
+++ wine/windows/class.c	2001/10/31 00:22:21
@@ -1073,7 +1073,7 @@
     wc->lpfnWndProc   = CLASS_GetProc( classPtr, WIN_PROC_16 );
     wc->cbClsExtra    = (INT16)classPtr->cbClsExtra;
     wc->cbWndExtra    = (INT16)classPtr->cbWndExtra;
-    wc->hInstance     = (HINSTANCE16)classPtr->hInstance;
+    wc->hInstance     = (HINSTANCE16) (classPtr->style & CS_GLOBALCLASS ? GetModuleHandleA("USER") : classPtr->hInstance);
     wc->hIcon         = classPtr->hIcon;
     wc->hCursor       = classPtr->hCursor;
     wc->hbrBackground = classPtr->hbrBackground;


More information about the wine-patches mailing list