Jump to content

Personal Browser - Drag and drop


hello20
 Share

Recommended Posts

Hi,

I create a personnal browser using the internet explorer engine.

I'm looking for modify the action when we drag and drop a file into the browser. Like upload the file on a specific server or open a MsgBox with the link of the file. At the moment when you drag and drop an item it will be open by Internet Explorer. Is it possible to change that?

#include <GUIConstantsEx.au3>

#include <ButtonConstants.au3>

#Include <INet.au3>

#include <WindowsConstants.au3>

Global $oIE = ObjCreate("Shell.Explorer.2")

Global $read_height = 500

Global $read_width = 800

Global $read_starthomepage = "1"

Global $read_homepage = "http://www.autoit.com"

$gui_main = GUICreate("", $read_width , $read_height +13, -1, -1, 0x04000000 + 0x00CF0000 + 0x00000010)

$gui_iewindow = GUICtrlCreateObj($oIE, 0, 25, $read_width, $read_height - 25)

GUICtrlSetResizing($gui_iewindow, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM)

$bar_back = GUICtrlCreateButton("Précédente", 1, 1, 80, -1)

GUICtrlSetResizing($bar_back, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)

$bar_forward = GUICtrlCreateButton("Suivante", 91, 1, 80, -1)

GUICtrlSetResizing($bar_forward, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)

$bar_refresh = GUICtrlCreateButton("Rafraîchir", 182, 1, 80, -1)

GUICtrlSetResizing($bar_refresh, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)

GUISetState(@SW_SHOW)

$status_bar = GUICtrlCreateLabel("Loading: " & $read_homepage & "...", 0, $read_height , $read_width, BitOR(11, 0x1000))

GUICtrlSetResizing($status_bar, $GUI_DOCKSTATEBAR)

GUISetState()

$oIE.Navigate ($read_homepage)

WinSetTitle($gui_main, "" , "Browser drag and drop action")

$nochange = 1

$nb_navigation = 0

$nb_precedent = 0

$goback = 0

$goforward = 0

While 1

If $oIE.Busy () Then

$url = $oIE.LocationURL ()

_StatusChange("Loading: " & $url & "...")

If $nochange = 0 And $goforward = 0 Then

$nb_navigation += 1

$nochange = 1

Else

$nochange = 1

EndIf

Else

if $nochange = 1 Then

_StatusChange("Done.")

if ($goback = 1) Then

$goback = 0

$nb_precedent += 1

$nb_navigation -= 2

EndIf

if ($goforward = 1) Then

$goforward = 0

$nb_navigation += 1

$nb_precedent -= 1

EndIf

;if ($gostop = 1) Then

; $gostop = 0

; $nb_navigation -= 1

; $nb_precedent -= 1

;EndIf

$nochange = 0

Else

$nochange = 0

EndIf

EndIf

$msg = GUIGetMsg(1)

If $msg[0] = $GUI_EVENT_CLOSE Then ExitLoop

Select

Case $msg[0] = $bar_back

if ($nb_navigation > $nb_precedent)Then

$oIE.GoBack

$goback = 1

EndIf

Case $msg[0] = $bar_forward

if Not $nb_precedent = 0 Then

$goforward = 1

$oIE.GoForward

EndIf

;Case $msg[0] = $bar_

; $gostop = 1

; $oIE.Stop

Case $msg[0] = $bar_refresh

$oIE.Refresh

Case $msg[0] = $GUI_EVENT_CLOSE

ExitLoop

EndSelect

WEnd

Func _StatusChange($message)

GUICtrlSetData($status_bar, $message)

EndFunc

Some one have an idea?

Thank you.

Link to comment
Share on other sites

Hi,

I create a personnal browser using the internet explorer engine.

I'm looking for modify the action when we drag and drop a file into the browser. Like upload the file on a specific server or open a MsgBox with the link of the file. At the moment when you drag and drop an item it will be open by Internet Explorer. Is it possible to change that?

Some one have an idea?

Thank you.

up
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...