Animation type.
1- Animate the window from left to right 2 -Animate the window from right to left 4 -Animate the window from top to bottom 8 -Animate the window from bottom to top 65536 -Hides the window 131072 – Activates the window 262144 -Slide animation 524288 – Fade effect
Code Samples
C#.Net
using Microsoft.Win32; using System.Runtime.InteropServices; const int AW_HOR_POSITIVE = 1; const int AW_HOR_NEGATIVE = 2; const int AW_VER_POSITIVE = 4; const int AW_VER_NEGATIVE = 8; const int AW_HIDE = 65536; const int AW_ACTIVATE = 131072; const int AW_SLIDE = 262144; const int AW_BLEND = 524288; [DllImport("user32", CharSet = CharSet.Auto)] private static extern int AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); private void Form1_Load(object sender, EventArgs e) { AnimateWindow(Handle, 500, AW_BLEND | AW_ACTIVATE); }
VB.Net
Imports Microsoft.Win32 Private Const AW_HOR_POSITIVE = 1 Private Const AW_HOR_NEGATIVE = 2 Private Const AW_VER_POSITIVE = 4 Private Const AW_VER_NEGATIVE = 8 Private Const AW_HIDE = 65536 Private Const AW_ACTIVATE = 131072 Private Const AW_SLIDE = 262144 Private Const AW_BLEND = 524288 Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Integer, ByVal dwtime As Integer, ByVal dwflags As Integer) As Boolean Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AnimateWindow(Handle, 500, &H80000 Or &H20000) End Sub