bpl5000
asked on
How to get display adapter info using VB6
I want to run a VB6 program that determines the current display adapter (video card). For example, if I go into Device Manager on my PC and look at my display adapter, it is called an NVIDIA GeForce GT 330. How can I retrieve this info with VB6?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, this seems to work...
Sub Main()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_DisplayConfiguration")
For Each objItem In colItems
MsgBox "Device Name: " & objItem.DeviceName
Next
End Sub
ASKER
I tried to give MartinLiss all the points and mark my last post as the best solution, but that didn't seem to work.
ASKER
Open in new window
This did work on my PC, but on the PC with the display adapter I'm looking to find, it fails saying "Path not found".
Any ideas?