summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Native_File_Chooser_WIN32.cxx7
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;