RS spawns two processes, one of which complains about Steam not being active. We find that one and close it.
| 17 | /// We find that one and close it. |
| 18 | /// </summary> |
| 19 | HANDLE GetMessageBoxProcess() |
| 20 | { |
| 21 | HWND hWnd = FindWindowW(L"#32770", L"Error."); // Dialog box class |
| 22 | if (!hWnd) { |
| 23 | return nullptr; |
| 24 | } |
| 25 | |
| 26 | DWORD dwProcessId = 0; |
| 27 | GetWindowThreadProcessId(hWnd, &dwProcessId); |
| 28 | if (dwProcessId == 0) { |
| 29 | return nullptr; |
| 30 | } |
| 31 | |
| 32 | return OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_TERMINATE, FALSE, dwProcessId); |
| 33 | } |
| 34 | |
| 35 | /// <summary> |
| 36 | /// Stops the game from starting two instances |
no outgoing calls
no test coverage detected