diff --git a/windows/QMK Toolbox/MainWindow.cs b/windows/QMK Toolbox/MainWindow.cs index cfce656636..8b88afddd1 100644 --- a/windows/QMK Toolbox/MainWindow.cs +++ b/windows/QMK Toolbox/MainWindow.cs @@ -12,6 +12,7 @@ using System.IO; using System.Linq; using System.Net.Http; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace QMK_Toolbox @@ -81,7 +82,16 @@ private void MainWindow_Load(object sender, EventArgs e) usbListener.bootloaderDeviceConnected += BootloaderDeviceConnected; usbListener.bootloaderDeviceDisconnected += BootloaderDeviceDisconnected; usbListener.outputReceived += BootloaderCommandOutputReceived; - usbListener.Start(); + + try + { + usbListener.Start(); + } + catch (COMException e) + { + logTextBox.LogError("USB device enumeration failed."); + logTextBox.LogError($"{e}"); + } if (_filePassedIn != string.Empty) {