Sign in to follow this  
Followers 0
flip2405

Process watching

6 posts in this topic

Can some one build me an example script.....

What i want it to do is watch my processlist then when notepad.exe closes it sends me a message saying notepad closed

Share this post


Link to post
Share on other sites



What have you tried yet that isn't working ?

Did you also look in the helpfile at:

ProcessExists()

ProcessWaitClose()

:)


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

Can some one build me an example script.....

What i want it to do is watch my processlist then when notepad.exe closes it sends me a message saying notepad closed

You've been a part of the forum long enough to know to post an example of what you've tried.

You could use AdlibEnable() / DllCallBackRegister + SetTimer dllcall / or even a simple While/Wend loop with ProcessExists() nested in an If/Then conditional statement.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If you are bored, look at my process manager. Look at the part where it refreshes the list. If a new process is found or one was closed, it refreshes the list. Then you only have to play with arrays.. shouldn't be hard to do.

-edit-

I thought he mentioned notepad.exe as an example... maybe he wants to do it for any process? He should be clearer...

Edited by Nahuel

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

okay here is what iv tryed

Sleep(1200)
While 1
$D = ProcessExists("Notepad.exe")
 WEnd
 If $D = 1 Then
     MsgBox(0,"Hi","3")
 EndIf
 
 If $D = 0 Then
     Msgbox(0,"bye","2")
     EndIf
Edited by SmOke_N

Share this post


Link to post
Share on other sites

okay here is what iv tryed

Sleep(1200)
While 1
$D = ProcessExists("Notepad.exe")
 WEnd
 If $D = 1 Then
     MsgBox(0,"Hi","3")
 EndIf
 
 If $D = 0 Then
     Msgbox(0,"bye","2")
     EndIf
You never leave the loop is why you never get a message box.

Use Jdeb's example if it's as simple as you have it here:

ProcessWaitClose("notepad.exe")
MsgBox(64, "Info", "Process no longer exists")

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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