IPortableDeviceManager::RefreshDeviceList

banner art

Previous Next

IPortableDeviceManager::RefreshDeviceList

The RefreshDeviceList method refreshes the list of devices that are connected to the computer.

Syntax

  HRESULT RefreshDeviceList();

Parameters

This method takes no parameters.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.

Remarks

When the IPortableDeviceManager interface is instantiated the first time, it generates a list of the devices that are connected. However, devices can connect and disconnect from the computer, making the original list obsolete. This method enables an application to refresh the list of connected devices.

This method is less resource-intensive than instantiating a new device manager to generate a new device list. However, it does require some resources; therefore, we recommend that you do not call this method arbitrarily. The best solution is to have the application register to get device arrival and removal notifications, and when a notification is received, have the application call this function.

For more information on registering for device notifications, see the Plug and Play documentation on MSDN.

Requirements

Header: Defined in PortableDeviceApi.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next