return 0;
}
+static HWND passphrase_box;
+
/*
* Dialog-box function for the passphrase box.
*/
switch (msg) {
case WM_INITDIALOG:
+ passphrase_box = hwnd;
/*
* Centre the window.
*/
int dlgret;
dlgret = DialogBoxParam(instance, MAKEINTRESOURCE(210),
NULL, PassphraseProc, (LPARAM) & pps);
+ passphrase_box = NULL;
if (!dlgret) {
if (comment)
sfree(comment);
case 101: /* add key */
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
+ if (passphrase_box) {
+ MessageBeep(MB_ICONERROR);
+ SetForegroundWindow(passphrase_box);
+ break;
+ }
prompt_add_keyfile();
}
return 0;
case WM_SYSCOMMAND:
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
case IDM_CLOSE:
+ if (passphrase_box)
+ SendMessage(passphrase_box, WM_CLOSE, 0, 0);
SendMessage(hwnd, WM_CLOSE, 0, 0);
break;
case IDM_VIEWKEYS:
}
break;
case IDM_ADDKEY:
+ if (passphrase_box) {
+ MessageBeep(MB_ICONERROR);
+ SetForegroundWindow(passphrase_box);
+ break;
+ }
prompt_add_keyfile();
break;
case IDM_ABOUT: