HighlanderSword

Program Status

4 posts in this topic

#1 ·  Posted

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

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

Thanks Water !!!!

Share this post


Link to post
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