HighlanderSword Posted March 7, 2017 Share Posted March 7, 2017 Hello, When I run the code below the Status Box display in the bottom corn er of the screen and puts in the text I desired. Now whenever anything else writes to the screen the text in the GUI goes blank. I need to be able to maintain the Gui Progress Text Box. What am I missing ? I've got a program that runs for a few hours and the users want to see a visual status of where things are (and they don't want to open a file to get the status so I thought I could use the GuiCreate and just keep updating that. Any ideas what I'm doing wrong ? Global $idMyedit,$_1 Prog_stat() GUICtrlSetData($idMyedit, _now() & " " & "Program status all ok" & @CRLF, 1) Msgbox(0,"Status","Test") Func Prog_stat() #Region ### START Koda GUI section ### Form= $_1 = GUICreate("Progress Status", 438, 152, 1479, 811) $idMyedit = GUICtrlCreateEdit("", 10, 20, 380, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) $idMyedit = GUICtrlCreateEdit("", 10, 20, 380, 97) GUICtrlSendMsg($idMyedit, $EM_LIMITTEXT, -1, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted March 7, 2017 Developers Share Posted March 7, 2017 24 minutes ago, HighlanderSword said: Now whenever anything else writes to the screen the text in the GUI goes blank. No idea what that means nor does your posted code simulate any of this, so please be a little clearer as to what the issue is. Jos 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 More sharing options...
water Posted March 7, 2017 Share Posted March 7, 2017 Example script: Writes a line to the progress window every second. The text of the message is changed every 5 seconds. #include <Date.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> AdlibRegister("UpdateProgressWindow", 1000) ; Update window every second Global $sMessage = "" Global $idMyedit, $_1, $iCounter = 0 CreateProgressWindow() While 1 Sleep(5000) ; Change text in progress window every 5 seconds ConsoleWrite("Script is still processing" & @CRLF) $sMessage = "Processing step " & $iCounter $iCounter += 1 WEnd Func CreateProgressWindow() #Region ### START Koda GUI section ### Form= $_1 = GUICreate("Progress Status", 438, 152, 1479, 811) $idMyedit = GUICtrlCreateEdit("", 10, 20, 380, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSendMsg($idMyedit, $EM_LIMITTEXT, -1, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### EndFunc ;==>Prog_stat Func UpdateProgressWindow() GUICtrlSetData($idMyedit, _Now() & " " & $sMessage & @CRLF, 1) EndFunc My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted March 7, 2017 Author Share Posted March 7, 2017 Thanks Water !!!! 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