[Resource] Win32 API Constant Reference - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: [Resource] Win32 API Constant Reference (/showthread.php?tid=62270) [Resource] Win32 API Constant Reference by segosa on 07-01-2006 at 07:55 PM
Sometimes when scripting and I need to make an Interop.Call call to a Windows API function that takes a parameter which is a constant, such as MB_OK for MessageBox or WM_CLOSE for SendMessage, I need to find out the value of the constant and the way I do this is open Visual Studio, type the constant name and hover over it so that the tooltip tells me the value. That method sucked. I googled for a reference of all the constant values and I didn't find much either. RE: [Resource] Win32 API Constant Reference by ShawnZ on 07-01-2006 at 08:03 PM
Here's a version wrapped in the Windows object to keep your script tidy RE: RE: [Resource] Win32 API Constant Reference by segosa on 07-01-2006 at 08:06 PM
quote: You're meant to either find the value of the constant you need or copy/paste a few of them into your script, not ALL of them. Although I suppose if you placed that in an external js file it'd be useful (btw, usage is Windows.API_NAME). RE: [Resource] Win32 API Constant Reference by ShawnZ on 07-01-2006 at 08:12 PM Yes segosa, the point was to have it in an external script file. RE: [Resource] Win32 API Constant Reference by alexp2_ad on 07-01-2006 at 08:16 PM http://www.pinvoke.net/ has user32 functions and a whole load of other stuff. deAd found that one. RE: RE: [Resource] Win32 API Constant Reference by segosa on 07-01-2006 at 08:19 PM
quote: That only has a few values of constants, though. And all the examples are C# and VB. RE: [Resource] Win32 API Constant Reference by ShawnZ on 07-01-2006 at 09:05 PM Thats because the website is for C# and VB's Pinvoke functionality RE: [Resource] Win32 API Constant Reference by CookieRevised on 07-02-2006 at 02:59 AM
quote:And use an relative extreme amount of otherwise useless memory..... It might be very usefull for the "quick test driving" and developing of scripts (so you don't waste time on looking up and defining the constants), but I suggest not to use it in released versions and actually define only the ones you need in the released script. quote:I strongly suggest to get a list from somewhere else. WIN32API.TXT is known to contain a lot of mistakes, wrong values and not to mention far from being complete.... unfortunatly. ---------- Setting aside that WIN32API.TXT isn't a reliable source for this, both files (the one from Segosa and the one from Shawnz) contain leftover texts too (because of the way they were automatically created without checking the output?). And setting aside that leftover block of text near the end, Shawnz' file will even create more problems as there are a lot of constant names being used as values without linking them to the Windows object. RE: [Resource] Win32 API Constant Reference by ShawnZ on 07-02-2006 at 05:18 AM It'd be helpful if you pointed out where exactly it didn't work... RE: RE: [Resource] Win32 API Constant Reference by segosa on 07-02-2006 at 07:37 AM
quote: Have you got any examples of wrong constant values? Why is WIN32API inaccurate? I'm sure Microsoft don't change the values of constants whenever they're bored... Anyway, any suggestions where to get a complete, accurate constant list? quote: Please point out an example... EDIT: shawnz, I think the reason yours doesn't work is because of stuff like this: code: STANDARD_RIGHTS_REQUIRED and so on should be Windows.STANDARD_RIGHTS_REQUIRED for example, I think.. RE: RE: RE: [Resource] Win32 API Constant Reference by CookieRevised on 07-02-2006 at 09:22 AM
quote:WIN32API.TXT is based upon Win95 only, which has +-5000 constants (and 1500 functions). WinXP has more than a thenfold of that... As for the inaccuracy, eg: quote:and that's just one of the quotes you'll find when browsing for win32api.txt in google**. Even MS itself has suggested not to use it (go figure why they still included it in VB6)! A good source would be simply anything except the original win32api.txt file. eg: the one on AllAPI.net, ActiveVB's APIViewer, APIviewer 2004/API-Guide, etc etc... search google "win32api" and you'll find tons**... ** both reasons why I didn't pointed to sources in the first post as I assumed you would search for it. And the results will all point to those 2 things. quote:indeed, but not only that, both files also contains leftover text. Simply scroll your created files quickly and you'll notice it in an instant. RE: RE: RE: RE: [Resource] Win32 API Constant Reference by segosa on 07-02-2006 at 09:34 AM
quote: Hmm, I see now, just a place where my regex didn't catch a Type declaration. I'd bother fixing it, but I suppose the file's a bit useless now since it's inaccurate/incomplete RE: [Resource] Win32 API Constant Reference by CookieRevised on 07-02-2006 at 09:38 AM
quote:Yeah... checking the output would have revealed that (you lazy you j/k)... btw, I attached the most accurate you'll find (from APIviewer 2004) in previous post. This is for Win32 (thus not Win 16, nor Win CE). Notice the size of it compared to the original one! Note: be carefull with auto-converting though!. In some cases you need to take in account the kind of number type being used, especially when the constant equals -1; A -1 as Integer is not the same as -1 as a Long. Also paranthesis are often used, which are actually pretty useless in many cases, they can be removed. RE: [Resource] Win32 API Constant Reference by segosa on 07-02-2006 at 09:59 AM
http://m00.cx/win32api.txt RE: [Resource] Win32 API Constant Reference by CookieRevised on 07-02-2006 at 11:02 AM
Nope, there are sill many many errors. Some could be in the original file also, but most are caused by the auto-converting. RE: RE: [Resource] Win32 API Constant Reference by segosa on 07-02-2006 at 11:18 AM
quote: All of those were in the original file. My "auto converting" just didn't catch them. Don't forget this was meant to be a quick reference to find the values of constants, not a file with entirely valid JScript. It was shawnz' idea to create a wrapper object, not mine. Anyway, the latest is here: http://m00.cx/win32api.txt I would say, even though there are bound to be small errors, it's *useful* as a reference for Win32 API constants. |