Sign in to follow this  
Followers 0
hoppy

Runonce

7 posts in this topic

I've got a script that's started with runonce, but some parts start to soon.

How can I pause the script untill the desktop is loaded?

I'm unable to find something to wait for .

Any ideas?

Thanks for your intrest.

Share this post


Link to post
Share on other sites



Can you please post your script so we can see what we can do with it?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

try

sleep(.......)

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage");Shift-Alt-d

;;;; Body of program would go here;;;;
If WinExists("........") Then
    HotKeySet("{......}", ".....")
Else
    MsgBox(64, "Info", "....................!")
    Exit(0)
EndIf

Func Close()
    Send("{....}")
EndFunc

While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc

$val = RunWait("Notepad.exe", "C:\WINDOWS", @SW_MAXIMIZE)
; script waits until Notepad closes
MsgBox(0, "Program returned with exit code:", $val)

ProcessWait("notepad.exe")

not really sure what your doing though try one of thoughs

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

...How can I pause the script untill the desktop is loaded?...

WinWait("Program Manager")

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks,

I'll give these things a shot when I'm back from work.

Share this post


Link to post
Share on other sites

HKCU\...\RunOnce starts when the desktop is running.

HKLM\...\RunOnce starts before the desktop is running and wait for each entry to finish.

Share this post


Link to post
Share on other sites

just what i needed

thanks m8

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
Sign in to follow this  
Followers 0