Jump to content

Sleep hangs while outlook loads


Bert
 Share

Recommended Posts

I have a start up script that I use to load a few things when I first boot up in the morning. What I'm noticing is the loop hangs for a bit while outlook is loading. I have a 1 year old rig, 4gigs of memory, and not that much running before I run the script. Other than this little performance issue, the PC performs very well. Here is the snippit of script that the problem is occurring:

if ProcessExists("OUTLOOK.EXE")=0 then 
    run("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE")
    $x=1
    TrayTip("", "Waiting on Outlook for "&$x&" second", 1, 1)
endif
while 1
    sleep(1000)
    if WinExists ("Microsoft Outlook", "Salesforce Association Toolbar") then
        $h = run('"C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "https://xxxxxxxxxx.xxxxxxxxx.com/?un=xxxxxxxx%40xxxxxx.com&pw='&$2&'"')
        exitloop
    endif
    if $x=30 then ExitLoop
    $x=$x+1
    TrayTip("", "Waiting on Outlook for "&$x&" seconds", 1, 1)      
wend

What is supposed to happen is the tool tip tells me how many seconds Outlook takes to load before loading Firefox. What I'm noticing is the seconds will tick by like this: 1..2..3..4............5........6..7..8..........9...10..11

Anyone got a suggestion on how to handle this?

Link to comment
Share on other sites

Try like this so even if it hangs it will give a true amount of time passed when it can update the traytip.

if ProcessExists("OUTLOOK.EXE")=0 then
    run("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE")
    $x=1
    TrayTip("", "Waiting on Outlook for "&$x&" second", 1, 1)
endif
Local $iTimer = TimerInit()
while 1
    sleep(1000)
    if WinExists ("Microsoft Outlook", "Salesforce Association Toolbar") then
        $h = run('"C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "https://xxxxxxxxxx.xxxxxxxxx.com/?un=xxxxxxxx%40xxxxxx.com&pw='&$2&'"')
        exitloop
    endif
    If (TimerDiff($iTimer) / 1000) >=30 then ExitLoop
    TrayTip("", "Waiting on Outlook for "&Round(30-(TimerDiff($iTimer) / 1000))&" seconds", 1, 1)
wend
GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
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...