Browse Source

Allow the Escape key to close the GUI.

Turns out IDCANCEL is a magic resource name.  If a button has that name
it automatically responds to Escape.
Iain Patterson 9 years ago
parent
commit
44d8d66023
3 changed files with 6 additions and 4 deletions
  1. 2 0
      ChangeLog.txt
  2. 1 1
      gui.cpp
  3. 3 3
      nssm.rc

+ 2 - 0
ChangeLog.txt

@@ -3,6 +3,8 @@ Changes since 2.17
   * Timeouts for each shutdown method can be configured in
     the registry.
 
+  * The GUI is slightly less sucky.
+
 Changes since 2.16
 -----------------
   * NSSM can now redirect the service's I/O streams to any path

+ 1 - 1
gui.cpp

@@ -209,7 +209,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {
           break;
 
         /* Cancel button */
-        case IDC_CANCEL:
+        case IDCANCEL:
           DestroyWindow(window);
           break;
 

+ 3 - 3
nssm.rc

@@ -70,7 +70,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 FONT 8, "MS Sans Serif"
 BEGIN
     DEFPUSHBUTTON   "Install service",IDC_OK,55,69,50,14
-    PUSHBUTTON      "Cancel",IDC_CANCEL,111,69,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,111,69,50,14
     EDITTEXT        IDC_PATH,48,7,110,14,ES_AUTOHSCROLL
     PUSHBUTTON      "Browse",IDC_BROWSE,163,7,50,14
     EDITTEXT        IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL
@@ -161,7 +161,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
 FONT 8, "MS Sans Serif"
 BEGIN
     DEFPUSHBUTTON   "Installer le service",IDC_OK,49,69,75,14
-    PUSHBUTTON      "Annuler",IDC_CANCEL,131,69,50,14
+    PUSHBUTTON      "Annuler",IDCANCEL,131,69,50,14
     EDITTEXT        IDC_PATH,48,7,110,14,ES_AUTOHSCROLL
     PUSHBUTTON      "Parcourir",IDC_BROWSE,163,7,50,14
     EDITTEXT        IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL
@@ -247,7 +247,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
 FONT 8, "MS Sans Serif"
 BEGIN
     DEFPUSHBUTTON   "Installa servizio",IDC_OK,49,69,58,14
-    PUSHBUTTON      "Annulla",IDC_CANCEL,111,69,50,14
+    PUSHBUTTON      "Annulla",IDCANCEL,111,69,50,14
     EDITTEXT        IDC_PATH,48,7,110,14,ES_AUTOHSCROLL
     PUSHBUTTON      "Sfoglia...",IDC_BROWSE,163,7,50,14
     EDITTEXT        IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL