Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Dual View


Dual View

Author
Message
jon doe
jon doe
Forum God
Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)

Group: Forum Members
Posts: 8, Visits: 21
Dear all,



I need help, I'm newbie for programming in vb6. I want to asking how to make our software can run with video card or detect video card, like prompter, thanks for your help
Joey
Joey
Forum God
Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)Forum God (9.3K reputation)

Group: Forum Members
Posts: 72, Visits: 46
To detect video cards,



Set wmi = GetObject("WinMgmts:")



Set mother_boards = wmi.InstancesOf("Win32_VideoController")

For Each board In mother_boards

t11 = Val(board.AdapterRAM)

t11 = Val(t11 / 1024 ^ 2)

If InStr(1, LCase(board.Caption), "x2") <> 0 Then t11 = t11 * 2

Text1 = Text1 & board.Caption & "|" & board.DeviceID & "|" & t11 & " Mb" & vbCrLf

Next board
jon doe
jon doe
Forum God
Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)

Group: Forum Members
Posts: 8, Visits: 21
thanks joey

Keithuk
Keithuk
Forum God
Forum God (155K reputation)

Group: Moderators
Posts: 1.9K, Visits: 5.5K
Private Function GetVideoCardName() As String



Dim objWMIService As Object, Dim colDevices As Object

Dim objDevice As Object, Dim sTemp As String



Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colDevices = objWMIService.ExecQuery("Select Name, Caption, Description From Win32_VideoController")

For Each objDevice In colDevices

'try name first

sTemp = Trim$(objDevice.Name)

'if nothing then try caption

If Len(sTemp) = 0 Then sTemp = Trim$(objDevice.Caption)

'if still nothing then try description

If Len(sTemp) = 0 Then sTemp = Trim$(objDevice.Description)

Next

GetVideoCardName = sTemp



ExitPoint:

Set colDevices = Nothing

Set objWMIService = Nothing



End Function


Keith

I've been programming with VB for 17 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

Edited
6/28/2014 by Keithuk
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search