Jump to content

Refresh a GUI Label every X minutes?


 Share

Recommended Posts

Hello,

i have a very little script, which shows a Label with infos from an ini File.

Now i want the script to check every X Minutes, if the Key in the ini File has changed and then change the label to the actual key.

At the moment, my Test-Script looks like this:

#include <GUIConstants.au3>
$status = "Test"
GUICreate("Statusmeldung", 200, 100) 
GUICtrlCreateLabel ("Aktueller Status:",  10, 10)
$meldung = GUICtrlCreateLabel ( "Default" , 10, 30, 100)
$weiter = GUICtrlCreateButton("Beenden", 60, 70, 88, 25)

GUISetState ()  
While 1 
   $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $weiter Then Exit
    $status = IniRead ("c:\temp\test.ini", "Status", "Meldung", "Keiner")
    GUICtrlSetData ($meldung, $status)  
Wend

The status from the ini file is checked every time when the "While Loop" starts. That is more than 1 time per second. But i only want the ini file to be checked every x minute.

I think this is very easy to realise, but i don't know how.

An other little question: How can i make the Gui Windows always stay on the top of the desktop and never get in the background? It don't have to be active, but only on the top of the desktop.

Thank you

SpecialK

Link to comment
Share on other sites

Hello,

i have a very little script, which shows a Label with infos from an ini File.

Now i want the script to check every X Minutes, if the Key in the ini File has changed and then change the label to the actual key.

At the moment, my Test-Script looks like this:

#include <GUIConstants.au3>
$status = "Test"
GUICreate("Statusmeldung", 200, 100) 
GUICtrlCreateLabel ("Aktueller Status:",  10, 10)
$meldung = GUICtrlCreateLabel ( "Default" , 10, 30, 100)
$weiter = GUICtrlCreateButton("Beenden", 60, 70, 88, 25)

GUISetState ()  
While 1 
   $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $weiter Then Exit
    $status = IniRead ("c:\temp\test.ini", "Status", "Meldung", "Keiner")
    GUICtrlSetData ($meldung, $status)  
WendoÝ÷ Ù8^²Ö­ºÇë¢kaz)â~)^Ç!yÉuëÞ¯+bì!z{az«¨µhbâ袮¢Û-j»lN­É¨­ëaj}mg©z»rÝëb¢yrÁ©í¶¢'âëhmç!yÉuëÞ¯,f{­xay-+"²÷«Éæ¬ÊÚ+y©b±æî¶'hmz0az¹b¶Ù^ªç¬¶*'jx¦jG­á®h§v,jÊË-k*'¶­¢¶zÉ-¢§vw¯z¸¶)íæÚrH+¢éÝ"×hm«Þ¶ÞiËb½æî¶åÊíëh¦íç^²Kh¥8ZL¨¹*^r&¥+ú®¢××öÚºÚ"µÍÚ[ÛYH    ÑÕRPÛÛÝ[Ë]LÉÝÂÌÍÜÝ]ÈH ][ÝÕÝ    ][ÝÂÕRPÜX]J ][ÝÔÝ]ÛY[[É][ÝËL
HÕRPÝÜX]SX[
    ][ÝÐZÝY[Ý]Î][ÝËLL
BÌÍÛY[[ÈHÕRPÝÜX]SX[
    ][ÝÑY][   ][ÝÈLÌL
BÌÍÝÙZ]HÕRPÝÜX]P]Û  ][ÝÐY[[][ÝË

ÌJBÕRTÙ]Ý]H

BYX[XJ  ][ÝÐÚXÚÒ[I][ÝË
L
BÚ[HHIÌÍÛÙÈHÕRQÙ]ÙÊ
BTÙ[XÝPØÙH  ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑHÜ   ÌÍÛÙÈH ÌÍÝÙZ]BQ^]ÛÜQ[Ù[XÝÑ[[ÈÚXÚÒ[J
BSØØ[ ÌÍÜÝ]ÈH[TXY
    ][ÝØÎÌLÝ[  ÌLÝÝ[I][ÝË ][ÝÔÝ]É][ÝË   ][ÝÓY[[É][ÝË   ][ÝÒÙZ[][ÝÊBQÕRPÝÙ]]J   ÌÍÛY[[Ë ÌÍÜÝ]ÊB[[

2.

WinSetOnTop ( "title", "text", flag )

Link to comment
Share on other sites

Hello,

i have a very little script, which shows a Label with infos from an ini File.

Now i want the script to check every X Minutes, if the Key in the ini File has changed and then change the label to the actual key.

At the moment, my Test-Script looks like this:

#include <GUIConstants.au3>
$status = "Test"
GUICreate("Statusmeldung", 200, 100) 
GUICtrlCreateLabel ("Aktueller Status:",  10, 10)
$meldung = GUICtrlCreateLabel ( "Default" , 10, 30, 100)
$weiter = GUICtrlCreateButton("Beenden", 60, 70, 88, 25)

GUISetState ()  
While 1 
   $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $weiter Then Exit
    $status = IniRead ("c:\temp\test.ini", "Status", "Meldung", "Keiner")
    GUICtrlSetData ($meldung, $status)  
Wend

The status from the ini file is checked every time when the "While Loop" starts. That is more than 1 time per second. But i only want the ini file to be checked every x minute.

I think this is very easy to realise, but i don't know how.

An other little question: How can i make the Gui Windows always stay on the top of the desktop and never get in the background? It don't have to be active, but only on the top of the desktop.

Thank you

SpecialK

For the timing question: Look at TimerInit() and TimerDiff() in the help file (just note that the time is counted in milliseconds and do the math accordingly).

To set your window to stay on top, use:

WinSetOnTop ( "Statusmeldung", "", 1)

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

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