Commit e607973a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

skins2: assume Unicode filesystem on Windows

parent 28caaf85
...@@ -146,43 +146,22 @@ STDMETHODIMP Win32DragDrop::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState, ...@@ -146,43 +146,22 @@ STDMETHODIMP Win32DragDrop::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState,
void Win32DragDrop::HandleDrop( HDROP HDrop ) void Win32DragDrop::HandleDrop( HDROP HDrop )
{ {
if( GetVersion() < 0x80000000 ) // Get the number of dropped files
{ int nbFiles = DragQueryFileW( HDrop, 0xFFFFFFFF, NULL, 0 );
// Use Unicode for Windows NT and above
// Get the number of dropped files
int nbFiles = DragQueryFileW( HDrop, 0xFFFFFFFF, NULL, 0 );
// For each dropped file
for( int i = 0; i < nbFiles; i++ )
{
// Get the name of the file
int nameLength = DragQueryFileW( HDrop, i, NULL, 0 ) + 1;
wchar_t *psz_fileName = new WCHAR[nameLength];
DragQueryFileW( HDrop, i, psz_fileName, nameLength );
// Add the file
CmdAddItem cmd(getIntf(),sFromWide(psz_fileName),m_playOnDrop);
cmd.execute();
delete[] psz_fileName; // For each dropped file
} for( int i = 0; i < nbFiles; i++ )
}
else
{ {
int nbFiles = DragQueryFile( HDrop, 0xFFFFFFFF, NULL, 0 ); // Get the name of the file
int nameLength = DragQueryFileW( HDrop, i, NULL, 0 ) + 1;
for( int i = 0; i < nbFiles; i++ ) wchar_t *psz_fileName = new WCHAR[nameLength];
{ DragQueryFileW( HDrop, i, psz_fileName, nameLength );
int nameLength = DragQueryFile( HDrop, i, NULL, 0 ) + 1;
char *psz_fileName = new char[nameLength];
DragQueryFile( HDrop, i, psz_fileName, nameLength );
CmdAddItem cmd(getIntf(),sFromLocale(psz_fileName),m_playOnDrop); // Add the file
cmd.execute(); CmdAddItem cmd(getIntf(),sFromWide(psz_fileName),m_playOnDrop);
cmd.execute();
delete[] psz_fileName; delete[] psz_fileName;
}
} }
DragFinish( HDrop ); DragFinish( HDrop );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment