This is one of those things that's obvious once you know it.  When dealing with COM, there is often a need to convert a WinForms Form object to an IntPtr handle, and vice versa.

Convert Handle to Form

static public Form GetForm( IntPtr handle )
{
    return handle == IntPtr.Zero ?
        null :
        Control.FromHandle( handle ) as Form;
}

Convert Form to Handle

Form form = new Form();
IntPtr handle = form.Handle;

Popularity: 30% [?]

Related posts:

  1. C# Focus TextBox on Form Load
  2. C# Convert String to Stream, and Stream to String
  3. Hide Form from Alt+Tab
  4. Convert Between Synchronous and Asynchronous
  5. C# WinForms Form Event Order