What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Resource] Win32 API Constant Reference

Pages: (2): « First « 1 [ 2 ] Last »
[Resource] Win32 API Constant Reference
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RE: [Resource] Win32 API Constant Reference
quote:
Originally posted by segosa
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...
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:
If you spend just a few seconds browsing WIN32API (or it's database twin), you'll see the hundreds of functions that are yours for the calling. So why wouldn't you use it? Well ... because it may be impressive, but it's often just not correct. Here's what Bruce McKinney says about it, "Unfortunately, WIN32API.TXT has a well-earned reputation for being full of errors." Dan Appleman agrees, "Frankly, Win32API.TXT is not perfectly good. In fact, it's not even close."
(..)
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:
Originally posted by segosa
quote:
Originally posted by CookieRevised
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?).
Please point out an example...

EDIT: shawnz, I think the reason yours doesn't work is because of stuff like this:
code:
Windows.prototype.SECTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE;
STANDARD_RIGHTS_REQUIRED and so on should be Windows.STANDARD_RIGHTS_REQUIRED for example, I think..
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.


.zip File Attachment: Win32api.zip (609.05 KB)
This file has been downloaded 812 time(s).

This post was edited on 07-02-2006 at 09:34 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2006 09:22 AM
Profile PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
O.P. RE: RE: RE: RE: [Resource] Win32 API Constant Reference
quote:
Originally posted by CookieRevised
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.


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 :P


This post was edited on 07-02-2006 at 09:48 AM by segosa.
The previous sentence is false. The following sentence is true.
07-02-2006 09:34 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Resource] Win32 API Constant Reference
quote:
Originally posted by segosa
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 :P
Yeah... checking the output would have revealed that (you lazy you :p 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.



This post was edited on 07-02-2006 at 09:40 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2006 09:38 AM
Profile PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
O.P. RE: [Resource] Win32 API Constant Reference
http://m00.cx/win32api.txt

Does it get the CookieRevised seal of approval?

EDIT: Bah, VB also has Not which needs to be converted too.

* segosa fixes..


This post was edited on 07-02-2006 at 10:02 AM by segosa.
The previous sentence is false. The following sentence is true.
07-02-2006 09:59 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Resource] Win32 API Constant Reference
Nope, there are sill many many errors. Some could be in the original file also, but most are caused by the auto-converting.


Stuff like:
var ADDRESS = ADDRESS64;
=> ADDRESS64 isn't defined as it was a structure

var ADDRESS_SIZE = sizeof(ADDRESS);
var ADDRESSINFO_SIZE = sizeof(ADDRESSINFO);
=> sizeof() is invalid in JScript and also these were structures

var AGENTAUDIOERROR_DEVICE = AGENTAUDIOERROR(1);
=> Arrays which aren't defined

var ALID_CHARSET = VALID_CHARSET = -27;
=> Dunno if this is due to the auto-converting or if this was already so in the original file. But it doesn't make much sense. Might need to check with the msdn library.

var AMF_AUTOMATICGAIN = -1#;
=> # isn't valid in JScript

var BEGIN_INTERFACE = virtual void a() {};
=> hmmmm....

var BFT_LOG = "\x01" | BFT_LOG_DIRECTORY;
=> Makes even less sense (boolean comparisson between a string and a number)

var CANNOT_LOAD = UINT(-8);
=> Dunno if this was in original file or not.

var ALG_CLASS_DATA_ENCRYPT = (3 * 2 ^ 13)
=> In JScript ^ means bitwise XOR, not the same as taken the power of which is meant here.


Also check every negative number. As I said earlier, a negative 'integer' isn't the same as the same number as a negative 'long'. eg: -1 as an integer (2bytes) is 65535 as a long (4bytes).


All these examples or only one example of the same kinds I got from quicky browsing the file, the file is full of things like these...

This post was edited on 07-02-2006 at 02:24 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2006 11:02 AM
Profile PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
O.P. RE: RE: [Resource] Win32 API Constant Reference
quote:
Originally posted by CookieRevised
Nope, there are sill many many errors. Some could be in the original file also, but most are caused by the auto-converting.


Stuff like:
var ADDRESS = ADDRESS64;
=> ADDRESS64 isn't defined as it was a structure

var ADDRESS_SIZE = sizeof(ADDRESS);
var ADDRESSINFO_SIZE = sizeof(ADDRESSINFO);
=> sizeof() is invalid in JScript and also these were structures

var AGENTAUDIOERROR_DEVICE = AGENTAUDIOERROR(1);
=> Arrays which aren't defined

var ALID_CHARSET = VALID_CHARSET = -27;
=> Dunno if this is due to the auto-converting or if this was already so in the original file. But it doesn't make much sense. Might need to check with the msdn library.

var AMF_AUTOMATICGAIN = -1#;
=> # isn't valid in JScript

var BEGIN_INTERFACE = virtual void a() {};
=> hmmmm....

var BFT_LOG = "\x01" | BFT_LOG_DIRECTORY;
=> Makes even less sense (boolean comparisson between a string and a number)

var CANNOT_LOAD = UINT(-8);
=> Dunno if this was in original file or not.


Also check every negative number. As I said earlier, a negative 'integer' isn't the same as the same number as a negative 'long'. eg: -1 as an integer (2bytes) is 65535 as a long (4bytes).


All these examples or only one example of the same kinds I got from quicky browsing the file, the file is full of things like these...


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.


This post was edited on 07-02-2006 at 11:19 AM by segosa.
The previous sentence is false. The following sentence is true.
07-02-2006 11:18 AM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On