如何确定显卡的型号

瓜瓜2008 2003-01-30 03:29:53
我用什么方法可以确定显卡的型号,
就像"超级优化大师"那样的
都了有没有人都做个"优化大师"感性趣
...全文
90 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
evogel 2003-06-03
  • 打赏
  • 举报
回复
GetObject("winmgmts:{impersonationLevel=impersonate}"). _
InstancesOf("Win32_DisplayConfiguration")
这是个服务,如果在98或非2000系统会出错
minajo21 2003-01-30
  • 打赏
  • 举报
回复
有段代码你看看:
Option Explicit

'listview column auto-resizing
Private Const LVM_FIRST As Long = &H1000
Private Const LVM_SETCOLUMNWIDTH As Long = (LVM_FIRST + 30)
Private Const LVSCW_AUTOSIZE As Long = -1
Private Const LVSCW_AUTOSIZE_USEHEADER As Long = -2

Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long


Private Sub Form_Load()

With ListView1
.ListItems.Clear
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "Caption"
.ColumnHeaders.Add , , "Driver ver"
.ColumnHeaders.Add , , "LogPixels"
.ColumnHeaders.Add , , "PelsH"
.ColumnHeaders.Add , , "PelsV"
.ColumnHeaders.Add , , "Spec ver"
.View = lvwReport
.Sorted = False

End With

Command1.Caption = "Display Configuration"

End Sub


Private Sub Command1_Click()

ListView1.ListItems.Clear
Call wmiDisplayConfiguration
Call lvAutosizeControl(ListView1)

End Sub


Private Sub lvAutosizeControl(lv As ListView)

Dim col2adjust As Long

'Size each column based on the maximum of
'wither the ColumnHeader text width, or,
'if the items below it are wider, the
'widest list item in the column
lv.Visible = False
For col2adjust = 0 To lv.ColumnHeaders.Count - 1

Call SendMessage(lv.hwnd, _
LVM_SETCOLUMNWIDTH, _
col2adjust, _
ByVal LVSCW_AUTOSIZE_USEHEADER)

Next
lv.Visible = True

End Sub


Private Sub wmiDisplayConfiguration()

Dim dcSet As SWbemObjectSet
Dim dc As SWbemObject
Dim itmx As ListItem
Dim msg As String

Set dcSet = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
InstancesOf("Win32_DisplayConfiguration")


On Local Error Resume Next

For Each dc In dcSet

Set itmx = ListView1.ListItems.Add(, , dc.Caption)

itmx.SubItems(1) = dc.DriverVersion
itmx.SubItems(2) = dc.LogPixels
itmx.SubItems(3) = dc.PelsHeight
itmx.SubItems(4) = dc.PelsWidth
itmx.SubItems(5) = dc.SpecificationVersion

Next

End Sub

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧