mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Corrected unregister notify call
Changed location and corrected used handle
This commit is contained in:
parent
dfcc3250cf
commit
687ff05948
@ -57,6 +57,7 @@ namespace DS4Windows
|
||||
bool turnOffTemp;
|
||||
bool runningBat;
|
||||
private bool changingService;
|
||||
private IntPtr regHandle = new IntPtr();
|
||||
private static DS4Form instance;
|
||||
Dictionary<Control, string> hoverTextDict = new Dictionary<Control, string>();
|
||||
// 0 index is used for application version text. 1 - 4 indices are used for controller status
|
||||
@ -1049,8 +1050,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
{
|
||||
Guid hidGuid = new Guid();
|
||||
NativeMethods.HidD_GetHidGuid(ref hidGuid);
|
||||
IntPtr outHandle = new IntPtr();
|
||||
bool result = ScpDevice.RegisterNotify(this.Handle, hidGuid, ref outHandle);
|
||||
bool result = ScpDevice.RegisterNotify(this.Handle, hidGuid, ref regHandle);
|
||||
if (!result)
|
||||
{
|
||||
ScpForm_Closing(this,
|
||||
@ -1080,11 +1080,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
{
|
||||
ScpDevice.UnregisterNotify(Handle);
|
||||
break;
|
||||
}
|
||||
case WM_QUERYENDSESSION:
|
||||
{
|
||||
systemShutdown = true;
|
||||
@ -2176,6 +2171,14 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScpDevice.UnregisterNotify(regHandle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ScpDevice.UnregisterNotify(Handle);
|
||||
}
|
||||
}
|
||||
else if (userClosing && closeMini && !contextclose)
|
||||
|
Loading…
Reference in New Issue
Block a user