[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr GetParent(IntPtr hWnd);
Public Declare Function GetParent Lib "User32" (ByVal hWnd As IntPtr) As IntPtr
None.
Please add some!
IntPtr GetParentSafe( IntPtr handle )
{
IntPtr result = GetParent( handle );
if( result == IntPtr.Zero )
{
// An error occured
throw new Win32Exception( Marshal.GetLastWin32Error() );
}
return result;
}
Do you know one? Please contribute it!