fix drag-and-drop with non-latin-1 chars in filename
svn: r2835
This commit is contained in:
parent
f14ecde023
commit
7c45b22d9d
|
@ -1593,21 +1593,24 @@ void wxWnd::OnDropFiles(WPARAM wParam)
|
||||||
POINT dropPoint;
|
POINT dropPoint;
|
||||||
WORD gwFilesDropped;
|
WORD gwFilesDropped;
|
||||||
char **files, *a_file;
|
char **files, *a_file;
|
||||||
int wIndex;
|
wchar_t *w_file;
|
||||||
|
int wIndex, len;
|
||||||
|
|
||||||
DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint);
|
DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint);
|
||||||
|
|
||||||
// Get the total number of files dropped
|
// Get the total number of files dropped
|
||||||
gwFilesDropped = (WORD)DragQueryFile ((HDROP)hFilesInfo,
|
gwFilesDropped = (WORD)DragQueryFile((HDROP)hFilesInfo,
|
||||||
(UINT)-1,
|
(UINT)-1,
|
||||||
(LPSTR)0,
|
(LPSTR)0,
|
||||||
(UINT)0);
|
(UINT)0);
|
||||||
|
|
||||||
files = new char *[gwFilesDropped];
|
files = new char *[gwFilesDropped];
|
||||||
|
|
||||||
for (wIndex=0; wIndex < (int)gwFilesDropped; wIndex++) {
|
for (wIndex=0; wIndex < (int)gwFilesDropped; wIndex++) {
|
||||||
DragQueryFile (hFilesInfo, wIndex, (LPSTR) wxBuffer, 1000);
|
len = DragQueryFileW(hFilesInfo, wIndex, NULL, 0);
|
||||||
a_file = copystring(wxBuffer);
|
w_file = new WXGC_ATOMIC wchar_t[len + 1];
|
||||||
|
DragQueryFileW(hFilesInfo, wIndex, w_file, len);
|
||||||
|
a_file = wxNARROW_STRING(w_file);
|
||||||
files[wIndex] = a_file;
|
files[wIndex] = a_file;
|
||||||
}
|
}
|
||||||
DragFinish (hFilesInfo);
|
DragFinish (hFilesInfo);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user