SetDisplayEx

Description:

baSetDisplayEx sets the screen size and depth.

Platforms:

Windows

Usage:

Result = baSetDisplay( Width , Height , Depth , Refresh, Mode , Force )

Arguments:

Integer, integer, integer, integer, string, integer.
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. Can be:

"temp" 

temporarily change the display settings.

"perm" 

permanently change the display settings.

"test" 

tests whether the display can be set without restarting.
If Force is true, forces the display to change.

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 = baSetDisplayEx( 640 , 480 , 8 , 75 , "temp" , false )

Authorware:
OK := baSetDisplayEx( 640 , 480 , 8 , 75 , "temp" , false )
 

Notes:

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.

Use can use baScreenInfo( "refresh" ) 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.

The refresh option will only work on NT/2000/XP/Vista.

You are encouraged to use the newer MultiDisplay functions instead of this one.
 

 

See also:

baSetDisplay
baSetMultiDisplay
baScreenInfo