tWin32 file open dialog tidied up; using this dialog no longer messes with the current working directory. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d82c8d7b77651eb9b1138e147b051f944b119d59
(DIR) parent f1fab42162b3785c602eda435fafc51b6d1b8dac
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Mon, 8 Jul 2002 12:50:33 +0000
Win32 file open dialog tidied up; using this dialog no longer messes with
tthe current working directory.
Diffstat:
M src/gtkport/gtkport.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -5054,20 +5054,22 @@ gchar *GtkGetFile(const GtkWidget *parent, const gchar *oldname,
const gchar *title)
{
OPENFILENAME ofn;
- char file[800], filetitle[800];
+ char file[800];
- memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = parent ? parent->hWnd : NULL;
+ ofn.hInstance = NULL;
ofn.lpstrFilter = NULL;
- ofn.nFilterIndex = 0;
+ ofn.lpstrCustomFilter = NULL;
+ ofn.nFilterIndex = 1;
ofn.lpstrFile = file;
ofn.nMaxFile = sizeof(file);
- ofn.lpstrFileTitle = filetitle;
- ofn.nMaxFileTitle = sizeof(filetitle);
+ ofn.lpstrFileTitle = NULL;
+ ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
+ ofn.lpstrTitle = title;
+ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
ofn.lpstrDefExt = NULL;
- ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if (GetOpenFileName(&ofn)) {
return g_strdup(file);
} else {