PATCH: AnimateWindow() stub

Bobby Bingham uhmmmm at ameritech.net
Tue Jun 5 15:25:03 CDT 2001


I was going to implement the full thing, but I'm just to busy right now with 
high-school finals and all.  Maybe I'll get back to it later.

This creates a stub implementation of AnimateWindow(), and just calls 
ShowWindow() with the appropriate flags. 

Bobby Bingham
uhmmmm at ameritech.net

--- WARNING: You are logged into reality as root!! ---
-------------- next part --------------
Index: dlls/user/user32.spec
===================================================================
RCS file: /home/wine/wine/dlls/user/user32.spec,v
retrieving revision 1.29
diff -u -r1.29 user32.spec
--- dlls/user/user32.spec	2001/05/18 22:51:56	1.29
+++ dlls/user/user32.spec	2001/06/05 20:14:27
@@ -660,6 +660,7 @@
 @ stdcall EnumDisplaySettingsExW(wstr long ptr long) EnumDisplaySettingsExW
 @ stdcall GetWindowModuleFileNameA(long ptr long) GetWindowModuleFileNameA
 @ stdcall GetWindowModuleFileNameW(long ptr long) GetWindowModuleFileNameW
+@ stdcall AnimateWindow(long long long) AnimateWindow
 
 ################################################################
 # Wine extensions: Win16 functions that are needed by other dlls
Index: include/winuser.h
===================================================================
RCS file: /home/wine/wine/include/winuser.h,v
retrieving revision 1.106
diff -u -r1.106 winuser.h
--- include/winuser.h	2001/05/18 22:51:56	1.106
+++ include/winuser.h	2001/06/05 20:14:41
@@ -2525,6 +2525,17 @@
 #define PM_REMOVE	0x0001
 #define PM_NOYIELD	0x0002
 
+/* AnimateWindow() flags */
+#define AW_SLIDE        0x00040000
+#define AW_ACTIVATE     0x00020000
+#define AW_BLEND        0x00080000
+#define AW_HIDE         0x00010000
+#define AW_CENTER       0x00000010
+#define AW_HOR_POSITIVE 0x00000001
+#define AW_HOR_NEGATIVE 0x00000002
+#define AW_VER_POSITIVE 0x00000004
+#define AW_VER_NEGATIVE 0x00000008
+
 /* WM_SHOWWINDOW wParam codes */
 #define SW_PARENTCLOSING    1
 #define SW_OTHERMAXIMIZED   2
@@ -3249,6 +3260,7 @@
 
 BOOL      WINAPI AdjustWindowRect(LPRECT,DWORD,BOOL);
 BOOL      WINAPI AdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD);
+BOOL      WINAPI AnimateWindow(HWND,DWORD,DWORD);
 #define     AnsiLowerA CharLowerA
 #define     AnsiLowerW CharLowerW
 #define     AnsiLower WINELIB_NAME_AW(AnsiLower)
Index: windows/winpos.c
===================================================================
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.100
diff -u -r1.100 winpos.c
--- windows/winpos.c	2001/05/22 19:55:20	1.100
+++ windows/winpos.c	2001/06/05 20:14:52
@@ -1468,6 +1468,30 @@
     return wasVisible;
 }
 
+/***********************************************************************
+ *		AnimateWindow (USER32.@)
+ *		Shows/Hides a window with an animation
+ *		NO ANIMATION YET
+ */
+BOOL WINAPI AnimateWindow(HWND hwnd, DWORD dwTime, DWORD dwFlags)
+{
+	FIXME("partial stub\n");
+
+	/* If trying to show/hide and it's already   *
+	 * shown/hidden or invalid window, fail with *
+	 * invalid parameter                         */
+	if(!IsWindow(hwnd) ||
+	   (IsWindowVisible(hwnd) && !(dwFlags & AW_HIDE)) ||
+	   (!IsWindowVisible(hwnd) && (dwFlags & AW_HIDE)))
+	{
+		SetLastError(ERROR_INVALID_PARAMETER);
+		return FALSE;
+	}
+
+	ShowWindow(hwnd, (dwFlags & AW_HIDE) ? SW_HIDE : ((dwFlags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA));
+
+	return TRUE;
+}
 
 /***********************************************************************
  *		GetInternalWindowPos (USER.460)
@@ -1476,7 +1500,7 @@
                                       LPPOINT16 ptIcon )
 {
     WINDOWPLACEMENT16 wndpl;
-    if (GetWindowPlacement16( hwnd, &wndpl )) 
+    if (GetWindowPlacement16( hwnd, &wndpl ))
     {
 	if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
 	if (ptIcon)  *ptIcon = wndpl.ptMinPosition;


More information about the wine-patches mailing list