Querying serial ports device information. Getting "unfriendly" identifier

C

Claire

I want to fill a list box with the "friendly" names for the serial ports
installed on a system, yet I also need to query the names required to
connect to that port.
ie I enumerate the friendly names of the Ports using the
SetupDiGetDeviceRegistryProperty api call passing SPDRP_FRIENDLYNAME to get
the friendly name "Prolific USB-to-Serial Comm Port (COM3)", but I also need
to know how to get the "COM3" part on its own.
I tried changing the SPDRP_FRIENDLYNAME to several other possible
parameters available to that api call but didn't get "COM3" from any of
them.



SetupDiGetDeviceRegistryProperty(NewDeviceInfoSet,
DeviceInfoData,
SPDRP_FRIENDLYNAME,
0,
DeviceName,
MAX_DEV_LEN,
IntPtr.Zero) )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top