让我们从一个示例开始,用户在Visual Studio中为解决方案>项目打开了几个选项卡(Default.aspx,Default.aspx.cs)我以编程方式想要监视devenv.exe进程并想知道哪个选项卡(文件准确无误) )用户正在努力。 如果有一些日志文件或进程对象有一些属性告诉? 或者必须完成图像处理?
Let's start with an example, User have several tabs opened for a solution>project in Visual Studio (Default.aspx, Default.aspx.cs) I programmatically want to monitor devenv.exe process and want to know which tab (file to be exact) user is working on. If there's some log file or process object has some attribute that tells? Or it has to be done with image processing?
最满意答案
您可以为Visual Studio编写扩展并监视DTE.Events.WindowEvents.WindowActivated 。 在活动窗口中,您可以获取文件用户正在处理的Document.FullName 。
请参阅例如状态栏中活动窗口的显示文档路径 。
You can write an extension for Visual Studio and monitor DTE.Events.WindowEvents.WindowActivated. From an active window you can get Document.FullName for a file user is working on.
See for example Display document path of the active window in the status bar.
更多推荐
发布评论