Microsoft Interop:如何获取当前创建的进程ID名称 [英] Microsoft Interop: How to get the Currently Created Process Id Name

查看:73
本文介绍了Microsoft Interop:如何获取当前创建的进程ID名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我为

Hi,

I created an object for

Microsoft.Office.Interop.Excel.Workbook xlBook;



通过使用这个对象,我调用了方法


by using this Object, I called the method

xlBook.Open(path,missing....);



当调用此open方法时,它会在任务管理器中创建一个excel.exe列表。



我的任务是,我需要在创建excel.exe时获取进程ID





在此先感谢。



火影忍者....





[原标题]

如何获取当前创建的进程ID,调用时的名称Microsoft.Office.Interop.Excel.Workbook xlBook.Open(..)method


when this open method gets called, it creates one excel.exe listing in the task manager.

My task is, I need to get the process Id when excel.exe is created


Thanks In Advance.

Naruto....


[original title]
How to get the Current created process Id,Name when call Microsoft.Office.Interop.Excel.Workbook xlBook.Open(..) method

推荐答案

http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/1185699b-4afc-40f9-8947-360da540db50 [< a href =http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/1185699b-4afc-40f9-8947-360da540db50target =_ blanktitle =New Window> ^ ]


Excel应用程序具有有趣的属性: Hwnd [ ^ ] ,它返回一个数字,指示Microsoft Excel窗口的顶级窗口句柄。

当您捕获Excel应用程序的句柄时,您可以使用 Process.GetProcessById() [ ^ ]到Excel应用程序。
Excel application has interesting property: Hwnd[^], which returns a number indicating the top-level window handle of the Microsoft Excel window.
When you catch the handle to Excel application, you can use Process.GetProcessById()[^] to Excel application.


这篇关于Microsoft Interop:如何获取当前创建的进程ID名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆