SetMultiDisplay

Description:

baSetMultiDisplay sets the screen size and depth of multiple monitors.

Platforms:

Windows and Macintosh

Usage:

Result = baSetMultiDisplay( Monitor, Width , Height , Depth , Refresh, Mode , Flags )

Arguments:

String, integer, integer, integer, integer, string, integer.
Monitor is the monitor to change.
Width is the new width of the screen in pixels.
Height is the new height of the screen in pixels.
Depth is the new depth of the screen in bits.
Refresh is the new refresh frequency.
Mode is the way in which the new display is set. On Windows, can be:

"temp" 

temporarily change the display settings.

"perm" 

permanently change the display settings.

"test" 

tests whether the display can be set without restarting.

Mode is ignored on Macintosh.

Flags changes options of the function. Ignored on Macintosh.

Returns:

Integer.
Returns 0 if the display was changed or can be changed without restarting.
Returns 1 if Windows will need to be restarted for the change to take effect.
Returns less than 0 if another error occurred, eg invalid screen size.

Examples:

Director:
OK = baSetMultiDisplay( "primary", 640 , 480 , 8 , 75 , "temp" , 2 )

Authorware:
OK := baSetMultiDisplay( "primary", 640 , 480 , 8 , 75 , "temp" , 2 )
 

Notes:

Monitor is the name of the monitor to change, eg: " \\.\DISPLAY1" (Windows) or "64298569" (Macintosh). You can get a list of the current monitors by calling baMultiDisplayList. You can use a value of "primary" to set the primary display without knowing its name, and "secondary" to change the secondary display.

There are 2 flags defined:

Forces the display to change even if it doesn't support changing. Use with caution. Windows only

When the projector quits, the screen settings will be reset to their original values. Using this flag means there is no need for you to restore the display before you quit the projector. All displays in the system will be reset, not just the display specified in the function. On Macintosh, the screen display will always return to the user's original vales when your projector quits, so this flag has no effect.

Not all display cards and drivers support screen changing without restarting.

The force option is not officially supported by Microsoft. It forces the display to change without restarting. This may work correctly with some video cards and drivers, but can cause palette problems on others, and crash the system on some. You are advised to only use this option on known hardware and after extensive testing.

If you use the "temp" mode, then the user's preferred screen display will be returned when the system is restarted. You can not set a "temp" mode unless it can be changed without restarting Windows.

The "temp" mode should only be used if you do not intend the user to be able to access the task bar or desktop while your program is running. When using the "temp" mode, Windows may not position the desktop icons and task bar in usable positions. You should use the "perm" option if you intend to allow the user access to the desktop.

Use can use the refresh option in baMultiDisplayInfo to get the current refresh frequency. It is possible to set a frequency that the display card is capable of using but that the monitor can not handle.

On Macintosh, not all screens support user selected refresh rates. In these cases, use a refresh rate of 0.


 

See also:

baMultiDisplayInfo
baSetDisplay
baSetDisplayEx