LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the refresh frequency of all displays

Hi

  My computer have connect two displays, I want to get refresh frequency of all displays. Windows api may be can do this, but i don't know how to use windows api. Does anybody can help me, Thanks.

  LV2017 X64

  

0 Kudos
Message 1 of 2
(2,052 Views)

Here's a .NET API call version in 2015:

 

Refresh rate.png

This is the following .NET code converted to LabVIEW:

Imports System.Management
    Private Function VideoControllerRefreshRate() As String
        Dim refreshRate As String = Nothing
        Dim query As New SelectQuery("Win32_VideoController")
 
        Using managementObjectSearcher As New ManagementObjectSearcher(query)
            Using managementObjectSearcherResults = managementObjectSearcher.Get() _
                                                    .Cast(Of ManagementObject)() _
                                                    .FirstOrDefault()
 
                If managementObjectSearcherResults IsNot Nothing Then
                    refreshRate = managementObjectSearcherResults("CurrentRefreshRate").ToString
                End If
            End Using
        End Using
 
        Return refreshRate
    End Function

Originally found here.

 

Small note: I only have a 1-monitor system to test on, but in theory it should work for any amount.  It's not tested on more than one though.

0 Kudos
Message 2 of 2
(2,019 Views)