I want to drag a link from a browser to my application and pick up both the url and the title/name associated with it.
I can read the url easily enough:
object o = data.GetData(typeof(string));
if (o != null)
if (data.GetDataPresent(DataFormats.Html, true))
String htmlsnippet = (string)data.GetData(DataFormats.Html);
The problem is that the html rarely contains the title.
For example www.bbc.co.uk/news
drag this into my app and I see the url
and the htmp snippet is:
However if I drag this link from my browser to my desk top the short-cut is
called 'BBC News - Home'
Similarly try cnn.com and the shortcut is labelled 'CNN.com International -
Breaking, World ...'
Can anyone help me find the title information? I don't want to retrieve the page as this will slow down the drag and drop, and anyway drag to desktop doesn't do this since it works if you go off-line and then drag a link from the browser to desktop.
[Modified: added pre tags...learn to use them, they are your friend!]