PINVOKE.NET attempts to address the difficulty of calling Win32 or other unmanaged APIs in managed code (languages such as C# and VB .NET). Manually defining and using PInvoke signatures (also known as Declare statements in VB) is an error-prone process that can introduce extremely subtle bugs. The rules are complex, and if you make a mistake, you’ll probably corrupt memory.
以后就不用羡慕c++可以直接调用win32api了。c#里面一样可以调用,一样的方便。几乎所有的微软sdk的C#声明在pinvoke.net里面。爽啊。
今天用NetMessageBufferSend写了一个发消息的小东东玩了玩。以前都是在cmd.exe里面用手发送的,同事用VC写了一GUI的工具,我操起c#也搞了一个。简单啊。。。。