From: Iain Patterson Date: Fri, 15 Nov 2013 15:50:17 +0000 (+0000) Subject: Allow the Escape key to close the GUI. X-Git-Tag: v2.18~1 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=44d8d66023bbe08a0237f2b519f3332cee549d4b;p=nssm.git 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. --- diff --git a/ChangeLog.txt b/ChangeLog.txt index d4850a3..0317979 100644 --- a/ChangeLog.txt +++ b/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 diff --git a/gui.cpp b/gui.cpp index c45347f..5aaf016 100644 --- a/gui.cpp +++ b/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; diff --git a/nssm.rc b/nssm.rc index d7c9d3b..8574f6c 100644 --- a/nssm.rc +++ b/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