fb:porticula NoPaste
COM-Ports auflisten
Uploader: | St_W |
Datum/Zeit: | 09.04.2012 19:02:31 |
#Include "windows.bi"
Dim hKey As HANDLE
If (RegOpenKeyEx(HKEY_LOCAL_MACHINE, @"HARDWARE\DEVICEMAP\SERIALCOMM", 0, KEY_QUERY_VALUE, @hKey) <> ERROR_SUCCESS) Then
Print "Fehler beim Öffnen des Registry Keys"
Sleep
End
EndIf
Dim index As Integer = 0
Dim comstr As String
Dim comport As String
comstr = Space(255)
comport = Space(8)
Dim comstrlen As Integer = Len(comstr)
Dim comportlen As Integer = Len(comport)
While (RegEnumValue(hKey, index, StrPtr(comstr), @comstrlen,0 , 0, StrPtr(comport), @comportlen) <> ERROR_NO_MORE_ITEMS)
Print Left(comport, comportlen) + " (" + Left(comstr, comstrlen) + ")"
index += 1
comstr = Space(255)
comport = Space(8)
comstrlen = Len(comstr)
comportlen = Len(comport)
Wend
RegCloseKey(hKey)
Print "Fertig"
Sleep