Jump to content
Sign in to follow this  
sb1920alk

Open a website folder with FrontPage

Recommended Posts

sb1920alk

I thought this would be easy, but I'm running out of ideas. I want to script the action of dragging a website folder onto a shortcut to FrontPage. The result is FrontPage opens with that site loaded. I've tried Run and ShellExecute with many different options.

Thanks,

Share this post


Link to post
Share on other sites
Malkey

I thought this would be easy, but I'm running out of ideas. I want to script the action of dragging a website folder onto a shortcut to FrontPage. The result is FrontPage opens with that site loaded. I've tried Run and ShellExecute with many different options.

Thanks,

Highlight the web address in the browser's navigation tool bar.

Drag the highlighted address to this script's input box.

FrontPage should start up. And, if the web page permits, it will open in FrontPage.

You may be able to use some of this script to have your script perform the way you prefer.

If you want to know more about the script, 99.9% of it came from

http://www.autoitscript.com/forum/index.ph...st&p=439165

#include <GUIConstants.au3>
#include <Misc.au3>

; http://www.autoitscript.com/forum/index.php?s=&showtopic=47588&view=findpost&p=439165
Global $Title = "Drag Text to"
Global $Dragging = False
Global $DragInc = 5 ;set when we decide dragging has started
Global $OldClip = ClipGet()

$Form1 = GUICreate($Title, 653, 50, 303, 50)
$Edit1 = GUICtrlCreateInput("", 5, 3, 643, 25)
;GUICtrlSetData(-1, "Edit1")

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ClipPut($OldClip)
            Exit
    EndSwitch
    CheckDrag()
WEnd

Func CheckDrag()
    If _IsPressed("1") And Not WinActive($Form1) Then
        Local $MousePos = MouseGetPos()
        While _IsPressed("1")
            $MousePosNew = MouseGetPos()
            If Abs($MousePosNew[0] - $MousePos[0]) > $DragInc Or Abs($MousePosNew[1] - $MousePos[1]) > $DragInc Then
                $Dragging = True
                ExitLoop
            EndIf
        WEnd

        While _IsPressed("1")
            $MousePosNew = MouseGetPos()
            Sleep(20)
        WEnd

        Local $WinPos = WinGetPos($Form1)
        Send("^{Insert}")

        If $Dragging Then
            If _ControlIDGetHovered() = $Edit1 Then
                MouseClick("Left")
                Send("+{Insert}")
                Run("C:\Program Files\Microsoft Office\OFFICE11\FRONTPG.EXE " & GUICtrlRead($Edit1))
            EndIf
        EndIf
        $Dragging = False
    EndIf
EndFunc   ;==>CheckDrag

Func _ControlIDGetHovered()
    Local $Old_Opt_MCM = Opt("MouseCoordMode", 1)
    Local $iRet = DllCall("user32.dll", "int", "WindowFromPoint", _
            "long", MouseGetPos(0), _
            "long", MouseGetPos(1))
    $iRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $iRet[0])
    Opt("MouseCoordMode", $Old_Opt_MCM)
    Return $iRet[0]
EndFunc   ;==>_ControlIDGetHovered

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.