Don't automatically close the GUI on error.
[nssm.git] / gui.cpp
diff --git a/gui.cpp b/gui.cpp
index 7955b1a..c45347f 100644 (file)
--- a/gui.cpp
+++ b/gui.cpp
@@ -205,7 +205,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {
       switch (LOWORD(w)) {\r
         /* OK button */\r
         case IDC_OK:\r
-          PostQuitMessage(install(window));\r
+          if (! install(window)) PostQuitMessage(0);\r
           break;\r
 \r
         /* Cancel button */\r
@@ -220,7 +220,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {
 \r
         /* Remove button */\r
         case IDC_REMOVE:\r
-          PostQuitMessage(remove(window));\r
+          if (! remove(window)) PostQuitMessage(0);\r
           break;\r
       }\r
       return 1;\r