Jump to content

Recommended Posts

Posted

Hello,

first of all, I need to know, whether a windows api exists, which logs (or broadcasts windows messages) when a new process starts to exist or ceases to be in existence.

What I mean is, like the DBT_DEVICEARRIVAL event, when windows posts (or sends) messages to all top level windows, when a new (USB) device is connected.

Why I need this, is because I want to write a script which will (surprisingly :) ) monitor specific running processes, and when it (or they) do exist, specific things would happen.

I think the poll-the-running-processes method (ProcessList) is overkill, because:

-only to refresh the non-changed process list is, well, overkill.

-if I set 1 sec to the polling interval, well, under a second a lot of things can happen (say, I want to suspend the process immediately when it starts, 'till some conditions are met).

 

So, long story short: are more efficient, maybe out-of-the-box windows API methods to track the existence of specific processes?

 

Thanks.

Best Regards,

CiV.

I know that my code is ugly. But it works. Mostly.

Posted

i was thinking... "is it possible, that no-one has ever asked this before?"

google: autoit monitor process

one good result here:

'?do=embed' frameborder='0' data-embedContent>>

you can easily adapt to your needs.

Signature - my forum contributions:

  Reveal hidden contents

 

Posted

@orbs: You are right, WMI is always a solution. But. I think with its poll-everything-in-a-database and filter-things-out method is even more overkill, than the regular "functional" way.

Some time ago I was tinkering with process CPU usage stats, and I found out (or found in the forums), that there are (at least) two methods:

-WMI,

-and some WinAPI function calls to achieve it (which method is obviously quicker and uses minimal footprint).

I'm sorry, I was not specific, that I want to avoid WMI as much as possible, because I think it's a hog.

So, what I am curious, is, whether some register-your-process-at-runtime-and-you'll-get-windows-notifications like, or a read-EventLog-like (if it's not equal to WMI, coz' don't know that) method exists?

 

BR, CiV.

I know that my code is ugly. But it works. Mostly.

Posted

My idea in that thread still works for processes that have windows.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

@guinness: Thanks. I think that'll work. (for processes that have windows :) )

I know that my code is ugly. But it works. Mostly.

Posted

You're welcome.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...