Jump to content
Sign in to follow this  
lilandywandy

Can someone verify if this is good?

Recommended Posts

lilandywandy

If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")<---[B]instead of msgbox, how can i make the computer do "nothing" or like sleep kinda[/B]
EndIf

and how can i add: " is process doesnt exist , then do BLAH"

Share this post


Link to post
Share on other sites
Jos

If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")<---[B]instead of msgbox, how can i make the computer do "nothing" or like sleep kinda[/B]
EndIf

and how can i add: " is process doesnt exist , then do BLAH"

<{POST_SNAPBACK}>

While 1
    While ProcessExists("notepad.exe") 
        sleep(10)
    WEnd
; do here what you want to do when process doesn't exists
WEnd

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
MSLx Fanboy

If ProcessExists("notepad.exe") Then

Sleep('1000')

Else

MsgBox(0,"Title", "Message", "10")

EndIf

You can put the While loop inside of the If statement so that it continues to sleep until the process doesn't exist any more. Make sure to change the "While 1" to "While ProcessExists("notepad.exe")" else it will not stop sleeping, and the script will never end.


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites
zeroZshadow

use the exitloop command for exiting the loop


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.