diff options
author | kinddragon <kinddragon@users.sourceforge.net> | 2010-05-09 05:01:27 +0400 |
---|---|---|
committer | kinddragon <kinddragon@users.sourceforge.net> | 2010-05-09 05:01:27 +0400 |
commit | 7b6b0c551b34ffc5da173e05bdb57875cffa24f1 (patch) | |
tree | 258df80d6d72ed132bd6bc02943600b2418e9b10 /src/apps/mplayerc | |
parent | 1318e0ef1212b7491b948d736fbc81d10e3a5cfc (diff) |
Implemented drag and drop folders with sub-folders (ticket #208)
Minor AudioSwitcher optimizations
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/branches/videorenderslib@1869 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc')
-rw-r--r-- | src/apps/mplayerc/MainFrm.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index 201b60e85..f9dabf21f 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -827,11 +827,13 @@ DROPEFFECT CMainFrame::OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState {
return DROPEFFECT_NONE;
}
+
DROPEFFECT CMainFrame::OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
UINT CF_URL = RegisterClipboardFormat(_T("UniformResourceLocator"));
return pDataObject->IsDataAvailable(CF_URL) ? DROPEFFECT_COPY : DROPEFFECT_NONE;
}
+
BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
UINT CF_URL = RegisterClipboardFormat(_T("UniformResourceLocator"));
@@ -851,7 +853,7 @@ BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoi SetForegroundWindow();
CAtlList<CString> sl;
- sl.AddTail(CString(url));
+ sl.AddTail(CString(url));
if(m_wndPlaylistBar.IsWindowVisible())
{
@@ -871,13 +873,16 @@ BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoi return bResult;
}
+
DROPEFFECT CMainFrame::OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point)
{
return (DROPEFFECT)-1;
}
+
void CMainFrame::OnDragLeave()
{
}
+
DROPEFFECT CMainFrame::OnDragScroll(DWORD dwKeyState, CPoint point)
{
return DROPEFFECT_NONE;
@@ -4288,6 +4293,8 @@ void CMainFrame::OnFileOpenCD(UINT nID) }
}
+void RecurseAddDir(CString path, CAtlList<CString>* sl);
+
void CMainFrame::OnDropFiles(HDROP hDropInfo)
{
SetForegroundWindow();
@@ -4306,7 +4313,19 @@ void CMainFrame::OnDropFiles(HDROP hDropInfo) {
CString fn;
fn.ReleaseBuffer(::DragQueryFile(hDropInfo, iFile, fn.GetBuffer(MAX_PATH), MAX_PATH));
- sl.AddTail(fn);
+ sl.AddTail(fn);
+
+ WIN32_FIND_DATA fd = {0};
+ HANDLE hFind = FindFirstFile(fn, &fd);
+ if(hFind != INVALID_HANDLE_VALUE)
+ {
+ if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ {
+ if(fn[fn.GetLength()-1] != '\\') fn += '\\';
+ RecurseAddDir(fn, &sl);
+ }
+ FindClose(hFind);
+ }
}
::DragFinish(hDropInfo);
|