From 475eebf93799a91094532644799a2cdde46a14cf Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 23 Jan 2001 17:37:52 +0000 Subject: [PATCH] Roman Pompejus's fix for the TAB-not-working-in-Event-Log bug git-svn-id: svn://svn.tartarus.org/sgt/putty@891 cda61777-01e9-0310-a592-d414129be87e --- putty.h | 6 ++++++ windlg.c | 16 +++++----------- window.c | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/putty.h b/putty.h index b618dd98..20eea8b3 100644 --- a/putty.h +++ b/putty.h @@ -85,6 +85,12 @@ GLOBAL int session_closed; 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 diff --git a/windlg.c b/windlg.c index 7a546541..18d1abae 100644 --- a/windlg.c +++ b/windlg.c @@ -13,8 +13,6 @@ static char **events = NULL; static int nevents = 0, negsize = 0; -static HWND logbox = NULL, abtbox = NULL; - static int readytogo; void force_normal(HWND hwnd) @@ -56,6 +54,7 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: + case IDCANCEL: logbox = NULL; DestroyWindow (hwnd); return 0; @@ -145,8 +144,8 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg, 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); @@ -158,8 +157,7 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg, } return 0; case WM_CLOSE: - abtbox = NULL; - DestroyWindow (hwnd); + EndDialog(hwnd, TRUE); return 0; } return 0; @@ -1996,11 +1994,7 @@ void showeventlog (HWND hwnd) { } 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, diff --git a/window.c b/window.c index 2e68239c..cd4d5391 100644 --- a/window.c +++ b/window.c @@ -564,7 +564,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { } 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); -- 2.11.0