Skip to content

Commit 45754dc

Browse files
authored
[IE] Check process ID when searching for Edge window handle (#10582)
1 parent 1395ca5 commit 45754dc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cpp/iedriver/BrowserFactory.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,14 @@ BOOL CALLBACK BrowserFactory::FindEdgeWindow(HWND hwnd, LPARAM arg) {
10871087
// continue if it is not "Chrome_WidgetWin_1"
10881088
if (strcmp(ANDIE_FRAME_WINDOW_CLASS, name) != 0) return TRUE;
10891089

1090+
// continue if window does not belong to the target process
1091+
DWORD process_id = NULL;
1092+
::GetWindowThreadProcessId(hwnd, &process_id);
1093+
ProcessWindowInfo* process_window_info = reinterpret_cast<ProcessWindowInfo*>(arg);
1094+
if (process_window_info->dwProcessId != process_id) {
1095+
return TRUE;
1096+
}
1097+
10901098
return EnumChildWindows(hwnd, FindEdgeChildWindowForProcess, arg);
10911099
}
10921100

0 commit comments

Comments
 (0)