Here, have a play with this. Save this out to an AHK file and run it. Bring up any window and press F1. You should see the overlay and buttons for that window. You can keep pressing F1 over whatever window is active and the script will re-create the overlay for that window. It's more of a proof of concept for now than, say, final code. When you're done playing, exit the script from its tray icon. Bedtime for me but I'll check back in in the morning.
F1::
{
Gui, 1: Destroy
Gui, 2: Destroy
; Get stats for the active window.
WinGetPos, X, Y, W, H, A
; Build out first GUI for the overlay.
Gui, 1: +Toolwindow -Caption +Lastfound +AlwaysOnTop
Gui, 1: Font, s22 ; Change the s# value to adjust font size.
Gui, 1: Add, Text, xm+70 ym+5 w100 h25 0x200 vmyText, CAP1 ; Change the xm/ym values to position the text.
Gui, 1: Font
Gui, 1: Color, Green ; Change overlay colour here.
Gui, 1: Show, % "x" . x . "y" . y . "w" . w . "h" . h, Overlay
GUI_ID := WinExist()
; Set it transparent and make it click-through.
WinSet, Transparent, 50 , % "ahk_id " . GUI_ID ; Change the numerical value for opaqueness amount.
WinSet, ExStyle , ^0x00000020, % "ahk_id " . GUI_ID ; Leave this value alone.
; Build out second GUI for the buttons.
Gui, 2: Margin, 0, 0
Gui, 2: +Toolwindow -Caption +Lastfound +AlwaysOnTop
Gui, 2: Add, Button, x y w100 h25 vmyButton1 gonClick, Click 1
Gui, 2: Add, Button, x y w100 h25 vmyButton2 gonClick, Click 2
Gui, 2: Show, % "x" . ( x + w ) . " y" . y
}
Return
onClick:
{
Gui, 2: Submit, NoHide
If ( A_GuiControl = "myButton1" )
{
; Do stuff here.
MsgBox, You clicked Button 1.
}
Else If ( A_GuiControl = "myButton2" )
{
; Do other stuff here.
MsgBox, You clicked Button 2.
}
}
Return