| 1180 | } |
| 1181 | |
| 1182 | BOOL CALLBACK BrowserFactory::FindChildWindowForProcess(HWND hwnd, LPARAM arg) { |
| 1183 | ProcessWindowInfo *process_window_info = reinterpret_cast<ProcessWindowInfo*>(arg); |
| 1184 | |
| 1185 | // Could this be an Internet Explorer Server window? |
| 1186 | // 25 == "Internet Explorer_Server\0" |
| 1187 | char name[25]; |
| 1188 | if (::GetClassNameA(hwnd, name, 25) == 0) { |
| 1189 | // No match found. Skip |
| 1190 | return TRUE; |
| 1191 | } |
| 1192 | |
| 1193 | if (strcmp(IE_SERVER_CHILD_WINDOW_CLASS, name) != 0) { |
| 1194 | return TRUE; |
| 1195 | } else { |
| 1196 | DWORD process_id = NULL; |
| 1197 | ::GetWindowThreadProcessId(hwnd, &process_id); |
| 1198 | LOG(DEBUG) << "Looking for " << process_window_info->dwProcessId; |
| 1199 | if (process_window_info->dwProcessId == process_id) { |
| 1200 | // Once we've found the first Internet Explorer_Server window |
| 1201 | // for the process we want, we can stop. |
| 1202 | process_window_info->hwndBrowser = hwnd; |
| 1203 | return FALSE; |
| 1204 | } |
| 1205 | } |
| 1206 | |
| 1207 | return TRUE; |
| 1208 | } |
| 1209 | |
| 1210 | BOOL CALLBACK BrowserFactory::FindEdgeChildWindowForProcess(HWND hwnd, LPARAM arg) { |
| 1211 | ProcessWindowInfo* process_window_info = reinterpret_cast<ProcessWindowInfo*>(arg); |