@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetCommModemStatus API !!!!C# Signature: [DllImport("kernel32.dll")] static extern bool GetCommModemStatus(SafeFileHandle hFile, out uint lpModemStat); !!!!User-Defined Types: None. !!!!Notes: Get the SafeFileHandle from call to CreateFile !!!!Tips & Tricks: Please add some! !!!!Sample Code: const uint MS_CTS_ON = 16; uint LastCtsStat; // watching for CTS (Clear To Send) void watchdog_Tick(object sender, EventArgs e) { if (!hComPort.IsInvalid) { uint stat; GetCommModemStatus(hComPort, out stat); if (stat == MS_CTS_ON) { if (LastCtsStat == 0) { LastCtsStat = 1; CTSEvent(true); // invoke event handler } } else { if (LastCtsStat >= 1) { LastCtsStat = 0; CTSEvent(false); } } } } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: GetCommModemStatus@msdn on MSDN
Edit kernel32.GetCommM...
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.