Added captions to MessageBoxes

This commit is contained in:
EnderIce2 2024-04-04 04:05:53 +03:00
parent 299408d10e
commit 7461479cbb
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
3 changed files with 29 additions and 11 deletions

View File

@ -461,8 +461,11 @@ NewConnection:
print("Pipe already exists: %s\n", print("Pipe already exists: %s\n",
GetErrorMessage()); GetErrorMessage());
if (!RunningAsService) if (!RunningAsService)
{
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "Pipe already exists",
MB_OK | MB_ICONSTOP);
}
ExitProcess(1); ExitProcess(1);
} }
@ -477,8 +480,11 @@ NewConnection:
print("Failed to create pipe: %s\n", print("Failed to create pipe: %s\n",
GetErrorMessage()); GetErrorMessage());
if (!RunningAsService) if (!RunningAsService)
{
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "Failed to create pipe",
MB_OK | MB_ICONSTOP);
}
ExitProcess(1); ExitProcess(1);
} }
@ -537,7 +543,11 @@ NewConnection:
{ {
print("Failed to create threads: %s\n", GetErrorMessage()); print("Failed to create threads: %s\n", GetErrorMessage());
if (!RunningAsService) if (!RunningAsService)
MessageBox(NULL, GetErrorMessage(), NULL, MB_OK | MB_ICONSTOP); {
MessageBox(NULL, GetErrorMessage(),
"Failed to create threads",
MB_OK | MB_ICONSTOP);
}
ExitProcess(1); ExitProcess(1);
} }

9
game.c
View File

@ -55,7 +55,8 @@ void LaunchGame(int argc, char **argv)
if (!GetBinaryType(argv[1], &dwBinaryType)) if (!GetBinaryType(argv[1], &dwBinaryType))
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "GetBinaryType",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
print("Executable type: %d\n", dwBinaryType); print("Executable type: %d\n", dwBinaryType);
@ -104,7 +105,8 @@ void LaunchGame(int argc, char **argv)
if (!CreateProcess(gamePath, gameArgs, NULL, NULL, FALSE, if (!CreateProcess(gamePath, gameArgs, NULL, NULL, FALSE,
0, NULL, NULL, &game_si, &game_pi)) 0, NULL, NULL, &game_si, &game_pi))
{ {
MessageBox(NULL, GetErrorMessage(), NULL, MB_OK | MB_ICONSTOP); MessageBox(NULL, GetErrorMessage(),
"CreateProcess", MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
LocalFree(gameArgs); LocalFree(gameArgs);
@ -136,7 +138,8 @@ void LaunchGame(int argc, char **argv)
} }
else else
{ {
MessageBox(NULL, GetErrorMessage(), NULL, MB_OK | MB_ICONSTOP); MessageBox(NULL, GetErrorMessage(),
"CreateToolhelp32Snapshot", MB_OK | MB_ICONSTOP);
ExitProcess(0); ExitProcess(0);
} }

View File

@ -113,7 +113,8 @@ void InstallService()
if (schSCManager == NULL) if (schSCManager == NULL)
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "OpenSCManager",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
@ -128,7 +129,8 @@ void InstallService()
if (schService == NULL) if (schService == NULL)
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "CreateService",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
else else
@ -156,7 +158,8 @@ void RemoveService()
if (schSCManager == NULL) if (schSCManager == NULL)
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "OpenSCManager",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
@ -166,7 +169,8 @@ void RemoveService()
if (schService == NULL) if (schService == NULL)
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "OpenService",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }
@ -195,7 +199,8 @@ void RemoveService()
if (!DeleteService(schService)) if (!DeleteService(schService))
{ {
MessageBox(NULL, GetErrorMessage(), MessageBox(NULL, GetErrorMessage(),
NULL, MB_OK | MB_ICONSTOP); "DeleteService",
MB_OK | MB_ICONSTOP);
ExitProcess(1); ExitProcess(1);
} }