Release 960521

Tue May 21 14:06:07 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/button.c]
	Made ButtonWndProc a 32-bit window procedure.

	* [controls/desktop.c]
	Made DesktopWndProc a 32-bit window procedure.
	Added handling of WM_SETCURSOR.

	* [controls/menu.c]
	Allocate menu items and strings on the 32-bit system heap.
	Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu,
	AppendMenu and LoadMenuIndirect.

	* [controls/widgets.c]
	Added possibility to have 32-bit built-in classes.

	* [files/drive.c]
	Implemented GetLogicalDrive() and GetLogicalDriveStrings().

	* [misc/spy.c] [include/spy.h]
	Added support for spying Win32 messages.

	* [loader/builtin.c]
	Fixed bug in -dll option parsing.

	* [memory/local.c]
	Added back the change by Huw D. M. Davies to free the block in
	LocalRealloc() before allocating the new one.

	* [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c]
	Fixed bug in bitmap size that caused memory corruption for 24bpp.

	* [windows/defwnd.c]
	Implemented Win32 version of DefWindowProc().

	* [windows/dialog.c]
	Implemented Win32 version of SendDlgItemMessage,
	Get/SetDlgItemText and Get/SetDlgItemInt.

	* [windows/mdi.c]
	Implemented Win32 version of DefFrameProc() and DefMDIChildProc().
	Don't make a copy of the OBM bitmaps for every MDI window.

	* [windows/message.c]
	Implemented Win32 version of SendMessage().
	
	* [windows/winproc.c] [windows/class.c] [windows/win.c]
	New scheme for 32-bit window procedures to replace aliases. All
	32-bit window procedure get a 16-bit address pointing to a
	WINDOWPROC structure.
	Implemented Ansi<->Unicode translation for CallWindowProc().
	Added translation of WM_DRAWITEM between Win16 and Win32.

	* [windows/win.c] [include/callback.h]
	Added ugly hack to build CREATESTRUCT on the stack when sending
	WM_NCCREATE.
	Implemented Win32 version of Get/SetWindowWord/Long and
	Get/SetWindowText.
	
Fri May 17 10:20:16 1996  Albrecht Kleine  <kleine@ak.sax.de>

	* [controls/button.c]
	Avoid gray text on gray background in disabled push buttons
	using a b/w raster and some raster operations (PatBlt,BitBlt).

	* [objects/text.c]
	DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 0be13a8..37a916f 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -202,7 +202,7 @@
         MinMax->ptMaxPosition.y = -yinc;
     }
 
-    SendMessage( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)SEGPTR_GET(MinMax) );
+    SendMessage16( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)SEGPTR_GET(MinMax) );
 
       /* Some sanity checks */
 
@@ -230,23 +230,21 @@
  *
  * Handle a WM_NCCALCSIZE message. Called from DefWindowProc().
  */
-LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS16 *params )
+LONG NC_HandleNCCalcSize( WND *pWnd, RECT16 *winRect )
 {
     RECT16 tmpRect = { 0, 0, 0, 0 };
-    WND *wndPtr = WIN_FindWndPtr( hwnd );    
 
-    if (!wndPtr) return 0;
-    NC_AdjustRect( &tmpRect, wndPtr->dwStyle, FALSE, wndPtr->dwExStyle );
-    params->rgrc[0].left   -= tmpRect.left;
-    params->rgrc[0].top    -= tmpRect.top;
-    params->rgrc[0].right  -= tmpRect.right;
-    params->rgrc[0].bottom -= tmpRect.bottom;
+    NC_AdjustRect( &tmpRect, pWnd->dwStyle, FALSE, pWnd->dwExStyle );
+    winRect->left   -= tmpRect.left;
+    winRect->top    -= tmpRect.top;
+    winRect->right  -= tmpRect.right;
+    winRect->bottom -= tmpRect.bottom;
 
-    if (HAS_MENU(wndPtr))
+    if (HAS_MENU(pWnd))
     {
-	params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd,
-				  params->rgrc[0].right - params->rgrc[0].left,
-				  -tmpRect.left, -tmpRect.top ) + 1;
+	winRect->top += MENU_GetMenuBarHeight( pWnd->hwndSelf,
+                                               winRect->right - winRect->left,
+                                             -tmpRect.left, -tmpRect.top ) + 1;
     }
     return 0;
 }
@@ -635,7 +633,7 @@
     FillRect16( hdc, &r, active ? sysColorObjects.hbrushActiveCaption : 
 	                          sysColorObjects.hbrushInactiveCaption );
 
-    if (GetWindowText( hwnd, buffer, 256 ))
+    if (GetWindowText32A( hwnd, buffer, sizeof(buffer) ))
     {
 	if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
 	else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
@@ -676,7 +674,7 @@
     {
         if (wndPtr->class->hIcon)
         {
-            SendMessage(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, 0);
+            SendMessage16(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, 0);
             DrawIcon( hdc, 0, 0, wndPtr->class->hIcon );
         }
         ReleaseDC(hwnd, hdc);
@@ -1028,7 +1026,7 @@
 	mouseRect.top    = MAX( mouseRect.top, sizingRect.top+minTrack.y );
 	mouseRect.bottom = MIN( mouseRect.bottom, sizingRect.top+maxTrack.y );
     }
-    SendMessage( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
+    SendMessage16( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
 
     if (GetCapture() != hwnd) SetCapture( hwnd );    
 
@@ -1108,8 +1106,8 @@
 	ReleaseDC( 0, hdc );
 	if (rootWindow == DefaultRootWindow(display)) XUngrabServer( display );
     }
-    SendMessage( hwnd, WM_EXITSIZEMOVE, 0, 0 );
-    SendMessage( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
+    SendMessage16( hwnd, WM_EXITSIZEMOVE, 0, 0 );
+    SendMessage16( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
 
     /* Single click brings up the system menu when iconized */
 
@@ -1168,9 +1166,9 @@
     if (!pressed) return;
 
     if (wParam == HTMINBUTTON) 
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, *(LONG*)&msg.pt );
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, *(LONG*)&msg.pt );
     else
-	SendMessage( hwnd, WM_SYSCOMMAND, 
+	SendMessage16( hwnd, WM_SYSCOMMAND, 
 		  IsZoomed(hwnd) ? SC_RESTORE : SC_MAXIMIZE, *(LONG*)&msg.pt );
 }
 
@@ -1243,7 +1241,7 @@
     switch(wParam)  /* Hit test */
     {
     case HTCAPTION:
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam );
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam );
 	break;
 
     case HTSYSMENU:
@@ -1251,15 +1249,15 @@
 	break;
 
     case HTMENU:
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
 	break;
 
     case HTHSCROLL:
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
 	break;
 
     case HTVSCROLL:
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
 	break;
 
     case HTMINBUTTON:
@@ -1275,7 +1273,7 @@
     case HTBOTTOM:
     case HTBOTTOMLEFT:
     case HTBOTTOMRIGHT:
-	SendMessage( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - HTLEFT+1, lParam);
+	SendMessage16( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - HTLEFT+1, lParam);
 	break;
 
     case HTBORDER:
@@ -1300,7 +1298,7 @@
      */
     if (pWnd->dwStyle & WS_MINIMIZE)
     {
-        SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND, SC_RESTORE, lParam );
+        SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND, SC_RESTORE, lParam );
         return 0;
     } 
 
@@ -1309,14 +1307,14 @@
     case HTCAPTION:
         /* stop processing if WS_MAXIMIZEBOX is missing */
         if (pWnd->dwStyle & WS_MAXIMIZEBOX)
-            SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND,
+            SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND,
                       (pWnd->dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE,
                       lParam );
 	break;
 
     case HTSYSMENU:
         if (!(pWnd->class->style & CS_NOCLOSE))
-            SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND, SC_CLOSE, lParam );
+            SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND, SC_CLOSE, lParam );
 	break;
     }
     return 0;
@@ -1362,7 +1360,7 @@
 	break;
 
     case SC_CLOSE:
-	return SendMessage( hwnd, WM_CLOSE, 0, 0 );
+	return SendMessage16( hwnd, WM_CLOSE, 0, 0 );
 
     case SC_VSCROLL:
     case SC_HSCROLL: