开发者

How to call Windows API functions in JScript?

开发者 https://www.devze.com 2023-01-11 18:35 出处:网络
I would like to obtain the current process id in a JScript script. This id is r开发者_如何学JAVAeturned by the Windows API GetCurrentProcessId (http://msdn.microsoft.com/en-us/library/ms683180.aspx) f

I would like to obtain the current process id in a JScript script. This id is r开发者_如何学JAVAeturned 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.


You have the answer in DynamicWrapperX v1.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消