Difference between revisions of "ISDBDevice::HandledDeviceList"

From MediaMonkey Wiki
Jump to: navigation, search
(Created page with "{{MethodDeclaration|SDBDevice|ISDBDevice|Property Get HandledDeviceList As ISDBDeviceList}} ===Property description=== Returns list of devices connected to the computer as [[S...")
(No difference)

Revision as of 17:45, 31 March 2014

CoClass SDBDevice, Interface ISDBDevice

Property Get HandledDeviceList As ISDBDeviceList

Property description

Returns list of devices connected to the computer as SDBDeviceList

But inlike ActiveDeviceList it returns only devices that are already handled by a device plugin and thus their DeviceHandle is always valid.


Option Explicit
Dim UI  : Set UI = SDB.UI
Sub OnStartUp()
    Dim mnuTest
    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = SDB.Localize("Get devices")
    mnuTest.OnClickFunc = "SDBOnClick"
    mnuTest.UseScript = Script.ScriptPath    
End Sub
Sub SDBOnClick(Item)   
  Dim list : Set list = SDB.Device.HandledDeviceList
  If list.Count = 0 Then
    Call SDB.MessageBox( "No connected device", mtError, Array(mbOk))
    Exit Sub
  End If
  Dim txt
  Dim i : i = 0
  For i = 0 To list.Count-1    
    txt = SDB.Device.Caption( list.DeviceHandle(i))
    Call SDB.MessageBox( txt, mtInformation, Array(mbOk))
    Exit Sub       
End Sub