Release 970720

Sat Jul 19 13:03:01 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [tools/build.c] [include/stackframe.h]
	Save the complete %ebp register in CallFrom16; fixes a crash with
	LabView reported by Andreas Mohr.

	* [loader/main.c]
	Avoid executing a built-in DLL.

	* [controls/static.c]
	Converted static window procedure to Win32.

	* [windows/message.c] [windows/queue.c] [include/queue.h]
	Hacked SendMessage functions to support inter-task messages with
	SendMessage32A/W.

Sun Jul 13 16:55:35 1997  Bernhard Rosenkraenzer <bero@bero-online.ml.org>

	* [ipc/bit_array.c]
	Don't use bitops.h in Linux 2.1.x (these versions do not return
	the previous state for clear_bit and set_bit)

	* [ipc/shm_main_blk.c]
	Adapt to GLIBC's ipc_perm structure.

	* [memory/ldt.c]
	Include <asm/unistd.h> on Linux/GLIBC systems (required for
	_syscall3).

Wed Jul 9 23:53:19 1997  David A. Cuthbert  <dacut@henry.ece.cmu.edu>

	* [include/options.h] [files/profile.c]
	Added PROFILE_GetWineIniBool and PROFILE_EnumerateWineIniSection.

	* [include/sysmetrics.h] [include/windows.h] [windows/sysmetrics.c]
	All sysmetrics moved to array (no more constant macros).  Added
	MOUSEWHEELPRESENT metric.

	* [include/bitmap.h] [objects/oembitmap.c]
	Added OBM_Init() (see also loader/main.c) and more support for Win95
	bitmaps; added size info to OEM bitmaps.

	* [include/graphics.h] [windows/graphics.h]
	Added GRAPH_DrawGenericReliefRect.

	* [loader/main.c]
	Added TWEAK_Init() and TWEAK_CheckConfiguration() calls (the
	latter checks for invalid entries in wine.conf).

	* [include/debug.h] [include/stddebug.h] [include/nonclient.h]
	  [include/tweak.h] [controls/menu.c] [misc/tweak.c]
	  [objects/gdiobj.c] [windows/syscolor.c] [windows/nonclient.c]
	  [BUGS] [documentation/win95look]
	Added tweaks for Windows 95 interface support.  See
 	documentation/win95look for more information.

	* [controls/edit.c]
	Fixed EDIT_MoveHome bug.

	* [misc/ver.c]
	Changed name of dprintf_ver_string to ver_dstring to fix
	problem with tools/make_debug utility.

Wed Jul 9 21:31:54 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [objects/dib.c]
	Don't use palettes with dibs with biBitCount > 8.

	* [misc/ole2nls.c][misc/ver.c]
	IsValidLocale, EnumSystemLocales fixed (winhlp32.exe works)
	Some VerLanguage coded moved to ole2nls.c, some cleanups.

	* [multimedia/mcistring.c]
	Fixed "capabilities <dev> device type" crash (cool.exe).

	* [misc/main.c]
	SystemParametersInfo*: added stub option 41
	(GETNONCLIENTMETRICS), duplicated some stuff away from SPI16
	that writes 32bit vars.(one COMCTL32.DLL crash, freecell.exe)

Tue Jul  8 22:40:53 1997  Morten Welinder  <terra@diku.dk>

	* [if1632/shell32.spec]
	Use Windows 95's ordinals. Help wanted, inquire within.

Mon Jul  7 11:20:36 1997  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [if1632/relay.c] [if1632/user.spec] [if1632/kernel.spec]
	  [tools/build-spec.txt] [tools/build.c]
	Added type 'segstr' (segmented pointer to null-terminated string)
	to .spec files.

	* [windows/user.c] [if1632/user.spec]
	ExitWindowsExec stub function added.

Mon Jul  7 01:18:25 1997  U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [files/file.c] [include/winbase.h] [if1632/kernel32.spec]
	Implement MoveFileEx32, some enhancement for Movefile32.

Sat Jul  5 18:13:48 1997  Bruce Milner <Bruce.Milner@genetics.utah.edu.

	* [files/file.c] [if1632/kernel32.spec] [include/winerror.h]
          [msdos/int21.c] [win32/file.c]
	Add LockFile/UnlockFile implementation.
	Add back in int21 func(0x5c) Record locking functions.

	* [files/file.c]
	Fixed bug with OF_REOPEN in FILE_DoOpenFile.

Fri Jul 4 12:00:00 1997  Henrik Olsen <Henrik.Olsen@iaeste.dk>

	* [misc/ole2nls.c] [programs/progman/Da.rc] [programs/winhelp/Da.rc]
	  [resources/sysres_Da.rc]
	Added/updated Danish language support.

Thu Jul  3 13:04:20 1997  Claus Fischer  <fischer@iue.tuwien.ac.at>

	* [files/dos_fs.c]
	Properly implemented DOSFS_UnixTimeToFileTime and
	DOSFS_FileTimeToUnixTime.

	* [documentation/wine.texinfo]
	First version of texinfo documentation.
diff --git a/controls/edit.c b/controls/edit.c
index 707bc69..469de64 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -1462,8 +1462,8 @@
 		e = EDIT_CharFromPos(wnd, es, 0x80000000,
 			HIWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP)), NULL);
 	else
-		e = lstrlen32A(es->text);
-	EDIT_EM_SetSel(wnd, es, extend ? es->selection_start : e, e, FALSE);
+		e = 0;
+	EDIT_EM_SetSel(wnd, es, e, extend ? es->selection_start : e, FALSE);
 	EDIT_EM_ScrollCaret(wnd, es);
 }
 
diff --git a/controls/menu.c b/controls/menu.c
index 4c7c82f..d99b6cc 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -33,8 +33,19 @@
 #include "graphics.h"
 #include "resource.h"
 #include "stddebug.h"
+#include "tweak.h"
 #include "debug.h"
 
+
+UINT32  MENU_BarItemTopNudge;
+UINT32  MENU_BarItemLeftNudge;
+UINT32  MENU_ItemTopNudge;
+UINT32  MENU_ItemLeftNudge;
+UINT32  MENU_HighlightTopNudge;
+UINT32  MENU_HighlightLeftNudge;
+UINT32  MENU_HighlightBottomNudge;
+UINT32  MENU_HighlightRightNudge;
+
 /* internal popup menu window messages */
 
 #define MM_SETMENUHANDLE	(WM_USER + 0)
@@ -101,13 +112,13 @@
 #define POPUP_YSHADE		4
 
   /* Space between 2 menu bar items */
-#define MENU_BAR_ITEMS_SPACE  16
+int MENU_BAR_ITEMS_SPACE = 12;
 
   /* Minimum width of a tab character */
-#define MENU_TAB_SPACE        8
+int MENU_TAB_SPACE = 8;
 
   /* Height of a separator item */
-#define SEPARATOR_HEIGHT      5
+int SEPARATOR_HEIGHT = 5;
 
   /* (other menu->FocusedItem values give the position of the focused item) */
 #define NO_SELECTED_ITEM  0xffff
@@ -147,14 +158,18 @@
 {
     HMENU32 hMenu = LoadMenuIndirect32A(SYSRES_GetResPtr(SYSRES_MENU_SYSMENU));
 
-    if( hMenu )
-    {
+    if( hMenu ) {
         POPUPMENU* menu = (POPUPMENU *) USER_HEAP_LIN_ADDR(hMenu);
         menu->wFlags |= MF_SYSMENU | MF_POPUP;
-	return hMenu;
     }
-    else fprintf( stderr, "Unable to load default system menu\n" );
-    return FALSE;
+    else {
+	hMenu = 0;
+	fprintf( stderr, "Unable to load default system menu\n" );
+    }
+
+    dprintf_menu( stddeb, "MENU_CopySysPopup: returning %ld.\n", hMenu );
+
+    return hMenu;
 }
 
 
@@ -409,6 +424,10 @@
     DWORD dwSize;
     char *p;
 
+    dprintf_menu( stddeb, "MENU_CalcItemSize: HDC 0x%lx, item '%s', at "
+		  "(%d, %d) %s\n", hdc, lpitem->text, orgX, orgY,
+		  menuBar ? "(MenuBar)" : "" );
+
     SetRect32( &lpitem->rect, orgX, orgY, orgX, orgY );
 
     if (lpitem->item_flags & MF_OWNERDRAW)
@@ -509,6 +528,13 @@
 	{
 	    if ((i != start) &&
 		(lpitem->item_flags & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
+
+	    dprintf_menu( stddeb, "MENU_PopupMenuCalcSize: calling "
+			  "MENU_CalcItemSize on '%s', org=(%d, %d)\n",
+			  lpitem->text, orgX, orgY );
+	    if(TWEAK_Win95Look)
+		++orgY;
+
 	    MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, FALSE );
             if (lpitem->item_flags & MF_MENUBARBREAK) orgX++;
 	    maxX = MAX( maxX, lpitem->rect.right );
@@ -572,6 +598,11 @@
 	    if ((helpPos == -1) && (lpitem->item_flags & MF_HELP)) helpPos = i;
 	    if ((i != start) &&
 		(lpitem->item_flags & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
+
+
+	    dprintf_menu( stddeb, "MENU_MenuBarCalcSize: calling "
+			  "MENU_CalcItemSize on item '%s', org=(%d, %d)\n",
+			  lpitem->text, orgX, orgY );
 	    MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE );
 	    if (lpitem->rect.right > lprect->right)
 	    {
@@ -619,8 +650,17 @@
 
     if (lpitem->item_flags & MF_SYSMENU)
     {
-	if( !IsIconic32(hwnd) ) NC_DrawSysButton( hwnd, hdc, 
-				lpitem->item_flags & (MF_HILITE | MF_MOUSESELECT));
+	if( !IsIconic32(hwnd) ) {
+	    if(TWEAK_Win95Look)
+		NC_DrawSysButton95( hwnd, hdc,
+				    lpitem->item_flags &
+				    (MF_HILITE | MF_MOUSESELECT) );
+	    else
+		NC_DrawSysButton( hwnd, hdc, 
+				  lpitem->item_flags &
+				  (MF_HILITE | MF_MOUSESELECT) );
+	}
+
 	return;
     }
 
@@ -647,11 +687,33 @@
     if (menuBar && (lpitem->item_flags & MF_SEPARATOR)) return;
     rect = lpitem->rect;
 
-      /* Draw the background */
+    /* Draw the background */
+    if(TWEAK_Win95Look) {
+	if(menuBar) {
+	    --rect.left;
+	    ++rect.bottom;
+	    --rect.top;
+	}
+	InflateRect32( &rect, -1, -1 );
+    }
 
-    if (lpitem->item_flags & MF_HILITE)
-	FillRect32( hdc, &rect, sysColorObjects.hbrushHighlight );
-    else FillRect32( hdc, &rect, sysColorObjects.hbrushMenu );
+    if (lpitem->item_flags & MF_HILITE) {
+	RECT32  r = rect;
+	r.top += MENU_HighlightTopNudge;
+	r.bottom += MENU_HighlightBottomNudge;
+	r.left += MENU_HighlightLeftNudge;
+	r.right += MENU_HighlightRightNudge;
+	FillRect32( hdc, &r, sysColorObjects.hbrushHighlight );
+    }
+    else {
+	RECT32  r = rect;
+	r.top += MENU_HighlightTopNudge;
+	r.bottom += MENU_HighlightBottomNudge;
+	r.left += MENU_HighlightLeftNudge;
+	r.right += MENU_HighlightRightNudge;
+	FillRect32( hdc, &r, sysColorObjects.hbrushMenu );
+    }
+
     SetBkMode32( hdc, TRANSPARENT );
 
       /* Draw the separator bar (if any) */
@@ -664,9 +726,16 @@
     }
     if (lpitem->item_flags & MF_SEPARATOR)
     {
-	SelectObject32( hdc, sysColorObjects.hpenWindowFrame );
-	MoveTo( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2 );
-	LineTo32( hdc, rect.right, rect.top + SEPARATOR_HEIGHT/2 );
+	if(TWEAK_Win95Look)
+	    TWEAK_DrawMenuSeparator95(hdc, rect.left + 1,
+				      rect.top + SEPARATOR_HEIGHT / 2 + 1,
+				      rect.right - 1);
+	else {
+	    SelectObject32( hdc, sysColorObjects.hpenWindowFrame );
+	    MoveTo( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2 );
+	    LineTo32( hdc, rect.right, rect.top + SEPARATOR_HEIGHT/2 );
+	}
+
 	return;
     }
 
@@ -742,16 +811,40 @@
 	    rect.left += MENU_BAR_ITEMS_SPACE / 2;
 	    rect.right -= MENU_BAR_ITEMS_SPACE / 2;
 	    i = strlen( lpitem->text );
+
+	    rect.top += MENU_BarItemTopNudge;
+	    rect.left += MENU_BarItemLeftNudge;
 	}
 	else
 	{
 	    for (i = 0; lpitem->text[i]; i++)
                 if ((lpitem->text[i] == '\t') || (lpitem->text[i] == '\b'))
                     break;
+
+	    rect.top += MENU_ItemTopNudge;
+	    rect.left += MENU_ItemLeftNudge;
 	}
-	
-	DrawText32A( hdc, lpitem->text, i, &rect,
-                     DT_LEFT | DT_VCENTER | DT_SINGLELINE );
+
+	if(!TWEAK_Win95Look || !(lpitem->item_flags & MF_GRAYED)) {
+	    DrawText32A( hdc, lpitem->text, i, &rect,
+			 DT_LEFT | DT_VCENTER | DT_SINGLELINE );
+	}
+	else {
+	    ++rect.left;
+	    ++rect.top;
+	    ++rect.right;
+	    ++rect.bottom;
+	    SetTextColor32(hdc, RGB(0xff, 0xff, 0xff));
+	    DrawText32A( hdc, lpitem->text, i, &rect,
+			 DT_LEFT | DT_VCENTER | DT_SINGLELINE );
+	    --rect.left;
+	    --rect.top;
+	    --rect.right;
+	    --rect.bottom;
+	    SetTextColor32(hdc, RGB(0x80, 0x80, 0x80));
+	    DrawText32A( hdc, lpitem->text, i, &rect,
+			 DT_LEFT | DT_VCENTER | DT_SINGLELINE );
+	}
 
 	if (lpitem->text[i])  /* There's a tab or flush-right char */
 	{
@@ -787,6 +880,7 @@
 	HPEN32 hPrevPen;
 
 	Rectangle32( hdc, rect.left, rect.top, rect.right, rect.bottom );
+
 	hPrevPen = SelectObject32( hdc, GetStockObject32( NULL_PEN ) );
 	if( hPrevPen )
 	{
@@ -794,20 +888,26 @@
 	    POPUPMENU *menu;
 
 	    /* draw 3-d shade */
+	    if(!TWEAK_Win95Look) {
+		SelectObject32( hdc, hShadeBrush );
+		SetBkMode32( hdc, TRANSPARENT );
+		ropPrev = SetROP232( hdc, R2_MASKPEN );
 
-	    SelectObject32( hdc, hShadeBrush );
-	    SetBkMode32( hdc, TRANSPARENT );
-	    ropPrev = SetROP232( hdc, R2_MASKPEN );
-
-	    i = rect.right;		/* why SetBrushOrg() doesn't? */
-	    PatBlt32( hdc, i & 0xfffffffe, rect.top + POPUP_YSHADE*SYSMETRICS_CYBORDER, 
-		      i%2 + POPUP_XSHADE*SYSMETRICS_CXBORDER, rect.bottom - rect.top, 0x00a000c9 );
-	    i = rect.bottom;
-	    PatBlt32( hdc, rect.left + POPUP_XSHADE*SYSMETRICS_CXBORDER, i & 0xfffffffe, 
-		      rect.right - rect.left, i%2 + POPUP_YSHADE*SYSMETRICS_CYBORDER, 0x00a000c9 );
-	    SelectObject32( hdc, hPrevPen );
-	    SelectObject32( hdc, hPrevBrush );
-	    SetROP232( hdc, ropPrev );
+		i = rect.right;		/* why SetBrushOrg() doesn't? */
+		PatBlt32( hdc, i & 0xfffffffe,
+			  rect.top + POPUP_YSHADE*SYSMETRICS_CYBORDER, 
+			  i%2 + POPUP_XSHADE*SYSMETRICS_CXBORDER,
+			  rect.bottom - rect.top, 0x00a000c9 );
+		i = rect.bottom;
+		PatBlt32( hdc, rect.left + POPUP_XSHADE*SYSMETRICS_CXBORDER,
+			  i & 0xfffffffe,rect.right - rect.left,
+			  i%2 + POPUP_YSHADE*SYSMETRICS_CYBORDER, 0x00a000c9 );
+		SelectObject32( hdc, hPrevPen );
+		SelectObject32( hdc, hPrevBrush );
+		SetROP232( hdc, ropPrev );
+	    }
+	    else
+		TWEAK_DrawReliefRect95(hdc, &rect);
 
 	    /* draw menu items */
 
@@ -846,10 +946,16 @@
     lprect->bottom = lprect->top + lppop->Height;
     if (suppress_draw) return lppop->Height;
     
+    if(TWEAK_Win95Look)
+	++lprect->bottom;
+
     FillRect32(hDC, lprect, sysColorObjects.hbrushMenu );
-    SelectObject32( hDC, sysColorObjects.hpenWindowFrame );
-    MoveTo( hDC, lprect->left, lprect->bottom );
-    LineTo32( hDC, lprect->right, lprect->bottom );
+
+    if(!TWEAK_Win95Look) {
+	SelectObject32( hDC, sysColorObjects.hpenWindowFrame );
+	MoveTo( hDC, lprect->left, lprect->bottom );
+	LineTo32( hDC, lprect->right, lprect->bottom );
+    }
 
     if (lppop->nItems == 0) return SYSMETRICS_CYMENU;
     for (i = 0; i < lppop->nItems; i++)
@@ -1116,8 +1222,8 @@
     LPSTR prevText = IS_STRING_ITEM(item->item_flags) ? item->text : NULL;
 
     dprintf_menu(stddeb,"SetItemData: %04x [%08x] '%s'  -> %04x [%08x] '%s'\n",
-		 item->item_flags, item->item_id, item->text ? item->text : "",
-		 flags, id, str ? str : "" );
+		 item->item_flags, item->item_id, prevText ? prevText : "",
+		 flags, id, (IS_STRING_ITEM(flags) && str) ? str : "" );
 
     if (IS_STRING_ITEM(flags))
     {
@@ -2241,6 +2347,9 @@
     WND *wndPtr;
     LPPOPUPMENU lppop;
 
+    dprintf_menu( stddeb, "MENU_GetMenuBarHeight: HWND 0x%lx, width %d, "
+		  "at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY );
+    
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
     if (!(lppop = (LPPOPUPMENU)USER_HEAP_LIN_ADDR((HMENU16)wndPtr->wIDmenu)))
       return 0;
@@ -2578,9 +2687,11 @@
     MENUITEM *item;
 
     if (IS_STRING_ITEM(flags) && str)
-        dprintf_menu( stddeb, "InsertMenu: %04x %d %04x %04x '%s'\n",
+        dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %04x, "
+		      "id %04x, str '%s'\n",
                       hMenu, pos, flags, id, str );
-    else dprintf_menu( stddeb, "InsertMenu: %04x %d %04x %04x %08lx\n",
+    else dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %04x, "
+		       "id %04x, str %08lx (not a string)\n",
                        hMenu, pos, flags, id, (DWORD)str );
 
     if (!(item = MENU_InsertItem( hMenu, pos, flags ))) return FALSE;
diff --git a/controls/static.c b/controls/static.c
index 77e6c55..6a547e2 100644
--- a/controls/static.c
+++ b/controls/static.c
@@ -9,6 +9,7 @@
 #include "windows.h"
 #include "win.h"
 #include "static.h"
+#include "heap.h"
 
 static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
 static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
@@ -65,9 +66,36 @@
 
 
 /***********************************************************************
+ *           STATIC_LoadIcon
+ *
+ * Load the icon for an SS_ICON control.
+ */
+static HICON16 STATIC_LoadIcon( WND *wndPtr, LPCSTR name )
+{
+    HICON16 hicon;
+
+    if (wndPtr->flags & WIN_ISWIN32)
+    {
+        hicon = LoadIcon32A( wndPtr->hInstance, name );
+        if (!hicon)  /* Try OEM icon (FIXME: is this right?) */
+            hicon = LoadIcon32A( 0, name );
+    }
+    else
+    {
+        LPSTR segname = SEGPTR_STRDUP(name);
+        hicon = LoadIcon16( wndPtr->hInstance, SEGPTR_GET(segname) );
+        if (!hicon)  /* Try OEM icon (FIXME: is this right?) */
+            hicon = LoadIcon32A( 0, segname );
+        SEGPTR_FREE(segname);
+    }
+    return hicon;
+}
+
+
+/***********************************************************************
  *           StaticWndProc
  */
-LRESULT StaticWndProc( HWND16 hWnd, UINT16 uMsg, WPARAM16 wParam,
+LRESULT StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
                        LPARAM lParam )
 {
     LRESULT lResult = 0;
@@ -77,120 +105,115 @@
 
     switch (uMsg)
     {
-	case WM_ENABLE:
-	    InvalidateRect32( hWnd, NULL, FALSE );
-	    break;
+    case WM_NCCREATE:
+        if (style == SS_ICON)
+        {
+            CREATESTRUCT32A *cs = (CREATESTRUCT32A *)lParam;
+            if (cs->lpszName)
+                STATIC_SetIcon( wndPtr,
+                                STATIC_LoadIcon( wndPtr, cs->lpszName ));
+            return 1;
+        }
+        return DefWindowProc32A( hWnd, uMsg, wParam, lParam );
 
-        case WM_NCCREATE:
-	    if (style == SS_ICON)
-            {
-		CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
-		if (cs->lpszName)
-                {
-                    HICON16 hicon = LoadIcon16( cs->hInstance, cs->lpszName );
-                    if (!hicon)  /* Try OEM icon (FIXME: is this right?) */
-                        hicon = LoadIcon16( 0, cs->lpszName );
-                    STATIC_SetIcon( wndPtr, hicon );
-                }
-                return 1;
-            }
-            return DefWindowProc16(hWnd, uMsg, wParam, lParam);
-
-	case WM_CREATE:
-	    if (style < 0L || style > LAST_STATIC_TYPE)
-            {
-                fprintf( stderr, "STATIC: Unknown style 0x%02lx\n", style );
-		lResult = -1L;
-		break;
-            }
-	    /* initialise colours */
-	    color_windowframe  = GetSysColor32(COLOR_WINDOWFRAME);
-	    color_background   = GetSysColor32(COLOR_BACKGROUND);
-	    color_window       = GetSysColor32(COLOR_WINDOW);
-	    break;
-
-        case WM_NCDESTROY:
-            if (style == SS_ICON)
-                DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
-            else 
-                lResult = DefWindowProc16(hWnd, uMsg, wParam, lParam);
+    case WM_CREATE:
+        if (style < 0L || style > LAST_STATIC_TYPE)
+        {
+            fprintf( stderr, "STATIC: Unknown style 0x%02lx\n", style );
+            lResult = -1L;
             break;
+        }
+        /* initialise colours */
+        color_windowframe  = GetSysColor32(COLOR_WINDOWFRAME);
+        color_background   = GetSysColor32(COLOR_BACKGROUND);
+        color_window       = GetSysColor32(COLOR_WINDOW);
+        break;
 
-	case WM_PAINT:
-            {
-                PAINTSTRUCT16 ps;
-                BeginPaint16( hWnd, &ps );
-                if (staticPaintFunc[style])
-                    (staticPaintFunc[style])( wndPtr, ps.hdc );
-                EndPaint16( hWnd, &ps );
-            }
-	    break;
+    case WM_NCDESTROY:
+        if (style == SS_ICON)
+            DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
+        else 
+            lResult = DefWindowProc32A( hWnd, uMsg, wParam, lParam );
+        break;
 
-	case WM_SYSCOLORCHANGE:
-	    color_windowframe  = GetSysColor32(COLOR_WINDOWFRAME);
-	    color_background   = GetSysColor32(COLOR_BACKGROUND);
-	    color_window       = GetSysColor32(COLOR_WINDOW);
-	    InvalidateRect32( hWnd, NULL, TRUE );
-	    break;
+    case WM_PAINT:
+        {
+            PAINTSTRUCT32 ps;
+            BeginPaint32( hWnd, &ps );
+            if (staticPaintFunc[style])
+                (staticPaintFunc[style])( wndPtr, ps.hdc );
+            EndPaint32( hWnd, &ps );
+        }
+        break;
 
-	case WM_SETTEXT:
-	    if (style == SS_ICON)
-	        /* FIXME : should we also return the previous hIcon here ??? */
-                STATIC_SetIcon( wndPtr, LoadIcon16( wndPtr->hInstance,
-                                                  (SEGPTR)lParam ));
-            else
-                DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
-	    InvalidateRect32( hWnd, NULL, FALSE );
-	    UpdateWindow32( hWnd );
-	    break;
+    case WM_ENABLE:
+        InvalidateRect32( hWnd, NULL, FALSE );
+        break;
 
-        case WM_SETFONT:
-            if (style == SS_ICON) return 0;
-            infoPtr->hFont = (HFONT16)wParam;
-            if (LOWORD(lParam))
-            {
-                InvalidateRect32( hWnd, NULL, FALSE );
-                UpdateWindow32( hWnd );
-            }
-            break;
+    case WM_SYSCOLORCHANGE:
+        color_windowframe  = GetSysColor32(COLOR_WINDOWFRAME);
+        color_background   = GetSysColor32(COLOR_BACKGROUND);
+        color_window       = GetSysColor32(COLOR_WINDOW);
+        InvalidateRect32( hWnd, NULL, TRUE );
+        break;
 
-        case WM_GETFONT:
-            return infoPtr->hFont;
+    case WM_SETTEXT:
+        if (style == SS_ICON)
+            /* FIXME : should we also return the previous hIcon here ??? */
+            STATIC_SetIcon( wndPtr, STATIC_LoadIcon( wndPtr, (LPCSTR)lParam ));
+        else
+            DEFWND_SetText( wndPtr, (LPCSTR)lParam );
+        InvalidateRect32( hWnd, NULL, FALSE );
+        UpdateWindow32( hWnd );
+        break;
 
-	case WM_NCHITTEST:
-	    return HTTRANSPARENT;
-
-        case WM_GETDLGCODE:
-            return DLGC_STATIC;
-
-	case STM_GETICON:
-	    return infoPtr->hIcon;
-
-	case STM_SETICON:
-            lResult = STATIC_SetIcon( wndPtr, (HICON16)wParam );
+    case WM_SETFONT:
+        if (style == SS_ICON) return 0;
+        infoPtr->hFont = (HFONT16)wParam;
+        if (LOWORD(lParam))
+        {
             InvalidateRect32( hWnd, NULL, FALSE );
             UpdateWindow32( hWnd );
-	    break;
+        }
+        break;
 
-	default:
-		lResult = DefWindowProc16(hWnd, uMsg, wParam, lParam);
-		break;
-	}
+    case WM_GETFONT:
+        return infoPtr->hFont;
 
-	return lResult;
+    case WM_NCHITTEST:
+        return HTTRANSPARENT;
+
+    case WM_GETDLGCODE:
+        return DLGC_STATIC;
+
+    case STM_GETICON:
+        return infoPtr->hIcon;
+
+    case STM_SETICON:
+        lResult = STATIC_SetIcon( wndPtr, (HICON16)wParam );
+        InvalidateRect32( hWnd, NULL, FALSE );
+        UpdateWindow32( hWnd );
+        break;
+
+    default:
+        lResult = DefWindowProc32A(hWnd, uMsg, wParam, lParam);
+        break;
+    }
+    
+    return lResult;
 }
 
 
 static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc )
 {
-    RECT16 rc;
-    HBRUSH16 hBrush;
+    RECT32 rc;
+    HBRUSH32 hBrush;
     WORD wFormat;
 
     LONG style = wndPtr->dwStyle;
     STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
 
-    GetClientRect16( wndPtr->hwndSelf, &rc);
+    GetClientRect32( wndPtr->hwndSelf, &rc);
 
     switch (style & 0x0000000F)
     {
@@ -225,42 +248,42 @@
     hBrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
                              hdc, wndPtr->hwndSelf );
     if (!hBrush) hBrush = GetStockObject32(WHITE_BRUSH);
-    FillRect16(hdc, &rc, hBrush);
-    if (wndPtr->text) DrawText16( hdc, wndPtr->text, -1, &rc, wFormat );
+    FillRect32( hdc, &rc, hBrush );
+    if (wndPtr->text) DrawText32A( hdc, wndPtr->text, -1, &rc, wFormat );
 }
 
 static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc )
 {
-    RECT16 rc;
+    RECT32 rc;
     HBRUSH32 hBrush;
 
-    GetClientRect16( wndPtr->hwndSelf, &rc);
+    GetClientRect32( wndPtr->hwndSelf, &rc);
     
     switch (wndPtr->dwStyle & 0x0f)
     {
     case SS_BLACKRECT:
 	hBrush = CreateSolidBrush32(color_windowframe);
-        FillRect16( hdc, &rc, hBrush );
+        FillRect32( hdc, &rc, hBrush );
 	break;
     case SS_GRAYRECT:
 	hBrush = CreateSolidBrush32(color_background);
-        FillRect16( hdc, &rc, hBrush );
+        FillRect32( hdc, &rc, hBrush );
 	break;
     case SS_WHITERECT:
 	hBrush = CreateSolidBrush32(color_window);
-        FillRect16( hdc, &rc, hBrush );
+        FillRect32( hdc, &rc, hBrush );
 	break;
     case SS_BLACKFRAME:
 	hBrush = CreateSolidBrush32(color_windowframe);
-        FrameRect16( hdc, &rc, hBrush );
+        FrameRect32( hdc, &rc, hBrush );
 	break;
     case SS_GRAYFRAME:
 	hBrush = CreateSolidBrush32(color_background);
-        FrameRect16( hdc, &rc, hBrush );
+        FrameRect32( hdc, &rc, hBrush );
 	break;
     case SS_WHITEFRAME:
 	hBrush = CreateSolidBrush32(color_window);
-        FrameRect16( hdc, &rc, hBrush );
+        FrameRect32( hdc, &rc, hBrush );
 	break;
     default:
         return;
diff --git a/controls/widgets.c b/controls/widgets.c
index 7efc765..20fe5a5 100644
--- a/controls/widgets.c
+++ b/controls/widgets.c
@@ -48,8 +48,6 @@
 
 static const BUILTIN_CLASS_INFO16 WIDGETS_BuiltinClasses16[] =
 {
-    { CS_GLOBALCLASS | CS_PARENTDC,
-       sizeof(STATICINFO), 0, "StaticWndProc", "Static" },
     { CS_GLOBALCLASS, sizeof(MDICLIENTINFO),
       STOCK_LTGRAY_BRUSH, "MDIClientWndProc", "MDIClient" }
 };
@@ -77,8 +75,11 @@
     { CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
       ComboLBWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboLBox" },
     /* BIC32_POPUPMENU */
-    { CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc,
-      0, sizeof(HMENU32), 0, 0, IDC_ARROW, NULL_BRUSH, 0, POPUPMENU_CLASS_NAME },
+    { CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0,
+      sizeof(HMENU32), 0, 0, IDC_ARROW, NULL_BRUSH, 0, POPUPMENU_CLASS_NAME },
+    /* BIC32_STATIC */
+    { CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc,
+      0, sizeof(STATICINFO), 0, 0, IDC_ARROW, 0, 0, "Static" },
     /* BIC32_SCROLL */
     { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
       ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},