From 95390bb866330af2a495a87db368886185bfd887 Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 28 Feb 2005 02:51:51 +0000 Subject: [PATCH] Make things other than Pageant use request_file(), why not, although all of its funkiness is switched off so the behaviour is the same as before. git-svn-id: svn://svn.tartarus.org/sgt/putty@5414 cda61777-01e9-0310-a592-d414129be87e --- windows/winctrls.c | 13 +------------ windows/winpgen.c | 11 +---------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/windows/winctrls.c b/windows/winctrls.c index 0fb4b9fc..4227c26f 100644 --- a/windows/winctrls.c +++ b/windows/winctrls.c @@ -1905,14 +1905,8 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg, HIWORD(wParam) == BN_DOUBLECLICKED))) { OPENFILENAME of; char filename[FILENAME_MAX]; - int ret; memset(&of, 0, sizeof(of)); -#ifdef OPENFILENAME_SIZE_VERSION_400 - of.lStructSize = OPENFILENAME_SIZE_VERSION_400; -#else - of.lStructSize = sizeof(of); -#endif of.hwndOwner = dp->hwnd; if (ctrl->fileselect.filter) of.lpstrFilter = ctrl->fileselect.filter; @@ -1925,14 +1919,9 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg, filename[lenof(filename)-1] = '\0'; of.nMaxFile = lenof(filename); of.lpstrFileTitle = NULL; - of.lpstrInitialDir = NULL; of.lpstrTitle = ctrl->fileselect.title; of.Flags = 0; - if (ctrl->fileselect.for_writing) - ret = GetSaveFileName(&of); - else - ret = GetOpenFileName(&of); - if (ret) { + if (request_file(NULL, &of, FALSE, ctrl->fileselect.for_writing)) { SetDlgItemText(dp->hwnd, c->base_id + 1, filename); ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE); } diff --git a/windows/winpgen.c b/windows/winpgen.c index dae9f93f..1e2075de 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -198,11 +198,6 @@ static int prompt_keyfile(HWND hwnd, char *dlgtitle, { OPENFILENAME of; memset(&of, 0, sizeof(of)); -#ifdef OPENFILENAME_SIZE_VERSION_400 - of.lStructSize = OPENFILENAME_SIZE_VERSION_400; -#else - of.lStructSize = sizeof(of); -#endif of.hwndOwner = hwnd; if (ppk) { of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0" @@ -217,13 +212,9 @@ static int prompt_keyfile(HWND hwnd, char *dlgtitle, *filename = '\0'; of.nMaxFile = FILENAME_MAX; of.lpstrFileTitle = NULL; - of.lpstrInitialDir = NULL; of.lpstrTitle = dlgtitle; of.Flags = 0; - if (save) - return GetSaveFileName(&of); - else - return GetOpenFileName(&of); + return request_file(NULL, &of, FALSE, save); } /* -- 2.11.0