Private Sub Command1_Click() Dim s, System, item Set System = GetObject("winmgmts:").InstancesOf("Win32_DesktopMonitor") For Each item In System s = s & "caption:" & item.Caption & vbCrLf s = s & "Description:" & item.Description & vbCrLf s = s & "ScreenWidth:" & item.ScreenWidth & vbCrLf s = s & "ScreenHeight:" & item.ScreenHeight & vbCrLf s = s & "MonitorManufacturer:" & item.MonitorManufacturer & vbCrLf Next Debug.Print s End Sub
还有就是查注册表但是这些其实都是不安全的
Dim s, System, item Set System = GetObject("winmgmts:").InstancesOf("Win32_DesktopMonitor")
For Each item In System s = s & "caption:" & item.Caption & vbCrLf
s = s & "Description:" & item.Description & vbCrLf
s = s & "ScreenWidth:" & item.ScreenWidth & vbCrLf
s = s & "ScreenHeight:" & item.ScreenHeight & vbCrLf
s = s & "MonitorManufacturer:" & item.MonitorManufacturer & vbCrLf
Next Debug.Print s
End Sub
优化大师是根据驱动信息,在自己建立的厂商数据库中查询实现的。To BestBadGod:
应该不是这样的,因为显示器根本就没有驱动,都是即插即用的。To chewinggum:
这个方法试过的,取到的都是驱动信息,“即插即用”。
http://blog.csdn.net/tonyzsb/archive/2008/10/23/3129583.aspx
http://blog.csdn.net/tonyzsb/archive/2008/10/23/3129583.aspx
http://blog.csdn.net/tonyzsb/archive/2008/10/23/3129583.aspx