Ok, this is just a layout, but you should get an idea ...
First add the link COM> Windows Script Host Object Model ' to your project.
Next, include the line ...
using IWshRuntimeLibrary;
In this example, I just used a list control, but I use what you need ... If you are handling the DragEnter event, you can get the file name passed as an argument. Then you can create a WshShell object to get the target link path.
private void listBox1_DragEnter(object sender, DragEventArgs e) { String[] fileName = (String[])e.Data.GetData("FileName"); WshShell shell = new WshShell(); IWshShortcut link = (IWshShortcut)shell.CreateShortcut(fileName[0]); String targetPath = link.TargetPath; listBox1.Items.Add(targetPath); }
The code does not handle shortcuts, etc., but it should give you a starter ... :)
user110714
source share