Uses
"UI"
,
"COMM"
,
"REGISTRY"
Global
sComPorts(200)
As
String
Function
TBMain
()
GetComports(10)
End
Function
Function
GetComPorts(
CBHNDL
As
DWord
)
Local
N,M
As
DWord
Local
nIdx
As
DWord
Local
sBuffer
As
String
Local
sPorts()
As
String
If
Registry_PathExists(
"HKEYLM"
,
"hardware\devicemap\serialcomm"
)
Then
sBuffer = Registry_GetAllKeys(
"HKEYLM"
,
"hardware\devicemap\serialcomm"
)
Split(Buffer,$
CRLF
,Ports)
If
UBound
(sPorts) <>
UBound
(sComPorts)
Then
ReDim
sComPorts(
UBound
(sPorts))
For
n = 1
To
UBound
(sPorts)
sComPorts(n) = Remain$(sPorts(n),
"="
)
Next
EndIf
EndIf
End
Function
Bookmarks