fix exception when capture new windows

This commit is contained in:
Kang Yu 2024-08-18 15:23:09 -07:00
parent 4cece1ab9c
commit 1e580843ff

View file

@ -1180,6 +1180,9 @@ namespace PersistentWindows.Common
if (string.IsNullOrEmpty(className)) if (string.IsNullOrEmpty(className))
return -1; return -1;
if (!windowProcessName.ContainsKey(hwnd))
return -1;
string procName = windowProcessName[hwnd]; string procName = windowProcessName[hwnd];
string title = GetWindowTitle(hwnd); string title = GetWindowTitle(hwnd);
if (className.Equals("ApplicationFrameWindow")) if (className.Equals("ApplicationFrameWindow"))