Sign in to follow this  
Followers 0
gadzail

prevent a window close event

8 posts in this topic

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?

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0