private void _Drop(object sender, DragEventArgs e) { // Create a IShellItemArray from the IDataObject // For this sample, we only open the first item that was dragged and dropped to our application. var psi = ShellHelpers.GetDragItem(e.Data); if (psi != null) { // Get the full path of the file string pszPath = psi.GetDisplayName(SIGDN.SIGDN_FILESYSPATH); // Open the file _OpenFile(pszPath); } }
private void _DragEnter(object sender, DragEventArgs e) { var psi = ShellHelpers.GetDragItem(e.Data); e.Effect = psi == null ? DragDropEffects.None : DragDropEffects.Link; }