|
How about that. Just one less thing to think about, when you need to map Win32 APIs to .NET [DllImport] statements, check out the PInvoke.NET wiki.
http://pinvoke.net/
What the .NET Framework class libraries don't provide, surely the Win32 API does. Everything from message constants to callback functions (delegates) and function declarations are provided. Of course, in community spirit what you can't find, please contribute after you figure it out.
For example, remember custom Windows messages with WM_USER? Well, search for WM_ and a list of defined message constants appears. No need to search through your dust-covered back-up CDs with those trusty C++ message definition headers. private const UInt32 WM_USER = 0x0400;
Search for EnumWindows, and you get all related definitions, including the callback EnumWindowsProc (in delegate form):
delegate int EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
Several related functions including EnumChildWindows, EnumWindowStations, and EnumWindows (shown here):
[DllImport("user32.dll")] static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
You can even look up COM interfaces for exposing a specific interface (GUIDs and all) from a .NET assembly. The wiki also links you to the MSDN documentation on the requested element.
I, for one, think this was a great idea. And, it is much better organized than your average wiki, thus you can actually be productive with your searches.
|