timmy2 Posted July 20, 2015 Share Posted July 20, 2015 I want my main script to to spawn another one that displays a simple box with some changeable text and an animated GIF throbber (aka. activity indicator). Something simple like what you get using ProgressOn, with changeable text like it has, but instead of a calibrated progress bar I just want the GIF to play until my script decides to close.I'm hoping one of the more frequent users of this forum can point me to a snippet or example that does this. I found numerous posts here about animated progress bars, transparent GIFs, etc., but they often include comments like "this technique uses a lot of CPU cycles", and the examples contain lots of code that is over my head. Perhaps I'm not searching for the right terms, and am instead getting bogged down in posts that deal with more sophisticated requirements. Google took me to this article that creates the following box that's similar to my goal but it has controls I don't need AND I could not begin to extrapolate his suggestions into Autoit code. For future readers of this post here are a couple of sites that produce nice little animated GIF throbbers.AjaxloadChimpy Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2015 Share Posted July 20, 2015 Break it down into pieces. First just get an animated gif on a gui.The rest sounds quite easy...Run("x.exe someparameters") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2015 Share Posted July 20, 2015 I'm glad this was a code question, I was half expecting an ann summers advertisement. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
timmy2 Posted July 20, 2015 Author Share Posted July 20, 2015 Break it down into pieces. First just get an animated gif on a gui.The rest sounds quite easy...Run("x.exe someparameters")I'll try it but the last time I did this (roughly a couple years ago) Autoit GUI's couldn't "play" animated GIFs. (maybe transparency was involved, too -- I forget) I just figured that was not an option. Thank you for replying. Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2015 Share Posted July 20, 2015 I cannot recall the name of the thread in example scripts but there is definitely an example for animated gif, 100% AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
KaFu Posted July 20, 2015 Share Posted July 20, 2015 (edited) I prefer this one: Edited July 20, 2015 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
timmy2 Posted July 20, 2015 Author Share Posted July 20, 2015 Break it down into pieces. First just get an animated gif on a gui.Here's my test script and the animated gif does not "animate". What am I missing? Example() Func Example() Local $sFilePath = @ScriptDir & "\dot_chase.gif" ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 400, 100) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $hChild = GUICreate("", 64, 64, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) ; Create a picture control with a transparent image. GUICtrlCreatePic($sFilePath, 0, 0, 64, 64) ; Display the child GUI. GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI) GUIDelete($hChild) EndFunc ;==>Example Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2015 Share Posted July 20, 2015 It's not as simple as that. See the thread @KaFu directed you to. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
timmy2 Posted July 20, 2015 Author Share Posted July 20, 2015 Thank you @KaFu and @JohnOne!#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> #include <GIFAnimation.au3> ; UDF courtesy of trancexx Global $sFilePath = @ScriptDir & "\dot_chase.gif" ; Create a GUI Global $hGUI = GUICreate("Example", 400, 120,-1,-1,$WS_DLGFRAME) GUISetBkColor ($COLOR_WHITE) Global $sFont = "Arial" GUISetFont(12, $FW_NORMAL, $GUI_FONTNORMAL, $sFont) GUICtrlCreateLabel("Some info for you", 85,38) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Add the animated GIF Global $hGIF = _GUICtrlCreateGIF($sFilePath, "", 10, 15) ; Display the animated GIF GUISetState(@SW_SHOW) ; Loop until the user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs GUIDelete($hGUI) Link to comment Share on other sites More sharing options...
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