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?
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\
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)
I think you will find all what you want about APIs there: http://pinvoke.net/
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With