User32AnimateWindow(IntPtr, Int32, WindowAnimation) Method
Produces special effects when showing or hiding a window.
This doesn't show the window so make sure you call
Show
or set
Visible property to
after calling
AnimateWindow(IntPtr, Int32, WindowAnimation).
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool AnimateWindow(
IntPtr hWnd,
int time,
WindowAnimation animation
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function AnimateWindow (
hWnd As IntPtr,
time As Integer,
animation As WindowAnimation
) As Boolean
Dim hWnd As IntPtr
Dim time As Integer
Dim animation As WindowAnimation
Dim returnValue As Boolean
returnValue = User32.AnimateWindow(hWnd,
time, animation)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool AnimateWindow(
IntPtr hWnd,
int time,
WindowAnimation animation
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member AnimateWindow :
hWnd : IntPtr *
time : int *
animation : WindowAnimation -> bool
No code example is currently available or this language may not be supported.
- hWnd IntPtr
-
A IntPtr handle to the window to animate.
The calling thread must own this window.
- time Int32
-
The time it takes to play the animation, in milliseconds.
Typically, an animation takes 200 milliseconds to play.
- animation WindowAnimation
-
The type of animation.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
The function will fail in the following situations:
If the window is already visible and you are trying to show the window.
If the window is already hidden and you are trying to hide the window.
When trying to animate a child window with
ShowFade or
HideFade.
If the thread does not own the window.
Note that, in this case,
AnimateWindow(IntPtr, Int32, WindowAnimation) fails
but
GetLastWin32Error returns
ERROR_SUCCESS.