如何使用JScript获取进程的主窗口句柄

如何使用JScript获取进程的主窗口句柄

本文介绍了如何使用JScript获取进程的主窗口句柄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JScript中是否有任何方法通过提供进程名称来获取进程主窗口的句柄? Process.MainWindowHandle 属性仅适用于JScript .NET.经典的JScript有类似的功能吗?

Is there any method in JScript to get the handle of the main window of a process by providing the process name? The Process.MainWindowHandle property works only in JScript .NET. Is anything similar available in classic JScript?

推荐答案

好,一旦我不得不为Outlook编写一个加载项.我的老板希望在Outlook加载时显示启动屏幕.但是Outlook窗口越过飞溅.经过大量搜索后,我发现FindWindow http://msdn.microsoft.com/query/dev10. query?appId = Dev10IDEF1& l = EN-US& k = k%28FINDWINDOW%29%3bk%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29%3bk%28DevLang-CSHARP%29& rd = true 这是有帮助的.此函数根据窗口标题和窗口类名称查找窗口.我p调用它并从C#中使用它.如果您可以通过JScript使用此功能,我认为它可以为您完成这项工作. (我使用Spy ++查找lpClassName参数)

Well once i had to write a add-in for Outlook. My boss wants a splash-screen to appear when Outlook loads. But Outlook window goes over the splash. After a lot of search i found FindWindow http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28FINDWINDOW%29%3bk%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29%3bk%28DevLang-CSHARP%29&rd=true this is help for it . This function finds window based on window caption and window class name. I p-invoked it and used it from C#. If you can use this function through JScript I think it could do the job for you. (I used Spy++ for finding lpClassName parameter)

这篇关于如何使用JScript获取进程的主窗口句柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:18