LAnimationWindow::LAnimationWindow

#include "ltwrappr.h"

L_VOID LAnimationWindow::LAnimationWindow(L_VOID)

L_VOID LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList=NULL, bAutoAnimate=FALSE, nID=0, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0, nCX=200, nCY=200)

HWND hWndParent;

/* handle to the parent window */

LBitmapList L_FAR * pBitmapList;

/* pointer to an LBitmapList object */

L_BOOL bAutoAnimate;

/* flag that indicates whether to automatically animate the list */

L_INT nID;

/* window ID */

DWORD dwStyle;

/* window style */

L_INT x;

/* x coordinate of the window */

L_INT y;

/* y coordinate of the window */

L_INT nCX;

/* window width */

L_INT nCY;

/* window height */

Constructs and initializes the different member variables of the LAnimationWindow object.

Parameter

Description

hWndParent

Handle to the parent window of the animation control.

pBitmapList

Pointer to a valid LBitmapList object to be played. The passed list will be copied to an internal member and invalidated.

bAutoAnimate

Flag that indicates whether to automatically animate the list. Possible values are:

 

Value

Meaning

 

TRUE

Automatically animate the list.

 

FALSE

Do not automatically animate the list.

 

nID

Window ID. This is used if the window is created as a child window.

dwStyle

Window style.

x

X coordinate of the origin of the animation window.

y

Y coordinate of the origin of the animation window.

nCX

Width of the animation window.

nCY

Height of the animation window.

Returns

None.

Comments

LAnimationWindow::LAnimationWindow() is the default constructor for the LAnimationWindow class. You should stop animation playback before you destroy the object.

LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList, bAutoAnimate, nID, dwStyle, x, y, nCX, nCY) sets the internal bitmap list to the passed pBitmapList. pBitmapList will be invalidated upon return.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LAnimationWindow::~LAnimationWindow, Class Members

Example

This is an example for LAnimationWindow::LAnimationWindow():

L_VOID TestFunction()
{
   LAnimationWindow MyAnimation
;

   //Constructor is called upon function entry
   //...
   //Use MyAnimation object
   //...
   //Destructor is called when the function returns
}

This is an example for LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList, bAutoAnimate, nID, dwStyle, x, y, nCX, nCY):

#include <ltlck.h> //Required for unlock support

L_VOID TestFunction(HWND hWndParent)
{
   LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded
   WRPUNLOCKSUPPORT(); //unlock GIF support

   LBitmapList MyBitmapList; //Create a bitmaplist

   if (MyBitmapList.Load (TEXT("eye.gif"))==SUCCESS)
   {
      LAnimationWindow MyAnimation
(hWndParent, /*Parent window*/
                  &MyBitmapList, /*Bitmaplist to assign to animation*/
                  TRUE, /*Auto play animation*/
                  0x0100, /*Child Window ID*/
                  WS_CHILD|WS_VISIBLE, /*Window style*/
                  0, /*Left position*/
                  0, /*Top position*/
                  300, /*Width*/
                  300/*Height*/ );
      while (MyAnimation.IsPlaying())
      {
         if (MyAnimation.DoEvents())
            break;
      }
   }
   else
      MessageBox(hWndParent, TEXT("Failed to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}