Thursday, 20 April 2017

PowerBuilder 10.5 AnimateWindow Code.

Decalre the External Function:
Function boolean AnimateWindow( &
   long lhWnd, long lTm, long lFlags ) library 'user32'

The first parameter is the handle to your window,
the second is the time taken for the animation (larger values take longer),
the last parameter is the animation type.

To call the function add the following code to the open event of your about window:

// Animate the window from left to right
Constant Long AW_HOR_POSITIVE = 1
// Animate the window from right to left
Constant Long AW_HOR_NEGATIVE = 2
// Animate the window from top to bottom
Constant Long AW_VER_POSITIVE = 4
// Animate the window from bottom to
Constant Long AW_VER_NEGATIVE = 8
// Makes the window appear to collapse inward
Constant Long AW_CENTER = 16
// Hides the window
Constant Long AW_HIDE = 65536
// Activates the window
Constant Long AW_ACTIVATE = 131072
// Uses slide animation
Constant Long AW_SLIDE = 262144
// Uses a fade effect
Constant Long AW_BLEND = 524288

AnimateWindow( Handle( this ), 500, AW_VER_NEGATIVE )

No comments: