For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > May 2006 > Drag/drop of a URL from browser









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Drag/drop of a URL from browser
jay.cho@objective.com

2006-05-24, 4:14 am

Hello,

(NB: I'm using VSE 3.1.2)

I've been trying to handle the drag/drop of a URL from the addressbar
of a browser (IE, Firefox) onto my application. I'm pretty sure it
would be simple enough but still cannot get it to work -- probably due
to my poor OLE knowledge.

My application already handles OLE drag/drop of files from Windows
Explorer (drag format: 'CF_HDROP') or mail from Outlook (drag format:
'FileGroupDescriptor') by checking IDataStorage, OLE_STGMEDIUM etc. But
when I try the similar approach for drag/drop of a URL (drag format:
'UniformResourceLocator'), I'm unable to get it to work and instead
gets various errors.

The current code looks like this:

....
iDataObject := aDragDropObject formats at: 'UniformResourceLocator'.
cfFormat := Clipboard registerFormat: 'UniformResourceLocator'.
formatEtc := OLE_FORMATETC format: cfFormat medium: 1.
(iDataObject hasGetDataFormat: formatEtc) ifTrue: [
formatEtc lindex: 0.
stgMedium := iDataObject getData: formatEtc.
iStream := stgMedium pstm.
"Cannot seem to copy the iStream contents..."
...
].

Btw, I'd also like to do the opposite -- that is, allow drag/drop of an
object that represents URL in my application back to the browser so
that the browser will update its contents.

Any help would be greatly appreciated.

Thanks,
Jay

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com