gui with extra tools for main program

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
adrian88888888
Posts: 84
Joined: 13 Mar 2020, 22:51

gui with extra tools for main program

Post by adrian88888888 » 01 May 2020, 19:30

Hello everyone:

im trying to make a gui of extra tools that is on top of the program that i use for work

i have not being able to make the gui work properly

run this script and you can understand better(opens paint and put a gui of extra tools)(there's more explanation inside the script):

Code: Select all

#SingleInstance,Force
SetTitleMatchMode, 2

Run, mspaint.exe ; for this case im going to put paint as the example

SetTimer, loop1, 0 ; the script has various "loops" runing constantly "at the same time"
SetTimer, loop2, 0 ; for this exaple i just put 3 loops doing the same
SetTimer, loop3, 0

WinWaitActive, Paint
Gui, -border
Gui, Add, Button, Default w80, Tool 1
Gui, Add, Button, Default w80, Tool 2
Gui, Add, Button, Default w80, Tool 3
Gui, Add, Button, Default w80, Tool 4
Gui, Add, Button, Default w80 gExit_Gui, Exit
Gui, +AlwaysOnTop
Gui, Show, , Extra Tools
return


WinWaitNotActive, Paint
Gui, Hide ; i hide the gui when the program its not avtive instead of doing exit app because the real script takes a wile to start again everytime that the main program gets focused again
WinWaitClose, Paint
ExitApp
return


loop1:
MouseGetPos, MouseX, MouseY, , Control_Under_Mouse, 0
GetKeyState, Mouse_LButton, LButton
return

loop2:
MouseGetPos, MouseX, MouseY, , Control_Under_Mouse, 0
GetKeyState, Mouse_LButton, LButton
return

loop3:
MouseGetPos, MouseX, MouseY, , Control_Under_Mouse, 0
GetKeyState, Mouse_LButton, LButton
return

Exit_Gui:
WinMinimize, Paint ; for comfort
ExitApp
return

Escape::
WinMinimize, Paint ; for comfort
ExitApp
i want it to:

-hide and show the gui when i minimize and maximize the main program

-do exitapp when i close the program

-being compatible with the rest of the script(the script its complex and one thing that haves its various settimers constantly running to get some data that i need in order to the rest of the script to work)

-start when the program starts(or maybe not, maybe make it start with windows and its hidden until the name of the window is focused)

Return to “Ask for Help (v1)”