Jump to content

Change Weblink in Other App


insury
 Share

Recommended Posts

There is a custom app that has a "weblink" button, so when clicked, a browser will be launched and a website (e.g. something.com) will be opened in the browser.

I would like to create a tool, so when this tool is running & the "weblink" button from the other app is clicked, a different address (e.g. something.com/about_us.html instead of something.com) will be opened.

Is it possible to create such tool using AutoIt?

I don't have access to the custom app source codes, otherwise I could have just changed the weblink in the custom app directly.

Thanks fo your help!

Link to comment
Share on other sites

Hide the weblink button with ControlHide, then replace it with your own.

#include <GuiConstants.au3>

Run("Notepad")
WinWaitActive("Untitled - Notepad")
$hWnd = WinGetHandle("Untitled - Notepad")
ControlHide($hWnd,"","Edit1")

$hWndChild = GUICreate("",100,20,10,10,$WS_CHILD,-1,$hWnd)
$Button = GUICtrlCreateButton("Button",0,0,100,20)
GUISetState()

While 1
    
    $msg = GUIGetMsg()
    
    If $msg = $Button Then
        msgbox(0,"","I stole notepads edit box and replaced it with my button")
        ExitLoop
    EndIf
    Sleep(100)
WEnd
Link to comment
Share on other sites

That's a very great idea!

Thanks so much, covaks!

Hide the weblink button with ControlHide, then replace it with your own.

#include <GuiConstants.au3>

Run("Notepad")
WinWaitActive("Untitled - Notepad")
$hWnd = WinGetHandle("Untitled - Notepad")
ControlHide($hWnd,"","Edit1")

$hWndChild = GUICreate("",100,20,10,10,$WS_CHILD,-1,$hWnd)
$Button = GUICtrlCreateButton("Button",0,0,100,20)
GUISetState()

While 1
    
    $msg = GUIGetMsg()
    
    If $msg = $Button Then
        msgbox(0,"","I stole notepads edit box and replaced it with my button")
        ExitLoop
    EndIf
    Sleep(100)
WEnd
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...