X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/d3a1a808f65812c591ef0de3e61a94b13aa73160..afb2076da15d8e2d22578c5e18edae725d085b4b:/pageant.c diff --git a/pageant.c b/pageant.c index d12e02b4..2b77dfc7 100644 --- a/pageant.c +++ b/pageant.c @@ -607,7 +607,7 @@ static void add_keyfile(char *filename) agent_query(request, reqlen, &vresponse, &resplen); response = vresponse; if (resplen < 5 || response[4] != SSH_AGENT_SUCCESS) - MessageBox(NULL, "The already running Pageant" + MessageBox(NULL, "The already running Pageant " "refused to add the key.", APPNAME, MB_OK | MB_ICONERROR); @@ -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) {