@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: SerialDisplayAdvancedSettings displays the system-supplied advanced settings dialog box for a specified COM port device. !!!!C# Signature: [DllImport("msports.dll", SetLastError=true)] static extern int SerialDisplayAdvancedSettings(IntPtr parentHwnd, IntPtr deviceInfoSet, ref SP_DEVINFO_DATA deviceInfoData); !!!!VB Signature: Declare Function SerialDisplayAdvancedSettings Lib "msports.dll" (TODO) As TODO !!!!User-Defined Types: [SP_DEVINFO_DATA] !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: var deviceClassGuid = Guid.Parse("{4d36e978-e325-11ce-bfc1-08002be10318}"); // Ports class GUID const int DIGCF_PRESENT = 0x2; IntPtr deviceInfoSetHandle = NativeMethods.SetupDiGetClassDevs(ref deviceClassGuid, null, IntPtr.Zero, DIGCF_PRESENT); try { // search frendlyName and open advanced settings var deviceInfoData = new SP_DEVINFO_DATA(); deviceInfoData.CbSize = (uint)Marshal.SizeOf(deviceInfoData); uint index = 0; while (NativeMethods.SetupDiEnumDeviceInfo(deviceInfoSetHandle, index++, ref deviceInfoData)) { var buffer = new byte[300]; const uint SPDRP_FRIENDLYNAME = 0xC; NativeMethods.SetupDiGetDeviceRegistryProperty(deviceInfoSetHandle, ref deviceInfoData, SPDRP_FRIENDLYNAME, out var _, buffer, (uint)buffer.Length, out var _); var friendlyName = Encoding.Unicode.GetString(buffer).TrimEnd('\0'); if (friendlyName == "...") { NativeMethods.SerialDisplayAdvancedSettings(IntPtr.Zero, deviceInfoSetHandle, ref deviceInfoData); return; } } } finally { NativeMethods.SetupDiDestroyDeviceInfoList(deviceInfoSetHandle); } Documentation: SerialDisplayAdvancedSettings@msdn on MSDN
Edit msports.SerialDis...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.