[IE] Check process ID when searching for Edge window handle
@@ -1087,6 +1087,14 @@ BOOL CALLBACK BrowserFactory::FindEdgeWindow(HWND hwnd, LPARAM arg) {
// continue if it is not "Chrome_WidgetWin_1"
if (strcmp(ANDIE_FRAME_WINDOW_CLASS, name) != 0) return TRUE;
+ // continue if window does not belong to the target process
+ DWORD process_id = NULL;
+ ::GetWindowThreadProcessId(hwnd, &process_id);
+ ProcessWindowInfo* process_window_info = reinterpret_cast<ProcessWindowInfo*>(arg);
+ if (process_window_info->dwProcessId != process_id) {
+ return TRUE;
+ }
+
return EnumChildWindows(hwnd, FindEdgeChildWindowForProcess, arg);
}
