From afb2076da15d8e2d22578c5e18edae725d085b4b Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 26 Sep 2002 17:57:44 +0000 Subject: [PATCH] If the user asks for the Pageant key list window and it's already present, bring it to the front. git-svn-id: svn://svn.tartarus.org/sgt/putty@1980 cda61777-01e9-0310-a592-d414129be87e --- pageant.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pageant.c b/pageant.c index 4cbc8aee..2b77dfc7 100644 --- a/pageant.c +++ b/pageant.c @@ -1596,14 +1596,17 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, keylist = CreateDialog(instance, MAKEINTRESOURCE(211), NULL, KeyListProc); ShowWindow(keylist, SW_SHOWNORMAL); - /* - * Sometimes the window comes up minimised / hidden - * for no obvious reason. Prevent this. - */ - SetForegroundWindow(keylist); - SetWindowPos(keylist, HWND_TOP, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); } + /* + * Sometimes the window comes up minimised / hidden for + * no obvious reason. Prevent this. This also brings it + * to the front if it's already present (the user + * selected View Keys because they wanted to _see_ the + * thing). + */ + SetForegroundWindow(keylist); + SetWindowPos(keylist, HWND_TOP, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); break; case IDM_ADDKEY: if (passphrase_box) { -- 2.11.0