Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for getres.kix

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

  1. ; GetRes.kix,  Version 1.00 for Windows 2000
  2. ; Display screen resolution and refresh rate
  3. ;
  4. ; Usage:  KIX32  GETRES.KIX
  5. ;
  6. ; Written by Rob van der Woude
  7. ; http://www.robvanderwoude.com
  8.  
  9. Break On
  10.  
  11. ; Loop through the registry subkeys, skipping VGASAVE,
  12. ; find the ones that have a subkey DEVICE0, and read
  13. ; the resolution and refresh rate values:
  14. $Index1 = 0
  15. :Loop1
  16. $Key1 = "HKEY_CURRENT_CONFIG\System\CurrentControlSet\SERVICES\"
  17. $KeyEnum1 = EnumKey( $Key1, $Index1 )
  18. If @ERROR = 0
  19. 	$Index1 = $Index1 + 1
  20. 	If UCase( $KeyEnum1 ) = "VGASAVE"
  21. 		GoTo Loop1
  22. 	EndIf
  23. 	$Index2 = 0
  24. 	:Loop2
  25. 	$Key2 = "HKEY_CURRENT_CONFIG\System\CurrentControlSet\SERVICES\$KeyEnum1"
  26. 	$KeyEnum2 = EnumKey( $Key2, $Index2 )
  27. 	$Index2 = $Index2 + 1
  28. 	If @ERROR = 0
  29. 		If UCase( $KeyEnum2 ) = "DEVICE0"
  30. 			? "VideoCard   : " + $KeyEnum1
  31. 			? "XResolution : " + ReadValue( "$Key2\Device0","DefaultSettings.XResolution" )
  32. 			? "YResolution : " + ReadValue( "$Key2\Device0","DefaultSettings.YResolution" )
  33. 			? "BitsPerPel  : " + ReadValue( "$Key2\Device0","DefaultSettings.BitsPerPel" )
  34. 			? "VRefresh    : " + ReadValue( "$Key2\Device0","DefaultSettings.VRefresh" )
  35. 			?
  36. 		EndIf
  37. 		GoTo Loop2
  38. 	EndIf
  39. 	GoTo Loop1
  40. EndIf
  41.  

page last modified: 2024-04-16; loaded in 0.0201 seconds