JSctypes: Difference between revisions

Jump to navigation Jump to search
616 bytes added ,  20 October 2009
Additional hints about referencing the dll without a path
(Additional hints about referencing the dll without a path)
Line 40: Line 40:
lib.close();
lib.close();
</pre>
</pre>
Instead of defining the whole path, you may also just give the file name.
<pre>
var lib = ctypes.open("user32.dll");
</pre>
Or even without the extension.
<pre>
var lib = ctypes.open("user32");
</pre>
If the full path is not given, Windows uses the following search order to locate the DLL:
#The current directory of the task that is using the DLL.
#The \WINNT directory.
#The \WINNT\SYSTEM directory.
#The \WINNT\SYSTEM32 directory.
#The directory of the executable for the task that is using the DLL.
#A directory listed in the PATH environment variable.
(taken from http://support.microsoft.com/kb/164501/)


{{Note|This functionality cannot be accessed from JavaScript used in web content. Only JavaScript that runs with chrome privileges (extensions and Firefox UI for example) can use js-ctypes.}}
{{Note|This functionality cannot be accessed from JavaScript used in web content. Only JavaScript that runs with chrome privileges (extensions and Firefox UI for example) can use js-ctypes.}}
20

edits

Navigation menu