简体   繁体   English

使用 HTA 调整 window(不是应用程序窗口)的大小

[英]Resizing a window (not the application window) with HTA

This is a interesting question.这是一个有趣的问题。 We are trying to resize another window (not the application window, and not it's child), in a HTA environnement.我们正在尝试在 HTA 环境中调整另一个 window(不是应用程序 window,而不是它的孩子)的大小。

I found the following code to read the processId我找到以下代码来读取 processId

// Process name
var objWMIService = GetObject('winmgmts:root\\CIMV2');
e = new Enumerator(objWMIService.ExecQuery('SELECT * FROM Win32_Process'));
for(; !e.atEnd(); e.moveNext()) {
    var s = e.item();   
    $('body').append('<p>' + s.Name + " ; " + s.Description + " ; " + s.ProcessID +    '</p>');
}

The code works on Windows XP, it has not been tested on windows7.该代码适用于 Windows XP,尚未在 windows7 上测试。

Is there any way to do the same to get the running windows on a PC.有什么方法可以在 PC 上运行 windows。

Thanks谢谢

In order to trap the processId of the launched application you need to use the function Exec from WScript.Shell.为了捕获已启动应用程序的 processId,您需要使用 WScript.Shell 中的 function Exec。

Full documentation: http://msdn.microsoft.com/en-us/library/x78640t0(v=VS.85).aspx完整文档: http://msdn.microsoft.com/en-us/library/x78640t0(v=VS.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM