SetDisplayEffect Example

InstallShield 2014 ยป InstallScript Language Reference

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the SetDisplayEffect function.

*

* This script displays the same bitmap seven times, with a

* different effect each time.

*

* Note: In order for this script to run correctly, you must

*       set the constant BITMAP_FILE so that it references an

*       existing bitmap file on the target system.  The

*       constant BITMAP_ID can be any integer in this example

*       since the bitmap is not loaded from a DLL and there

*       are no other bitmaps on the screen.

*

\*--------------------------------------------------------------*/

 

#define BITMAP_FILE "C:\\Windows\\Forest.BMP"

 

// ID to use for the bitmap.

#define BITMAP_ID 1

 

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

 

export prototype ExFn_SetDisplayEffect(HWND);

 

function ExFn_SetDisplayEffect(hMSI)

begin

 

   // Open a background window so the effect's name can

   // be shown in the title bar each time the bitmap

   // is displayed.

   Enable (FULLWINDOWMODE);

   Enable (BACKGROUND);

 

   // 1. Display bitmap using the box stripe effect.

   SetDisplayEffect (EFF_FADE);

 

   SetTitle ("Fade effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   // 2. Display bitmap using the reveal effect.

   SetDisplayEffect (EFF_REVEAL);

 

   SetTitle("Reveal effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   // 3. Display bitmap using the horizontal reveal effect.

   SetDisplayEffect (EFF_HORZREVEAL);

 

   SetTitle ("Horizontal reveal effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   // 4. Display bitmap using the horizontal stripe effect.

   SetDisplayEffect (EFF_HORZSTRIPE);

 

   SetTitle ("Horizontal stripe effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   // 5. Display bitmap using the vertical stripe effect.

   SetDisplayEffect (EFF_VERTSTRIPE);

 

   SetTitle ("Vertical stripe effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   // 6. Display bitmap using the box stripe effect.

   SetDisplayEffect (EFF_BOXSTRIPE);

 

   SetTitle ("Box stripe effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

   Delay (1);

 

   // 7. Clear all effects.

   SetDisplayEffect (EFF_NONE);

 

   SetTitle ("No effect", 0, BACKGROUNDCAPTION);

   PlaceBitmap (BITMAP_FILE, BITMAP_ID, 0, 0, CENTERED);

   Delay (3);

   PlaceBitmap ("", BITMAP_ID, 0, 0, REMOVE);

 

   Delay (1);

 

end;