Note that there are some explanatory texts on larger screens.

plurals
  1. PODrag and Drop non existent multiple file to Explorer
    text
    copied!<p>I would like to drag and drop elements of a listbox to explorer. I made a copy of one non existent file as it is described in this article and changed a bit the program code: <a href="https://stackoverflow.com/questions/1845654/how-to-use-filegroupdescriptor-to-drag-file-to-explorer-c-sharp">How to use filegroupdescriptor to drag file to explorer c#</a></p> <pre><code>private void listView1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.None) return; byte[] array = Encoding.ASCII.GetBytes("ABCD"); DataObject dataObject = new DataObject(); DragFileInfo filesInfo = new DragFileInfo(@"myFile.txt", array); MemoryStream infoStream = GetFileDescriptor(filesInfo); MemoryStream contentStream = GetFileContents(filesInfo); dataObject.SetData(CFSTR_FILEDESCRIPTORW, infoStream); dataObject.SetData(CFSTR_FILECONTENTS, contentStream); dataObject.SetData(CFSTR_PERFORMEDDROPEFFECT, null); // drag and drop file with name "myFile.txt" and body "ABCD". DoDragDrop(dataObject, DragDropEffects.All); } private MemoryStream GetFileContents(DragFileInfo fileInfo) { MemoryStream stream = new MemoryStream(); if (fileInfo.SourceFileBody.Length == 0) fileInfo.SourceFileBody = new Byte[1]; stream.Write(fileInfo.SourceFileBody, 0, fileInfo.SourceFileBody.Length); return stream; } public struct DragFileInfo { public string FileName; public byte[] SourceFileBody; public DateTime WriteTime; public Int64 FileSize; public DragFileInfo(string fileName, byte[] sourceFileBody) { FileName = fileName; SourceFileBody = sourceFileBody; WriteTime = DateTime.Now; FileSize = sourceFileBody.Length; } } </code></pre> <p>This worked fine, but I need to drag and drop several files at the same time. How can I do this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload