To expand on what Niels said, you'll want to P/Invoke that API:
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(
IntPtr hWnd,
uint msg,
IntPtr wParam,
IntPtr lParam);
There are some shortcuts, too. If a param takes an address of a struct, rather than make several unsafe calls from the System.Runtime.InteropServices namespace, you can instead overload SendMessage. For instance, the TVM_SETITEM message for a TreeView Common Control (which System.Windows.Forms.TreeView encapsulates) requires the address of an `LPTVITEM` for the `lParam`. You could overload `SendMessage` like so: [DllImport("user32.dll")] private static extern IntPtr SendMessage) IntPtr hWnd, uint msg, IntPtr wParam, ref LVITEM lvItem); You'll still have to define the `LVITEM` struct, but this is pretty easy to do. See more information about that in the `StructLayoutAttribute` documentation. -----BEGIN GEEK CODE BLOCK----- [Version: 3.21](http://www.geekcode.com/geek.html) GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----