MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / GetMessageBoxProcess

Function GetMessageBoxProcess

DLL/QualityOfLife.cpp:19–33  ·  view source on GitHub ↗

RS spawns two processes, one of which complains about Steam not being active. We find that one and close it.

Source from the content-addressed store, hash-verified

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

Callers 1

StopTwoRSInstancesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected