Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a list of windows API constants

Every time I interact with dll's like the user32.dll I need constants like MF_REMOVE. Is there a overview for all that constants or a c# library that constants all these constants?

like image 903
Tarion Avatar asked Apr 05 '09 14:04

Tarion


4 Answers

You'll find all the constants in the C headers of the win32 API. The low-tech way of getting this information is to simply run a text search in the headers folder of visual studio or the platform SDK.
This will usually be something like :

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\

like image 126
shoosh Avatar answered Oct 17 '22 02:10

shoosh


This online tool MagnumDb as "Magic Number Database" (disclaimer: I wrote it) is a totally free seach engine that contains 99% of Windows SDK constants (around 380000 integers, enums, guids, interface ids, clsids, etc.).

You can query it by name or by value, using wildcards, etc., for example: http://www.magnumdb.com/search?q=MF_REMOVE

will get you this (name, type, value, hex value, SDK header file location):

MF_REMOVE   Int32   4096    0x00001000  %ProgramFiles(x86)%\Windows Kits\10\Include\10.0.16299.0\um\winuser.rh(1213,0)
like image 27
Simon Mourier Avatar answered Oct 17 '22 00:10

Simon Mourier


I think you will find all what you want about APIs there: http://pinvoke.net/

like image 31
Amr Elgarhy Avatar answered Oct 17 '22 02:10

Amr Elgarhy


Try the PInvoke Interop Assistant. For most constants, all you have to do is simply enter their name and it will spit out the C# or VB.Net code which represents these contstants.

The tool is not limited to constants. It can also help with type definitions, functions, and function pointers. It can also translate most definition snippets on the fly to managed code.


(source: msdn.com)

like image 3
JaredPar Avatar answered Oct 17 '22 00:10

JaredPar