What appears to be missing is the automatic mapping of the A (ansi) and W (wide) suffixed function names to conventional unsuffixed function names. In C, this is done using macros. If UNICODE is not defined, the macro MessageBoxEx would expand to MessageBoxExA. With UNICODE, the macro expands to MessageBoxExW. Similarly, TEXT is used to wrap strings to ensure they're unprefixed or prefixed with an L respectively. You could do this by hand, it's just a bit more tedious to write.
One would wish these distinctions could be forgotten with calling the Win32api from JS. However, that is a pipe dream and could have an impact on performance.
This is fascinating, but I just can't discern a practical purpose.
The novelty of the "I just converted this huge piece of software written in c or machine code into JS" type of post usually extends only to the title. The link itself generally serves only to evoke a profound "WTF" (and in this case took upwards of 40 seconds to load.)
Although I appreciate the undertaking of compiling prodigious libraries, drivers, etc. into JS, I don't see practical value in the product of said undertaking.
The fact that this practice has proliferated throughout HN recently is odd. This kind of thing is certainly remarkable, but it doesn't do anything.
You're 100% right but you're missing something here. Something like this takes skill and builds skill and when you've finished you just want to show it off. And it really is impressive! Sure, it has no practical application itself but I'm sure that some piece of this or some technique used in porting it to JS will have some practical value somewhere. Sometimes the practical is born from the impractical.
I guess what I'm saying is why does it need to do anything or be practical? Cool stuff is just cool sometimes.
sarvesh, you were hellbanned more than 3 years ago. His post:
Windows script host (cscript) allows you to execute js files in addition to vbscript (vbs). This is particularly useful in extending the functionality of batch files. This can be useful in a lot of circumstances build process, installation etc.
Possibly with https://github.com/tjfontaine/node-libclang. I'm actually working on a node module that will automatically parse header files using libclang and make native dynamic libraries available with no configuration required on the end of the developer. It will eventually be part of https://github.com/olalonde/better-require if you're interested.
The actual code generator I haven't published because it was kind of a pile of crap. I created bindings to libclang as well here but haven't finished rewriting a more generalized code generator from it https://github.com/Benvie/node-clang/blob/master/bindings.js
[+] [-] brokenparser|13 years ago|reply
[+] [-] vinayan3|13 years ago|reply
[+] [-] ruswick|13 years ago|reply
The novelty of the "I just converted this huge piece of software written in c or machine code into JS" type of post usually extends only to the title. The link itself generally serves only to evoke a profound "WTF" (and in this case took upwards of 40 seconds to load.)
Although I appreciate the undertaking of compiling prodigious libraries, drivers, etc. into JS, I don't see practical value in the product of said undertaking.
The fact that this practice has proliferated throughout HN recently is odd. This kind of thing is certainly remarkable, but it doesn't do anything.
[+] [-] bpatrianakos|13 years ago|reply
I guess what I'm saying is why does it need to do anything or be practical? Cool stuff is just cool sometimes.
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] alter8|13 years ago|reply
Windows script host (cscript) allows you to execute js files in addition to vbscript (vbs). This is particularly useful in extending the functionality of batch files. This can be useful in a lot of circumstances build process, installation etc.
[+] [-] sarvesh|13 years ago|reply
[deleted]
[+] [-] tezza|13 years ago|reply
http://www.microsoft.com/resources/documentation/windows/xp/...
Things like accessing namespace folders, creating shortcuts, etc are easier through this WHost interface than the raw API.
[+] [-] scg|13 years ago|reply
[+] [-] Androsynth|13 years ago|reply
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] k3n|13 years ago|reply
[+] [-] Benvie|13 years ago|reply
This is the beginnings of a windows registry library https://github.com/Benvie/node-winreg
This is an example of creating a windowless event loop in order to create a low level keyboard/mouse hook https://github.com/Benvie/node-Windows/blob/master/input.js
[+] [-] donebizkit|13 years ago|reply
[+] [-] olalonde|13 years ago|reply
[+] [-] weej|13 years ago|reply
That said, WinRT doesn't expose Win32 API. Well done. That takes dedication, skill, and lack of sanity.
> Edit WinRT API link: http://msdn.microsoft.com/en-us/library/windows/apps/br21137...
[+] [-] 4ad|13 years ago|reply
[+] [-] olalonde|13 years ago|reply
[+] [-] Benvie|13 years ago|reply
[+] [-] guiomie|13 years ago|reply
[+] [-] yarrel|13 years ago|reply
[+] [-] Cordiapxq|13 years ago|reply
[+] [-] thibaut_barrere|13 years ago|reply
You can for instance get processes informations, start a wave sound, and many more.
Scroll down to the middle to see API calls.
One use-case is using CoffeeScript or JavaScript to write tools that would benefit from these calls (could be system tools, or not).
[+] [-] guiomie|13 years ago|reply
[+] [-] cpayne|13 years ago|reply