Brian Heibert wrote:
> Is it possible to change the screen size of the computer monitor
> before loading the rest of the program?
> My program needs a screen size of 1024x768
(1) Obtain a copy of RezLib from
<http://tntbasic.com/download/adlib/RezLib_1.1.11.sit>
or elsewhere.
(2) Save this demo as an FB file:
'--------------
include "Tlbx RezLib.incl"
_rlRezNotFound = 7
end globals
local mode
local fn SetMainScreenResolution( resolutionName as Str31 )
'~'1
dim as long j, @ nResols
dim as OSStatus @ err
dim as ScreenRef screen
xref rlInfoList(99) as RLInfo
screen = fn NewScreenRef( #0, @err )
if ( err ) then exit fn
rlInfoList = fn GetResolutionList( screen, @nResols )
j = 0
while ( j < nResols )
long if ( rlInfoList.name(j) == resolutionName )
err = fn SetResolution( screen, rlInfoList.resolutionID(j) )
exit fn
end if
j++
wend
err = _rlRezNotFound
end fn = err
// main program
dim as OSStatus err
err = fn SetMainScreenResolution( "1024 x 768" )
long if ( err )
stop "SetMainScreenResolution failed with error " + str$( err )
xelse
stop
end if
'--------------
(3) Place the file RezLib in the same folder as the demo.
(4) Run the demo.
Robert P.
Attachments: