Release 960928

Fri Sep 27 14:18:42 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/button.c]
	Fixed focus rectangle size and clipping.

	* [controls/scroll.c]
	Converted to Win32 and added support for scroll page.
	Completed SetScrollInfo() and implemented other Win32 functions.

	* [files/file.c]
	Removed FILE_Read() (use _lread32 instead).

	* [objects/dce.c] [include/dce.h]
	Allocate DCE on the Win32 heap, and use pointers instead of
	handles.
	Implemented Win32 version of DC functions.

	* [windows/painting.c]
	Attempt to make CS_PARENTDC style work again.

Wed Sep 25 23:40:52 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [windows/dce.c] [windows/winpos.c]
	Override SaveUnder attribute when painting took place
	in a window below. Force X to raise activated window 
	in seamless mode.

	* [misc/clipboard.c] [windows/event.c]
	Translation between DOS and Unix text formats and several
	other fixes for the sudden selection loss.

	* [windows/message.c]
	Apply "first" and "last" when checking for WM_QUIT in 
        MSG_PeekMessage().

	* [windows/win.c]
	Rearranged DestroyWindow() to fit "Windows Internals"
	description.

	* [windows/win.c] [windows/winpos.c] [windows/nonclient.c]
	Misc. fixes to CBT hook calls.

	* [controls/menu.c] [misc/user.c]
	Fixup resident popup menu window so that it doesn't get
	destroyed by USER_AppExit().

	* [loader/module.c] [loader/task.c] [windows/event.c]
	Process "unsafe" X events outside the scheduler to prevent
	deadlocks.

	* [windows/message.c] [windows/queue.c] [windows/winpos.c]
	Lots of fixes for better Win16 multitasking.

Wed Sep 25 20:36:30 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [include/windows.h]
	Added some missing HOOK defines.

	* [misc/shell.c][if1632/shell32.spec][include/shell.h]
	SHGetFileInfoA stub added (win95 mplayer.exe /play bla.avi).

	* [win32/console.c][include/wincon.h]
	GetConsoleScreenBufferInfo, GetLargestConsoleWindowSize added.

	* [misc/registry.c]
	Some null ptr fixes.

	* [loader/pe_image.c]
	Fixed exported function lookup. (msvcrt20.dll)
	Add debugsyms for entrypoint, exported functions and sections.

	* [multimedia/mmsystem.c]
	MCIOpen: support for element opens (mplayer.exe /play bla.avi).

	* [several]
	Added several missing things/stubs/simple thunks from win32
	to win16 code.

Sat Sep 21 17:27:44 1996  O.Flebbe  <flebbe@science-computing.uni-tuebingen.de>

	* [windows/property.c]
	Fixed debugging of 16 Bit RemoveProp().

	* [debugger/memory.c]
	Added DEBUG_checkmap_bad() for linux.

Thu Sep 19 20:48:31 1996  Albrecht Kleine  <kleine@ak.sax.de>

	* [windows/event.c] [windows/hook.c]
	Use EnableHardwareInput() for JournalPlayback hook.

	* [controls/listbox.c]
	Changed handling of LB_GETITEMRECT in empty listboxes.

Thu Sep 19 13:34:35 1996  Slaven Rezic  <eserte@cs.tu-berlin.de>

	* [misc/main.c]
	Fixes to X resources handling.	

Wed Sep 18 00:31:15 1996  Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>

	* [objects/metafile.c] [include/gdi.h] [objects/dc.c]
	Individual handle table created for each metafile. Fixed
 	GlobalReAlloc() bug in MF_AddHandleDC() (was MF_AddHandleInternal).

	* [windows/graphics.c] [objects/dc.c]
	Rectangle() changed to work better with wide pens and PS_NULL.
	Use JoinMiter.

	* [windows/winpos.c]
	Make the whole (non X) window invalid on resize if CS_[VH]REDRAW
 	is set.

	* [windows/nonclient.c]
	AdjustWindowRectEx() should perform calculations even if the
 	window is minimized.

	* [windows/mdi.c]
	Better handling of system button painting. Maximized windows can
 	contain scroll bars. Icons now maximize properly.

	* [windows/defwnd.c] [windows/nonclient.c] [controls/menu.c]
	Improved greying of items in system menu. WM_INITMEMUPOPUP no
 	longer caught in DefWndProc, DEFWND_InitSysMenuPopup moved to
 	menu.c.

Mon Sep 16 21:30:00 1996  Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [several files]
	Fix missing includes and wrong printing arguments.

	* [controls/listbox.c]
	Don't sort drives in ListBoxDirectory().
	
Sat Sep 14 09:05:47 1996  Petri Tuomola <ptuomola@xs4all.nl>

	* [windows/dialog.c]
	Fixed handling of Shift-TAB in dialogs.

Thu Sep 12 18:31:00 1996  Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>

	* [if1632/gdi32.spec]
	Added SelectClipRgn - call win16 version.

	* [if1632/user32.spec]
	Added GetAsyncKeyState, GetMenuItemID and GetMenuStringA.

	* [include/wincon.h]
	Added COORD and SMALL_RECT typedefs, moved CONSOLE_SCREEN_BUFFER_INFO
	out of #if 0 protected portion of file.

	* [loader/pe_image.c]
	PE_InitTEB() - Tidy up, bug fix to stack pointer value (Borland
	programs now work better)

	* [win32/console.c]
	Added stub functions for GetConsoleScreenBufferInfo and 
	GetLargestConsoleWindowSize

	* [win32/findfile.c]
	FindFirstFile32A() - removed erroneous strcpy

	* [windows/keyboard.c]
	GetAsyncKeyState() - bug fix - now returns value as per Microsoft
	specification. NB - I still have doubts about some other functions
	in this file.
diff --git a/controls/desktop.c b/controls/desktop.c
index 810dd5c..f7529e8 100644
--- a/controls/desktop.c
+++ b/controls/desktop.c
@@ -4,13 +4,13 @@
  * Copyright 1994 Alexandre Julliard
  */
 
+#define NO_TRANSITION_TYPES  /* This file is Win32-clean */
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 #include "win.h"
 #include "desktop.h"
 #include "directory.h"
-#include "file.h"
 #include "graphics.h"
 #include "heap.h"
 
@@ -20,11 +20,11 @@
  *
  * Load a bitmap from a file. Used by SetDeskWallPaper().
  */
-static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
+static HBITMAP32 DESKTOP_LoadBitmap( HDC32 hdc, const char *filename )
 {
     BITMAPFILEHEADER *fileHeader;
     BITMAPINFO *bitmapInfo;
-    HBITMAP hbitmap;
+    HBITMAP32 hbitmap;
     HFILE file;
     LPSTR buffer;
     LONG size;
@@ -33,10 +33,10 @@
 
     if ((file = _lopen( filename, OF_READ )) == HFILE_ERROR)
     {
-        UINT32 len = GetWindowsDirectory( NULL, 0 );
+        UINT32 len = GetWindowsDirectory32A( NULL, 0 );
         if (!(buffer = HeapAlloc( SystemHeap, 0, len + strlen(filename) + 2 )))
             return 0;
-        GetWindowsDirectory( buffer, len + 1 );
+        GetWindowsDirectory32A( buffer, len + 1 );
         strcat( buffer, "\\" );
         strcat( buffer, filename );
         file = _lopen( buffer, OF_READ );
@@ -50,7 +50,7 @@
 	return 0;
     }
     _llseek( file, 0, 0 );
-    size = FILE_Read( file, buffer, size );
+    size = _lread32( file, buffer, size );
     _lclose( file );
     fileHeader = (BITMAPFILEHEADER *)buffer;
     bitmapInfo = (BITMAPINFO *)(buffer + sizeof(BITMAPFILEHEADER));
@@ -74,15 +74,16 @@
  *
  * Handle the WM_ERASEBKGND message.
  */
-static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
+static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
+                                     DESKTOPINFO *infoPtr )
 {
-    RECT16 rect;
+    RECT32 rect;
     WND*   Wnd = WIN_FindWndPtr( hwnd );
 
     if( Wnd->hrgnUpdate > 1 ) DeleteObject( Wnd->hrgnUpdate );
     Wnd->hrgnUpdate = 0;
 
-    GetClientRect16( hwnd, &rect );    
+    GetClientRect32( hwnd, &rect );    
 
     /* Paint desktop pattern (only if wall paper does not cover everything) */
 
@@ -93,14 +94,14 @@
 	  /* Set colors in case pattern is a monochrome bitmap */
 	SetBkColor( hdc, RGB(0,0,0) );
 	SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
-	FillRect16( hdc, &rect, infoPtr->hbrushPattern );
+	FillRect32( hdc, &rect, infoPtr->hbrushPattern );
     }
 
       /* Paint wall paper */
 
     if (infoPtr->hbitmapWallPaper)
     {
-	int x, y;
+	INT32 x, y;
 
 	if (infoPtr->fTileWallPaper)
 	{
@@ -147,12 +148,12 @@
 	infoPtr->hbrushPattern = 0;
 	infoPtr->hbitmapWallPaper = 0;
 	SetDeskPattern();
-	SetDeskWallPaper( (LPSTR)-1 );
+	SetDeskWallPaper32( (LPSTR)-1 );
 	break;
 	
     case WM_ERASEBKGND:
 	if (rootWindow == DefaultRootWindow(display)) return 1;
-	return DESKTOP_DoEraseBkgnd( hwnd, (HDC)wParam, infoPtr );
+	return DESKTOP_DoEraseBkgnd( hwnd, (HDC32)wParam, infoPtr );
 
     case WM_SYSCOMMAND:
 	if ((wParam & 0xfff0) != SC_CLOSE) return 0;
@@ -169,7 +170,7 @@
 /***********************************************************************
  *           SetDeskPattern   (USER.279)
  */
-BOOL SetDeskPattern(void)
+BOOL16 SetDeskPattern(void)
 {
     char buffer[100];
     GetProfileString( "desktop", "Pattern", "(None)", buffer, 100 );
@@ -178,14 +179,25 @@
 
 
 /***********************************************************************
- *           SetDeskWallPaper   (USER.285)
+ *           SetDeskWallPaper16   (USER.285)
  */
-BOOL SetDeskWallPaper( LPCSTR filename )
+BOOL16 SetDeskWallPaper16( LPCSTR filename )
 {
-    HBITMAP hbitmap;
-    HDC hdc;
+    return SetDeskWallPaper32( filename );
+}
+
+
+/***********************************************************************
+ *           SetDeskWallPaper32   (USER32.475)
+ *
+ * FIXME: is there a unicode version?
+ */
+BOOL32 SetDeskWallPaper32( LPCSTR filename )
+{
+    HBITMAP32 hbitmap;
+    HDC32 hdc;
     char buffer[256];
-    WND *wndPtr = WIN_FindWndPtr( GetDesktopWindow() );
+    WND *wndPtr = WIN_GetDesktop();
     DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
 
     if (filename == (LPSTR)-1)
@@ -193,16 +205,16 @@
 	GetProfileString( "desktop", "WallPaper", "(None)", buffer, 256 );
 	filename = buffer;
     }
-    hdc = GetDC( 0 );
+    hdc = GetDC32( 0 );
     hbitmap = DESKTOP_LoadBitmap( hdc, filename );
-    ReleaseDC( 0, hdc );
+    ReleaseDC32( 0, hdc );
     if (infoPtr->hbitmapWallPaper) DeleteObject( infoPtr->hbitmapWallPaper );
     infoPtr->hbitmapWallPaper = hbitmap;
     infoPtr->fTileWallPaper = GetProfileInt( "desktop", "TileWallPaper", 0 );
     if (hbitmap)
     {
-	BITMAP16 bmp;
-	GetObject16( hbitmap, sizeof(bmp), &bmp );
+	BITMAP32 bmp;
+	GetObject32A( hbitmap, sizeof(bmp), &bmp );
 	infoPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
 	infoPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
     }
@@ -215,9 +227,9 @@
  *
  * Set the desktop pattern.
  */
-BOOL DESKTOP_SetPattern(char *pattern )
+BOOL32 DESKTOP_SetPattern( LPCSTR pattern )
 {
-    WND *wndPtr = WIN_FindWndPtr( GetDesktopWindow() );
+    WND *wndPtr = WIN_GetDesktop();
     DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
     int pat[8];
 
@@ -228,7 +240,7 @@
 			   &pat[4], &pat[5], &pat[6], &pat[7] ))
     {
 	WORD pattern[8];
-	HBITMAP hbitmap;
+	HBITMAP32 hbitmap;
 	int i;
 
 	for (i = 0; i < 8; i++) pattern[i] = pat[i] & 0xffff;