OS/2, eCS & ArcaOS - Technical > Programming
Where does OS/2 store the screen resolution?
Neil Waldhauer:
I'm interested in knowing the screen resolution that OS/2 will use. The program needs to read the information from disk for a volume that is not currently booted, for example, if the computer is booted from CD, but wants to show the resolution that a disk volume will use if it is booted.
Neil Waldhauer:
Answering myself:
http://www.edm2.com/index.php/REXX_Tips_%26_Tricks:Change_the_WPS_with_REXX#Get_the_display_resolution
--- Code: ---/* print the current resolution */
call rxFuncAdd "SysIni", "REXXUTIL", "SysIni"
inifile = 'USER'
rblock = SysIni(inifile, 'PM_DISPLAYDRIVERS', 'DEFAULTSYSTEMRESOLUTION')
say length(rblock) "chars:" c2x(rblock)
hres = reverse(substr(rblock,1,4))
say "horizontal:" c2d(hres)
vres = reverse(substr(rblock,5,4))
say "vertical:" c2d(vres)
dres = reverse(substr(rblock,9,4))
say "depth:" c2d(dres)
resolutionChangePending = SysIni(inifile ,"PM_DISPLAYDRIVERS", "RESOLUTION_CHANGED")
if resolutionChangePending = "1" || "00"x then
resolutionChangePending = 1
else
resolutionChangePending = 0
say "resolution change pending:" resolutionChangePending
return
--- End code ---
Martin Iturbide:
Thanks Neil for posting the source. I was also wondering where to get that information.
Regards
Martin Iturbide:
Hi Neil
I also found this PM sample that can show you the current resolution.
https://github.com/OS2World/DEV-SAMPLES-C-PM-DIVE-ShowJet
Regards
Neil Waldhauer:
Thanks, Martin. I did not look at OS/2 Multi-Media functions. DiveQueryCaps will give the information for the currently booted system, which is useful.
My main need was to work on a system that is not booted, and can't be booted to the desktop because of a wrong screen resolution. But my method doesn't work as well for the currently booted system, so I will be looking into DiveQueryCaps to do that better.
Navigation
[0] Message Index
[#] Next page
Go to full version