12-31-2018 04:29 AM
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
12-31-2018 12:31 PM - edited 12-31-2018 12:32 PM
Here's a .NET API call version in 2015:
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.