ISDBDevice::HandledDeviceList: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to 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 edit summary
Line 7: Line 7:


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


===Example===
===Example===

Revision as of 17:46, 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.


Introduced in MediaMonkey version 4.1.1.


Example

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       
  Next 
      
End Sub