How to call Windows API functions in JScript?

I would like to obtain the current process id in a JScript script. This id is returned by the Windows API GetCurrentProcessId (http://msdn.microsoft.com/en-us/library/ms683180.aspx) function. How do I call this function in JScript?

This obviously doesn't work:

var id = GetCurrentProcessId();
WScript.Echo("ProcessId is " + id);

Windows APIs aren't made available to the JScript runtime. You're limited to methods and properties listed in the MSDN JScript language reference, although you can also connect to WMI and create instances of COM Objects to extend beyond JScript's limitations.


您在DynamicWrapperX v1.0中有答案。

链接地址: http://www.djcxy.com/p/47542.html

上一篇: jQuery JSONP回调没有开火

下一篇: 如何在JScript中调用Windows API函数?