Trimmed WndProc method

This commit is contained in:
Travis Nickles 2018-07-16 17:29:05 -05:00
parent a7b5b2ff35
commit a3943728e3

View File

@ -991,15 +991,16 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
private bool inHotPlug = false;
private int hotplugCounter = 0;
private object hotplugCounterLock = new object();
private const int DBT_DEVNODES_CHANGED = 0x0007;
protected override void WndProc(ref Message m)
{
try
{
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
{
if (runHotPlug)
{
Int32 Type = m.WParam.ToInt32();
if (Type == DBT_DEVNODES_CHANGED)
{
lock (hotplugCounterLock)
{
hotplugCounter++;
@ -1014,14 +1015,13 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
}
}
}
catch { }
if (m.Msg == WM_QUERYENDSESSION)
systemShutdown = true;
// If this is WM_QUERYENDSESSION, the closing event should be
// raised in the base WndProc.
try { base.WndProc(ref m); }
catch { }
base.WndProc(ref m);
}
private void InnerHotplug2(SynchronizationContext uiContext)