WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WMI
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Display Refresh Rate

 Keywords: current refresh rate display 

Question:

Just wondering if there is a way to get the current refresh rate of the display like 60Hz, 75Hz, 100Hz etc...

Answer:

You might try poking around in the registry around this key:
HKLM\System\CurrentControlSet\Services\Class\Display. 
On a Win98 box it appears to be:
HKLM\System\CurrentControlSet\Services\Class\Display\0000\MODES\16\1024,768[RefreshRate].
It may differ depending on the video hardware.


WMI might be able to give you some info. Give this code a try:


Locator = ObjectOpen("WbemScripting.SWbemLocator")
Service = Locator.ConnectServer()
Security = Service.Security_
Security.ImpersonationLevel = 3
Class = "Win32_DisplayConfiguration"
Instance = Service.InstancesOf(Class)
hEnum = ObjectCollectionOpen(Instance)
While 1
  Obj = ObjectCollectionNext(hEnum)
  If Obj == 0 Then Break
  Message(Obj.Description, StrCat("Display Frequency"," = ",Obj.DisplayFrequency))
EndWhile
ObjectCollectionClose(hEnum)
ObjectClose(Instance)
ObjectClose(Security)
ObjectClose(Service)
ObjectClose(Locator)

Exit

Article ID:   W15784
File Created: 2003:05:13:11:30:04
Last Updated: 2003:05:13:11:30:04