Rene Post's other patch: PuTTYgen was generating double file dialogs
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 14 May 2003 18:53:28 +0000 (18:53 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 14 May 2003 18:53:28 +0000 (18:53 +0000)
by mistake.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3196 cda61777-01e9-0310-a592-d414129be87e

puttygen.c

index e16b4f3..8ce452a 100644 (file)
@@ -1107,6 +1107,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
          case IDC_SAVE:
           case IDC_EXPORT_OPENSSH:
           case IDC_EXPORT_SSHCOM:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (state->key_exists) {
@@ -1200,6 +1202,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
            }
            break;
          case IDC_SAVEPUB:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (state->key_exists) {
@@ -1233,6 +1237,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
            break;
          case IDC_LOAD:
          case IDC_IMPORT:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (!state->generation_thread_exists) {