如何获取启动的任何应用程序的通知
我正在开发一个适用于 Windows Mobile 6.5 的应用程序,它需要知道何时启动任何应用程序。 有什么方法可以在启动任何应用程序时收到通知吗?
我们可以做这样的事情吗?
i am working on an application for windows mobile 6.5, which need to know whenever any application is launched.
Is there any way to get notified when any application is launched?
Can we do something like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为没有办法在创建新进程时获取事件。但是,您可以使用 ToolHelp API 获取进程列表,因此应该可以获得必要的信息,但您需要不断轮询才能检测进程何时启动。
紧凑框架中不提供对 ToolHelp API 的访问,但您可以使用本机 API 代替。可以在此处找到示例: http://msdn.microsoft.com/en-我们/library/aa446560.aspx
I don't think there is a way to get an event when a new process is created. However, you can get a list of processes using the ToolHelp API, so it should be possible to get the necessary information, but you need to continuously poll in order to detect when a process is started.
Access to the ToolHelp API is not provided in compact framework but you can use the native API instead. An example can be found here: http://msdn.microsoft.com/en-us/library/aa446560.aspx
我认为您将不得不使用艾伦的建议来轮询可用的进程。我曾研究过自定义 Windows CE shell,它们使用 RegisterTaskBar(HWND) 在创建、引发和销毁窗口时接收通知。但这并不意味着每个进程都有一个窗口。
I think you're going to have to poll for the available processes using Allan's suggestion. I've worked on custom Windows CE shells, and they use the RegisterTaskBar(HWND) to receive notification when windows are created, raised, and destroyed. But that doesn't means every process has a window.