Jump to content
lee321987

Drag and drop hyperlink onto button - possible?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
Share on other sites
Posted (edited)

@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

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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

×
×
  • Create New...