GLOBAL char *logfile;
/*
+ * Window handles for the dialog boxes that can be running during a
+ * PuTTY session.
+ */
+GLOBAL HWND logbox;
+
+/*
* I've just looked in the windows standard headr files for WM_USER, there
* are hundreds of flags defined using the form WM_USER+123 so I've
* renumbered this NETEVENT value and the two in window.c
static char **events = NULL;
static int nevents = 0, negsize = 0;
-static HWND logbox = NULL, abtbox = NULL;
-
static int readytogo;
void force_normal(HWND hwnd)
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
+ case IDCANCEL:
logbox = NULL;
DestroyWindow (hwnd);
return 0;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- abtbox = NULL;
- DestroyWindow (hwnd);
+ case IDCANCEL:
+ EndDialog(hwnd, TRUE);
return 0;
case IDA_LICENCE:
EnableWindow(hwnd, 0);
}
return 0;
case WM_CLOSE:
- abtbox = NULL;
- DestroyWindow (hwnd);
+ EndDialog(hwnd, TRUE);
return 0;
}
return 0;
}
void showabout (HWND hwnd) {
- if (!abtbox) {
- abtbox = CreateDialog (hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),
- hwnd, AboutProc);
- ShowWindow (abtbox, SW_SHOWNORMAL);
- }
+ DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),hwnd, AboutProc);
}
void verify_ssh_host_key(char *host, int port, char *keytype,
}
if(!timer_id)
timer_id = SetTimer(hwnd, 1, 20, NULL);
- DispatchMessage (&msg);
+ if (!(IsWindow(logbox) && IsDialogMessage(logbox, &msg)))
+ DispatchMessage (&msg);
/* Make sure we blink everything that needs it. */
term_blink(0);