none
Programatically Drag and Drop a file outside form RRS feed

  • Question

  • I really hope i can get an answer here.

    Im trying to programmatically drag and drop an imagefile onto a 3rd party browser ( in this case Google Chrome, specifically the wordpress editor).

    1. load the image file by filepath to the data object
    2. move the mouse manually to the location i want to 'drop' the file
    3. click that location as if i was dropping the file. (any application that would normally also support dropping files)

    The reason for needing the specific 'drag and drop'  is because 'copy paste' results in a randomized filename, and i need to keep the original filename. 

    The functionality would be the same as when i would drag and drop within a folder with any other file. [click+hold the file, drag onto new location, release button to drop].

    I've tried to use the Image1.OLEDrag method of the image control, but to no success. Calling Image1.OLEDrag only seems to work if the form has the focus at the moment of calling the method. And this is something i want to prevent.

    I want to prevent the need of the form having focus, because i will be snipping images, naming them, and then press a hotkey to start the DragDrop and click the location where it needs to 'drop'  the file.

    I hope i didn't over explain, but this issue has been troubling me for a week now, and i need some sleep. I'm using VB6 but don't know where to put the question other than Visual Basic..Other forums didn't seem able to work it out.

    Tuesday, January 28, 2020 11:30 AM

All replies