TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The entire win32 API in JavaScript

113 pointsby Benvieover 12 years ago

12 comments

brokenparserover 12 years ago
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.
评论 #4801292 未加载
ruswickover 12 years ago
This is fascinating, but I just can't discern a practical purpose.<p>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.)<p>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.<p>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.
评论 #4800883 未加载
评论 #4800905 未加载
评论 #4805827 未加载
评论 #4801108 未加载
tezzaover 12 years ago
I want to put a reminder that Windows itself provides a lot of background command scripting via WHost<p><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wsh_overview.mspx?mfr=true" rel="nofollow">http://www.microsoft.com/resources/documentation/windows/xp/...</a><p>Things like accessing namespace folders, creating shortcuts, etc are easier through this WHost interface than the raw API.
scgover 12 years ago
Can someone please explain what's the purpose of this JS code?
评论 #4800198 未加载
评论 #4800306 未加载
评论 #4800197 未加载
k3nover 12 years ago
Nice! Do you have a quick example you could share?
评论 #4801377 未加载
评论 #4800253 未加载
olalondeover 12 years ago
Was this generated with Clang? I hope it was not written by hand...
weejover 12 years ago
Sshhhh...don't let this individual know that Windows 8 API, Windows Runtime (RT), is available in JavaScript.<p>That said, WinRT doesn't expose Win32 API. Well done. That takes dedication, skill, and lack of sanity.<p>&#62; Edit WinRT API link: <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/apps/br21137...</a>
4adover 12 years ago
I'm more interested in how this was automatically generated rather than in the end product itself.
评论 #4800464 未加载
评论 #4802184 未加载
guiomieover 12 years ago
What is the overhead of using FFI in this case vs going with a native c/c++ module ?
yarrelover 12 years ago
s/in/wrapped in/
Cordiapxqover 12 years ago
Not sure what the point of this is.. can someone enlighten me?
评论 #4800383 未加载
评论 #4800572 未加载
cpayneover 12 years ago
Still no cure for cancer...