Release 960405

Fri Apr  5 15:22:55 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/button.c] [controls/static.c]
	Changes to use WND * wherever possible.

	* [debugger/dbg.y] [debugger/debug.l]
	Added 'info module' and 'walk module' commands.

	* [if1632/Makefile.in] [if1632/relay.c] [tools/build.c]
	Added assembly code generation to call from Wine into 32-bit code.
	Changed all 'call32' references in 'callfrom16' to avoid confusion
	with Win32 routines.

	* [include/callback.h]
	Added prototypes for 32-bit callbacks.

	* [loader/module.c] [if1632/relay32.c] [tools/build.c]
	Unified 16- and 32-bit modules. The fake module for 32-bit DLLs is
	now generated by the build program.

	* [include/module.h]
	Added extra info to NE_MODULE for Win32 modules to point to the PE
	module data.

	* [include/pe_image.h] [loader/pe_image.c] [win32/resource.c]
	Removed the wine_files list. The PE data for a module can now be
	accessed with the NE_WIN32_MODULE macro.

	* [loader/signal.c] [miscemu/instr.c]
	Don't start the BIOS timer at startup, but only after an access to
	the 0x40 segment.

	* [memory/local.c]
	Changed LOCAL_Lock() to return a 32-bit pointer.

	* [misc/main.c] [include/dlls.h]
	Some built-in DLLs (like KERNEL) can no longer be disabled from
 	the command-line.
	
Thu Apr  4 19:54:39 1996  Keith Reynolds <keithr@sco.COM>

	* [*/*]
	A lot of small changes to support SCO OpenServer 5.

Thu Apr  4 15:38:13 1996  Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>

	* [controls/edit.c]
	Fixed GetKeyState() call to use 0x8000 convention.

	* [include/windows.h]
	Added undocumented messages EM_SCROLL and EM_GETTHUMB.

Thu Apr  4 09:52:52 1996  John Harvey <john@division.co.uk>

	* [if1632/except.S]
	Modified code to assemble on unixware.

Wed Apr  3 09:38:26 1996  Juergen Marquardt <marqu@lunar.advantest.de>

	* [objects/font.c]
	Implementation of a second font cache which will be updated
	dynamically.

Mon Apr  1 16:47:40 1996  Robert Pouliot <krynos@qbc.clic.net>

	* [resources/sysres_Cz.rc] [resources/sysres_Da.rc]
	  [resources/sysres_De.rc] [resources/sysres_Eo.rc]
	  [resources/sysres_Es.rc] [resources/sysres_Fi.rc]
	  [resources/sysres_No.rc] [resources/TODO]
	Updated FIND_TEXT and REPLACE_TEXT to work like the English version.
diff --git a/controls/button.c b/controls/button.c
index 80bd0f4..68515db 100644
--- a/controls/button.c
+++ b/controls/button.c
@@ -12,14 +12,14 @@
 #include "button.h"
 #include "stackframe.h"
 
-extern void DEFWND_SetText( HWND hwnd, LPSTR text );  /* windows/defwnd.c */
+extern void DEFWND_SetText( WND *wndPtr, LPSTR text );  /* windows/defwnd.c */
 
-static void PB_Paint( HWND hWnd, HDC hDC, WORD action );
-static void CB_Paint( HWND hWnd, HDC hDC, WORD action );
-static void GB_Paint( HWND hWnd, HDC hDC, WORD action );
-static void UB_Paint( HWND hWnd, HDC hDC, WORD action );
-static void OB_Paint( HWND hWnd, HDC hDC, WORD action );
-static void BUTTON_CheckAutoRadioButton(HWND hWnd);
+static void PB_Paint( WND *wndPtr, HDC hDC, WORD action );
+static void CB_Paint( WND *wndPtr, HDC hDC, WORD action );
+static void GB_Paint( WND *wndPtr, HDC hDC, WORD action );
+static void UB_Paint( WND *wndPtr, HDC hDC, WORD action );
+static void OB_Paint( WND *wndPtr, HDC hDC, WORD action );
+static void BUTTON_CheckAutoRadioButton( WND *wndPtr );
 
 
 #define MAX_BTN_TYPE  12
@@ -40,7 +40,7 @@
     BUTTON_UNCHECKED    /* BS_OWNERDRAW */
 };
 
-typedef void (*pfPaint)(HWND,HDC,WORD);
+typedef void (*pfPaint)( WND *wndPtr, HDC hdc, WORD action );
 
 static pfPaint btnPaintFunc[MAX_BTN_TYPE] =
 {
@@ -58,11 +58,21 @@
     OB_Paint     /* BS_OWNERDRAW */
 };
 
-#define PAINT_BUTTON(hwnd,style,action) \
+#define PAINT_BUTTON(wndPtr,style,action) \
      if (btnPaintFunc[style]) { \
-         HDC hdc = GetDC( hwnd ); \
-         (btnPaintFunc[style])(hwnd,hdc,action); \
-         ReleaseDC( hwnd, hdc ); }
+         HDC hdc = GetDC( (wndPtr)->hwndSelf ); \
+         (btnPaintFunc[style])(wndPtr,hdc,action); \
+         ReleaseDC( (wndPtr)->hwndSelf, hdc ); }
+
+#ifdef WINELIB32
+#define BUTTON_SEND_CTLCOLOR(wndPtr,hdc) \
+    SendMessage( GetParent((wndPtr)->hwndSelf), WM_CTLCOLORBTN, \
+                 (hdc), (wndPtr)->hwndSelf )
+#else
+#define BUTTON_SEND_CTLCOLOR(wndPtr,hdc) \
+    SendMessage( GetParent((wndPtr)->hwndSelf), WM_CTLCOLOR, (hdc), \
+                 MAKELPARAM((wndPtr)->hwndSelf, CTLCOLOR_BTN) )
+#endif
 
 static HBITMAP hbitmapCheckBoxes = 0;
 static WORD checkBoxWidth = 0, checkBoxHeight = 0;
@@ -93,7 +103,7 @@
                 }
 
 	case WM_ENABLE:
-                PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE );
+                PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
 		break;
 
 	case WM_CREATE:
@@ -124,7 +134,7 @@
                 {
                     PAINTSTRUCT ps;
                     HDC hdc = BeginPaint( hWnd, &ps );
-                    (btnPaintFunc[style])( hWnd, hdc, ODA_DRAWENTIRE );
+                    (btnPaintFunc[style])( wndPtr, hdc, ODA_DRAWENTIRE );
                     ReleaseDC( hWnd, hdc );
                 }
 		break;
@@ -187,14 +197,14 @@
                 break;
 
         case WM_SETTEXT:
-		DEFWND_SetText( hWnd, (LPSTR)PTR_SEG_TO_LIN(lParam) );
-                PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE );
+		DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
+                PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
 		return 0;
 
         case WM_SETFONT:
                 infoPtr->hFont = (HFONT) wParam;
                 if (lParam)
-                    PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE );
+                    PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
                 break;
 
         case WM_GETFONT:
@@ -202,12 +212,12 @@
 
 	case WM_SETFOCUS:
                 infoPtr->state |= BUTTON_HASFOCUS;
-                PAINT_BUTTON( hWnd, style, ODA_FOCUS );
+                PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
 		break;
 
 	case WM_KILLFOCUS:
                 infoPtr->state &= ~BUTTON_HASFOCUS;
-                PAINT_BUTTON( hWnd, style, ODA_FOCUS );
+                PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
 		break;
 
 	case WM_SYSCOLORCHANGE:
@@ -219,7 +229,7 @@
 		wndPtr->dwStyle = (wndPtr->dwStyle & 0xfffffff0) 
 		                   | (wParam & 0x0000000f);
                 style = wndPtr->dwStyle & 0x0000000f;
-                PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE );
+                PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
 		break;
 
 	case BM_GETCHECK:
@@ -232,10 +242,10 @@
 		if ((infoPtr->state & 3) != wParam)
                 {
                     infoPtr->state = (infoPtr->state & ~3) | wParam;
-                    PAINT_BUTTON( hWnd, style, ODA_SELECT );
+                    PAINT_BUTTON( wndPtr, style, ODA_SELECT );
                 }
 		if(style == BS_AUTORADIOBUTTON && wParam==BUTTON_CHECKED)
-			BUTTON_CheckAutoRadioButton(hWnd);
+			BUTTON_CheckAutoRadioButton( wndPtr );
                 break;
 
 	case BM_GETSTATE:
@@ -247,7 +257,7 @@
                 {
                     if (wParam) infoPtr->state |= BUTTON_HIGHLIGHTED;
                     else infoPtr->state &= ~BUTTON_HIGHLIGHTED;
-                    PAINT_BUTTON( hWnd, style, ODA_SELECT );
+                    PAINT_BUTTON( wndPtr, style, ODA_SELECT );
                 }
                 break;
 
@@ -264,7 +274,7 @@
  *       Push Button Functions
  */
 
-static void PB_Paint( HWND hButton, HDC hDC, WORD action )
+static void PB_Paint( WND *wndPtr, HDC hDC, WORD action )
 {
     RECT rc;
     HPEN hOldPen;
@@ -272,19 +282,13 @@
     char *text;
     DWORD dwTextSize;
     TEXTMETRIC tm;
-    WND *wndPtr = WIN_FindWndPtr( hButton );
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
-    GetClientRect(hButton, &rc);
+    GetClientRect(wndPtr->hwndSelf, &rc);
 
       /* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
     if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
-#ifdef WINELIB32
-    SendMessage( GetParent(hButton), WM_CTLCOLORBTN, hDC, hButton );
-#else
-    SendMessage( GetParent(hButton), WM_CTLCOLOR, (WORD)hDC,
-                 MAKELPARAM(hButton, CTLCOLOR_BTN) );
-#endif
+    BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowFrame);
     hOldBrush = (HBRUSH)SelectObject(hDC, sysColorObjects.hbrushBtnFace);
     SetBkMode(hDC, TRANSPARENT);
@@ -347,7 +351,7 @@
  *       Check Box & Radio Button Functions
  */
 
-static void CB_Paint( HWND hWnd, HDC hDC, WORD action )
+static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
 {
     RECT rc;
     HBRUSH hBrush;
@@ -355,18 +359,12 @@
     char *text;
     TEXTMETRIC tm;
     SIZE size;
-    WND *wndPtr = WIN_FindWndPtr(hWnd);
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
-    GetClientRect(hWnd, &rc);
+    GetClientRect(wndPtr->hwndSelf, &rc);
 
     if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
-#ifdef WINELIB32 /* JBP: Different in Win32 */
-    hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLORBTN, hDC, hWnd);
-#else
-    hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, hDC,
-			 MAKELPARAM(hWnd, CTLCOLOR_BTN));
-#endif
+    hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     if (action == ODA_DRAWENTIRE) FillRect(hDC, &rc, hBrush);
 
     GetTextMetrics(hDC, &tm);
@@ -412,14 +410,15 @@
 /**********************************************************************
  *       BUTTON_CheckAutoRadioButton
  *
- * hWnd is checked, uncheck everything else in group
+ * wndPtr is checked, uncheck everything else in group
  */
-static void BUTTON_CheckAutoRadioButton(HWND hWnd)
+static void BUTTON_CheckAutoRadioButton( WND *wndPtr )
 {
-    HWND parent = GetParent(hWnd);
-    HWND sibling;
-    for(sibling = GetNextDlgGroupItem(parent,hWnd,FALSE);
-        sibling != hWnd;
+    HWND parent, sibling;
+    if (!(wndPtr->dwStyle & WS_CHILD)) return;
+    parent = wndPtr->parent->hwndSelf;
+    for(sibling = GetNextDlgGroupItem(parent,wndPtr->hwndSelf,FALSE);
+        sibling != wndPtr->hwndSelf;
         sibling = GetNextDlgGroupItem(parent,sibling,FALSE))
 	    SendMessage(sibling,BM_SETCHECK,BUTTON_UNCHECKED,0);
 }
@@ -429,26 +428,20 @@
  *       Group Box Functions
  */
 
-static void GB_Paint( HWND hWnd, HDC hDC, WORD action )
+static void GB_Paint( WND *wndPtr, HDC hDC, WORD action )
 {
     RECT rc;
     char *text;
     SIZE size;
-    WND *wndPtr = WIN_FindWndPtr( hWnd );
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
     if (action != ODA_DRAWENTIRE) return;
 
     if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
-#ifdef WINELIB32
-    SendMessage( GetParent(hWnd), WM_CTLCOLORBTN, hDC, hWnd );
-#else
-    SendMessage( GetParent(hWnd), WM_CTLCOLOR, hDC,
-		 MAKELPARAM(hWnd, CTLCOLOR_BTN));
-#endif
+    BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     SelectObject( hDC, sysColorObjects.hpenWindowFrame );
 
-    GetClientRect(hWnd, &rc);
+    GetClientRect( wndPtr->hwndSelf, &rc);
 
     MoveTo( hDC, rc.left, rc.top+2 );
     LineTo( hDC, rc.right-1, rc.top+2 );
@@ -471,24 +464,18 @@
  *       User Button Functions
  */
 
-static void UB_Paint( HWND hWnd, HDC hDC, WORD action )
+static void UB_Paint( WND *wndPtr, HDC hDC, WORD action )
 {
     RECT rc;
     HBRUSH hBrush;
-    WND *wndPtr = WIN_FindWndPtr( hWnd );
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
     if (action == ODA_SELECT) return;
 
-    GetClientRect(hWnd, &rc);
+    GetClientRect( wndPtr->hwndSelf, &rc);
 
     if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
-#ifdef WINELIB32
-    hBrush = SendMessage( GetParent(hWnd), WM_CTLCOLORBTN, hDC, hWnd );
-#else
-    hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
-			 MAKELPARAM(hWnd, CTLCOLOR_BTN));
-#endif
+    hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     FillRect(hDC, &rc, hBrush);
 
     if ((action == ODA_FOCUS) ||
@@ -501,10 +488,9 @@
  *       Ownerdrawn Button Functions
  */
 
-static void OB_Paint( HWND hWnd, HDC hDC, WORD action )
+static void OB_Paint( WND *wndPtr, HDC hDC, WORD action )
 {
     DRAWITEMSTRUCT dis;
-    WND *wndPtr = WIN_FindWndPtr( hWnd );
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
     dis.CtlType    = ODT_BUTTON;
@@ -514,9 +500,10 @@
     dis.itemState  = (infoPtr->state & BUTTON_HASFOCUS) ? ODS_FOCUS : 0 |
                      (infoPtr->state & BUTTON_HIGHLIGHTED) ? ODS_SELECTED : 0 |
                      (wndPtr->dwStyle & WS_DISABLED) ? ODS_DISABLED : 0;
-    dis.hwndItem   = hWnd;
+    dis.hwndItem   = wndPtr->hwndSelf;
     dis.hDC        = hDC;
-    GetClientRect( hWnd, &dis.rcItem );
+    GetClientRect( wndPtr->hwndSelf, &dis.rcItem );
     dis.itemData   = 0;
-    SendMessage(GetParent(hWnd), WM_DRAWITEM, 1, (LPARAM) MAKE_SEGPTR(&dis) );
+    SendMessage( GetParent(wndPtr->hwndSelf), WM_DRAWITEM, 1,
+                 (LPARAM)MAKE_SEGPTR(&dis) );
 }