Foxpro访问Windows正在运行的进程以及如何结束正在运行的进程
如何获取 Foxpro 9 中任务管理器运行进程的列表,以及如何终止 FoxPro 列表中的其中一个进程?
How do I get a list of the Task manager running processes in Foxpro 9, and how can I kill one of these processes in the list in FoxPro?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 WMI 可以让这变得简单。在 http://www.berezniker.com/content/pages/visual-foxpro/check-if-exe-running-and-optionally-terminate-it 也可以轻松适应列出进程。
Using WMI makes this easy. There's a sample implementation of terminating a process using WIN32_Process at http://www.berezniker.com/content/pages/visual-foxpro/check-if-exe-running-and-optionally-terminate-it which could also easily be adapted to list the processes.
这是一个杀死特定程序的所有可见实例的函数。您需要知道它的类名。我已经能够通过搜索找到常见应用程序(如 Office 应用程序)的类名:
刚刚意识到进程可能与应用程序不同。看起来查找进程的API函数是EnumProcesses。查看 http://www.news2news.com/vfp/?group= -1&函数=246。
添马舰
Here's a function to kill all visible instances of a particular program. You need to know its ClassName. I've been able to find ClassNames for common applications (like the Office apps) by searching:
Just realized that a process may not be the same as an application. It looks like the API function for finding processes is EnumProcesses. Check out http://www.news2news.com/vfp/?group=-1&function=246.
Tamar