Jump to content

Process watching


Recommended Posts

  • Developers

What have you tried yet that isn't working ?

Did you also look in the helpfile at:

ProcessExists()

ProcessWaitClose()

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
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
Edited by SmOke_N
Link to comment
Share on other sites

  • Moderators

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.

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...