Jump to content

Drag and drop image from webpage


Recommended Posts

Is it possible for me to drag and drop an image from a webpage and save it to a particular folder? I have my drag and drop working for local files, but when I try to drag an image from a webpage it doesn't work. I get one of those circles with a line through it (no smoking image) when I drag the file over my app.

Link to comment
Share on other sites

...  it doesn't work. I get one of those circles with a line through it (no smoking image) when I drag the file over my app.

..... try not to smoke while dragging
did you try? ........ :P

edit: ....jokes aside ..... I can not understand where you want to drop the image

Edited by Chimp
added integration to post

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

figured it out. "Protected Mode" has to be turned off in IE settings in order to drag an image from a webpage to the gui for a drag and drop operation. To program it I put this in the beginning of the script.

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", "2500", "REG_DWORD", 3)

I set the value to "0" on my exit function to put it back when I'm done with the app.

Link to comment
Share on other sites

I was interested at one stage (still am I guess), to be able to drag a URL to a drop box, which is kind of similar to what you are doing.

I can do it with Files, Folders or Shortcuts, but it fails with a URL.

When I get a chance, I will look into the possibility that you may have come up with a solution for me.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Here's a script you searched for:

;https://autoit.de/index.php/Thread/22579-Dropbox-für-Links-aus-Browsern/?postID=185846#post185846
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


    Local $hGui, $iMsg
    $hGui = GUICreate("Dropbox",150,150, -1, -1, BitOr($WS_SIZEBOX,$WS_BORDER) ,bitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW) )
    GUICtrlSetState(-1, $GUI_ONTOP)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui,"",0,0, 150, 150,-1)
    GUISetState()
    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
    _GuiCtrlRichEdit_SetEventMask($hRichEdit, $ENM_SELCHANGE )
    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                _GUICtrlRichEdit_Destroy($hRichEdit)
                GuiDelete()
            Exit
        EndSelect
    WEnd

Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
    #forceref $hWnd, $iMsg, $iWparam
    Local $hWndFrom, $iCode, $tNMHDR, $tEnLink, $cpMin, $cpMax, $tMsgFilter
    $tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hRichEdit
            Select
                Case $iCode = $EN_SELCHANGE
                    Checklink()
            EndSelect
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY


func Checklink()
    Local $sURL, $arrValidURL
    $sURL = _GUICtrlRichEdit_GetText($hRichEdit)
    $arrValidURL = StringRegExp($sURL, "(?s)((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)",2)

    #comments-start
    _GUICtrlRichEdit_GetSelText($hRichEdit)
    _Guictrlrichedit_settext($hRichEdit,"")
    if UBound($arrValidURL) > 0 Then
        ;// Gueltige URL ok, mach irgendwas damit
        ConsoleWrite($arrValidURL[0] & @CRLF)
        ;//
    EndIf
    #comments-end
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...