Jump to content

Beginner - Stop GUI


AutoDEV
 Share

Recommended Posts

3 hours ago, AutoDEV said:

Please how to stop a actual gui and not all ?

Your code snippet is not sufficient for a precise answer. In general, you exit a function with the RETURN command. EXIT terminates the entire script.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

  • Developers

This is becoming a standard answer for you @AutoDEV: Post code that is valid and runnable when you want support!
So, please for here on put in the effort to do so and only ask questions with complete information! 

Thanks 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

ok.

I have make hotkey

Func _PauseScript()
    $bPaused = True
    GUICtrlSetData($Button1, "Make PAUSE")
    If MsgBox(0, 'Pause', 'click ok for continue') = $IDOK Then
        $bPaused = False
        GUICtrlSetData($Button1,"MAKE ONE PAUSE")
        Return
    EndIf
EndFunc

HotKeySet("{F8}", "_PauseScript")

But how make stop function ?

Thanks

Link to comment
Share on other sites

I have one app

When i click on F10 i need close current GUIa and loop

HotKeySet("{F10}", "_ExitScript")

Func _ExitScript()
    $m =  MsgBox(4, 'STOP', 'want stop GUI ?')
    if $m == 6 Then
        Exit
        ;exitloop not working
    EndIf
EndFunc

and exitloop not working because is not a loop, im lost.

How to close loop ?

TY

Edited by AutoDEV
Link to comment
Share on other sites

  • Developers

@AutoDEV, Please read my previous post again and make sure you conform to that request!

Any question without the appropriate information or working script will simply be removed. Hope that I am clear now because I would hate to resort to this rather silly approach of removing post. 

Thanks

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

OK im sorry, im not one troll, and my questions is hard for me.

I make more easy:

How to stop a loop when  i press  F10.

Exemple code 1 :

HotKeySet("{F10}", "_ExitLoop")
Global $bLoop = True
While $bLoop
    Sleep(100)
WEnd
MsgBox(4096, "Exit Loop", "Complete")
Func _ExitLoop()
    $bLoop = False
EndFunc

Exemple 2 :

HotKeySet("{F11}", "_ExitLoop") 
Global $exitloop = False

While 1
    If $exitloop = True Then
        MsgBox( 0 , '' , '$exitloop = '& $exitloop &' , Will exit the loop now.' )
        $exitloop = NOT $exitloop
        ExitLoop
    EndIf
WEnd

Func _ExitLoop()
    $exitloop = True
EndFunc

Probllem with the script is im blocked in infinite loop. and projet is in pause

I can't make best description for,my problem Jos and Andreik

Thank you to help me

Edited by AutoDEV
Link to comment
Share on other sites

38 minutes ago, AutoDEV said:

. and projet is in pause

Global $bLoop = True
If HotKeySet("{F10}", "_ExitLoop") Then ; https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm
    MainLoop()
    MsgBox(4096, "Exit Loop", "Complete")
Else
    MsgBox(4096, "No can do", "That key did not work, bye.")
EndIf

Func MainLoop()
    While $bLoop
        Sleep(100)
    WEnd
EndFunc

Func _ExitLoop()
    $bLoop = False
EndFunc

Read the help file. There you will find all your answers.
Read the forums and you're gonna find over 180,000 answers of questions mostly, of those that did not read the help file.

PS: .. write your code thinking that everything is going to fail. That way you will code with "unexpected results" in mind, making you a better person programmer :)

Edited by argumentum
spelling

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...