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