home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / screreso.zip / SCRERESO.CMD
OS/2 REXX Batch file  |  2000-12-11  |  641b  |  25 lines

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