如何使用JScript获取进程的主窗口句柄? [英] How to get the main window handle of a process using JScript?

查看:139
本文介绍了如何使用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

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获取进程的主窗口句柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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