Thingy2nl Posted February 10, 2013 Posted February 10, 2013 Hi,Not sure if anybody is interested, but I came across some questions about a wait screen to present to the user while the system is doing whatever needs to be done. I could not find something the was easy to use and stayed on screen while the script actually continues. So I came up with the follow.... maybe somebody will find it usefull.I started by getting a semi random wait animated gif. I use this one:Then I proceded to add the _GUIResourcePic.au3 from JScript found here:Finally i added 2 functions to my au3 like this:Func Wait( $WaitTime ) $smallform = GUICreate('', 214, 138, Default, Default, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) _GUICtrlPic_Create(".\processing.gif", 1, 1, 0, 0) GUISetState(@SW_SHOW, $smallform) sleep( $WaitTime) EndFuncNote the @smallform that I declare Global in a seperate au3 and the size settings 214, 138 that are the same size as the gif.Func EndWait() GUIDelete($smallform) EndFuncNow, when i know I am going to do something that will take some time, I call the Wait() function. That will open a new, borderless GUItelling the user to wait, and when done, turn off the GUI with the EndWait().I added the variable sleep time because I have somoe functions that will take 4 or 5 seconds. To short to build the GUI and display itcorrectly, but to long not to show anything. In those cases I add additional 2 or 3 seconds waittime to give the GUI time to build and theuser to actually see something.Secondly, I choose to rebuild and delete the GUI every time a I had some issues reusing just one GUI. The GUI would display, but theanimated GIF was not shown on consecutive uses....So, hope someone can use this to his advantage
romanais Posted February 11, 2013 Posted February 11, 2013 Hello, and thank you ! I tested your script, and I've no problem with consecutive uses. I just changed sleep( $WaitTime ) to sleep( $WaitTime * 1000) So I can use your function with Wait(10) ;time in seconds
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now