diff options
| author | Manolo Gouy <Manolo> | 2014-06-24 15:06:24 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2014-06-24 15:06:24 +0000 |
| commit | 10caca062ad7e6a7fa8d83235611a889988cb1e4 (patch) | |
| tree | 485a6deb6a4ab94b38385946e6f6f47e0dc66209 /src/Fl_Native_File_Chooser_WIN32.cxx | |
| parent | f7f820ed4c729240da8100d1d157700114235757 (diff) | |
Fixed error when browsing for a directory and using a non-ascii starting directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10207 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Native_File_Chooser_WIN32.cxx')
| -rw-r--r-- | src/Fl_Native_File_Chooser_WIN32.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx index 3d5dfae77..8ca7a91bf 100644 --- a/src/Fl_Native_File_Chooser_WIN32.cxx +++ b/src/Fl_Native_File_Chooser_WIN32.cxx @@ -441,7 +441,7 @@ int Fl_Native_File_Chooser::showfile() { int CALLBACK Fl_Native_File_Chooser::Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) { switch (msg) { case BFFM_INITIALIZED: - if (data) ::SendMessage(win, BFFM_SETSELECTION, TRUE, data); + if (data) ::SendMessage(win, BFFM_SETSELECTIONW, TRUE, data); break; case BFFM_SELCHANGED: TCHAR path[FNFC_MAX_PATH]; @@ -518,10 +518,11 @@ int Fl_Native_File_Chooser::showdir() { _binf.pszDisplayName = displayname; // PRESET DIR - char presetname[FNFC_MAX_PATH]; + WCHAR presetname[FNFC_MAX_PATH]; if ( _directory ) { - strcpy(presetname, _directory); // Unix2Win(presetname); + wcsncpy(presetname, utf8towchar(_directory), FNFC_MAX_PATH); + presetname[FNFC_MAX_PATH-1] = 0; _binf.lParam = (LPARAM)presetname; } else _binf.lParam = 0; |
