diff -u cvs/hq/wine/windows/class.c wine/windows/class.c
--- cvs/hq/wine/windows/class.c	Mon Jul 23 22:20:24 2001
+++ wine/windows/class.c	Mon Aug 13 00:49:01 2001
@@ -468,22 +468,26 @@
     ATOM atom;
     int iSmIconWidth, iSmIconHeight;
     CLASS *classPtr;
+    HINSTANCE hInstance = GetModuleHandleA(NULL);
+    UINT style;
 
-    if (!(atom = GlobalAddAtomA( wc->lpszClassName ))) return 0;
+    if (!(atom = AddAtomA( wc->lpszClassName ))) return 0;
 
-    if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
+    style = wc->style & ~CS_GLOBALCLASS;
+
+    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, style,
                                           wc->cbClsExtra, wc->cbWndExtra )))
     {
-        GlobalDeleteAtom( atom );
+        DeleteAtom( atom );
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
-                   atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
-                   wc->hbrBackground, wc->style, wc->cbClsExtra,
+    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name=%s\n",
+                   atom, (DWORD)wc->lpfnWndProc, hInstance,
+                   wc->hbrBackground, style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr,
-                   HIWORD(wc->lpszClassName) ? wc->lpszClassName : "" );
-    
+                   HIWORD(wc->lpszClassName) ? debugstr_a(wc->lpszClassName) : "" );
+
     iSmIconWidth  = GetSystemMetrics(SM_CXSMICON);
     iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
     
@@ -491,8 +495,8 @@
     classPtr->hIconSm       = CopyImage(wc->hIcon, IMAGE_ICON,
 					iSmIconWidth, iSmIconHeight,
 					LR_COPYFROMRESOURCE);
-    classPtr->hCursor       = (HCURSOR16)wc->hCursor;
-    classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
+    classPtr->hCursor       = wc->hCursor;
+    classPtr->hbrBackground = wc->hbrBackground;
 
     WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
                      WIN_PROC_32A, WIN_PROC_CLASS );
@@ -509,21 +513,26 @@
     ATOM atom;
     int iSmIconWidth, iSmIconHeight;
     CLASS *classPtr;
+    HINSTANCE hInstance = GetModuleHandleW(NULL);
+    UINT style;
 
-    if (!(atom = GlobalAddAtomW( wc->lpszClassName ))) return 0;
+    if (!(atom = AddAtomW( wc->lpszClassName ))) return 0;
 
-    if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
+    style = wc->style & ~CS_GLOBALCLASS;
+
+    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, style,
                                           wc->cbClsExtra, wc->cbWndExtra )))
     {
-        GlobalDeleteAtom( atom );
+        DeleteAtom( atom );
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
-                   atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
-                   wc->hbrBackground, wc->style, wc->cbClsExtra,
-                   wc->cbWndExtra, classPtr );
-    
+    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name=%s\n",
+                   atom, (DWORD)wc->lpfnWndProc, hInstance,
+                   wc->hbrBackground, style, wc->cbClsExtra,
+                   wc->cbWndExtra, classPtr,
+                   HIWORD(wc->lpszClassName) ? debugstr_w(wc->lpszClassName) : "" );
+
     iSmIconWidth  = GetSystemMetrics(SM_CXSMICON);
     iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
 
@@ -531,8 +540,8 @@
     classPtr->hIconSm       = CopyImage(wc->hIcon, IMAGE_ICON,
 					iSmIconWidth, iSmIconHeight,
 					LR_COPYFROMRESOURCE);
-    classPtr->hCursor       = (HCURSOR16)wc->hCursor;
-    classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
+    classPtr->hCursor       = wc->hCursor;
+    classPtr->hbrBackground = wc->hbrBackground;
 
     WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
                      WIN_PROC_32W, WIN_PROC_CLASS );
@@ -582,25 +591,30 @@
 {
     ATOM atom;
     CLASS *classPtr;
+    HINSTANCE hInstance = GetModuleHandleA(NULL);
+    UINT style;
 
-    if (!(atom = GlobalAddAtomA( wc->lpszClassName ))) return 0;
+    if (!(atom = AddAtomA( wc->lpszClassName ))) return 0;
 
-    if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
+    style = wc->style & ~CS_GLOBALCLASS;
+
+    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, style,
                                           wc->cbClsExtra, wc->cbWndExtra )))
     {
-        GlobalDeleteAtom( atom );
+        DeleteAtom( atom );
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
-                   atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
-                   wc->hbrBackground, wc->style, wc->cbClsExtra,
-                   wc->cbWndExtra, classPtr );
-    
-    classPtr->hIcon         = (HICON16)wc->hIcon;
-    classPtr->hIconSm       = (HICON16)wc->hIconSm;
-    classPtr->hCursor       = (HCURSOR16)wc->hCursor;
-    classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
+    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name=%s\n",
+                   atom, (DWORD)wc->lpfnWndProc, hInstance,
+                   wc->hbrBackground, style, wc->cbClsExtra,
+                   wc->cbWndExtra, classPtr,
+                   HIWORD(wc->lpszClassName) ? debugstr_a(wc->lpszClassName) : "" );
+
+    classPtr->hIcon         = wc->hIcon;
+    classPtr->hIconSm       = wc->hIconSm;
+    classPtr->hCursor       = wc->hCursor;
+    classPtr->hbrBackground = wc->hbrBackground;
     WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
                      WIN_PROC_32A, WIN_PROC_CLASS );
     CLASS_SetMenuNameA( classPtr, wc->lpszMenuName );
@@ -615,25 +629,30 @@
 {
     ATOM atom;
     CLASS *classPtr;
+    HINSTANCE hInstance = GetModuleHandleW(NULL);
+    UINT style;
 
-    if (!(atom = GlobalAddAtomW( wc->lpszClassName ))) return 0;
+    if (!(atom = AddAtomW( wc->lpszClassName ))) return 0;
 
-    if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
+    style = wc->style & ~CS_GLOBALCLASS;
+
+    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, style,
                                           wc->cbClsExtra, wc->cbWndExtra )))
     {
-        GlobalDeleteAtom( atom );
+        DeleteAtom( atom );
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
+    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name=%s\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
-                   wc->cbWndExtra, classPtr );
-    
-    classPtr->hIcon         = (HICON16)wc->hIcon;
-    classPtr->hIconSm       = (HICON16)wc->hIconSm;
-    classPtr->hCursor       = (HCURSOR16)wc->hCursor;
-    classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
+                   wc->cbWndExtra, classPtr,
+                   HIWORD(wc->lpszClassName) ? debugstr_w(wc->lpszClassName) : "" );
+
+    classPtr->hIcon         = wc->hIcon;
+    classPtr->hIconSm       = wc->hIconSm;
+    classPtr->hCursor       = wc->hCursor;
+    classPtr->hbrBackground = wc->hbrBackground;
     WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
                      WIN_PROC_32W, WIN_PROC_CLASS );
     CLASS_SetMenuNameW( classPtr, wc->lpszMenuName );
