Release 961102

Sat Nov  2 12:50:40 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [files/dos_fs.c]
	Added long file name mask in DOSFS_FindNext().

	* [loader/pe_image.c] [loader/task.c]
	Moved Win32 task startup into TASK_CallToStart().

	* [objects/dc.c]
	Fixed SetDCState() for memory DC (thanks to Constantine
	Sapuntzakis for spotting this one).

	* [windows/winpos.c]
	Fixed WINPOS_ForceXWindowRaise() to preserve correct Z-order.

	* [*/*]
	Added Win32 version for many graphics functions.

Thu Oct 31 10:00:18 1996  Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>

	* [controls/button.c]
	BUTTON_CheckAutoRadioButton() unchecks only auto radio buttons.

	* [controls/edit.c]
	EM_GETSEL result should have HIWORD(result) >= LOWORD(result); old
	EDIT_EM_GetSel() renamed to EDIT_GetSel(). 

	* [windows/dialog.c]
	DS_LOCALEDIT is a dialog style not an edit style.

	* [windows/winproc.c]
	Stop stack trashing when wndPtr->text == NULL.

Tue Oct 29 23:35:04 1996   Constantine P Sapuntzakis <csapuntz@mit.edu>

	* [windows/dce.c]
	GetDCEx32 - The determination of whether to use the DC cache or
 	not should be independent of DCX_USESTYLE.

Sat Oct 26 17:31:00 1996  Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>

	* [files/directory.c]
	Added errno.h to #includes

	* [tools/makedep.c]
	Close files once they have been processed.
diff --git a/controls/button.c b/controls/button.c
index fcf591b..8d92822 100644
--- a/controls/button.c
+++ b/controls/button.c
@@ -252,38 +252,38 @@
 static void PB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
 {
     RECT32 rc;
-    HPEN16 hOldPen;
-    HBRUSH16 hOldBrush;
+    HPEN32 hOldPen;
+    HBRUSH32 hOldBrush;
     BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
 
     GetClientRect32( wndPtr->hwndSelf, &rc );
 
       /* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
-    if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
+    if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
     BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
-    hOldPen = (HPEN16)SelectObject(hDC, sysColorObjects.hpenWindowFrame);
-    hOldBrush = (HBRUSH16)SelectObject(hDC, sysColorObjects.hbrushBtnFace);
+    hOldPen = (HPEN32)SelectObject32(hDC, sysColorObjects.hpenWindowFrame);
+    hOldBrush = (HBRUSH32)SelectObject32(hDC, sysColorObjects.hbrushBtnFace);
     SetBkMode(hDC, TRANSPARENT);
-    Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
+    Rectangle32(hDC, rc.left, rc.top, rc.right, rc.bottom);
     if (action == ODA_DRAWENTIRE)
     {
-        SetPixel( hDC, rc.left, rc.top, GetSysColor(COLOR_WINDOW) );
-        SetPixel( hDC, rc.left, rc.bottom-1, GetSysColor(COLOR_WINDOW) );
-        SetPixel( hDC, rc.right-1, rc.top, GetSysColor(COLOR_WINDOW) );
-        SetPixel( hDC, rc.right-1, rc.bottom-1, GetSysColor(COLOR_WINDOW) );
+        SetPixel32( hDC, rc.left, rc.top, GetSysColor(COLOR_WINDOW) );
+        SetPixel32( hDC, rc.left, rc.bottom-1, GetSysColor(COLOR_WINDOW) );
+        SetPixel32( hDC, rc.right-1, rc.top, GetSysColor(COLOR_WINDOW) );
+        SetPixel32( hDC, rc.right-1, rc.bottom-1, GetSysColor(COLOR_WINDOW) );
     }
     InflateRect32( &rc, -1, -1 );
 
     if ((wndPtr->dwStyle & 0x000f) == BS_DEFPUSHBUTTON)
     {
-        Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
+        Rectangle32(hDC, rc.left, rc.top, rc.right, rc.bottom);
         InflateRect32( &rc, -1, -1 );
     }
 
     if (infoPtr->state & BUTTON_HIGHLIGHTED)
     {
         /* draw button shadow: */
-        SelectObject(hDC, sysColorObjects.hbrushBtnShadow );
+        SelectObject32(hDC, sysColorObjects.hbrushBtnShadow );
         PatBlt(hDC, rc.left, rc.top, 1, rc.bottom-rc.top, PATCOPY );
         PatBlt(hDC, rc.left, rc.top, rc.right-rc.left, 1, PATCOPY );
         rc.left += 2;  /* To position the text down and right */
@@ -324,8 +324,8 @@
         }   
     }
 
-    SelectObject( hDC, hOldPen );
-    SelectObject( hDC, hOldBrush );
+    SelectObject32( hDC, hOldPen );
+    SelectObject32( hDC, hOldBrush );
 }
 
 
@@ -349,17 +349,17 @@
     rect.left=(rc->right-rect.right)/2;       /* for centering text bitmap */
     rect.top=(rc->bottom-rect.bottom)/2;
     hbmMem = CreateCompatibleBitmap( hDC,rect.right,rect.bottom);
-    SelectObject( hdcMem, hbmMem);
-    hBr = SelectObject( hdcMem,CreatePatternBrush(hbm));
-    DeleteObject( hbm);
+    SelectObject32( hdcMem, hbmMem);
+    hBr = SelectObject32( hdcMem, CreatePatternBrush32(hbm) );
+    DeleteObject32( hbm );
     PatBlt( hdcMem,0,0,rect.right,rect.bottom,WHITENESS);
-    if (hFont) SelectObject( hdcMem, hFont);
+    if (hFont) SelectObject32( hdcMem, hFont);
     DrawText32A( hdcMem, text, -1, &rc2, DT_SINGLELINE);  
     PatBlt( hdcMem,0,0,rect.right,rect.bottom,0xFA0089);
-    DeleteObject( SelectObject( hdcMem,hBr));
+    DeleteObject32( SelectObject32( hdcMem,hBr) );
     BitBlt( hDC,rect.left,rect.top,rect.right,rect.bottom,hdcMem,0,0,0x990000);
     DeleteDC( hdcMem);
-    DeleteObject( hbmMem);
+    DeleteObject32( hbmMem );
 }
 
 
@@ -377,7 +377,7 @@
 
     GetClientRect16(wndPtr->hwndSelf, &rc);
 
-    if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
+    if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
     hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     if (action == ODA_DRAWENTIRE) FillRect16( hDC, &rc, hBrush );
 
@@ -427,7 +427,7 @@
 /**********************************************************************
  *       BUTTON_CheckAutoRadioButton
  *
- * wndPtr is checked, uncheck everything else in group
+ * wndPtr is checked, uncheck every other auto radio button in group
  */
 static void BUTTON_CheckAutoRadioButton( WND *wndPtr )
 {
@@ -435,9 +435,10 @@
     if (!(wndPtr->dwStyle & WS_CHILD)) return;
     parent = wndPtr->parent->hwndSelf;
     for(sibling = GetNextDlgGroupItem32( parent, wndPtr->hwndSelf, FALSE );
-        sibling != wndPtr->hwndSelf;
+        sibling != wndPtr->hwndSelf && sibling != 0;
         sibling = GetNextDlgGroupItem32( parent, sibling, FALSE ))
-	    SendMessage32A( sibling, BM_SETCHECK32, BUTTON_UNCHECKED, 0 );
+	    if((WIN_FindWndPtr(sibling)->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)
+		SendMessage32A( sibling, BM_SETCHECK32, BUTTON_UNCHECKED, 0 );
 }
 
 
@@ -452,17 +453,17 @@
 
     if (action != ODA_DRAWENTIRE) return;
 
-    if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
+    if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
     BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
-    SelectObject( hDC, sysColorObjects.hpenWindowFrame );
+    SelectObject32( hDC, sysColorObjects.hpenWindowFrame );
 
     GetClientRect16( wndPtr->hwndSelf, &rc);
 
     MoveTo( hDC, rc.left, rc.top+2 );
-    LineTo( hDC, rc.right-1, rc.top+2 );
-    LineTo( hDC, rc.right-1, rc.bottom-1 );
-    LineTo( hDC, rc.left, rc.bottom-1 );
-    LineTo( hDC, rc.left, rc.top+2 );
+    LineTo32( hDC, rc.right-1, rc.top+2 );
+    LineTo32( hDC, rc.right-1, rc.bottom-1 );
+    LineTo32( hDC, rc.left, rc.bottom-1 );
+    LineTo32( hDC, rc.left, rc.top+2 );
 
     if (!wndPtr->text) return;
     if (wndPtr->dwStyle & WS_DISABLED)
@@ -486,7 +487,7 @@
 
     GetClientRect16( wndPtr->hwndSelf, &rc);
 
-    if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
+    if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
     hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
     FillRect16( hDC, &rc, hBrush );