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:
segosa
Community's Choice
*****


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

I then remembered VB came with a file called WIN32API.TXT that contained all the Constants, Declares and Types used by the Win32 API functions. However I didn't like the format of the file (as I don't like VB's syntax anyway) so I used a combination of (regex) find/replace and various other things to format the file the way JScript developers would find most convenient. I removed the useless Declares and Types, changes &H for hex into 0x, And and Or into & and |, and made each line follow the format 'var CONST = 0xVALUE;' so that it's possible to easily copy and paste it into your script should you want to.

The file is hosted here: [EDITED: file found to be inaccurate/incomplete]

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

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [Resource] Win32 API Constant Reference
Here's a version wrapped in the Windows object to keep your script tidy

http://zivontsis.googlepages.com/win32api.txt

This post was edited on 07-01-2006 at 08:04 PM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-01-2006 08:03 PM
Profile PM Web 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 ShawnZ
Here's a version wrapped in the Windows object to keep your script tidy

http://zivontsis.googlepages.com/win32api.txt


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).
The previous sentence is false. The following sentence is true.
07-01-2006 08:06 PM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [Resource] Win32 API Constant Reference
Yes segosa, the point was to have it in an external script file. :p
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-01-2006 08:12 PM
Profile PM Web Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: [Resource] Win32 API Constant Reference
http://www.pinvoke.net/ has user32 functions and a whole load of other stuff.  deAd found that one. :)

This post was edited on 07-01-2006 at 08:17 PM by alexp2_ad.
07-01-2006 08:16 PM
Profile E-Mail 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 alexp2_ad
http://www.pinvoke.net/ has user32 functions and a whole load of other stuff.  deAd found that one. :)


That only has a few values of constants, though. And all the examples are C# and VB. :(
The previous sentence is false. The following sentence is true.
07-01-2006 08:19 PM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [Resource] Win32 API Constant Reference
Thats because the website is for C# and VB's Pinvoke functionality :p
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-01-2006 09:05 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Resource] Win32 API Constant Reference
quote:
Originally posted by ShawnZ
Yes segosa, the point was to have it in an external script file. :p
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:
Originally posted by segosa
I then remembered VB came with a file called WIN32API.TXT that contained all the Constants, Declares and Types used by the Win32 API functions.
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.

This post was edited on 07-02-2006 at 03:17 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2006 02:59 AM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [Resource] Win32 API Constant Reference
It'd be helpful if you pointed out where exactly it didn't work...
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-02-2006 05:18 AM
Profile PM Web 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
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.



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

This post was edited on 07-02-2006 at 07:42 AM by segosa.
The previous sentence is false. The following sentence is true.
07-02-2006 07:37 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