PlaceWindow

InstallShield 2014 » InstallScript Language Reference

The PlaceWindow function changes the position of user interface objects. This includes billboards, Adobe Flash application files, and AVI files that are displayed at run time through PlayMMedia. Specify the distance between the sides of the object and the edges of the screen in nDx and nDy.

When using this function, be aware that an installation runs on a variety of screen resolutions. You may want to determine the extents of the screen before you position the objects. The distance is measured in pixels and is between the edge of the object and the edge of the corner of the specified screen.

Note: The PlaceWindow function does not have any effect on the type of billboard that is displayed on a progress dialog. To learn more about the different types of billboards, see Billboard Styles and File Types for InstallScript and InstallScript MSI Projects.

Restrictions

This function cannot be used to position message boxes or custom dialogs.

Message boxes cannot be positioned with this function because they are created using the native Windows API. A message box’s position is determined by the Windows API and is not under the control of an installation.
Custom dialogs cannot be positioned with this function. PlaceWindow does not work in conjunction with the AskOptions, AskPath, AskText, or EnterDisk functions. By default, a dialog appears in the center of the desktop, unless the background window mode is enabled. If the installation is in window mode, the dialog appears in the center of the background window.

Syntax

PlaceWindow ( nObject, nDx, nDy, nCorner );

Parameters

PlaceWindow Parameters

Parameter

Description

nObject

Specifies the object whose position is to be changed. Pass one of the following predefined constants in this parameter:

ASKOPTIONS—Moves the AskOptions dialog.
ASKPATH—Moves the AskPath dialog.
ASKTEXT—Moves the AskText dialog.
BACKGROUND—Moves the background window.
BILLBOARD—Sets the location of billboards used during the file transfer process.
ENTERDISK—Moves the EnterDisk dialog.
MMEDIA_AVI—Sets the window position for the next .avi file to be played. By default, the .avi file is played at run time in a window in the left corner of the screen, 10 pixels from the left and 10 pixels from the top.
MMEDIA_SWF—Sets the window position for the Adobe Flash application file (.swf) to be played.
STATUS—Moves the progress indicator.
STATUSDLG—Moves the dialog style progress indicator.
STATUSEX—Moves the Setup Status dialog.
STATUSOLD—Moves the old style progress indicator.

Tip: When you call PlaceWindow to move the progress indicator or status dialog, be sure to pass the correct constant for the feedback object you have enabled in your setup. For example, if you called Enable (STATUSOLD), you must pass STATUSOLD to PlaceWindow.

nDx

Specifies the distance in pixels between the appropriate edge of the object and the edge of the screen on the horizontal axis.

nDy

Specifies the distance in pixels between the appropriate edge of the object and the edge of the screen on the vertical axis.

nCorner

Specifies from which corner to measure the distances expressed in nDx and nDy. Pass one of the following predefined constants in this parameter:

LOWER_LEFT—Measures nDx from the left and nDy from the bottom of the main InstallShield window.
LOWER_RIGHT—Measures the nDx from the right and nDy from the bottom of the main InstallShield window.
UPPER_LEFT—Measures the nDx from the left and nDy from the top of the main InstallShield window.
UPPER_RIGHT—Measures the nDx from the right and nDy from the top of the main InstallShield window.
CENTERED—Centers the user interface object within the window.

Note: CENTERED can also be placed in nDx or nDy to center an object only horizontally or only vertically.

Return Values

PlaceWindow Return Values

Return Value

Description

0

Indicates that the function successfully changed the position of the object.

< 0

Indicates that the function was unable to change the position of the object.

Additional Information

Use the PlayMMedia function if you want your installation to play an Adobe Flash application file (.swf) or an AVI file.

See Also