Created
November 7, 2023 15:29
-
-
Save ievgiienko/85047e4e0fdc503cc0866f8126cc5c25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void Folder_OnDrop(object sender, ShellFolderDropEventArgs e) | |
{ | |
e.AllowedEffects = Constants.DROP_EFFECT_COPY | Constants.DROP_EFFECT_MOVE | Constants.DROP_EFFECT_LINK; | |
var formats = e.Formats.Split('\n'); | |
var format = formats[0]; | |
int count = 0; | |
var data = folder.GetDragData(e.TaskId, format, 0, ref count); | |
if (count > 0) | |
{ | |
var str = Encoding.Unicode.GetString(data); | |
Console.WriteLine($"Drop task id: " + e.TaskId + ", target id = " + e.TargetId + ", key state = " + e.KeyState); | |
var id = folder.PIDLToId(str); | |
Console.WriteLine(" Drop PIDLToId: " + id); | |
Console.WriteLine(" Formats: " + e.Formats); | |
} | |
} | |
private static void Folder_OnDrag(object sender, ShellFolderDragEventArgs e) | |
{ | |
e.AllowedEffects = Constants.DROP_EFFECT_COPY | Constants.DROP_EFFECT_MOVE | Constants.DROP_EFFECT_LINK; | |
var formats = e.Formats.Split('\n'); | |
var format = formats[0]; | |
int count = 0; | |
var data = folder.GetDragData(e.TaskId, format, 0, ref count); | |
if (count > 0) | |
{ | |
var str = Encoding.Unicode.GetString(data); | |
Console.WriteLine($"Drag task id: " + e.TaskId + ", target id = " + e.TargetId + ", key state = " + e.KeyState + ", drag type = " + e.DragType); | |
var id = folder.PIDLToId(str); | |
Console.WriteLine(" Drag PIDLToId: " + id); | |
Console.WriteLine(" Formats: " + e.Formats); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment