I have this code to show information to the user about what he should do next. If the user clicks, the message should dissapear
Code: Select all
ShowInfoGuiUntilNextClick(msg, fontColor:="Red", fontSize:=20, offsetX:=100, offsetY:=100, guiWidth:=500) {
; 1) create GUI
Gui, InfoGui:New, , InfoGui
Gui, InfoGui:Color, AAAAAA
Gui, InfoGui:Font, s%fontSize% bold c%fontColor%, Verdana
Gui, InfoGui:Add, Text, x0 y0 w%guiWidth%, %msg%
Gui, InfoGui:Margin, 0,0
Gui, InfoGui:+LastFound +AlwaysOnTop -DPIScale -Caption +ToolWindow
Gui, InfoGui:Show, NoActivate AutoSize, InfoGui ; show gui where the mouse is or stationary
Winset, TransColor, AAAAAA 150, InfoGui
; 2) wait for next click or esc to delete gui again
LButtonPressed := false
EscPressed := false
CoordMode, Mouse, Screen
while !(LButtonPressed or EscPressed) {
MouseGetPos, mx, my
wx := mx + offsetX
wy := my + offsetY
WinMove, InfoGui, , %wx%, %wy%
LButtonPressed := GetKeyState("LButton", "P")
EscPressed := GetKeyState("Escape", "P")
Sleep, 20
}
Gui, InfoGui:Destroy
}