We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

The AnimateWindow API enables users to produce special effects like rolling, sliding, fading when loading or closing windows.
 
Parameters
  •  hwnd
 Handle to the window to animate.
 
  •  dwTime
 Specifies how long it takes to play the animation, in milliseconds.
 
  •  dwFlags
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


Related Tags:

VB.NET

Author: Pradip Shukla

top

VB.NET

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login