SetColor Example

InstallShield 2016 » InstallScript Language Reference

Note • To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

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

*

* InstallShield Example Script

*

* Demonstrates the SetColor function.

*

* The first call to SetColor sets the background color to solid

* blue.  The second call sets the background color to gradient

* red.  The last call sets the background color to an RGB value.

*

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

 

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

#include "Ifx.h"

 

export prototype ExFn_SetColor(HWND);

 

function ExFn_SetColor(hMSI)

begin

 

   // Change the background color to solid blue.

   if (SetColor (BACKGROUND, BK_SOLIDBLUE) < 0) then

      MessageBox ("SetColor failed.", SEVERE);

   endif;

 

   // Delay for three seconds.

   Delay (3);

 

   // Change the background color to gradient red.

   if (SetColor (BACKGROUND, BK_RED) < 0) then

      MessageBox ("SetColor failed.", SEVERE);

   endif;

 

   // Delay for three seconds.

   Delay (3);

 

   // Change the background color to custom magenta.

   if (SetColor (BACKGROUND, RGB(100, 50, 150)) < 0) then

      MessageBox ("SetColor failed.", SEVERE);

   endif;

 

   Delay (3);

 

end;