Powered by GeSHi

Source code for getres.cmd

(view source code of getres.cmd as plain text)

  1. /* Display screen resolution settings */
  2.  
  3. if RxFuncQuery( "SysLoadFuncs" ) <> 0 then do
  4. 	call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. 	call SysLoadFuncs
  6. end
  7.  
  8. res = SysIni( "USER", "PM_DISPLAYDRIVERS", "DEFAULTSYSTEMRESOLUTION" )
  9.  
  10. if res = "ERROR:" then do
  11. 	say
  12. 	say "Error getting resolution"
  13. 	EXIT 1
  14. end
  15.  
  16. horz = c2d( reverse( substr( res, 1, 4 ) ) )
  17. vert = c2d( reverse( substr( res, 5, 4 ) ) )
  18. cols = c2d( reverse( substr( res, 9, 4 ) ) )
  19.  
  20. say
  21. say "Resolution: "||horz||" x "||vert||" @ "||cols||" colors"
  22.