Skip to content

Commit

Permalink
Raise error if manual terminatino fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eschan145 committed Jan 25, 2025
1 parent 544007e commit b822ebe
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,28 @@ void Application::manage_command(

// If it does, terminate its process
if (selected && strlen(selected) > 0) {
dieknow::close_application_by_exe(selected);

std::string message = "Successfully closed " +
std::string(selected);
MessageBox(
hwnd,
message.c_str(),
"Success",
MB_ICONINFORMATION
);
bool result = dieknow::close_application_by_exe(selected);

if (result) {
std::string message = "Successfully closed " +
std::string(selected);
MessageBox(
hwnd,
message.c_str(),
"Success",
MB_ICONINFORMATION
);
} else {
std::string message = "Failed to close " +
std::string(selected) + "!. It may not be running.";

MessageBox(
hwnd,
message.c_str(),
"Failed",
MB_ICONERROR
);
}
} else {
// Display an error if it doesn't
MessageBox(
Expand Down

0 comments on commit b822ebe

Please sign in to comment.