+// ----------------------------------------------------------------------------
+// file clipboard
+// ----------------------------------------------------------------------------
+
+void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event))
+{
+#ifdef __WXMSW__
+ wxFileDataObject *dobj = new wxFileDataObject;
+
+ wxFileDialog dialog(this, "Select a file to copy", "", "",
+ "All files (*.*)|*.*", 0);
+
+ if ( dialog.ShowModal() == wxID_OK )
+ {
+ wxString filename = dialog.GetPath();
+ dobj->AddFile(filename);
+
+ wxClipboardLocker locker;
+ if ( !locker )
+ {
+ wxLogError("Can't open clipboard");
+ }
+ else
+ {
+ if ( !wxTheClipboard->AddData(dobj) )
+ {
+ wxLogError("Can't copy file to the clipboard");
+ }
+ else
+ {
+ wxLogStatus(this, "File '%s' copied to the clipboard",
+ filename.c_str());
+ }
+ }
+ }
+ else
+ {
+ wxLogStatus(this, "Aborted");
+ }
+#else // !MSW
+ wxLogError("Sorry, not implemented");
+#endif // MSW/!MSW
+}
+