0

I have written in C# a simple application to list all COM ports in PC. It saves me a lot of time since I work with multiple USB to serial converters. I would like to have a fast access to changing COM port number for selected adapter.

I display them in ListBox. I would like to open Property page or Advanced settings window when right clicking on an item (like Device Manager does in popup menu Properties).

For listing devices I use:

ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity WHERE Name LIKE \"%(COM%\"");

I found that in WINAPI there exists fuction SerialDisplayAdvancedSettings but I have no idea how to access it in C# and how to provide its parameters.

Is there a way how to display system Property dialog for selected COM port device?

  • Wrong way around. It is the device driver author that uses this function to display his custom property page. He needs to do this in his property page provider, a "plugin" that Device Manager uses. Not everything that DM does is exposed in an api. – Hans Passant May 10 '16 at 15:35

1 Answers1

0

You can use P/Invoke to call the WINAPI function from your C# code. pinvoke.net has examples although not specifically for the function in which you are interested. But there's enough info there to help you.

Marc Sherman
  • 2,303
  • 14
  • 22