Read original post by Peter Kuhn at Mister Goodcat
The Silverlight release candidate finally has the previously announced built-in support for Platform Invocation Services, which more often is abbreviated by PInvoke or P/Invoke. If you're not familiar with the topic, you can read a small tutorial here, or an MSDN Magazine article here. In a nutshell, P/Invoke allows you to call into unmanaged code that is located in Win32 dlls on the system. Since the release candidate has been made available, people already have come up with nice short tutorials regarding this, for example how to let your computer beep. However, often P/Invoke is much more complex than these simple examples, especially when you need to move data between the managed and unmanaged world.