How to get Title when Drag and Drop link from IE to my app?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My C# application supports drag and drop of files, folders, shortcuts and
links from other applications into mine. This all works pretty nicely,
except that I am trying to get a little more information when a web link is
dropped onto my application from Internet Explorer.

When you drag the link in the Address bar of Internet Explorer to your
desktop, the desktop shortcut that gets created has the Title of the web page
as it’s name, and it also picks up the custom Icon for that web page. I’m
trying to figure out how to get that information out of the
DragEventArgs.Data property when the same kind of link is dropped onto my
application, but I have had no luck.

Here is a summary of what I know so far (e is the DragEventArgs):

- The e.Data.GetData(DataFormats.Text) returns the URL. This works fine.

- Some of the other DataFormats choices return the URL as well, but I’ve
tried them all and that’s all there is. No other information available in
those choices.

- I thought the e.Data.GetFormats() would tell me something, but it just
returns an empty array of strings (string[0]), so I guess that Internet
Explorer doesn’t really support that call.

- I found a solution on the web that uses
e.Data.GetData("FileGroupDescriptor") to get a System.IO.Stream that is
supposed to contain the Title of the web page, but I found that it just
contained the same URL or a reference to a file name, depending on the web
site.

So, my question is, do you know how to get the Title of the web page when
dragging and dropping a link from IE to an application? I assume there must
be a way, since Windows can do this when you drop it on the desktop as a
shortcut.

Of less importance to me, but also interesting, is how can you get the
custom Icon associated with the web page?
 
Hello, anybody out there? The MSDN subscription page claims that I should
have gotten a response within two business days, but it's been more like a
week and a half now. Any thoughts at all?
 
Back
Top