Jump to content

Drag and drop hyperlink onto button - possible?


Recommended Posts

  • 2 weeks later...
On 5/1/2019 at 4:29 AM, lee321987 said:

Hello.

I'd like to create a button that accepts drag and drop from a link in my web browser, then I'll do something with the URL that the hyperlink points to.

Is this possible?

Are you looking for a button that contains a variable that you can edit along the way or include it in something else?

 

Regards,

Supra

Link to comment
Share on other sites

On 5/9/2019 at 2:44 PM, supraaxdd said:

Are you looking for a button that contains a variable that you can edit along the way or include it in something else?

I wrote a program that downloads a file (getting the URL from the clipboard).

I want to make the button do the same thing if I drag a link from the web browser onto the button.

Edited by lee321987
Link to comment
Share on other sites

@lee321987,

I am not an expert in this but I don't know if you are able to do that. Please wait until a more experienced member of the community comes because I don't want to give you  false information.

Above, Nine said: You can only do it with a rich edit...

There is probably a way, but I don't know how...

Regards,

Supra

Edited by supraaxdd
Link to comment
Share on other sites

Here it is using a richedit (simple way)

#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>

$hGUI = GUICreate("test", 650, 50, -1, 100)
$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 10, 10, 600, 30)
GUISetState()

While 1
  Switch GUIGetMsg()
     Case $GUI_EVENT_CLOSE
        _GUICtrlRichEdit_Destroy($hRichEdit)
        Exit
  EndSwitch
  
  If _GUICtrlRichEdit_IsModified($hRichEdit) Then 
        $content = _GUICtrlRichEdit_GetText($hRichEdit)
        _GUICtrlRichEdit_SetModified($hRichEdit, false)
        Msgbox(0,"", $content)   ; <<<<< do what you want with the link here
        _GUICtrlRichEdit_SetText($hRichEdit, "")
  EndIf
  Sleep(10)
Wend

 

Edited by mikell
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...