Jump to content

Hiding a small gui while main stuff is running?


Chimaera
 Share

Recommended Posts

Got a script that removes tempfiles etc and it has a choice gui at start for local or offline drives

The choice is done like this

Func _GuiChoice()
    Local $hGUI = GUICreate("Drive Choice", 150, 100, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX))
    Local $Button_1 = GUICtrlCreateButton('Local Machine', 15, 15, 120, 30)
    GUICtrlSetState($Button_1, $GUI_FOCUS)
    _Font9()
    Local $Button_2 = GUICtrlCreateButton('Offline Machine', 15, 55, 120, 30)
    _Font9()

    GUISetState()
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Button_1 ; Local Machine Choice
;~          GUICtrlSetState($hGUI, @SW_MINIMIZE) ; <<<<<<<<<<<
                $OS = 'C:' ; Set the local drive choice
                $VerTest = _WinVer() ; test for windows version on the chosen drive
                $aUsers = _UserAccounts(); Work out the names of the user accounts
                $Paths = _SetPaths() ; Set the modified paths for the offline drive
                $Clean = _CleanList() ; Remove files
                ExitLoop
            Case $Button_2 ; Offline Machine Choice
                $OS = _DriveChoice() ; Make the user choose the drive
                $VerTest = _WinVer() ; test for windows version on the chosen drive
                $aUsers = _UserAccounts(); Work out the names of the user accounts
                $Paths = _SetPaths() ; Set the modified paths for the offline drive
                $Clean = _CleanList() ; Remove files
                Exit
        EndSwitch
    WEnd
    GUIDelete($hGUI)
EndFunc   ;==>_GuiChoice

What i want to be able to do is once $Clean = _CleanList() starts then i want to exit or minimize or something to get the window out of the way

I have to have it visible to make the choice obviously but once that has happened it needs to have gone

You can see in the code i have been trying different options ExitLoop/GUICtrlSetState($hGUI, @SW_MINIMIZE) etc

But i just cant find a way to hide it.

 

Any thoughts?

 

Link to comment
Share on other sites

Try using BitOr instead of BitXOr. Or, post a working script that we can run to test what you're doing.

Just noticed, you're using GUICTRLSetState instead of GUISetState.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

And that appears to be the answer :)

4 hours ago, BrewManNH said:

GUISetState

Many thanks

 

The BitXOr was a snippet Melba gave me a long time ago for a non adjustable gui

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...