Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLEDragDropping an image URL

Status
Not open for further replies.

vfp4ever

Programmer
Oct 18, 2013
71
East Java
Hello,

I would like to use OLE Drag and Drop to copy an image address (its URL, not the image itself) from my web browser directly into the TextBox control contained in a Grid column. That is, drag a thumbnail picture and drop its address so that I can download either the low and high resolution images at the same time (after manipulating the URL).

Any suggestion on the format I should use in GetFormat and GetData?
 
I'd say forget about this.

I don't see a standard defined for what you can expect as data object from a drag operation.
What I tried just now for short is ole enabling a textbox and dragging from IE and chrome. From chrome I get the destination URL of an image, from IE I get nothing.

If you want to go further in that direction you'd have to find out what ole data the browser generates in a drag operation and then see what arrives in VFP in the OleDragDrop event.

Bye, Olaf.
 
For what it's worth, I just tried it with Firefox. For a normal image, the result was the same as Chrome, that is, the URL of the image. But for a hyperlinked image, it gave the URL of the link target.

The point is that it is up to the drag source to decide the format of the object being dragged. There's no reason to expect any consistency between browsers in this respect.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thank you, Olaf and Mike.

I use Opera as browser, and apparently it only allows to drag the image and drop its URL into any textbox within its own window. From VFP I do not see any sign of life in OLEDragOver (once set OLEDragMode = 1 && Automatic, OLEDropMode = 1 && DROP-ENABLED, OLEDropHasData = 1 && DROPHASDATA_USEFUL), so I assume it is not a problem of data format, but rather Opera's policy to restrict OLE operations within its boundaries. Should not the OLEDragOver event trigger even when the data format is unknown?

Never mind, I can still manage to do what I intended to do with a right-click on the image (then Copy Image Address) and a double-click on VFP's TextBox (to trigger my own code). I just missed the opportunity to see an OLE Drag and Drop venture working :).

Dario
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top