Through VBScript here we can enumerate all network connections ( visible or not visible ). But I cannot find any C++ or COM codes to do this.
strServer = "."
Set objWMI = GetObject("winmgmts://" & strServer & "/root\Microsoft\HomeNet")
Set objInstances = objWMI.InstancesOf("HNet_ConnectionProperties",48)
On Error Resume Next
For Each objInstance in objInstances
With objInstance
WScript.Echo .Connection
WScript.Echo .IsIcsPrivate
WScript.Echo .IsIcsPublic
End With
On Error Goto 0
Next
This is the Equivalent C++ Code to access the
HNet_ConnectionPropertiesWMI ClassAlso consider use a tool like the
Delphi WMI Code Creator, which can help you to generate c++ code to access the WMI.