SetFont Example

InstallShield 2016 ยป InstallScript Language Reference

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

*

* InstallShield Example Script

*

* Demonstrates the SetFont function.

*

* In this script, three different titles are displayed in

* the setup's main window;  each title remains on the

* screen for three seconds. The titles are displayed by

* calls to SetTitle, which also sets the type size and

* color.  To control the font and font style of the titles,

* the script calls SetFont before each call to SetTitle.

*

*           Font              Size    Style          Color

*

* Title 1   Times New Roman    36     Normal         Red

* Title 2   Courier New        48     Italic         Yellow

* Title 3   Arial              60     Bold, Shadow   Blue

*

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

 

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

#include "Ifx.h"

 

export prototype ExFn_SetFont(HWND);

 

function ExFn_SetFont(hMSI)

begin

 

    Enable ( BACKGROUND );

 

    // Title 1: Times Roman, 36pt, Normal, Red.

    if (SetFont (FONT_TITLE, STYLE_NORMAL, "Times New Roman") < 0) then

        MessageBox ("SetFont failed.", SEVERE);

    endif;

 

    SetTitle ("SetFont Example 1", 36, RGB(255, 0, 0));

    Delay (3);

 

    // Title 2: Courier New, 48pt, Italic, Yellow.

    if (SetFont (FONT_TITLE, STYLE_ITALIC, "Courier New") < 0) then

        MessageBox ("SetFont failed.", SEVERE);

    endif;

 

    SetTitle ("SetFont Example 2", 48, RGB(255, 255, 0));

    Delay (3);

 

    // Title 3: Arial, 60pt, Bold, Shadow, Blue.

    if (SetFont (FONT_TITLE, STYLE_BOLD | STYLE_SHADOW, "Arial") < 0) then

        MessageBox ("SetFont failed.", SEVERE);

    endif;

 

    SetTitle ("SetFont Example 3", 60, RGB(0, 0, 255));

    Delay (3);

 

end;