summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorleo2005-03-15 19:24:20 +0000
committerleo2005-03-15 19:24:20 +0000
commit25af63d7d7b85f99f5327d1b97a3ac24fbfd93f0 (patch)
treec3428f9ec542690fa86a9cfd388530804fc51593 /win
parent05ce44a61fcc3dad6e23977539ae06c678f46896 (diff)
Fixed drag and drop of files.
git-svn-id: http://svn.leocad.org/trunk@391 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win')
-rw-r--r--win/Mainfrm.cpp16
-rw-r--r--win/Mainfrm.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index 9b2e023..dba878f 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -108,6 +108,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_ACTIVATEAPP()
ON_COMMAND(ID_VIEW_NEWVIEW, OnViewNewView)
ON_MESSAGE(WM_SETMESSAGESTRING, OnSetMessageString)
+ ON_WM_DROPFILES()
//}}AFX_MSG_MAP
ON_COMMAND_RANGE(ID_PIECEBAR_ZOOMPREVIEW, ID_PIECEBAR_SUBPARTS, OnPieceBar)
ON_UPDATE_COMMAND_UI_RANGE(ID_PIECEBAR_ZOOMPREVIEW, ID_PIECEBAR_SUBPARTS, OnUpdatePieceBar)
@@ -1317,3 +1318,18 @@ void CMainFrame::UpdateMenuAccelerators()
m_bmpMenu.Detach();
}
+
+void CMainFrame::OnDropFiles(HDROP hDropInfo)
+{
+ SetActiveWindow(); // activate us first !
+ UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
+
+ if (nFiles > 0)
+ {
+ TCHAR szFileName[_MAX_PATH];
+ ::DragQueryFile(hDropInfo, 0, szFileName, _MAX_PATH);
+
+ project->OpenProject(szFileName);
+ }
+ ::DragFinish(hDropInfo);
+}
diff --git a/win/Mainfrm.h b/win/Mainfrm.h
index 1061cc9..2024c93 100644
--- a/win/Mainfrm.h
+++ b/win/Mainfrm.h
@@ -85,6 +85,7 @@ protected:
afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
afx_msg void OnViewNewView();
afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
+ afx_msg void OnDropFiles(HDROP hDropInfo);
//}}AFX_MSG
// Status bar