Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
4ab7aa39
Commit
4ab7aa39
authored
Nov 08, 2006
by
Marian Durkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix skins2 Drag&Drop to accept files with non-ANSI CP characters
parent
cc53b715
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
12 deletions
+41
-12
modules/gui/skins2/src/skin_common.hpp
modules/gui/skins2/src/skin_common.hpp
+8
-0
modules/gui/skins2/win32/win32_dragdrop.cpp
modules/gui/skins2/win32/win32_dragdrop.cpp
+33
-12
No files found.
modules/gui/skins2/src/skin_common.hpp
View file @
4ab7aa39
...
...
@@ -76,6 +76,14 @@ static inline string sFromLocale( const string &rLocale )
return
res
;
}
/// Wrapper around FromWide, to avoid the need to call free()
static
inline
string
sFromWide
(
const
wstring
&
rWide
)
{
char
*
s
=
FromWide
(
rWide
.
c_str
()
);
string
res
=
s
;
free
(
s
);
return
res
;
}
/// Wrapper around ToLocale, to avoid the need to call LocaleFree()
static
inline
string
sToLocale
(
const
string
&
rUTF8
)
...
...
modules/gui/skins2/win32/win32_dragdrop.cpp
View file @
4ab7aa39
...
...
@@ -146,23 +146,44 @@ STDMETHODIMP Win32DragDrop::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState,
void
Win32DragDrop
::
HandleDrop
(
HDROP
HDrop
)
{
if
(
GetVersion
()
<
0x80000000
)
{
// Use Unicode for Windows NT and above
// Get the number of dropped files
int
nbFiles
=
DragQueryFile
(
HDrop
,
0xFFFFFFFF
,
NULL
,
0
);
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
;
}
}
else
{
int
nbFiles
=
DragQueryFile
(
HDrop
,
0xFFFFFFFF
,
NULL
,
0
);
for
(
int
i
=
0
;
i
<
nbFiles
;
i
++
)
{
int
nameLength
=
DragQueryFile
(
HDrop
,
i
,
NULL
,
0
)
+
1
;
char
*
psz_fileName
=
new
char
[
nameLength
];
DragQueryFile
(
HDrop
,
i
,
psz_fileName
,
nameLength
);
// Add the file
CmdAddItem
cmd
(
getIntf
(),
sFromLocale
(
psz_fileName
),
m_playOnDrop
);
CmdAddItem
cmd
(
getIntf
(),
sFromLocale
(
psz_fileName
),
m_playOnDrop
);
cmd
.
execute
();
delete
[]
psz_fileName
;
}
}
DragFinish
(
HDrop
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment