Jump to content

Tray not run program


silvano
 Share

Recommended Posts

hello,

I have a problem with tray...

I have created script that check registry key and

run a program, like schedule task, but if I don't move mouse over tray ico don't start...

this is my partial script

Opt("TrayIconHide", 0)   ;0=show, 1=hide tray icon
Opt("TrayAutoPause",0) ; Script will not be paused when clicking the tray icon.
;Opt("TrayOnEventMode",1) 
Opt("TrayMenuMode",1)
; .....
;func & GUI
;....

$start = RegRead($chiaveREG, "start")
While 1
    $msgItem = TrayGetMsg()


If $start == @HOUR&":"&@MIN Then
        Run("myprog.exe",@ScriptDir)
        ExitLoop
EndIf
; ........
WEnd
exit
Link to comment
Share on other sites

the tray icon does not have anything to do with the "run" portion of your script

;$start = RegRead($chiaveREG, "start") ;
$start = @HOUR & ":" & @MIN + 2 ; for testing

While 1

    $start2 = @HOUR & ":" & @MIN

    If $start = $start2 Then
        Run("notepad.exe")
        ExitLoop
    EndIf

    ToolTip("Start Time = " & $start & @CRLF & "Real Time = " & $start2, 20, 20, "Time Machine", 1)
    Sleep(2000)

WEnd
Exit

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

the tray icon does not have anything to do with the "run" portion of your script

;$start = RegRead($chiaveREG, "start") ;
$start = @HOUR & ":" & @MIN + 2 ; for testing

While 1

    $start2 = @HOUR & ":" & @MIN

    If $start = $start2 Then
        Run("notepad.exe")
        ExitLoop
    EndIf

    ToolTip("Start Time = " & $start & @CRLF & "Real Time = " & $start2, 20, 20, "Time Machine", 1)
    Sleep(2000)

WEnd
Exit

oÝ÷ ÛÂ!j÷­zËb¨º»®*mnë]¢}ý·
+Ø^¦ºé¢²)íë®*m,!W¥w¥G­+:Ó}к^wzÚ[v+à·­7ݨµáÞ¶jëh×6
while 1 
If $msgItem = 0 Then ContinueLoop ; comment this
....
WEnd
Exit

if I comment this line the script work! bho!?

tks a lot..

but now I have a question...

this script work as similar to schedule task but while script is most cpu intensitive...

a smart solution is DOS AT for program schedule task, but I don't know to generate it with autoit

another solution is the Sleep() func before while script

Question: who is the best solution?

bye

Edited by silvano
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...