Question

I have an existing .exe program (not mine so I can't edit it) that runs in a window of static size. What I want to do is overlay an extra button (preferably an image in the same style) on top of this window at specific coordinates within that window (and it has to move with the window if dragged elsewhere) to expand on it's functionality.

How do I go about this? I have searched for quite a bit, but wasn't able to find anything. I was able to create a Parent-Child in AutoIT itself, but cannot seem to attach a child to an existing application.

Was it helpful?

Solution

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
; NotepadAddOn
ShellExecute('notepad')
WinWaitActive("[CLASS:Notepad]", "")
$pos_A = WinGetPos("[CLASS:Notepad]", "")
$hGui = GUICreate('YOUR GUI', $pos_A[2], 50, $pos_A[0], $pos_A[1] - 50)
GUISetState(@SW_SHOW) ; will display an empty dialog box
AdlibRegister('_WinMove', 10)

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Func _WinMove()
        $p_A = WinGetPos("[CLASS:Notepad]", "")
        WinMove($hGui, "", $p_A[0], $p_A[1] + $p_A[3])
EndFunc   ;==>_WinMove
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top