Fix an issue where sometimes the window proc would throw exceptions and crash the plugin
This commit is contained in:
parent
cdf05d2913
commit
f0a5a48c73
@ -66,7 +66,6 @@ public class DialAction : EncoderBase
|
||||
_thread.SetApartmentState(ApartmentState.STA);
|
||||
_thread.Start();
|
||||
|
||||
|
||||
_currentAudioSession = settings.FallbackBehavior == FallbackBehavior.SystemSounds ? _audioHelper.GetSystemSounds() : _audioHelper.GetSystemVolume();
|
||||
}
|
||||
|
||||
@ -208,9 +207,16 @@ public class DialAction : EncoderBase
|
||||
|
||||
|
||||
public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnTick();
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Exception on WinEventProc\n {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
"Name": "Focused Application Volume",
|
||||
"Description": "Control the volume of the focused application",
|
||||
"URL": "https://github.com/dlprows/FocusVolumeControl",
|
||||
"Version": "1.0.0",
|
||||
"Version": "1.0.1",
|
||||
"CodePath": "FocusVolumeControl",
|
||||
"Category": "Volume Control [dlprows]",
|
||||
"Icon": "Images/pluginIcon",
|
||||
|
Loading…
Reference in New Issue
Block a user