X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=gui.cpp;h=5aaf016892a1147ffe7e78bcc9e1904592557585;hb=98a2516c22eefd912301ff3c39736da8970dcdff;hp=84fd4c26df98c12f175f67d3d6264ae710247ad9;hpb=ce9eb5d4646a0e279eae2909a18fccb1197e15fb;p=nssm.git diff --git a/gui.cpp b/gui.cpp index 84fd4c2..5aaf016 100644 --- a/gui.cpp +++ b/gui.cpp @@ -28,6 +28,7 @@ int nssm_gui(int resource, char *name) { /* Go! */ MSG message; while (GetMessage(&message, 0, 0, 0)) { + if (IsDialogMessage(dlg, &message)) continue; TranslateMessage(&message); DispatchMessage(&message); } @@ -204,11 +205,11 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { switch (LOWORD(w)) { /* OK button */ case IDC_OK: - PostQuitMessage(install(window)); + if (! install(window)) PostQuitMessage(0); break; /* Cancel button */ - case IDC_CANCEL: + case IDCANCEL: DestroyWindow(window); break; @@ -219,7 +220,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { /* Remove button */ case IDC_REMOVE: - PostQuitMessage(remove(window)); + if (! remove(window)) PostQuitMessage(0); break; } return 1;