Grafikkarte herausfinden

  • Hallo zusammen,

    gibt es eine Möglichkeit, per AutoIt herauszufinden, welche Grafikkarte auf dem PC installiert ist?
    Dxdiag etc. wäre sicherlich eine gute Anlaufstelle, aber wie kommt man per AutoIt an Dxdiag?

    LG Flo

  • Oscar weiß wie es geht

    Such einfach nach Computer-Info 2.0 von Oscar....
    Er erkennt sogar beide Grafikkarten in meinem Notebook :)

    Gruß Dietmar

    Achtung Anfänger! :whistling:

    Betrachten des Quellcodes auf eigene Gefahr, bei Übelkeit,Erbrechen,Kopfschmerzen übernehme ich keine Haftung. 8o

    • Offizieller Beitrag

    Hier die Funktionen zum erkennen der Grafikkarte:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    $aVideoController = _CI_GetVideoController()
    _ArrayDisplay($aVideoController)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _CI_GetVideoController($strComputer = '.')
    Local $aReturn[2][12] = [[ _
    'Hersteller:', 'Beschreibung:', 'RAMDAC:', 'Grafikkarten-RAM:', _
    'RAM-Typ:', 'Horiz. Auflösung:', 'Vertik. Auflösung:', 'Bits/Pixel:', _
    'Anzahl der Farben:', 'Bildwiederholfrequenz:', 'Treiberversion:', 'Treiberdatum:']]
    Local $aRAMType[14] = ['', 'Anderer', 'Unbekannt', 'VRAM', 'DRAM', 'SRAM', 'WRAM', 'EDO RAM', _
    'Burst Sync DRAM', 'Pipelined Burst SRAM', 'CDRAM', '3DRAM', 'SDRAM', 'SGRAM']
    Local $x = 0, $objWMIService, $colItems, $Output
    $objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
    If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
    $colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_VideoController', 'WQL', 0x30)
    If IsObj($colItems) Then
    For $objItem In $colItems
    $x += 1
    ReDim $aReturn[$x + 1][12]
    $aReturn[$x][0] = $objItem.AdapterCompatibility
    $aReturn[$x][1] = $objItem.Description
    $aReturn[$x][2] = $objItem.AdapterDACType
    $aReturn[$x][3] = _ByteAutoSize($objItem.AdapterRAM, 0, 3)
    $aReturn[$x][4] = $aRAMType[Number($objItem.VideoMemoryType)]
    $aReturn[$x][5] = $objItem.CurrentHorizontalResolution
    $aReturn[$x][6] = $objItem.CurrentVerticalResolution
    $aReturn[$x][7] = $objItem.CurrentBitsPerPixel
    $aReturn[$x][8] = _StringAddThousandsSep($objItem.CurrentNumberOfColors, '.', ',')
    $aReturn[$x][9] = $objItem.CurrentRefreshRate & ' Hz'
    $aReturn[$x][10] = $objItem.DriverVersion
    $aReturn[$x][11] = _WMIDateStringToDate($objItem.DriverDate)
    Next
    EndIf
    Return $aReturn
    EndFunc ;==>_CI_GetVideoController

    [/autoit] [autoit][/autoit] [autoit]

    Func _WMIDateStringToDate($dtmDate)
    Return (StringMid($dtmDate, 7, 2) & '.' & StringMid($dtmDate, 5, 2) & '.' & StringLeft($dtmDate, 4) _
    & ' ' & StringMid($dtmDate, 9, 2) & ':' & StringMid($dtmDate, 11, 2) & ':' & StringMid($dtmDate, 13, 2))
    EndFunc ;==>_WMIDateStringToDate

    [/autoit] [autoit][/autoit] [autoit]

    ;===============================================================================
    ; Function Name: _ByteAutoSize($iSize[, $iRound][, $iFormat][, $bThousands])
    ; Description:: Gibt einen Bytewert in einer bestimmten Einheit zurück
    ; Parameter(s): $iSize = Größe in Byte übergeben
    ; $iRound = Anzahl der Nachkommastellen (0...8)
    ; $iFormat = bestimmt den Rückgabewert
    ; 0 = Automatisch (je nach übergebenen Wert)
    ; 1 = in Byte
    ; 2 = in KByte
    ; 3 = in MByte
    ; 4 = in GByte
    ; $bThousands = Rückgabe mit Tausendertrennzeichen (True/False)
    ; Requirement(s): #include <String.au3>
    ; Author(s): Oscar (http://www.autoit.de)
    ;===============================================================================
    Func _ByteAutoSize($iSize, $iRound = 2, $iFormat = 0, $bThousands = True)
    Local $aSize[4] = [' Byte', ' KByte', ' MByte', ' GByte'], $sReturn
    If $iFormat < 0 Or $iFormat > 4 Then $iFormat = 0
    If $iRound < 0 Or $iRound > 8 Then $iRound = 2
    If Not IsBool($bThousands) Then $bThousands = False
    $iSize = Abs($iSize)
    If $iFormat = 0 Then
    For $i = 30 To 0 Step -10
    If $iSize > (2 ^ $i) Then
    $iFormat = $i / 10 + 1
    ExitLoop
    EndIf
    Next
    EndIf
    If $iFormat = 0 Then $iFormat = 1
    $sReturn = StringFormat('%.' & $iRound & 'f', Round($iSize / (2 ^ (($iFormat - 1) * 10)), $iRound))
    If $bThousands Then $sReturn = _StringAddThousandsSep($sReturn, '.', ',')
    Return $sReturn & $aSize[$iFormat - 1]
    EndFunc ;==>_ByteAutoSize

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _StringAddThousandsSep
    ; Description ...: Returns the original numbered string with the Thousands delimiter inserted.
    ; Syntax.........: _StringAddThousandsSep($sString[, $sThousands = -1[, $sDecimal = -1]])
    ; Parameters ....: $sString - The string to be converted.
    ; $sThousands - Optional: The Thousands delimiter
    ; $sDecimal - Optional: The decimal delimiter
    ; Return values .: Success - The string with Thousands delimiter added.
    ; Author ........: SmOke_N (orignal _StringAddComma
    ; Modified.......: Valik (complete re-write, new function name)
    ; ===============================================================================================================================
    Func _StringAddThousandsSep($sString, $sThousands = -1, $sDecimal = -1)
    Local $sResult = "" ; Force string
    Local $rKey = "HKCU\Control Panel\International"
    If $sDecimal = -1 Then $sDecimal = RegRead($rKey, "sDecimal")
    If $sThousands = -1 Then $sThousands = RegRead($rKey, "sThousand")
    Local $aNumber = StringRegExp($sString, "(\D?\d+)\D?(\d*)", 1) ; This one works for negatives.
    If UBound($aNumber) = 2 Then
    Local $sLeft = $aNumber[0]
    While StringLen($sLeft)
    $sResult = $sThousands & StringRight($sLeft, 3) & $sResult
    $sLeft = StringTrimRight($sLeft, 3)
    WEnd
    $sResult = StringTrimLeft($sResult, StringLen($sThousands)) ; Strip leading thousands separator
    If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1]
    EndIf
    Return $sResult
    EndFunc ;==>_StringAddThousandsSep

    [/autoit]
  • Vielen Dank!
    Ich habe gerade auch schon dein Skript durchgelesen und werde sicherlich noch vieles andere davon anwenden können :D
    Einige Anmerkungen habe ich auch noch geschrieben...

    Wirklich vielen Dank für die Arbeit!