mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
Added UnregisterNotify call
This commit is contained in:
parent
2029cc5531
commit
7d871c0709
@ -62,8 +62,9 @@ namespace DS4Windows
|
||||
{ "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion,
|
||||
string.Empty, string.Empty, string.Empty, string.Empty };
|
||||
|
||||
internal const string UPDATER_VERSION = "1.2.8.0";
|
||||
internal static int WM_QUERYENDSESSION = 0x11;
|
||||
private const string UPDATER_VERSION = "1.2.8.0";
|
||||
private const int WM_QUERYENDSESSION = 0x11;
|
||||
private const int WM_CLOSE = 0x10;
|
||||
internal string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe";
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@ -1041,7 +1042,9 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
private const int DBT_DEVICEREMOVECOMPLETE = 0x8004;
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == ScpDevice.WM_CREATE)
|
||||
switch (m.Msg)
|
||||
{
|
||||
case ScpDevice.WM_CREATE:
|
||||
{
|
||||
Guid hidGuid = new Guid();
|
||||
NativeMethods.HidD_GetHidGuid(ref hidGuid);
|
||||
@ -1052,8 +1055,9 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
ScpForm_Closing(this,
|
||||
new FormClosingEventArgs(CloseReason.ApplicationExitCall, false));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
||||
case ScpDevice.WM_DEVICECHANGE:
|
||||
{
|
||||
if (runHotPlug)
|
||||
{
|
||||
@ -1073,10 +1077,20 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (m.Msg == WM_QUERYENDSESSION)
|
||||
case WM_CLOSE:
|
||||
{
|
||||
ScpDevice.UnregisterNotify(Handle);
|
||||
break;
|
||||
}
|
||||
case WM_QUERYENDSESSION:
|
||||
{
|
||||
systemShutdown = true;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
// If this is WM_QUERYENDSESSION, the closing event should be
|
||||
// raised in the base WndProc.
|
||||
|
Loading…
Reference in New Issue
Block a user