Jump to content

Recommended Posts

Posted

Hi,

I would like to prevent an accidentally mouseclick on the close button of a window program.

I have a program to test and it is quite slow so if I accidentally close the program it takes a lot of time to restart.

It could be helpful a messagebox that ask me if I am sure to do that.

Do you know how?

Posted

I forgot to say that I have to open a lot of window child of this program so when I close all the window to start a new test It can happen that I also close the main program.

That's why I need to do that!

Posted (edited)

maybe try "ANYGUI.au3" in Example scripts

maybe place a label or something over the exit button and when it is clicked it will bring up a message box

just one idea/direction

8)

EDIT: great minds think alike... but i was too slow!!!

Edited by Valuater

NEWHeader1.png

Posted

You could throw up a GUI or a SplashText to cover the close button until after you are done testing.

It could be done... I'll try.

Thanks.

Posted

You could throw up a GUI or a SplashText to cover the close button until after you are done testing.

maybe try "ANYGUI.au3" in Example scripts

maybe place a label or something over the exit button and when it is clicked it will bring up a message box

just one idea/direction

8)

EDIT: great minds think alike... but i was too slow!!!

It works... a Splashtext is perfect.

Thanks all.

I wrote this code (about the msgbox I will do it):

OPT ("WinTitleMatchMode" , 2 )
TrayTip ("xx", " some text " & @CRLF, 10 , 1)

HotKeySet("+!d", "F_exit")
AdlibEnable("F_checkClose")
while 1
    sleep(100)
wend

Func F_checkClose()
    ConsoleWrite(@CRLF&"check")
    If WinExists("titlewindow") Then
        $size = WinGetPos("titlewindow")
        $xs=$size[0]+$size[2]-21
        $ys=$size[1]-1
        if WinActive("titlewindow") Then
            SplashTextOn("", " X ", 18, 18, $xs, $ys, 1+32, "")
        Else
            SplashOff()
        EndIf
    Else
        SplashOff()
    EndIf
EndFunc

Func F_exit()
    Exit
EndFunc

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
×
×
  • Create New...