mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
Trimmed WndProc method
This commit is contained in:
parent
a7b5b2ff35
commit
a3943728e3
@ -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 (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
||||
if (runHotPlug)
|
||||
{
|
||||
if (runHotPlug)
|
||||
Int32 Type = m.WParam.ToInt32();
|
||||
if (Type == DBT_DEVNODES_CHANGED)
|
||||
{
|
||||
Int32 Type = m.WParam.ToInt32();
|
||||
lock (hotplugCounterLock)
|
||||
{
|
||||
hotplugCounter++;
|
||||
@ -1009,19 +1010,18 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
if (!inHotPlug)
|
||||
{
|
||||
inHotPlug = true;
|
||||
TaskRunner.Run(() => { Thread.Sleep(1500); InnerHotplug2(uiContext); });
|
||||
TaskRunner.Run(() => { Thread.Sleep(1500); InnerHotplug2(uiContext); });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user