PlaceWindow 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 PlaceWindow function.

*

* PlaceWindow is called to place the background window 50

* pixels to the right and below the upper left-hand corner

* of the display.

*

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

 

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

#include "Ifx.h"

 

export prototype ExFn_PlaceWindow(HWND);

 

function ExFn_PlaceWindow(hMSI)

begin

 

    Enable ( BACKGROUND );

 

    Enable ( DEFWINDOWMODE );

 

    MessageBox ("This is the default position of the background window.",

               INFORMATION);

 

    // Delay calling PlaceWindow for three seconds.

    Delay(3);

 

    // Change the position of the background window.

    if (PlaceWindow (BACKGROUND, 50, 50, UPPER_LEFT) < 0) then

        MessageBox ("PlaceWindow failed.", SEVERE);

    else

        MessageBox ("This is the new position of the background window.",

                   INFORMATION);

        // Delay exiting script for three seconds.

        Delay(3);

    endif;

    

end;