catch exception in WinEventProc()

This commit is contained in:
Kang Yu 2024-07-26 21:58:48 -07:00
parent db6ca09f65
commit 185b34268c

View file

@ -1513,6 +1513,18 @@ namespace PersistentWindows.Common
} }
private void WinEventProc(IntPtr hWinEventHook, User32Events eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) private void WinEventProc(IntPtr hWinEventHook, User32Events eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{
try
{
WinEventProcCore(hWinEventHook, eventType, hwnd, idObject, idChild, dwEventThread, dwmsEventTime);
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}
private void WinEventProcCore(IntPtr hWinEventHook, User32Events eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{ {
if (!initialized) if (!initialized)
return; return;