How to call Windows API functions in JScript?

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

This clearly does not work:

var id = GetCurrentProcessId(); WScript.Echo("ProcessId is " + id); 
+7
javascript winapi
source share
2 answers

Windows APIs are not available for the JScript runtime. You are limited by the methods and properties listed in the MSDN JScript language link , although you can also connect to WMI and instantiate COM objects to go beyond the limits of JScript.

+2
source share

You have an answer in DynamicWrapperX v1.0 .

+2
source share

All Articles