I don't understand the basics are here
https://docs.microsoft.com/en-us/win...ideocontroller in the WMI class, because used DX structures, also I think that only the primary vga that is used is of interest.
Code:
Name_GPU.Text = "GPU Name : " & GPU_Name()
Ram_Adapter.Text = "VGA Memory : " & Format_Bytes(AdapterRAM)
...
Private Function GPU_Name() As String
'Info GPU
Dim Name_GPU As String = ""
Dim GPU As New ManagementObjectSearcher("SELECT Name FROM Win32_VideoController")
For Each Info_GPU As ManagementObject In GPU.Get()
Try
Name_GPU = Info_GPU("Name").ToString()
Exit For
Catch ex As Exception
Name_GPU = "?"
End Try
Next
Return Name_GPU
End Function
Private Function AdapterRAM() As String
'Info GPU
Dim Adapter_RAM As String = ""
Dim GPU As New ManagementObjectSearcher("SELECT AdapterRAM FROM Win32_VideoController")
For Each Info_GPU As ManagementObject In GPU.Get()
Try
Adapter_RAM = Info_GPU("AdapterRAM").ToString()
Exit For
Catch ex As Exception
Adapter_RAM = "?"
End Try
Next
Return Adapter_RAM
End Function
Private Function Format_Bytes(ByVal Bytes_Convert As String) As String
Dim Total_Convert As Double
Try
Select Case Bytes_Convert
'Case Is >= 1073741824 'GB
' Total_Convert = CDbl(Bytes_Convert / 1073741824) 'GB
' Return FormatNumber(Total_Convert, 2) & " GBytes"
Case Is >= 1048576 'To 1073741823
Total_Convert = CDbl(Bytes_Convert / 1048576) 'MB
Return FormatNumber(Total_Convert, 0) & " MBytes"
Case 1024 To 1048575
Total_Convert = CDbl(Bytes_Convert / 1024) 'KB
Return FormatNumber(Total_Convert, 0) & " KBytes"
Case 0 To 1023
Total_Convert = Bytes_Convert 'Bytes
Return FormatNumber(Total_Convert, 0) & " Bytes"
Case Else
Return ""
End Select
Catch
Return ""
End Try
End Function