GetParent (user32)
Last changed: -78.110.196.168

.
Summary

C# Signature:

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr GetParent(IntPtr hWnd);

User-Defined Types:

None.

Notes:

GetParent sets LastError

Tips & Tricks:

Please add some!

Sample Code:

IntPtr GetParentSafe( IntPtr handle )

{

   IntPtr result = GetParent( handle );

   if( result == IntPtr.Zero )
   {
       // An error occured
       throw new Win32Exception( Marshal.GetLastWin32Error() );
   }

   return result;

}

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
GetParent on MSDN