void OnDropFiles(IntPtr hDrop) { var filenames = new List <string>(); int count = Shell32.DragQueryFile(hDrop, 0xFFFFFFFF, null, 0); for (uint i = 0; i < count; i++) { var sb = new StringBuilder(256); if (Shell32.DragQueryFile(hDrop, i, sb, (uint)sb.Capacity) > 0) { filenames.Add(sb.ToString()); } } Shell32.DragFinish(hDrop); // var pt = this.PointToClient(Control.MousePosition); var de = new DropFilesEventArgs(filenames.ToArray(), pt); this.PostDropFiles(de); if (de.Handled) { return; } if (filenames.Count > 0) { OpenDocuments(filenames.ToArray()); } }
public void OnFilesDrop(DropFilesEventArgs e) { if (ReadOnly) { return; } var topic = this.GetTopicAt(e.MousePosition.X, e.MousePosition.Y); if (topic != null) { if (MenuDropFiles == null) { InitializeDropFilesMenu(); } DropFilesTopic = topic; DropFileNames = e.FileNames; MenuDropFiles.Renderer = UITheme.Default.ToolStripRenderer; MenuDropFiles.Show(this, e.MousePosition, ToolStripDropDownDirection.BelowRight); e.Handled = true; } }
static void dlg_CBDropFiles(object sender, DropFilesEventArgs e) { }