Jump to content
Sign in to follow this  
insury

Change Weblink in Other App

Recommended Posts

insury

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!

Share this post


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

Share this post


Link to post
Share on other sites
insury

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

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.