diff options
author | nijtmans <nijtmans> | 2010-04-19 13:49:23 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-04-19 13:49:23 (GMT) |
commit | 778527e9aa2406a8e5e59eed40e3067163b7311a (patch) | |
tree | 8527adbf3e46181d11c733b43398f0a59f497665 | |
parent | ae65a4c29ddb9e67779bcf13d9d438fa146fd0da (diff) | |
download | tk-778527e9aa2406a8e5e59eed40e3067163b7311a.zip tk-778527e9aa2406a8e5e59eed40e3067163b7311a.tar.gz tk-778527e9aa2406a8e5e59eed40e3067163b7311a.tar.bz2 |
[Patch 2898255]: Filenames limit with Tk_GetFileName()
Assure modern style dialogs where available
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | win/tkWinDialog.c | 16 |
2 files changed, 15 insertions, 3 deletions
@@ -2,6 +2,8 @@ * win/tkWinDialog.c Fix [Bug 2987995]: Tk_GetOpenFile returns garbage under described circumstances + * win/tkWinDialog.c [Patch 2898255]: Filenames limit with Tk_GetFileName() + Assure modern style dialogs where availab.e 2010-04-13 Jan Nijtmans <nijtmans@users.sf.net> diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 9e2ebe2..7c9ebbb 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,10 +8,12 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.71 2010/04/19 11:05:33 nijtmans Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.72 2010/04/19 13:49:24 nijtmans Exp $ * */ +#define WINVER 0x0500 /* Requires Windows 2K definitions */ +#define _WIN32_WINNT 0x0500 #include "tkWinInt.h" #include "tkFileFilter.h" #include "tkFont.h" @@ -721,7 +723,11 @@ GetFileNameW( hWnd = Tk_GetHWND(Tk_WindowId(tkwin)); ZeroMemory(&ofn, sizeof(OPENFILENAMEW)); - ofn.lStructSize = sizeof(OPENFILENAMEW); + if (LOBYTE(LOWORD(GetVersion())) < 5) { + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; + } else { + ofn.lStructSize = sizeof(OPENFILENAMEW); + } ofn.hwndOwner = hWnd; ofn.hInstance = TkWinGetHInstance(ofn.hwndOwner); ofn.lpstrFile = (WCHAR *) file; @@ -1242,7 +1248,11 @@ GetFileNameA( hWnd = Tk_GetHWND(Tk_WindowId(tkwin)); ZeroMemory(&ofn, sizeof(OPENFILENAMEA)); - ofn.lStructSize = sizeof(ofn); + if (LOBYTE(LOWORD(GetVersion())) < 5) { + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; + } else { + ofn.lStructSize = sizeof(ofn); + } ofn.hwndOwner = hWnd; ofn.hInstance = TkWinGetHInstance(ofn.hwndOwner); ofn.lpstrFilter = NULL; |