开发者

Is there a windows message that I can hook for when an application starts?

开发者 https://www.devze.com 2022-12-17 08:15 出处:网络
I want to know whenever any application starts. Is there a windows message开发者_运维知识库 that I can set a hook for to know exactly when that happens?If polling is not a problem you could use one of

I want to know whenever any application starts. Is there a windows message开发者_运维知识库 that I can set a hook for to know exactly when that happens?


If polling is not a problem you could use one of the approaches described in the answers to a related question:

C# Process Monitor

The suggested solutions use WMI or Windows audit process tracking mechanism.


The first message sent to new windows is WM_NCCREATE. But this has nothing to do with the process itself, which is what I suspect you're asking? By definition 'window messages' will start to arrive only after you create a window (using CreateWindowEx or whatever), but that can happen long after the process has started.

You don't say what language/framework you're using. In VC++ and the like you can just use whatever passes for the WinMain function. For VB it would be a Main function in a module.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号