File: winforms\Managed\System\WinForms\UnsafeNativeMethods.cs
Project: ndp\fx\src\System.Windows.Forms.csproj (System.Windows.Forms)
//------------------------------------------------------------------------------
// <copyright file="UnsafeNativeMethods.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>                                                                
//------------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Versioning;
 
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Boolean,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Boolean,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Int32[]):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.IntPtr):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Object&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Object&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.String):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Text.StringBuilder):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+CHARFORMAT2A):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+CHARFORMATA):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+CHARFORMATW):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+CHARRANGE):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+EDITSTREAM):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+EDITSTREAM64):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+FINDTEXT):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+HDLAYOUT&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LOGFONT):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVBKIMAGE):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVCOLUMN):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVCOLUMN_T):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVFINDINFO&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVGROUP):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVHITTESTINFO&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVHITTESTINFO&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVHITTESTINFO):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVINSERTMARK):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVINSERTMARK):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVITEM&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVTILEVIEWINFO):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVTILEVIEWINFO):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+MCHITTESTINFO):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+MSG):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+MSG):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+PARAFORMAT):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+POINT):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+RECT&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+REPASTESPECIAL):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+SIZE):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+SYSTEMTIME):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+SYSTEMTIMEARRAY):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TBBUTTON&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TBBUTTONINFO&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TCITEM_T):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TEXTRANGE):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TOOLINFO_T):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TOOLINFO_TOOLTIP):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TV_HITTESTINFO):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TV_INSERTSTRUCT&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TV_ITEM&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Runtime.InteropServices.HandleRef,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Windows.Forms.NativeMethods+GETTEXTLENGTHEX,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Drawing.Rectangle&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Windows.Forms.NativeMethods+POINT,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.PostMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.IntPtr):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.PostMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.IntPtr):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods..ctor()")]
[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+SMsoComponentManager..ctor()")]
 
// Verified that current call stacks that use these don't expose them in an unsafe fashion.
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.ClipCursor(System.Windows.Forms.NativeMethods+COMRECT):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.ClipCursor(System.Windows.Forms.NativeMethods+RECT&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetClientRect(System.Runtime.InteropServices.HandleRef,System.IntPtr):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetProcAddress(System.Runtime.InteropServices.HandleRef,System.String):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetRegionData(System.Runtime.InteropServices.HandleRef,System.Int32,System.IntPtr):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GlobalFree(System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GlobalLock(System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GlobalUnlock(System.Runtime.InteropServices.HandleRef):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IsChild(System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+HDLAYOUT&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.ImmNotifyIME(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Int32):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetAncestor(System.Runtime.InteropServices.HandleRef,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetFocus():System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SetFocus(System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(System.Guid&,System.Object,System.Int32,System.Guid&):System.Object")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CoRegisterMessageFilter(System.Runtime.InteropServices.HandleRef,System.IntPtr&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(System.Windows.Forms.NativeMethods+MSG&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.EnableScrollBar(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.EnumThreadWindows(System.Int32,System.Windows.Forms.NativeMethods+EnumThreadWindowsCallback,System.Runtime.InteropServices.HandleRef):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetForegroundWindow():System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetMenu(System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetMenuItemInfo(System.Runtime.InteropServices.HandleRef,System.Int32,System.Boolean,System.Windows.Forms.NativeMethods+MENUITEMINFO_T_RW):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetMessageA(System.Windows.Forms.NativeMethods+MSG&,System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetMessageW(System.Windows.Forms.NativeMethods+MSG&,System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetObject(System.Runtime.InteropServices.HandleRef,System.Int32,System.Windows.Forms.NativeMethods+BITMAP):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetShortPathName(System.String,System.String,System.UInt32):System.UInt32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetSystemPowerStatus(System.Windows.Forms.NativeMethods+SYSTEM_POWER_STATUS&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetTempFileName(System.String,System.String,System.Int32,System.Text.StringBuilder):System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetWindowText(System.Runtime.InteropServices.HandleRef,System.Text.StringBuilder,System.Int32):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IntCloseHandle(System.Runtime.InteropServices.HandleRef):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IntCreateCompatibleDC(System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IntCreateIC(System.String,System.String,System.String,System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IntDuplicateHandle(System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,System.IntPtr&,System.Int32,System.Boolean,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IntOleInitialize(System.Int32):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.IsDialogMessage(System.Runtime.InteropServices.HandleRef,System.Windows.Forms.NativeMethods+MSG&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.OleUninitialize():System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.PostThreadMessage(System.Int32,System.Int32,System.IntPtr,System.IntPtr):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Object&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+CHARFORMAT2A):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+EDITSTREAM64):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVBKIMAGE):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVGROUP):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVINSERTMARK):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+LVTILEVIEWINFO):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32,System.Windows.Forms.NativeMethods+TOOLINFO_TOOLTIP):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Runtime.InteropServices.HandleRef,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Windows.Forms.NativeMethods+GETTEXTLENGTHEX,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef,System.Int32,System.Windows.Forms.NativeMethods+POINT,System.Windows.Forms.NativeMethods+LVINSERTMARK):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SystemParametersInfo(System.Int32,System.Int32,System.IntPtr[],System.Int32):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.TranslateMessage(System.Windows.Forms.NativeMethods+MSG&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.WaitMessage():System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetShortPathName(System.String,System.Text.StringBuilder,System.UInt32):System.UInt32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetWindowLong32(System.Runtime.InteropServices.HandleRef,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GetWindowLongPtr64(System.Runtime.InteropServices.HandleRef,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.OleCreateIPictureIndirect(System.Object,System.Guid&,System.Boolean):System.Windows.Forms.UnsafeNativeMethods+IPicture")]
 
// Verified that current call stacks that use this seem to be safe.
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+ThemingScope.GetCurrentActCtx(System.IntPtr&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+ThemingScope.ActivateActCtx(System.IntPtr,System.IntPtr&):System.Boolean")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+ThemingScope.CreateActCtx(System.Windows.Forms.UnsafeNativeMethods+ThemingScope+ACTCTX&):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+ThemingScope.DeactivateActCtx(System.Int32,System.IntPtr):System.Boolean")]
 
// SEC 
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CopyMemory(System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,System.Int32):System.Void")]
 
// SEC 
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GlobalAlloc(System.Int32,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.GlobalReAlloc(System.Runtime.InteropServices.HandleRef,System.Int32,System.Int32):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CopyMemoryW(System.IntPtr,System.String,System.Int32):System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CopyMemoryW(System.IntPtr,System.Char[],System.Int32):System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CopyMemoryA(System.IntPtr,System.String,System.Int32):System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.CopyMemory(System.IntPtr,System.Byte[],System.Int32):System.Void")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.WideCharToMultiByte(System.Int32,System.Int32,System.String,System.Int32,System.Byte[],System.Int32,System.IntPtr,System.IntPtr):System.Int32")]
 
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SetWindowLongPtr64(System.Runtime.InteropServices.HandleRef,System.Int32,System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SetWindowLongPtr32(System.Runtime.InteropServices.HandleRef,System.Int32,System.Runtime.InteropServices.HandleRef):System.IntPtr")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods.SHLoadIndirectString(System.String,System.Text.StringBuilder,System.UInt32,System.IntPtr):System.UInt32")]
 
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+Shell32.SHCreateShellItem(System.IntPtr,System.IntPtr,System.IntPtr,System.Windows.Forms.FileDialogNative+IShellItem&):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+Shell32.SHGetFolderPathExPrivate(System.Guid&,System.UInt32,System.IntPtr,System.Text.StringBuilder,System.UInt32):System.Int32")]
[assembly: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope="member", Target="System.Windows.Forms.UnsafeNativeMethods+Shell32.SHILCreateFromPath(System.String,System.IntPtr&,System.UInt32&):System.Int32")]
 
namespace System.Windows.Forms {
 
    using Accessibility;
    using System.Runtime.InteropServices;
    using System.Runtime.InteropServices.ComTypes;
    using System.Runtime.ConstrainedExecution;
    using System;
    using System.Security.Permissions;
    using System.Collections;
    using System.IO;
    using System.Text;
    using System.Security;
    using System.Diagnostics;
    using System.Diagnostics.CodeAnalysis;
    using System.Drawing;
 
    using IComDataObject = System.Runtime.InteropServices.ComTypes.IDataObject;
 
    [
    SuppressUnmanagedCodeSecurity()
    ]
    internal static class UnsafeNativeMethods {
 
        [DllImport(ExternDll.Shlwapi, CharSet=CharSet.Unicode, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.None)]
        internal static extern uint SHLoadIndirectString(string pszSource, StringBuilder pszOutBuf, uint cchOutBuf, IntPtr ppvReserved);
    
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int ReadClassStg(HandleRef pStg, [In, Out] ref Guid pclsid);
 
        [DllImport(ExternDll.Ole32, SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = true)]
        internal extern static void CoTaskMemFree(IntPtr pv);
 
        [DllImport(ExternDll.User32)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetClassName(HandleRef hwnd, StringBuilder lpClassName, int nMaxCount);
 
        //SetClassLong won't work correctly for 64-bit: we should use SetClassLongPtr instead.  On
        //32-bit, SetClassLongPtr is just #defined as SetClassLong.  SetClassLong really should 
        //take/return int instead of IntPtr/HandleRef, but since we're running this only for 32-bit
        //it'll be OK.
        public static IntPtr SetClassLong(HandleRef hWnd, int nIndex, IntPtr dwNewLong)
        {
            if (IntPtr.Size == 4)
            {
                return SetClassLongPtr32(hWnd, nIndex, dwNewLong);
            }
            return SetClassLongPtr64(hWnd, nIndex, dwNewLong);
        }
        [DllImport(ExternDll.User32, CharSet = System.Runtime.InteropServices.CharSet.Auto, EntryPoint = "SetClassLong")]
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetClassLongPtr32(HandleRef hwnd, int nIndex, IntPtr dwNewLong);
        [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")]
        [DllImport(ExternDll.User32, CharSet = System.Runtime.InteropServices.CharSet.Auto, EntryPoint = "SetClassLongPtr")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetClassLongPtr64(HandleRef hwnd, int nIndex, IntPtr dwNewLong);
 
        [DllImport(ExternDll.Ole32, ExactSpelling=true, PreserveSig=false)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern UnsafeNativeMethods.IClassFactory2 CoGetClassObject(
            [In]
            ref Guid clsid,
            int dwContext,
            int serverInfo,
            [In]
            ref Guid refiid);
 
        [return: MarshalAs(UnmanagedType.Interface)][DllImport(ExternDll.Ole32, ExactSpelling=true, PreserveSig=false)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern object CoCreateInstance(
            [In]
            ref Guid clsid,
            [MarshalAs(UnmanagedType.Interface)]
            object punkOuter,
            int context,
            [In]
            ref Guid iid);
 
        //This marshals differently than NativeMethods.POINTSTRUCT
        internal struct POINTSTRUCT {
            public int x;
            public int y;
 
            public POINTSTRUCT(int x, int y) {
                this.x = x;
                this.y = y;
            }
        }
 
        // We need this for Vista specific features/fixes
        private static readonly Version VistaOSVersion = new Version(6, 0);
 
        /// <summary>
        /// Used to tell if Vista API's are supported
        /// </summary>
        internal static bool IsVista
        {
            get
            {
                OperatingSystem os = Environment.OSVersion;
                if (os == null)
                    return false;
 
                return (os.Platform == PlatformID.Win32NT) &&
                       (os.Version.CompareTo(VistaOSVersion) >= 0);
            }
        }
 
        [DllImport(ExternDll.Kernel32, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
        [ResourceExposure(ResourceScope.AppDomain)]
        public static extern int GetLocaleInfo(int Locale,int LCType,StringBuilder lpLCData,int cchData) ;
 
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int WriteClassStm(IStream pStream, ref Guid clsid);
 
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern int ReadClassStg(IStorage pStorage, [Out]out Guid clsid);
 
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern int ReadClassStm(IStream pStream, [Out]out Guid clsid);
 
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern int OleLoadFromStream(IStream pStorage, ref Guid iid, out IOleObject pObject);
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int OleSaveToStream(IPersistStream pPersistStream, IStream pStream);
 
        [DllImport(ExternDll.Ole32)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int CoGetMalloc(int dwReserved, out IMalloc pMalloc);
        
        /* Commenting this out until someone actually needs to use it again...
        [DllImport(ExternDll.Ole32)]
          public static extern int OleSetMenuDescriptor(IntPtr hOleMenu, IntPtr hWndFrame, IntPtr hWndActiveObject, IOleInPlaceFrame frame, IOleInPlaceActiveObject activeObject);
        */
 
        /* Commenting this out until someone actually needs to use it again...
        [DllImport(ExternDll.Kernel32)]
        public static extern bool IsBadReadPtr(HandleRef ptr, int size);
        */
 
        [DllImport(ExternDll.Comdlg32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PageSetupDlg([In, Out] NativeMethods.PAGESETUPDLG lppsd);
 
        [DllImport(ExternDll.Comdlg32, EntryPoint = "PrintDlg", SetLastError = true, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PrintDlg_32([In, Out] NativeMethods.PRINTDLG_32 lppd);
 
        [DllImport(ExternDll.Comdlg32, EntryPoint = "PrintDlg", SetLastError = true, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PrintDlg_64([In, Out] NativeMethods.PRINTDLG_64 lppd);
 
        public static bool PrintDlg([In, Out] NativeMethods.PRINTDLG lppd) {
            if (IntPtr.Size == 4) {
                NativeMethods.PRINTDLG_32 lppd_32 = lppd as NativeMethods.PRINTDLG_32;
                if (lppd_32 == null) {
                    throw new System.NullReferenceException("PRINTDLG data is null");
                }
                return PrintDlg_32(lppd_32);
            }
            else {
                NativeMethods.PRINTDLG_64 lppd_64 = lppd as NativeMethods.PRINTDLG_64;
                if (lppd_64 == null) {
                    throw new System.NullReferenceException("PRINTDLG data is null");
                }
                return PrintDlg_64(lppd_64);
            }
        }
 
        [DllImport(ExternDll.Comdlg32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int PrintDlgEx([In, Out] NativeMethods.PRINTDLGEX lppdex);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int OleGetClipboard(ref IComDataObject data);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int OleSetClipboard(IComDataObject pDataObj);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int OleFlushClipboard();
        [DllImport(ExternDll.Oleaut32, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void OleCreatePropertyFrameIndirect(NativeMethods.OCPFIPARAMS p);
        [DllImport(ExternDll.Oleaut32, EntryPoint = "OleCreateFontIndirect", ExactSpelling = true, PreserveSig = false)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern UnsafeNativeMethods.IFont OleCreateIFontIndirect(NativeMethods.FONTDESC fd, ref Guid iid);
        [DllImport(ExternDll.Oleaut32, EntryPoint = "OleCreatePictureIndirect", ExactSpelling = true, PreserveSig = false)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern UnsafeNativeMethods.IPicture OleCreateIPictureIndirect([MarshalAs(UnmanagedType.AsAny)]object pictdesc, ref Guid iid, bool fOwn);
        [DllImport(ExternDll.Oleaut32, EntryPoint = "OleCreatePictureIndirect", ExactSpelling = true, PreserveSig = false)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern UnsafeNativeMethods.IPictureDisp OleCreateIPictureDispIndirect([MarshalAs(UnmanagedType.AsAny)] object pictdesc, ref Guid iid, bool fOwn);
        // cpb: #8309 -- next two methods, refiid arg must be IPicture.iid
        [DllImport(ExternDll.Oleaut32, PreserveSig = false)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern UnsafeNativeMethods.IPicture OleCreatePictureIndirect(NativeMethods.PICTDESC pictdesc, [In]ref Guid refiid, bool fOwn);
        [DllImport(ExternDll.Oleaut32, PreserveSig = false)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern UnsafeNativeMethods.IFont OleCreateFontIndirect(NativeMethods.tagFONTDESC fontdesc, [In]ref Guid refiid);
        [DllImport(ExternDll.Oleaut32, ExactSpelling = true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int VarFormat(ref object pvarIn, HandleRef pstrFormat, int iFirstDay, int iFirstWeek, uint dwFlags, [In, Out]ref IntPtr pbstr);
        [DllImport(ExternDll.Shell32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int DragQueryFile(HandleRef hDrop, int iFile, StringBuilder lpszFile, int cch);
 
        public static int DragQueryFileLongPath(HandleRef hDrop, int iFile, StringBuilder lpszFile)
        {
            if (null != lpszFile && 0 != lpszFile.Capacity && iFile != unchecked((int)0xFFFFFFFF))
            {
                int resultValue = 0;
 
                // iterating by allocating chunk of memory each time we find the length is not sufficient.
                // Performance should not be an issue for current MAX_PATH length due to this
                if ((resultValue = DragQueryFile(hDrop, iFile, lpszFile, lpszFile.Capacity)) == lpszFile.Capacity)
                {
                    // passing null for buffer will return actual number of charectors in the file name.
                    // So, one extra call would be suffice to avoid while loop in case of long path.
                    int capacity = DragQueryFile(hDrop, iFile, null, 0);
                    if (capacity < NativeMethods.MAX_UNICODESTRING_LEN)
                    {
                        lpszFile.EnsureCapacity(capacity);
                        resultValue = DragQueryFile(hDrop, iFile, lpszFile, capacity);
                    }
                    else
                    {
                        resultValue = 0;
                    }
                }
 
                lpszFile.Length = resultValue;
                return resultValue;  // what ever the result.
            }
            else
            {
                return DragQueryFile(hDrop, iFile, lpszFile, lpszFile.Capacity);
            }
        }
        [DllImport(ExternDll.User32, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool EnumChildWindows(HandleRef hwndParent, NativeMethods.EnumChildrenCallback lpEnumFunc, HandleRef lParam);
        [DllImport(ExternDll.Shell32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr ShellExecute(HandleRef hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
        [DllImport(ExternDll.Shell32, CharSet=CharSet.Auto, EntryPoint="ShellExecute", BestFitMapping = false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr ShellExecute_NoBFM(HandleRef hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int SetScrollPos(HandleRef hWnd, int nBar, int nPos, bool bRedraw);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool EnableScrollBar(HandleRef hWnd, int nBar, int value);
 
        [DllImport(ExternDll.Shell32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int Shell_NotifyIcon(int message, NativeMethods.NOTIFYICONDATA pnid);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static bool InsertMenuItem(HandleRef hMenu, int uItem, bool fByPosition, NativeMethods.MENUITEMINFO_T lpmii);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr  GetMenu(HandleRef hWnd);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetMenuItemInfo(HandleRef hMenu, int uItem, bool fByPosition, [In, Out] NativeMethods.MENUITEMINFO_T lpmii);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetMenuItemInfo(HandleRef hMenu, int uItem, bool fByPosition, [In, Out] NativeMethods.MENUITEMINFO_T_RW lpmii);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static bool SetMenuItemInfo(HandleRef hMenu, int uItem, bool fByPosition, NativeMethods.MENUITEMINFO_T lpmii);
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="CreateMenu", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreateMenu();
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateMenu() {
            return System.Internal.HandleCollector.Add(IntCreateMenu(), NativeMethods.CommonHandles.Menu);
        }
        
        [DllImport(ExternDll.Comdlg32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetOpenFileName([In, Out] NativeMethods.OPENFILENAME_I ofn);
 
        [DllImport(ExternDll.User32, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool EndDialog(HandleRef hWnd, IntPtr result);
 
        public const int MB_PRECOMPOSED = 0x00000001;
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Unicode, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int MultiByteToWideChar(int CodePage, int dwFlags, byte[] lpMultiByteStr, int cchMultiByte, char[] lpWideCharStr, int cchWideChar);
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int WideCharToMultiByte(int codePage, int flags, [MarshalAs(UnmanagedType.LPWStr)]string wideStr, int chars, [In,Out]byte[] pOutBytes, int bufferBytes, IntPtr defaultChar, IntPtr pDefaultUsed);
 
        [DllImport(ExternDll.Kernel32, SetLastError=true, ExactSpelling=true, EntryPoint="RtlMoveMemory", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemory(HandleRef destData, HandleRef srcData, int size);
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, EntryPoint="RtlMoveMemory")]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemory(IntPtr pdst, byte[] psrc, int cb);
 
        [DllImport(ExternDll.Kernel32, ExactSpelling = true, EntryPoint = "RtlMoveMemory", CharSet = CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemoryW(IntPtr pdst, string psrc, int cb);
        [DllImport(ExternDll.Kernel32, ExactSpelling = true, EntryPoint = "RtlMoveMemory", CharSet = CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemoryW(IntPtr pdst, char[] psrc, int cb);
 
        [DllImport(ExternDll.Kernel32, ExactSpelling = true, EntryPoint = "RtlMoveMemory", CharSet = CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemoryA(IntPtr pdst, string psrc, int cb);
        [DllImport(ExternDll.Kernel32, ExactSpelling = true, EntryPoint = "RtlMoveMemory", CharSet = CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void CopyMemoryA(IntPtr pdst, char[] psrc, int cb);
        
        
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, EntryPoint="DuplicateHandle", SetLastError=true)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntDuplicateHandle(HandleRef processSource, HandleRef handleSource, HandleRef processTarget, ref IntPtr handleTarget, int desiredAccess, bool inheritHandle, int options);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr DuplicateHandle(HandleRef processSource, HandleRef handleSource, HandleRef processTarget, ref IntPtr handleTarget, int desiredAccess, bool inheritHandle, int options) {
            IntPtr ret = IntDuplicateHandle(processSource, handleSource, processTarget, ref handleTarget,
                                         desiredAccess, inheritHandle, options);
            System.Internal.HandleCollector.Add(handleTarget, NativeMethods.CommonHandles.Kernel);
            return ret;
        }
        
        [DllImport(ExternDll.Ole32, PreserveSig=false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern UnsafeNativeMethods.IStorage StgOpenStorageOnILockBytes(UnsafeNativeMethods.ILockBytes iLockBytes, UnsafeNativeMethods.IStorage pStgPriority, int grfMode, int sndExcluded, int reserved);
        [DllImport(ExternDll.Ole32, PreserveSig=false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetHGlobalFromILockBytes(UnsafeNativeMethods.ILockBytes pLkbyt);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetWindowsHookEx(int hookid, NativeMethods.HookProc pfnhook, HandleRef hinst, int threadid);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetKeyboardState(byte [] keystate);
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="keybd_event", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void Keybd_event(byte vk, byte scan, int flags, int extrainfo);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int SetKeyboardState(byte [] keystate);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool UnhookWindowsHookEx(HandleRef hhook);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short GetAsyncKeyState(int vkey);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr CallNextHookEx(HandleRef hhook, int code, IntPtr wparam, IntPtr lparam);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int ScreenToClient( HandleRef hWnd, [In, Out] NativeMethods.POINT pt );
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto, SetLastError = true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetModuleFileName(HandleRef hModule, StringBuilder buffer, int length);
        public static StringBuilder GetModuleFileNameLongPath(HandleRef hModule)
        {
            StringBuilder buffer = new StringBuilder(NativeMethods.MAX_PATH);
            int noOfTimes = 1;
            int length = 0;
            // Iterating by allocating chunk of memory each time we find the length is not sufficient.
            // Performance should not be an issue for current MAX_PATH length due to this change.
            while (((length = GetModuleFileName(hModule, buffer, buffer.Capacity)) == buffer.Capacity) 
                && Marshal.GetLastWin32Error() == NativeMethods.ERROR_INSUFFICIENT_BUFFER 
                && buffer.Capacity < NativeMethods.MAX_UNICODESTRING_LEN)
            {
                noOfTimes += 2; // Increasing buffer size by 520 in each iteration.
                int capacity = noOfTimes * NativeMethods.MAX_PATH < NativeMethods.MAX_UNICODESTRING_LEN ? noOfTimes * NativeMethods.MAX_PATH : NativeMethods.MAX_UNICODESTRING_LEN;
                buffer.EnsureCapacity(capacity);
            }
            buffer.Length = length;
            return buffer;
        }
        [DllImport(ExternDll.User32, CharSet=CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]        
        public static extern bool IsDialogMessage(HandleRef hWndDlg, [In, Out] ref NativeMethods.MSG msg);        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool TranslateMessage([In, Out] ref NativeMethods.MSG msg);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DispatchMessage([In] ref NativeMethods.MSG msg);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DispatchMessageA([In] ref NativeMethods.MSG msg);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DispatchMessageW([In] ref NativeMethods.MSG msg);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int PostThreadMessage(int id, int msg, IntPtr wparam, IntPtr lparam);
        [DllImport(ExternDll.Ole32, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int CoRegisterMessageFilter(HandleRef newFilter, ref IntPtr oldMsgFilter);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, EntryPoint="OleInitialize", SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        private static extern int IntOleInitialize(int val);
        public static int OleInitialize() {
            return IntOleInitialize(0);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static bool EnumThreadWindows(int dwThreadId, NativeMethods.EnumThreadWindowsCallback lpfn, HandleRef lParam);
        [return:MarshalAs(UnmanagedType.Bool)] [DllImport(ExternDll.Kernel32, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public extern static bool GetExitCodeThread(IntPtr hThread, out uint lpExitCode);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendDlgItemMessage(HandleRef hDlg, int nIDDlgItem, int Msg, IntPtr wParam, IntPtr lParam);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int OleUninitialize();
        [DllImport(ExternDll.Comdlg32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetSaveFileName([In, Out] NativeMethods.OPENFILENAME_I ofn);
        [DllImport(ExternDll.User32, EntryPoint="ChildWindowFromPointEx", ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern IntPtr _ChildWindowFromPointEx(HandleRef hwndParent, POINTSTRUCT pt, int uFlags);
        public static IntPtr ChildWindowFromPointEx(HandleRef hwndParent, int x, int y, int uFlags) {
            POINTSTRUCT ps = new POINTSTRUCT(x, y);
            return _ChildWindowFromPointEx(hwndParent, ps, uFlags);
        }
        [DllImport(ExternDll.Kernel32, EntryPoint="CloseHandle", ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntCloseHandle(HandleRef handle);
        public static bool CloseHandle(HandleRef handle) {
            System.Internal.HandleCollector.Remove((IntPtr)handle, NativeMethods.CommonHandles.Kernel);
            return IntCloseHandle(handle);
        }
        
        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, EntryPoint="CreateCompatibleDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreateCompatibleDC(HandleRef hDC);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateCompatibleDC(HandleRef hDC) {
            return System.Internal.HandleCollector.Add(IntCreateCompatibleDC(hDC), NativeMethods.CommonHandles.CompatibleHDC);
        }
 
        #region SendKeys SendInput functionality
 
        [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool BlockInput([In, MarshalAs(UnmanagedType.Bool)] bool fBlockIt);
 
        [DllImport(ExternDll.User32, ExactSpelling = true, SetLastError=true, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern uint SendInput(uint nInputs, NativeMethods.INPUT[] pInputs, int cbSize);
 
        #endregion
 
        /*
        [DllImport(ExternDll.Kernel32, EntryPoint = "CreateFileMapping", CharSet = CharSet.Auto, SetLastError = true)]
        private static extern IntPtr IntCreateFileMapping(HandleRef hFile, IntPtr lpAttributes, int flProtect, int dwMaxSizeHi, int dwMaxSizeLow, string lpName);
        public static IntPtr CreateFileMapping(HandleRef hFile, IntPtr lpAttributes, int flProtect, int dwMaxSizeHi, int dwMaxSizeLow, string lpName) {
            return System.Internal.HandleCollector.Add(IntCreateFileMapping(hFile, lpAttributes, flProtect, dwMaxSizeHi, dwMaxSizeLow, lpName), NativeMethods.CommonHandles.Kernel);
        }
 
        [DllImport(ExternDll.Kernel32, EntryPoint = "OpenFileMapping", CharSet = CharSet.Auto, SetLastError = true)]
        private static extern IntPtr IntOpenFileMapping(int dwDesiredAccess, bool bInheritHandle, string lpName);
        public static IntPtr OpenFileMapping(int dwDesiredAccess, bool bInheritHandle, string lpName) {
            return System.Internal.HandleCollector.Add(IntOpenFileMapping(dwDesiredAccess, bInheritHandle, lpName), NativeMethods.CommonHandles.Kernel);
        }
*/
 
        [DllImport(ExternDll.Kernel32, EntryPoint = "MapViewOfFile", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)]            
        [ResourceExposure(ResourceScope.Process)]
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        private static extern IntPtr IntMapViewOfFile(HandleRef hFileMapping, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr MapViewOfFile(HandleRef hFileMapping, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap) {
            return System.Internal.HandleCollector.Add(IntMapViewOfFile(hFileMapping, dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap), NativeMethods.CommonHandles.Kernel);
        }
 
        [DllImport(ExternDll.Kernel32, EntryPoint = "UnmapViewOfFile", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntUnmapViewOfFile(HandleRef pvBaseAddress);
        public static bool UnmapViewOfFile(HandleRef pvBaseAddress) {
            System.Internal.HandleCollector.Remove((IntPtr)pvBaseAddress, NativeMethods.CommonHandles.Kernel);
            return IntUnmapViewOfFile(pvBaseAddress);
        }
 
        [DllImport(ExternDll.User32, ExactSpelling = true, EntryPoint = "GetDCEx", CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntGetDCEx(HandleRef hWnd, HandleRef hrgnClip, int flags);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr GetDCEx(HandleRef hWnd, HandleRef hrgnClip, int flags) {
            return System.Internal.HandleCollector.Add(IntGetDCEx(hWnd, hrgnClip, flags), NativeMethods.CommonHandles.HDC);
        }
        
        // GetObject stuff
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, [In, Out] NativeMethods.BITMAP bm);
 
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, [In, Out] NativeMethods.LOGPEN lp);
        public static int GetObject(HandleRef hObject, NativeMethods.LOGPEN lp) {
            return GetObject(hObject, Marshal.SizeOf(typeof(NativeMethods.LOGPEN)), lp);
        }
        
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, [In, Out] NativeMethods.LOGBRUSH lb);
        public static int GetObject(HandleRef hObject, NativeMethods.LOGBRUSH lb) {
            return GetObject(hObject, Marshal.SizeOf(typeof(NativeMethods.LOGBRUSH)), lb);
        }
        
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, [In, Out] NativeMethods.LOGFONT lf);
        public static int GetObject(HandleRef hObject, NativeMethods.LOGFONT lp) {
            return GetObject(hObject, Marshal.SizeOf(typeof(NativeMethods.LOGFONT)), lp);
        }
        
        //HPALETTE
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, ref int nEntries);
        [DllImport(ExternDll.Gdi32, SetLastError=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObject(HandleRef hObject, int nSize, int[] nEntries);
        [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetObjectType(HandleRef hObject);
 
        [DllImport(ExternDll.User32, EntryPoint="CreateAcceleratorTable", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreateAcceleratorTable(/*ACCEL*/ HandleRef pentries, int cCount);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateAcceleratorTable(/*ACCEL*/ HandleRef pentries, int cCount) {
            return System.Internal.HandleCollector.Add(IntCreateAcceleratorTable(pentries, cCount), NativeMethods.CommonHandles.Accelerator);
        }
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="DestroyAcceleratorTable", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntDestroyAcceleratorTable(HandleRef hAccel);
        public static bool DestroyAcceleratorTable(HandleRef hAccel) {
            System.Internal.HandleCollector.Remove((IntPtr)hAccel, NativeMethods.CommonHandles.Accelerator);
            return IntDestroyAcceleratorTable(hAccel);
        }
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short VkKeyScan(char key);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetCapture();
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetCapture(HandleRef hwnd);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetFocus();
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetCursorPos([In, Out] NativeMethods.POINT pt);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short GetKeyState(int keyCode);
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        [SuppressMessage("Microsoft.Security", "CA2101:SpecifyMarshalingForPInvokeStringArguments")]
        public static extern uint GetShortPathName(string lpszLongPath, StringBuilder lpszShortPath, uint cchBuffer);
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="SetWindowRgn", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern int IntSetWindowRgn(HandleRef hwnd, HandleRef hrgn, bool fRedraw);
        public static int SetWindowRgn(HandleRef hwnd, HandleRef hrgn, bool fRedraw) {
            int retval = IntSetWindowRgn(hwnd, hrgn, fRedraw);
            if (retval != 0) {
                // we do this because after a SetWindowRgn call, the system owns the region
                // so we don't need to bother cleaning it up.
                //
                System.Internal.HandleCollector.Remove((IntPtr)hrgn, NativeMethods.CommonHandles.GDI);
            }
            return retval;
        }
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetWindowText(HandleRef hWnd, StringBuilder lpString, int nMaxCount);
        
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto)]            
        [ResourceExposure(ResourceScope.None)]
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        public static extern void GetTempFileName(string tempDirName, string prefixName, int unique, StringBuilder sb);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetWindowText(HandleRef hWnd, string text);
 
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GlobalAlloc(int uFlags, int dwBytes);
        
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GlobalReAlloc(HandleRef handle, int bytes, int flags);
 
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GlobalLock(HandleRef handle);
        
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GlobalUnlock(HandleRef handle);
        
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GlobalFree(HandleRef handle);
        
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GlobalSize(HandleRef handle);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmSetConversionStatus(HandleRef hIMC, int conversion, int sentence);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmGetConversionStatus(HandleRef hIMC, ref int conversion, ref int sentence);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr ImmGetContext(HandleRef hWnd);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmReleaseContext(HandleRef hWnd, HandleRef hIMC);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr ImmAssociateContext(HandleRef hWnd, HandleRef hIMC);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmDestroyContext(HandleRef hIMC);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr ImmCreateContext();
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmSetOpenStatus(HandleRef hIMC, bool open);
        
        [DllImport(ExternDll.Imm32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmGetOpenStatus(HandleRef hIMC);
 
        [DllImport(ExternDll.Imm32, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ImmNotifyIME(HandleRef hIMC, int dwAction, int dwIndex, int dwValue);
 
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetFocus(HandleRef hWnd);
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetParent(HandleRef hWnd);
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetAncestor(HandleRef hWnd, int flags); 
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool IsChild(HandleRef hWndParent, HandleRef hwnd);
 
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
        public static extern bool IsZoomed(HandleRef hWnd);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr FindWindow(string className, string windowName);
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int MapWindowPoints(HandleRef hWndFrom, HandleRef hWndTo, [In, Out] ref NativeMethods.RECT rect, int cPoints);
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int MapWindowPoints(HandleRef hWndFrom, HandleRef hWndTo, [In, Out] NativeMethods.POINT pt, int cPoints);
 
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, bool wParam, int lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int[] lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int[] wParam, int[] lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, ref int wParam, ref int lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, string lParam);
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, IntPtr wParam, string lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, StringBuilder lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TOOLINFO_T lParam);        
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TOOLINFO_TOOLTIP lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TBBUTTON lParam);        
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TBBUTTONINFO lParam);        
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TV_ITEM lParam);        
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TV_INSERTSTRUCT lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TV_HITTESTINFO lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVBKIMAGE lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.LVHITTESTINFO lParam);
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TCITEM_T lParam);
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.HDLAYOUT hdlayout);
 
        //for Tooltips
        //
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, HandleRef wParam, int lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, HandleRef lParam);        
 
 
        // For RichTextBox
        //
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out, MarshalAs(UnmanagedType.LPStruct)] NativeMethods.PARAFORMAT lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out, MarshalAs(UnmanagedType.LPStruct)] NativeMethods.CHARFORMATA lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out, MarshalAs(UnmanagedType.LPStruct)] NativeMethods.CHARFORMAT2A lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out, MarshalAs(UnmanagedType.LPStruct)] NativeMethods.CHARFORMATW lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int SendMessage(HandleRef hWnd, int msg, int wParam, [Out, MarshalAs(UnmanagedType.IUnknown)]out object editOle);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.CHARRANGE lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.FINDTEXT lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TEXTRANGE lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.POINT lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, NativeMethods.POINT wParam, int lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.REPASTESPECIAL lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.EDITSTREAM lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.EDITSTREAM64 lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, NativeMethods.GETTEXTLENGTHEX wParam, int lParam);
 
        // For Button
        //
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out] NativeMethods.SIZE lParam);        
       
        // For ListView
        //
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out] ref NativeMethods.LVFINDINFO lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVHITTESTINFO lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVCOLUMN_T lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out] ref NativeMethods.LVITEM lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVCOLUMN lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVGROUP lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, NativeMethods.POINT wParam, [In, Out] NativeMethods.LVINSERTMARK lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.LVINSERTMARK lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out] NativeMethods.LVTILEVIEWINFO lParam);        
        
        // For MonthCalendar
        //
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.MCHITTESTINFO lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.SYSTEMTIME lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.SYSTEMTIMEARRAY lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, [In, Out] NativeMethods.LOGFONT lParam);        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.MSG lParam);
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, IntPtr wParam, [In, Out] ref NativeMethods.RECT lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, ref short wParam, ref short lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, [In, Out, MarshalAs(UnmanagedType.Bool)] ref bool wParam, IntPtr lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, int wParam, IntPtr lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, int wParam, [In, Out] ref NativeMethods.RECT lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, int wParam, [In, Out] ref Rectangle lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static IntPtr SendMessage(HandleRef hWnd, int Msg, IntPtr wParam, NativeMethods.ListViewCompareCallback pfnCompare);
       
        [DllImport(ExternDll.User32, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SendMessageTimeout(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, out IntPtr pdwResult);
 
        public const int SMTO_ABORTIFHUNG = 0x0002;        
 
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetParent(HandleRef hWnd, HandleRef hWndParent);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetWindowRect(HandleRef hWnd, [In, Out] ref NativeMethods.RECT rect);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetWindow(HandleRef hWnd, int uCmd);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetDlgItem(HandleRef hWnd, int nIDDlgItem);
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetModuleHandle(string modName);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DefMDIChildProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr CallWindowProc(IntPtr wndProc, IntPtr hWnd, int msg,
                                                IntPtr wParam, IntPtr lParam);
        
/*                                               
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern IntPtr GetProp(HandleRef hWnd, int atom);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern IntPtr GetProp(HandleRef hWnd, string name);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern IntPtr RemoveProp(HandleRef hWnd, short atom);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern IntPtr RemoveProp(HandleRef hWnd, string propName);
   */
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short GlobalDeleteAtom(short atom);
 
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Ansi)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetProcAddress(HandleRef hModule, string lpProcName);
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetClassInfo(HandleRef hInst, string lpszClass, [In, Out] NativeMethods.WNDCLASS_I wc);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetClassInfo(HandleRef hInst, string lpszClass, IntPtr h);
/*
        [DllImport(ExternDll.Shell32, CharSet=CharSet.Auto)]
        public static extern int SHGetFolderPath(HandleRef hwndOwner, int nFolder, HandleRef hToken, int dwFlags, StringBuilder lpszPath);
*/        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetSystemMetrics(int nIndex);
        
        // This API is available starting Windows10 RS1
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetSystemMetricsForDpi(int nIndex, uint dpi);
 
        /// <summary>
        /// Tries to get system metrics for the dpi. dpi is ignored if "GetSystemMetricsForDpi" is not available on the OS that this application is running.
        /// </summary>
        /// <param name="nIndex">index</param>
        /// <param name="dpi">dpi requested</param>
        /// <returns>returns system metrics for dpi</returns>
        public static int TryGetSystemMetricsForDpi(int nIndex, uint dpi) {
            if (ApiHelper.IsApiAvailable(ExternDll.User32, "GetSystemMetricsForDpi")) {
                return GetSystemMetricsForDpi(nIndex, dpi);
            }
            else {
                Debug.Assert(false, "GetSystemMetricsForDpi() is not available on this OS");
                return GetSystemMetrics(nIndex);
            }
        }
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, ref NativeMethods.RECT rc, int nUpdate);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, ref int value, int ignore);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, ref bool value, int ignore);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, ref NativeMethods.HIGHCONTRAST_I rc, int nUpdate);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, [In, Out] NativeMethods.NONCLIENTMETRICS metrics, int nUpdate);
        
        // This API is available starting Windows10 RS1
        [DllImport(ExternDll.User32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfoForDpi(int nAction, int nParam, [In, Out] NativeMethods.NONCLIENTMETRICS metrics, int nUpdate, uint dpi);
 
        /// <summary>
        /// Tries to get system parameter info for the dpi. dpi is ignored if "SystemParametersInfoForDpi()" API is not available on the OS that this application is running.
        /// </summary>
        public static bool TrySystemParametersInfoForDpi(int nAction, int nParam, [In, Out] NativeMethods.NONCLIENTMETRICS metrics, int nUpdate, uint dpi) {
            if(ApiHelper.IsApiAvailable(ExternDll.User32, "SystemParametersInfoForDpi")) {
                return SystemParametersInfoForDpi(nAction,  nParam, metrics,  nUpdate,  dpi);
            }
            else {
                Debug.Assert(false, "SystemParametersInfoForDpi() is not available on this OS");
                return SystemParametersInfo(nAction, nParam, metrics, nUpdate);
            }
        }
/*
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, [In, Out] NativeMethods.ICONMETRICS iconMetrics, int nUpdate);
*/
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, [In, Out] NativeMethods.LOGFONT font, int nUpdate);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, bool [] flag, bool nUpdate);
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetComputerName(StringBuilder lpBuffer, int[] nSize);
        [DllImport(ExternDll.Advapi32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetUserName(StringBuilder lpBuffer, int[] nSize);
        [DllImport(ExternDll.User32, ExactSpelling=true)]
        [ResourceExposure(ResourceScope.Machine)]
        public static extern IntPtr GetProcessWindowStation();
        [DllImport(ExternDll.User32, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetUserObjectInformation(HandleRef hObj, int nIndex, [MarshalAs(UnmanagedType.LPStruct)] NativeMethods.USEROBJECTFLAGS pvBuffer, int nLength, ref int lpnLengthNeeded);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int ClientToScreen( HandleRef hWnd, [In, Out] NativeMethods.POINT pt );
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetForegroundWindow();
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetDesktopWindow();
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int RegisterDragDrop(HandleRef hwnd, UnsafeNativeMethods.IOleDropTarget target);
        [DllImport(ExternDll.Ole32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int RevokeDragDrop(HandleRef hwnd);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PeekMessage([In, Out] ref NativeMethods.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove);
        [DllImport(ExternDll.User32, CharSet=CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PeekMessageW([In, Out] ref NativeMethods.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove);
        [DllImport(ExternDll.User32, CharSet=CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PeekMessageA([In, Out] ref NativeMethods.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove);
        
/*        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto), 
         SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        public static extern bool SetProp(HandleRef hWnd, int atom, HandleRef data);
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        public static extern bool SetProp(HandleRef hWnd, string propName, HandleRef data);
*/
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool PostMessage(HandleRef hwnd, int msg, IntPtr wparam, IntPtr lparam);
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short GlobalAddAtom(string atomName);
        [DllImport(ExternDll.Oleacc, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr LresultFromObject(ref Guid refiid, IntPtr wParam, HandleRef pAcc);
        [DllImport(ExternDll.Oleacc, ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int CreateStdAccessibleObject(HandleRef hWnd, int objID, ref Guid refiid, [In, Out, MarshalAs(UnmanagedType.Interface)] ref object pAcc);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void NotifyWinEvent(int winEvent, HandleRef hwnd, int objType, int objID);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetMenuItemID(HandleRef hMenu, int nPos);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetSubMenu(HandleRef hwnd, int index);
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetMenuItemCount(HandleRef hMenu);
        [DllImport(ExternDll.Oleaut32, PreserveSig=false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void GetErrorInfo(int reserved, [In, Out] ref UnsafeNativeMethods.IErrorInfo errorInfo);
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="BeginPaint", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern IntPtr IntBeginPaint(HandleRef hWnd, [In, Out] ref NativeMethods.PAINTSTRUCT lpPaint);
        public static IntPtr BeginPaint(HandleRef hWnd, [In, Out, MarshalAs(UnmanagedType.LPStruct)] ref NativeMethods.PAINTSTRUCT lpPaint) {
            return System.Internal.HandleCollector.Add(IntBeginPaint(hWnd, ref lpPaint), NativeMethods.CommonHandles.HDC);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="EndPaint", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntEndPaint(HandleRef hWnd, ref NativeMethods.PAINTSTRUCT lpPaint);
        public static bool EndPaint(HandleRef hWnd, [In, MarshalAs(UnmanagedType.LPStruct)] ref NativeMethods.PAINTSTRUCT lpPaint) {
            System.Internal.HandleCollector.Remove(lpPaint.hdc, NativeMethods.CommonHandles.HDC);
            return IntEndPaint(hWnd, ref lpPaint);
        }
 
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="GetDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntGetDC(HandleRef hWnd);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr GetDC(HandleRef hWnd) {
            return System.Internal.HandleCollector.Add(IntGetDC(hWnd), NativeMethods.CommonHandles.HDC);
        }
 
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="GetWindowDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntGetWindowDC(HandleRef hWnd);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr GetWindowDC(HandleRef hWnd) {
            return System.Internal.HandleCollector.Add(IntGetWindowDC(hWnd), NativeMethods.CommonHandles.HDC);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="ReleaseDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern int IntReleaseDC(HandleRef hWnd, HandleRef hDC);
        public static int ReleaseDC(HandleRef hWnd, HandleRef hDC) {
            System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC);
            return IntReleaseDC(hWnd, hDC);
        }
 
        [DllImport(ExternDll.Gdi32, SetLastError=true, EntryPoint="CreateDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreateDC(string lpszDriver, string lpszDeviceName, string lpszOutput, HandleRef devMode);
        
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateDC(string lpszDriver) {
            return System.Internal.HandleCollector.Add(IntCreateDC(lpszDriver, null, null, NativeMethods.NullHandleRef), NativeMethods.CommonHandles.HDC);
        }
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateDC(string lpszDriverName, string lpszDeviceName, string lpszOutput, HandleRef /*DEVMODE*/ lpInitData) {
            return System.Internal.HandleCollector.Add(IntCreateDC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), NativeMethods.CommonHandles.HDC);
        }
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SystemParametersInfo(int nAction, int nParam, [In, Out] IntPtr[] rc, int nUpdate);
        
        [DllImport(ExternDll.User32, EntryPoint="SendMessage", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        //public extern static IntPtr SendCallbackMessage(HandleRef hWnd, int Msg, IntPtr wParam, UnsafeNativeMethods.IRichTextBoxOleCallback lParam);
        public extern static IntPtr SendCallbackMessage(HandleRef hWnd, int Msg, IntPtr wParam, IntPtr lParam);
        
        [DllImport(ExternDll.Shell32, ExactSpelling=true, CharSet=CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void DragAcceptFiles(HandleRef hWnd, bool fAccept);
       
        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetDeviceCaps(HandleRef hDC, int nIndex);
 
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetScrollInfo(HandleRef hWnd, int fnBar, NativeMethods.SCROLLINFO si);
       
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int SetScrollInfo(HandleRef hWnd, int fnBar, NativeMethods.SCROLLINFO si, bool redraw);
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetActiveWindow();
 
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.Machine)]
        private static extern IntPtr LoadLibrary(string libname);
       
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
        [ResourceExposure(ResourceScope.Machine)]
        private static extern IntPtr LoadLibraryEx(string lpModuleName, IntPtr hFile, uint dwFlags);
 
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool FreeLibrary(HandleRef hModule);
 
        //GetWindowLong won't work correctly for 64-bit: we should use GetWindowLongPtr instead.  On
        //32-bit, GetWindowLongPtr is just #defined as GetWindowLong.  GetWindowLong really should 
        //take/return int instead of IntPtr/HandleRef, but since we're running this only for 32-bit
        //it'll be OK.
        public static IntPtr GetWindowLong(HandleRef hWnd, int nIndex)
        {
            if (IntPtr.Size == 4)
            {
                return GetWindowLong32(hWnd, nIndex);
            }
            return GetWindowLongPtr64(hWnd, nIndex);
        }
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "GetWindowLong")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetWindowLong32(HandleRef hWnd, int nIndex);
 
        [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "GetWindowLongPtr")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetWindowLongPtr64(HandleRef hWnd, int nIndex);
 
        //SetWindowLong won't work correctly for 64-bit: we should use SetWindowLongPtr instead.  On
        //32-bit, SetWindowLongPtr is just #defined as SetWindowLong.  SetWindowLong really should 
        //take/return int instead of IntPtr/HandleRef, but since we're running this only for 32-bit
        //it'll be OK.
        public static IntPtr SetWindowLong(HandleRef hWnd, int nIndex, HandleRef dwNewLong) 
        {
            if (IntPtr.Size == 4)
            {
                return SetWindowLongPtr32(hWnd, nIndex, dwNewLong);
            }
            return SetWindowLongPtr64(hWnd, nIndex, dwNewLong);
        }
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLong")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetWindowLongPtr32(HandleRef hWnd, int nIndex, HandleRef dwNewLong);
        [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLongPtr")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, int nIndex, HandleRef dwNewLong);
 
        public static IntPtr SetWindowLong(HandleRef hWnd, int nIndex, NativeMethods.WndProc wndproc)
        {
            if (IntPtr.Size == 4)
            {
                return SetWindowLongPtr32(hWnd, nIndex, wndproc);
            }
            return SetWindowLongPtr64(hWnd, nIndex, wndproc);
        }
        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLong")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetWindowLongPtr32(HandleRef hWnd, int nIndex, NativeMethods.WndProc wndproc);
        [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")]
        [DllImport(ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLongPtr")]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, int nIndex, NativeMethods.WndProc wndproc);
 
        [DllImport(ExternDll.Ole32, PreserveSig = false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern UnsafeNativeMethods.ILockBytes CreateILockBytesOnHGlobal(HandleRef hGlobal, bool fDeleteOnRelease);
        [DllImport(ExternDll.Ole32, PreserveSig=false)]
        [ResourceExposure(ResourceScope.None)]
        public static extern UnsafeNativeMethods.IStorage StgCreateDocfileOnILockBytes(UnsafeNativeMethods.ILockBytes iLockBytes, int grfMode, int reserved);
 
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="CreatePopupMenu", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreatePopupMenu();
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreatePopupMenu() {
            return System.Internal.HandleCollector.Add(IntCreatePopupMenu(), NativeMethods.CommonHandles.Menu);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool RemoveMenu(HandleRef hMenu, int uPosition, int uFlags);
       
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="DestroyMenu", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntDestroyMenu(HandleRef hMenu);
        public static bool DestroyMenu(HandleRef hMenu) {
            System.Internal.HandleCollector.Remove((IntPtr)hMenu, NativeMethods.CommonHandles.Menu);
            return IntDestroyMenu(hMenu);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetForegroundWindow(HandleRef hWnd);
      
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr GetSystemMenu(HandleRef hWnd, bool bRevert);
      
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr DefFrameProc(IntPtr hWnd, IntPtr hWndClient, int msg, IntPtr wParam, IntPtr lParam);
      
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool TranslateMDISysAccel(IntPtr hWndClient, [In, Out] ref NativeMethods.MSG msg);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetLayeredWindowAttributes(HandleRef hwnd, int crKey, byte bAlpha, int dwFlags);
      
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static bool SetMenu(HandleRef hWnd, HandleRef hMenu);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetWindowPlacement(HandleRef hWnd, ref NativeMethods.WINDOWPLACEMENT placement);
 
    
        [DllImport(ExternDll.Kernel32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void GetStartupInfo([In, Out] NativeMethods.STARTUPINFO_I startupinfo_i);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetMenuDefaultItem(HandleRef hwnd, int nIndex, bool pos);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool EnableMenuItem(HandleRef hMenu, int UIDEnabledItem, int uEnable);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr SetActiveWindow(HandleRef hWnd);
 
        [DllImport(ExternDll.Gdi32, SetLastError=true, EntryPoint="CreateIC", CharSet=System.Runtime.InteropServices.CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr IntCreateIC(string lpszDriverName, string lpszDeviceName, string lpszOutput, HandleRef /*DEVMODE*/ lpInitData);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateIC(string lpszDriverName, string lpszDeviceName, string lpszOutput, HandleRef /*DEVMODE*/ lpInitData) {
            return System.Internal.HandleCollector.Add(IntCreateIC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), NativeMethods.CommonHandles.HDC);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ClipCursor(ref NativeMethods.RECT rcClip);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool ClipCursor(NativeMethods.COMRECT rcClip);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr SetCursor(HandleRef hcursor);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetCursorPos(int x, int y);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public extern static int ShowCursor(bool bShow);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="DestroyCursor", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntDestroyCursor(HandleRef hCurs);
        public static bool DestroyCursor(HandleRef hCurs) {
            System.Internal.HandleCollector.Remove((IntPtr)hCurs, NativeMethods.CommonHandles.Cursor);
            return IntDestroyCursor(hCurs);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool IsWindow(HandleRef hWnd);
    
        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, EntryPoint="DeleteDC", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        private static extern bool IntDeleteDC(HandleRef hDC);
        public static bool DeleteDC(HandleRef hDC) {
            System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC);
            return IntDeleteDC(hDC);
        }
 
        public static bool DeleteCompatibleDC(HandleRef hDC)
        {
            System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.CompatibleHDC);
            return IntDeleteDC(hDC);
        }
 
        public const int LAYOUT_RTL = 0x00000001;
        public const int LAYOUT_BITMAPORIENTATIONPRESERVED = 0x00000008;        
 
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Ansi)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetMessageA([In, Out] ref NativeMethods.MSG msg, HandleRef hWnd, int uMsgFilterMin, int uMsgFilterMax);
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Unicode)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetMessageW([In, Out] ref NativeMethods.MSG msg, HandleRef hWnd, int uMsgFilterMin, int uMsgFilterMax);
     
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr PostMessage(HandleRef hwnd, int msg, int wparam, int lparam);
 
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern IntPtr PostMessage(HandleRef hwnd, int msg, int wparam, IntPtr lparam);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetClientRect(HandleRef hWnd, [In, Out] ref NativeMethods.RECT rect);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetClientRect(HandleRef hWnd, IntPtr rect);
    
        [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
        [DllImport(ExternDll.User32, EntryPoint="WindowFromPoint", ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        private static extern IntPtr _WindowFromPoint(POINTSTRUCT pt);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr WindowFromPoint(int x, int y) {
            POINTSTRUCT ps = new POINTSTRUCT(x, y);
            return _WindowFromPoint(ps);
        }
        [DllImport(ExternDll.User32, SetLastError=true, ExactSpelling = true)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr WindowFromDC( HandleRef hDC );
        [DllImport(ExternDll.User32, EntryPoint="CreateWindowEx", CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr IntCreateWindowEx(int  dwExStyle, string lpszClassName,
                                                   string lpszWindowName, int style, int x, int y, int width, int height,
                                                   HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, [MarshalAs(UnmanagedType.AsAny)] object pvParam);
        [ResourceExposure(ResourceScope.Process)]
        [ResourceConsumption(ResourceScope.Process)]
        public static IntPtr CreateWindowEx(int  dwExStyle, string lpszClassName,
                                         string lpszWindowName, int style, int x, int y, int width, int height,
                                         HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, [MarshalAs(UnmanagedType.AsAny)]object pvParam) {
            return IntCreateWindowEx(dwExStyle, lpszClassName,
                                         lpszWindowName, style, x, y, width, height, hWndParent, hMenu,
                                         hInst, pvParam);
        }
        
        [DllImport(ExternDll.User32, ExactSpelling=true, EntryPoint="DestroyWindow", CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool IntDestroyWindow(HandleRef hWnd);
        public static bool DestroyWindow(HandleRef hWnd) {
            return IntDestroyWindow(hWnd);
        }
        
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool UnregisterClass(string className, HandleRef hInstance);
    
        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.Process)]
        public static extern IntPtr GetStockObject(int nIndex);
     
        [DllImport(ExternDll.User32, CharSet=CharSet.Auto, SetLastError=true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern short RegisterClass(NativeMethods.WNDCLASS_D wc);
   
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void PostQuitMessage(int nExitCode);
    
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern void WaitMessage();
     
        [DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetWindowPlacement(HandleRef hWnd, [In] ref NativeMethods.WINDOWPLACEMENT placement);
 
        // This method is not available until Windows 8.1
        [DllImport(ExternDll.User32, ExactSpelling=true, SetLastError = true)]
        [ResourceExposure(ResourceScope.None)]
        public static extern uint GetDpiForWindow(HandleRef hWnd);
 
        // For system power status
        //
        [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool GetSystemPowerStatus([In, Out] ref NativeMethods.SYSTEM_POWER_STATUS systemPowerStatus);
 
        [DllImport(ExternDll.Powrprof, ExactSpelling=true, CharSet=CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern bool SetSuspendState(bool hiberate, bool forceCritical, bool disableWakeEvent);
 
        //for RegionData
        [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
        [ResourceExposure(ResourceScope.None)]
        public static extern int GetRegionData(HandleRef hRgn, int size, IntPtr lpRgnData);
 
        public unsafe static NativeMethods.RECT[] GetRectsFromRegion(IntPtr hRgn) {
            NativeMethods.RECT[] regionRects = null;
            IntPtr pBytes = IntPtr.Zero;
            try {
                // see how much memory we need to allocate
                int regionDataSize = GetRegionData(new HandleRef(null, hRgn), 0, IntPtr.Zero);
                if (regionDataSize != 0) {
                    pBytes = Marshal.AllocCoTaskMem(regionDataSize);
                    // get the data
                    int ret = GetRegionData(new HandleRef(null, hRgn), regionDataSize, pBytes);
                    if (ret == regionDataSize) {
                        // cast to the structure
                        NativeMethods.RGNDATAHEADER* pRgnDataHeader = (NativeMethods.RGNDATAHEADER*)pBytes;
                        if (pRgnDataHeader->iType == 1) {    // expecting RDH_RECTANGLES
                            regionRects = new NativeMethods.RECT[pRgnDataHeader->nCount];
 
                            Debug.Assert(regionDataSize == pRgnDataHeader->cbSizeOfStruct + pRgnDataHeader->nCount * pRgnDataHeader->nRgnSize);
                            Debug.Assert(Marshal.SizeOf(typeof(NativeMethods.RECT)) == pRgnDataHeader->nRgnSize || pRgnDataHeader->nRgnSize == 0);
 
                            // use the header size as the offset, and cast each rect in.
                            int rectStart = pRgnDataHeader->cbSizeOfStruct;
                            for (int i = 0; i < pRgnDataHeader->nCount; i++) {
                                // use some fancy pointer math to just copy the rect bits directly into the array.
                                regionRects[i] = *((NativeMethods.RECT*)((byte*)pBytes + rectStart + (Marshal.SizeOf(typeof(NativeMethods.RECT)) * i)));
                            }
                        }
                    }
                }
            }
            finally {
                if (pBytes != IntPtr.Zero) {
                    Marshal.FreeCoTaskMem(pBytes);
                }
            }
            return regionRects;
        }
 
        /* Unused
        // for GetUserNameEx
        public enum EXTENDED_NAME_FORMAT {
            NameUnknown = 0,
            NameFullyQualifiedDN = 1,
            NameSamCompatible = 2,
            NameDisplay = 3,
            NameUniqueId = 6,
            NameCanonical = 7,
            NameUserPrincipal = 8,
            NameCanonicalEx = 9,
            NameServicePrincipal = 10
        }
        */
 
        [ComImport(), Guid("00000122-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleDropTarget {
            [PreserveSig]
            int OleDragEnter(
                [In, MarshalAs(UnmanagedType.Interface)]
                object pDataObj,
                [In, MarshalAs(UnmanagedType.U4)]
                int grfKeyState,
                [In]
                POINTSTRUCT pt,
                [In, Out]
                ref int pdwEffect);
            
            [PreserveSig]
            int OleDragOver(
                [In, MarshalAs(UnmanagedType.U4)]
                int grfKeyState,
                [In]
                POINTSTRUCT pt,
                [In, Out]
                ref int pdwEffect);
            
            [PreserveSig]
            int OleDragLeave();
            
            [PreserveSig]
            int OleDrop(
                [In, MarshalAs(UnmanagedType.Interface)]
                object pDataObj,
                [In, MarshalAs(UnmanagedType.U4)]
                int grfKeyState,
                [In]
                POINTSTRUCT pt,
                [In, Out]
                ref int pdwEffect);
        }
        
        [ComImport(), Guid("00000121-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleDropSource {
            
            [PreserveSig]
            int OleQueryContinueDrag(
                int fEscapePressed,
                [In, MarshalAs(UnmanagedType.U4)]
                int grfKeyState);
 
            [PreserveSig]
            int OleGiveFeedback(
                [In, MarshalAs(UnmanagedType.U4)]
                int dwEffect);
        }
        
        [ComImport(), Guid("00000016-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleMessageFilter {
        
            [PreserveSig]
            int HandleInComingCall(
                int dwCallType,
                IntPtr hTaskCaller,
                int dwTickCount,
                /* LPINTERFACEINFO */ IntPtr lpInterfaceInfo);
 
            [PreserveSig]
            int RetryRejectedCall(
                IntPtr hTaskCallee,
                int dwTickCount,
                int dwRejectType);
            
            [PreserveSig]
            int MessagePending(
                IntPtr hTaskCallee,
                int dwTickCount,
                int dwPendingType);
        }
        
        [
        ComImport(), 
        Guid("B196B289-BAB4-101A-B69C-00AA00341D07"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)
        ]
        public interface IOleControlSite {
            
            [PreserveSig]
            int OnControlInfoChanged();
            
            [PreserveSig]
            int LockInPlaceActive(int fLock);
            
            [PreserveSig]
            int GetExtendedControl(
                [Out, MarshalAs(UnmanagedType.IDispatch)]
                out object ppDisp);
            
            [PreserveSig]
            int TransformCoords(
                [In, Out]
                NativeMethods._POINTL pPtlHimetric,
                [In, Out]
                NativeMethods.tagPOINTF pPtfContainer,
                [In, MarshalAs(UnmanagedType.U4)]
                int dwFlags);
            
            [PreserveSig]
            int TranslateAccelerator(
                [In]
                ref NativeMethods.MSG pMsg,
                [In, MarshalAs(UnmanagedType.U4)]
                int grfModifiers);
 
            [PreserveSig]
            int OnFocus(int fGotFocus);
            
            [PreserveSig]
            int ShowPropertyFrame();
 
        }
        
        [ComImport(), Guid("00000118-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleClientSite {
            
            [PreserveSig]
            int SaveObject();
 
            [PreserveSig]
            int GetMoniker(
                [In, MarshalAs(UnmanagedType.U4)]
                int dwAssign,
                [In, MarshalAs(UnmanagedType.U4)]
                int dwWhichMoniker,
                [Out, MarshalAs(UnmanagedType.Interface)]
                out object moniker);
 
            [PreserveSig]
            int GetContainer(out IOleContainer container);
            
            [PreserveSig]
            int ShowObject();
            
            [PreserveSig]
            int OnShowWindow(int fShow);
            
            [PreserveSig]
            int RequestNewObjectLayout();
        }
        
        [ComImport(), Guid("00000119-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleInPlaceSite {
            
            IntPtr GetWindow();
            
            [PreserveSig]
            int ContextSensitiveHelp(int fEnterMode);
            
            [PreserveSig]
            int CanInPlaceActivate();
            
            [PreserveSig]
            int OnInPlaceActivate();
            
            [PreserveSig]
            int OnUIActivate();
            
            [PreserveSig]
            int GetWindowContext(
                [Out, MarshalAs(UnmanagedType.Interface)] 
                out UnsafeNativeMethods.IOleInPlaceFrame ppFrame,
                [Out, MarshalAs(UnmanagedType.Interface)] 
                out UnsafeNativeMethods.IOleInPlaceUIWindow ppDoc,
                [Out] 
                NativeMethods.COMRECT lprcPosRect,
                [Out] 
                NativeMethods.COMRECT lprcClipRect,
                [In, Out] 
                NativeMethods.tagOIFI lpFrameInfo);
            
            [PreserveSig]
            int Scroll(
                NativeMethods.tagSIZE scrollExtant);
            
            [PreserveSig]
            int OnUIDeactivate(
                int fUndoable);
                
            [PreserveSig]
            int OnInPlaceDeactivate();
            
            [PreserveSig]
            int DiscardUndoState();
            
            [PreserveSig]
            int DeactivateAndUndo();
            
            [PreserveSig]
            int OnPosRectChange(
                [In] 
                NativeMethods.COMRECT lprcPosRect);
        }
        
        [ComImport(), Guid("742B0E01-14E6-101B-914E-00AA00300CAB"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface ISimpleFrameSite {
 
            [PreserveSig]
                int PreMessageFilter(
                IntPtr hwnd,
                [In, MarshalAs(UnmanagedType.U4)] 
                int msg,
                IntPtr wp,
                IntPtr lp,
                [In, Out] 
                ref IntPtr plResult,
                [In, Out, MarshalAs(UnmanagedType.U4)] 
                ref int pdwCookie);
            
            [PreserveSig]
            int PostMessageFilter(
                IntPtr hwnd,
                [In, MarshalAs(UnmanagedType.U4)] 
                int msg,
                IntPtr wp,
                IntPtr lp,
                [In, Out] 
                ref IntPtr plResult,
                [In, MarshalAs(UnmanagedType.U4)] 
                int dwCookie);
        }
        
        [ComImport(), Guid("40A050A0-3C31-101B-A82E-08002B2B2337"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IVBGetControl {
        
            [PreserveSig]
            int EnumControls(
                int dwOleContF,
                int dwWhich,
                [Out] 
                out IEnumUnknown ppenum);
        }
        
        [ComImport(), Guid("91733A60-3F4C-101B-A3F6-00AA0034E4E9"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IGetVBAObject {
            
           [PreserveSig]
           int GetObject(
                [In] 
                ref Guid riid,
                [Out, MarshalAs(UnmanagedType.LPArray)] 
                IVBFormat[] rval,
                int dwReserved);
        }
        
        [ComImport(), Guid("9BFBBC02-EFF1-101A-84ED-00AA00341D07"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IPropertyNotifySink {
            void OnChanged(int dispID);
            
            [PreserveSig]
            int OnRequestEdit(int dispID);
        }
        
        [ComImport(), Guid("9849FD60-3768-101B-8D72-AE6164FFE3CF"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IVBFormat {
            
            [PreserveSig]
            int Format(
                [In] 
                ref object var,
                IntPtr pszFormat,
                IntPtr lpBuffer,
                short cpBuffer,
                int lcid,
                short firstD,
                short firstW,
                [Out, MarshalAs(UnmanagedType.LPArray)] 
                short[] result);
        }
        
        [ComImport(), Guid("00000100-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IEnumUnknown {
                
            [PreserveSig]
            int Next(
                [In, MarshalAs(UnmanagedType.U4)] 
                int celt,
                [Out] 
                IntPtr rgelt,
                IntPtr pceltFetched);
                
            [PreserveSig]
                int Skip(
                [In, MarshalAs(UnmanagedType.U4)] 
                int celt);
                
            void Reset();
            
            void Clone(
                [Out] 
                out IEnumUnknown ppenum);
        }
        
        [ComImport(), Guid("0000011B-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleContainer {
            
            [PreserveSig]
            int ParseDisplayName(
                [In, MarshalAs(UnmanagedType.Interface)] 
                object pbc,
                [In, MarshalAs(UnmanagedType.BStr)] 
                string pszDisplayName,
                [Out, MarshalAs(UnmanagedType.LPArray)] 
                int[] pchEaten,
                [Out, MarshalAs(UnmanagedType.LPArray)] 
                object[] ppmkOut);
                
            [PreserveSig]
            int EnumObjects(
                [In, MarshalAs(UnmanagedType.U4)] 
                int grfFlags,
                [Out] 
                out IEnumUnknown ppenum);
                
            [PreserveSig]
            int LockContainer(
                bool fLock);
        }
        
        [ComImport(), Guid("00000116-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IOleInPlaceFrame {
            
            IntPtr GetWindow();
            
            [PreserveSig]
            int ContextSensitiveHelp(int fEnterMode);
            
            [PreserveSig]
            int GetBorder(
                [Out]
                NativeMethods.COMRECT lprectBorder);
            
            [PreserveSig]
            int RequestBorderSpace(
                [In]
                NativeMethods.COMRECT pborderwidths);
            
            [PreserveSig]
            int SetBorderSpace(
                [In]
                NativeMethods.COMRECT pborderwidths);
            
            [PreserveSig]
            int  SetActiveObject(
                [In, MarshalAs(UnmanagedType.Interface)]
                UnsafeNativeMethods.IOleInPlaceActiveObject pActiveObject,
                [In, MarshalAs(UnmanagedType.LPWStr)]
                string pszObjName);
            
            [PreserveSig]
            int InsertMenus(
                [In]
                IntPtr hmenuShared,
                [In, Out]
                NativeMethods.tagOleMenuGroupWidths lpMenuWidths);
            
            [PreserveSig]
            int SetMenu(
                [In]
                IntPtr hmenuShared,
                [In]
                IntPtr holemenu,
                [In]
                IntPtr hwndActiveObject);
            
            [PreserveSig]
            int RemoveMenus(
                [In]
                IntPtr hmenuShared);
            
            [PreserveSig]
            int SetStatusText(
                [In, MarshalAs(UnmanagedType.LPWStr)]
                string pszStatusText);
            
            [PreserveSig]
            int EnableModeless(
                bool fEnable);
            
            [PreserveSig]
                int TranslateAccelerator(
                [In]
                ref NativeMethods.MSG lpmsg,
                [In, MarshalAs(UnmanagedType.U2)]
                short wID);
        }
        
        // Used to control the webbrowser appearance and provide DTE to script via window.external
        [ComVisible(true), ComImport(), Guid("BD3F23C0-D43E-11CF-893B-00AA00BDCE1A"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IDocHostUIHandler {
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int ShowContextMenu(
                [In, MarshalAs(UnmanagedType.U4)]
                int dwID,
                [In]
                NativeMethods.POINT pt,
                [In, MarshalAs(UnmanagedType.Interface)]
                object pcmdtReserved,
                [In, MarshalAs(UnmanagedType.Interface)]
                object pdispReserved);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int GetHostInfo(
                [In, Out]
                NativeMethods.DOCHOSTUIINFO info);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int ShowUI(
                [In, MarshalAs(UnmanagedType.I4)]
                int dwID,
                [In]
                UnsafeNativeMethods.IOleInPlaceActiveObject activeObject,
                [In]
                NativeMethods.IOleCommandTarget commandTarget,
                [In]
                UnsafeNativeMethods.IOleInPlaceFrame frame,
                [In]
                UnsafeNativeMethods.IOleInPlaceUIWindow doc);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int HideUI();
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int UpdateUI();
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int EnableModeless(
                [In, MarshalAs(UnmanagedType.Bool)]
                bool fEnable);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int OnDocWindowActivate(
                [In, MarshalAs(UnmanagedType.Bool)]
                bool fActivate);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int OnFrameWindowActivate(
                [In, MarshalAs(UnmanagedType.Bool)]
                bool fActivate);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int ResizeBorder(
                [In]
                NativeMethods.COMRECT rect,
                [In]
                UnsafeNativeMethods.IOleInPlaceUIWindow doc,
                bool fFrameWindow);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int TranslateAccelerator(
                [In]
                ref NativeMethods.MSG msg,
                [In]
                ref Guid group,
                [In, MarshalAs(UnmanagedType.I4)]
                int nCmdID);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int GetOptionKeyPath(
                [Out, MarshalAs(UnmanagedType.LPArray)]
                String[] pbstrKey,
                [In, MarshalAs(UnmanagedType.U4)]
                int dw);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int GetDropTarget(
                [In, MarshalAs(UnmanagedType.Interface)]
                UnsafeNativeMethods.IOleDropTarget pDropTarget,
                [Out, MarshalAs(UnmanagedType.Interface)]
                out UnsafeNativeMethods.IOleDropTarget ppDropTarget);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int GetExternal(
                [Out, MarshalAs(UnmanagedType.Interface)]
                out object ppDispatch);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int TranslateUrl(
                [In, MarshalAs(UnmanagedType.U4)]
                int dwTranslate,
                [In, MarshalAs(UnmanagedType.LPWStr)]
                string strURLIn,
                [Out, MarshalAs(UnmanagedType.LPWStr)]
                out string pstrURLOut);
 
            [return: MarshalAs(UnmanagedType.I4)]
            [PreserveSig]
            int FilterDataObject(
                IComDataObject pDO,
                out IComDataObject ppDORet);
        }
 
        [SuppressUnmanagedCodeSecurity, ComImport(), Guid("D30C1661-CDAF-11d0-8A3E-00C04FC9E26E"),
        TypeLibType(TypeLibTypeFlags.FHidden | TypeLibTypeFlags.FDual | TypeLibTypeFlags.FOleAutomation)]
        public interface IWebBrowser2 {
            //
            // IWebBrowser members
            [DispId(100)] void GoBack();
            [DispId(101)] void GoForward();
            [DispId(102)] void GoHome();
            [DispId(103)] void GoSearch();
            [DispId(104)] void Navigate([In] string Url, [In] ref object flags,
                            [In] ref object targetFrameName, [In] ref object postData,
                            [In] ref object headers);
            [DispId(-550)] void Refresh();
            [DispId(105)] void Refresh2([In] ref object level);
            [DispId(106)] void Stop();
            [DispId(200)] object Application {[return: MarshalAs(UnmanagedType.IDispatch)]get;}
            [DispId(201)] object Parent {[return: MarshalAs(UnmanagedType.IDispatch)]get;}
            [DispId(202)] object Container {[return: MarshalAs(UnmanagedType.IDispatch)]get;}
            [DispId(203)] object Document {[return: MarshalAs(UnmanagedType.IDispatch)]get;}
            [DispId(204)] bool TopLevelContainer {get;}
            [DispId(205)] string Type {get;}
            [DispId(206)] int Left {get; set;}
            [DispId(207)] int Top {get; set;}
            [DispId(208)] int Width {get; set;}
            [DispId(209)] int Height {get; set;}
            [DispId(210)] string LocationName {get;}
            [DispId(211)] string LocationURL {get;}
            [DispId(212)] bool Busy {get;}
            //
            // IWebBrowserApp members
            [DispId(300)] void Quit();
            [DispId(301)] void ClientToWindow([Out]out int pcx, [Out]out int pcy);
            [DispId(302)] void PutProperty([In] string property, [In] object vtValue);
            [DispId(303)] object GetProperty([In] string property);
            [DispId(0)] string Name {get;}
            [DispId(-515)] int HWND {get;}
            [DispId(400)] string FullName {get;}
            [DispId(401)] string Path {get;}
            [DispId(402)] bool Visible {get; set;}
            [DispId(403)] bool StatusBar {get; set;}
            [DispId(404)] string StatusText {get; set;}
            [DispId(405)] int ToolBar {get; set;}
            [DispId(406)] bool MenuBar {get; set;}
            [DispId(407)] bool FullScreen {get; set;}
            //
            // IWebBrowser2 members
            [DispId(500)] void Navigate2([In] ref object URL, [In] ref object flags,
                            [In] ref object targetFrameName, [In] ref object postData,
                            [In] ref object headers);
            [DispId(501)] NativeMethods.OLECMDF QueryStatusWB([In] NativeMethods.OLECMDID cmdID);
            [DispId(502)] void ExecWB([In] NativeMethods.OLECMDID cmdID,
                    [In] NativeMethods.OLECMDEXECOPT cmdexecopt,
                    ref object pvaIn,
                    IntPtr pvaOut);
            [DispId(503)] void ShowBrowserBar([In] ref object pvaClsid, [In] ref object pvarShow,
                    [In] ref object pvarSize);
            [DispId(-525)] WebBrowserReadyState ReadyState {get;}
            [DispId(550)] bool Offline {get; set;}
            [DispId(551)] bool Silent {get; set;}
            [DispId(552)] bool RegisterAsBrowser {get; set;}
            [DispId(553)] bool RegisterAsDropTarget {get; set;}
            [DispId(554)] bool TheaterMode {get; set;}
            [DispId(555)] bool AddressBar {get; set;}
            [DispId(556)] bool Resizable {get; set;}
        }
 
        [ComImport(), Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DWebBrowserEvents2 {
            [DispId(102)] void StatusTextChange([In] string text);
            [DispId(108)] void ProgressChange([In] int progress, [In] int progressMax);
            [DispId(105)] void CommandStateChange([In] long command, [In] bool enable);
            [DispId(106)] void DownloadBegin();
            [DispId(104)] void DownloadComplete();
            [DispId(113)] void TitleChange([In] string text);
            [DispId(112)] void PropertyChange([In] string szProperty);
            [DispId(250)] void BeforeNavigate2([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp,
                                 [In] ref object URL, [In] ref object flags,
                                 [In] ref object targetFrameName, [In] ref object postData,
                                 [In] ref object headers, [In, Out] ref bool cancel);
            [DispId(251)] void NewWindow2([In, Out, MarshalAs(UnmanagedType.IDispatch)] ref object pDisp,
                                [In, Out] ref bool cancel);
            [DispId(252)] void NavigateComplete2([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp,
                                [In] ref object URL);
            [DispId(259)] void DocumentComplete([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp,
                                [In] ref object URL);
            [DispId(253)] void OnQuit();
            [DispId(254)] void OnVisible([In] bool visible);
            [DispId(255)] void OnToolBar([In] bool toolBar);
            [DispId(256)] void OnMenuBar([In] bool menuBar);
            [DispId(257)] void OnStatusBar([In] bool statusBar);
            [DispId(258)] void OnFullScreen([In] bool fullScreen);
            [DispId(260)] void OnTheaterMode([In] bool theaterMode);
            [DispId(262)] void WindowSetResizable([In] bool resizable);
            [DispId(264)] void WindowSetLeft([In] int left);
            [DispId(265)] void WindowSetTop([In] int top);
            [DispId(266)] void WindowSetWidth([In] int width);
            [DispId(267)] void WindowSetHeight([In] int height);
            [DispId(263)] void WindowClosing([In] bool isChildWindow, [In, Out] ref bool cancel);
            [DispId(268)] void ClientToHostWindow([In, Out] ref long cx, [In, Out] ref long cy);
            [DispId(269)] void SetSecureLockIcon([In] int secureLockIcon);
            [DispId(270)] void FileDownload([In, Out] ref bool cancel);
            [DispId(271)] void NavigateError([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp,
                    [In] ref object URL, [In] ref object frame, [In] ref object statusCode, [In, Out] ref bool cancel);
            [DispId(225)] void PrintTemplateInstantiation([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp);
            [DispId(226)] void PrintTemplateTeardown([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp);
            [DispId(227)] void UpdatePageStatus([In, MarshalAs(UnmanagedType.IDispatch)] object pDisp,
                    [In] ref object nPage, [In] ref object fDone);
            [DispId(272)] void PrivacyImpactedStateChange([In] bool bImpacted);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("626FC520-A41E-11cf-A731-00A0C9082637"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLDocument {
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetScript();
        }
        
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("332C4425-26CB-11D0-B483-00C04FD90119"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLDocument2 {
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetScript();
            IHTMLElementCollection GetAll();
            IHTMLElement GetBody();
            IHTMLElement GetActiveElement();
            IHTMLElementCollection GetImages();
            IHTMLElementCollection GetApplets();
            IHTMLElementCollection GetLinks();
            IHTMLElementCollection GetForms();
            IHTMLElementCollection GetAnchors();
            void SetTitle(string p);
            string GetTitle();
            IHTMLElementCollection GetScripts();
            void SetDesignMode(string p);
            string GetDesignMode();
            [return: MarshalAs(UnmanagedType.Interface)] object GetSelection();
            string GetReadyState();
            [return: MarshalAs(UnmanagedType.Interface)] object GetFrames();
            IHTMLElementCollection GetEmbeds();
            IHTMLElementCollection GetPlugins();
            void SetAlinkColor(object c);
            object GetAlinkColor();
            void SetBgColor(object c);
            object GetBgColor();
            void SetFgColor(object c);
            object GetFgColor();
            void SetLinkColor(object c);
            object GetLinkColor();
            void SetVlinkColor(object c);
            object GetVlinkColor();
            string GetReferrer();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLLocation GetLocation();
            string GetLastModified();
            void SetUrl(string p);
            string GetUrl();
            void SetDomain(string p);
            string GetDomain();
            void SetCookie(string p);
            string GetCookie();
            void SetExpando(bool p);
            bool GetExpando();
            void SetCharset(string p);
            string GetCharset();
            void SetDefaultCharset(string p);
            string GetDefaultCharset();
            string GetMimeType();
            string GetFileSize();
            string GetFileCreatedDate();
            string GetFileModifiedDate();
            string GetFileUpdatedDate();
            string GetSecurity();
            string GetProtocol();
            string GetNameProp();
            int Write([In, MarshalAs(UnmanagedType.SafeArray)] object[] psarray);
            int WriteLine([In, MarshalAs(UnmanagedType.SafeArray)] object[] psarray);
            [return: MarshalAs(UnmanagedType.Interface)] object Open(string mimeExtension, object name, object features, object replace);
            void Close();
            void Clear();
            bool QueryCommandSupported(string cmdID);
            bool QueryCommandEnabled(string cmdID);
            bool QueryCommandState(string cmdID);
            bool QueryCommandIndeterm(string cmdID);
            string QueryCommandText(
                    string cmdID);
            Object QueryCommandValue(string cmdID);
            bool ExecCommand(string cmdID,
                    bool showUI, Object value);
            bool ExecCommandShowHelp(string cmdID);
            IHTMLElement CreateElement(string eTag);
            void SetOnhelp(Object p);
            Object GetOnhelp();
            void SetOnclick(Object p);
            Object GetOnclick();
            void SetOndblclick(Object p);
            Object GetOndblclick();
            void SetOnkeyup(Object p);
            Object GetOnkeyup();
            void SetOnkeydown(Object p);
            Object GetOnkeydown();
            void SetOnkeypress(Object p);
            Object GetOnkeypress();
            void SetOnmouseup(Object p);
            Object GetOnmouseup();
            void SetOnmousedown(Object p);
            Object GetOnmousedown();
            void SetOnmousemove(Object p);
            Object GetOnmousemove();
            void SetOnmouseout(Object p);
            Object GetOnmouseout();
            void SetOnmouseover(Object p);
            Object GetOnmouseover();
            void SetOnreadystatechange(Object p);
            Object GetOnreadystatechange();
            void SetOnafterupdate(Object p);
            Object GetOnafterupdate();
            void SetOnrowexit(Object p);
            Object GetOnrowexit();
            void SetOnrowenter(Object p);
            Object GetOnrowenter();
            void SetOndragstart(Object p);
            Object GetOndragstart();
            void SetOnselectstart(Object p);
            Object GetOnselectstart();
            IHTMLElement ElementFromPoint(int x, int y);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLWindow2 GetParentWindow();
            [return: MarshalAs(UnmanagedType.Interface)] object GetStyleSheets();
            void SetOnbeforeupdate(Object p);
            Object GetOnbeforeupdate();
            void SetOnerrorupdate(Object p);
            Object GetOnerrorupdate();
            string toString();
            [return: MarshalAs(UnmanagedType.Interface)] object CreateStyleSheet(string bstrHref,int lIndex);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050F485-98B5-11CF-BB82-00AA00BDCE0B"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLDocument3 {
            void ReleaseCapture();
            void Recalc([In] bool fForce);
            object CreateTextNode([In] string text);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetDocumentElement();
            string GetUniqueID();
            bool AttachEvent([In] string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            void DetachEvent([In] string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            void SetOnrowsdelete([In] Object p);
            Object GetOnrowsdelete();
            void SetOnrowsinserted([In] Object p);
            Object GetOnrowsinserted();
            void SetOncellchange([In] Object p);
            Object GetOncellchange();
            void SetOndatasetchanged([In] Object p);
            Object GetOndatasetchanged();
            void SetOndataavailable([In] Object p);
            Object GetOndataavailable();
            void SetOndatasetcomplete([In] Object p);
            Object GetOndatasetcomplete();
            void SetOnpropertychange([In] Object p);
            Object GetOnpropertychange();
            void SetDir([In] string p);
            string GetDir();
            void SetOncontextmenu([In] Object p);
            Object GetOncontextmenu();
            void SetOnstop([In] Object p);
            Object GetOnstop();
            object CreateDocumentFragment();
            object GetParentDocument();
            void SetEnableDownload([In] bool p);
            bool GetEnableDownload();
            void SetBaseUrl([In] string p);
            string GetBaseUrl();
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetChildNodes();
            void SetInheritStyleSheets([In] bool p);
            bool GetInheritStyleSheets();
            void SetOnbeforeeditfocus([In] Object p);
            Object GetOnbeforeeditfocus();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElementCollection GetElementsByName([In] string v);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetElementById([In] string v);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElementCollection GetElementsByTagName([In] string v);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050F69A-98B5-11CF-BB82-00AA00BDCE0B"),
        InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLDocument4 {
            void Focus();
            bool HasFocus();
            void SetOnselectionchange(object p);
            object GetOnselectionchange();
            object GetNamespaces();
            object createDocumentFromUrl(string bstrUrl, string bstrOptions);
            void SetMedia(string bstrMedia);
            string GetMedia();
            object CreateEventObject([In, Optional] ref object eventObject);
            bool FireEvent(string eventName);
            object CreateRenderStyle(string bstr);
            void SetOncontrolselect(object p);
            object GetOncontrolselect();
            string GetURLUnencoded();
        }
        
 
        [ComImport(), Guid("3050f613-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLDocumentEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)] bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1026)] bool onstop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1027)] void onbeforeeditfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1037)] void onselectionchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("332C4426-26CB-11D0-B483-00C04FD90119"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLFramesCollection2 {
            object Item(ref object idOrName);
            int GetLength();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("332C4427-26CB-11D0-B483-00C04FD90119"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLWindow2 {
            [return: MarshalAs(UnmanagedType.IDispatch)] object Item([In] ref object pvarIndex);
            int GetLength();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLFramesCollection2 GetFrames();
            void SetDefaultStatus([In] string p);
            string GetDefaultStatus();
            void SetStatus([In] string p);
            string GetStatus();
            int SetTimeout([In] string expression, [In] int msec, [In] ref Object language);
            void ClearTimeout([In] int timerID);
            void Alert([In] string message);
            bool Confirm([In] string message);
            [return: MarshalAs(UnmanagedType.Struct)] object Prompt([In] string message, [In] string defstr);
            object GetImage();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLLocation GetLocation();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IOmHistory GetHistory();
            void Close();
            void SetOpener([In] object p);
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetOpener();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IOmNavigator GetNavigator();
            void SetName([In] string p);
            string GetName();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLWindow2 GetParent();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLWindow2 Open([In] string URL, [In] string name, [In] string features, [In] bool replace);
            object GetSelf();
            object GetTop();
            object GetWindow();
            void Navigate([In] string URL);
            void SetOnfocus([In] Object p);
            Object GetOnfocus();
            void SetOnblur([In] Object p);
            Object GetOnblur();
            void SetOnload([In] Object p);
            Object GetOnload();
            void SetOnbeforeunload(Object p);
            Object GetOnbeforeunload();
            void SetOnunload([In] Object p);
            Object GetOnunload();
            void SetOnhelp(Object p);
            Object GetOnhelp();
            void SetOnerror([In] Object p);
            Object GetOnerror();
            void SetOnresize([In] Object p);
            Object GetOnresize();
            void SetOnscroll([In] Object p);
            Object GetOnscroll();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLDocument2 GetDocument();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLEventObj GetEvent();
            object Get_newEnum();
            Object ShowModalDialog([In] string dialog, [In] ref Object varArgIn, [In] ref Object varOptions);
            void ShowHelp([In] string helpURL, [In] Object helpArg, [In] string features);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLScreen GetScreen();
            object GetOption();
            void Focus();
            bool GetClosed();
            void Blur();
            void Scroll([In] int x, [In] int y);
            object GetClientInformation();
            int SetInterval([In] string expression, [In] int msec, [In] ref Object language);
            void ClearInterval([In] int timerID);
            void SetOffscreenBuffering([In] Object p);
            Object GetOffscreenBuffering();
            [return: MarshalAs(UnmanagedType.Struct)] Object ExecScript([In] string code, [In] string language);
            string toString();
            void ScrollBy([In] int x, [In] int y);
            void ScrollTo([In] int x, [In] int y);
            void MoveTo([In] int x, [In] int y);
            void MoveBy([In] int x, [In] int y);
            void ResizeTo([In] int x, [In] int y);
            void ResizeBy([In] int x, [In] int y);
            object GetExternal();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f4ae-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLWindow3 {
            int GetScreenLeft();
            int GetScreenTop();
            bool AttachEvent(string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            void DetachEvent(string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            int SetTimeout([In]ref object expression, int msec, [In] ref object language);
            int SetInterval([In]ref object expression, int msec, [In] ref object language);
            void Print();
            void SetBeforePrint(object o);
            object GetBeforePrint();
            void SetAfterPrint(object o);
            object GetAfterPrint();
            object GetClipboardData();
            object ShowModelessDialog(string url, object varArgIn, object options);
        }
        
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f6cf-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLWindow4 {
            [return: MarshalAs(UnmanagedType.IDispatch)] object CreatePopup([In] ref object reserved);
            [return: MarshalAs(UnmanagedType.Interface)] object frameElement();
        }
 
        
        [ComImport(), Guid("3050f625-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLWindowEvents2 {
            [DispId(1003)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1008)] void onunload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1002)] bool onerror(string description, string url, int line);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1017)] void onbeforeunload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1024)] void onbeforeprint(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1025)] void onafterprint(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f666-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLPopup {
            void show(int x, int y, int w, int h, ref object element);
            void hide();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLDocument GetDocument();
            bool IsOpen();
        }
        
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f35c-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLScreen {
            int GetColorDepth();
            void SetBufferDepth(int d);
            int GetBufferDepth();
            int GetWidth();
            int GetHeight();
            void SetUpdateInterval(int i);
            int GetUpdateInterval();
            int GetAvailHeight();
            int GetAvailWidth();
            bool GetFontSmoothingEnabled();
        }
 
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("163BB1E0-6E00-11CF-837A-48DC04C10000"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLLocation {
            void SetHref([In] string p);
            string GetHref();
            void SetProtocol([In] string p);
            string GetProtocol();
            void SetHost([In] string p);
            string GetHost();
            void SetHostname([In] string p);
            string GetHostname();
            void SetPort([In] string p);
            string GetPort();
            void SetPathname([In] string p);
            string GetPathname();
            void SetSearch([In] string p);
            string GetSearch();
            void SetHash([In] string p);
            string GetHash();
            void Reload([In] bool flag);
            void Replace([In] string bstr);
            void Assign([In] string bstr);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("FECEAAA2-8405-11CF-8BA1-00AA00476DA6"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IOmHistory {
            short GetLength();
            void Back();
            void Forward();
            void Go([In] ref Object pvargdistance);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("FECEAAA5-8405-11CF-8BA1-00AA00476DA6"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IOmNavigator {
            string GetAppCodeName();
            string GetAppName();
            string GetAppVersion();
            string GetUserAgent();
            bool JavaEnabled();
            bool TaintEnabled();
            object GetMimeTypes();
            object GetPlugins();
            bool GetCookieEnabled();
            object GetOpsProfile();
            string GetCpuClass();
            string GetSystemLanguage();
            string GetBrowserLanguage();
            string GetUserLanguage();
            string GetPlatform();
            string GetAppMinorVersion();
            int GetConnectionSpeed();
            bool GetOnLine();
            object GetUserProfile();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050F32D-98B5-11CF-BB82-00AA00BDCE0B"),
        InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLEventObj {
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetSrcElement();
            bool GetAltKey();
            bool GetCtrlKey();
            bool GetShiftKey();
            void SetReturnValue(object p);
            object GetReturnValue();
            void SetCancelBubble(bool p);
            bool GetCancelBubble();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetFromElement();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetToElement();
            void SetKeyCode([In] int p);
            int GetKeyCode();
            int GetButton();
            string GetEventType();
            string GetQualifier();
            int GetReason();
            int GetX();
            int GetY();
            int GetClientX();
            int GetClientY();
            int GetOffsetX();
            int GetOffsetY();
            int GetScreenX();
            int GetScreenY();
            object GetSrcFilter();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f48B-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLEventObj2 {
            void SetAttribute(string attributeName, object attributeValue, int lFlags);
            object GetAttribute(string attributeName, int lFlags);
            bool RemoveAttribute(string attributeName, int lFlags);
            void SetPropertyName(string name);
            string GetPropertyName();
            void SetBookmarks(ref object bm);
            object GetBookmarks();
            void SetRecordset(ref object rs);
            object GetRecordset();
            void SetDataFld(string df);
            string GetDataFld();
            void SetBoundElements(ref object be);
            object GetBoundElements();
            void SetRepeat(bool r);
            bool GetRepeat();
            void SetSrcUrn(string urn);
            string GetSrcUrn();
            void SetSrcElement(ref object se);
            object GetSrcElement();
            void SetAltKey(bool alt);
            bool GetAltKey();
            void SetCtrlKey(bool ctrl);
            bool GetCtrlKey();
            void SetShiftKey(bool shift);
            bool GetShiftKey();
            void SetFromElement(ref object element);
            object GetFromElement();
            void SetToElement(ref object element);
            object GetToElement();
            void SetButton(int b);
            int GetButton();
            void SetType(string type);
            string GetType();
            void SetQualifier(string q);
            string GetQualifier();
            void SetReason(int r);
            int GetReason();
            void SetX(int x);
            int GetX();
            void SetY(int y);
            int GetY();
            void SetClientX(int x);
            int GetClientX();
            void SetClientY(int y);
            int GetClientY();
            void SetOffsetX(int x);
            int GetOffsetX();
            void SetOffsetY(int y);
            int GetOffsetY();
            void SetScreenX(int x);
            int GetScreenX();
            void SetScreenY(int y);
            int GetScreenY();
            void SetSrcFilter(ref object filter);
            object GetSrcFilter();
            object GetDataTransfer();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f814-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLEventObj4 {
            int GetWheelDelta();
        };
        
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050F21F-98B5-11CF-BB82-00AA00BDCE0B"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLElementCollection {
            string toString();
            void SetLength(int p);
            int GetLength();
            [return: MarshalAs(UnmanagedType.Interface)] object Get_newEnum();
            [return: MarshalAs(UnmanagedType.IDispatch)] object Item(object idOrName, object index);
            [return: MarshalAs(UnmanagedType.Interface)] object Tags(object tagName);
        }
        
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050F1FF-98B5-11CF-BB82-00AA00BDCE0B"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLElement {
            void SetAttribute(string attributeName, object attributeValue, int lFlags);
            object GetAttribute(string attributeName, int lFlags);
            bool RemoveAttribute(string strAttributeName, int lFlags);
            void SetClassName(string p);
            string GetClassName();
            void SetId(string p);
            string GetId();
            string GetTagName();
            IHTMLElement GetParentElement();
            IHTMLStyle GetStyle();
            void SetOnhelp(Object p);
            Object GetOnhelp();
            void SetOnclick(Object p);
            Object GetOnclick();
            void SetOndblclick(Object p);
            Object GetOndblclick();
            void SetOnkeydown(Object p);
            Object GetOnkeydown();
            void SetOnkeyup(Object p);
            Object GetOnkeyup();
            void SetOnkeypress(Object p);
            Object GetOnkeypress();
            void SetOnmouseout(Object p);
            Object GetOnmouseout();
            void SetOnmouseover(Object p);
            Object GetOnmouseover();
            void SetOnmousemove(Object p);
            Object GetOnmousemove();
            void SetOnmousedown(Object p);
            Object GetOnmousedown();
            void SetOnmouseup(Object p);
            Object GetOnmouseup();
            [return: MarshalAs(UnmanagedType.Interface)] IHTMLDocument2 GetDocument();
            void SetTitle(string p);
            string GetTitle();
            void SetLanguage(string p);
            string GetLanguage();
            void SetOnselectstart(Object p);
            Object GetOnselectstart();
            void ScrollIntoView(object varargStart);
            bool Contains(IHTMLElement pChild);
            int GetSourceIndex();
            Object GetRecordNumber();
            void SetLang(string p);
            string GetLang();
            int GetOffsetLeft();
            int GetOffsetTop();
            int GetOffsetWidth();
            int GetOffsetHeight();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement GetOffsetParent();
            void SetInnerHTML(string p);
            string GetInnerHTML();
            void SetInnerText(string p);
            string GetInnerText();
            void SetOuterHTML(string p);
            string GetOuterHTML();
            void SetOuterText(string p);
            string GetOuterText();
            void InsertAdjacentHTML(string @where,
                string html);
            void InsertAdjacentText(string @where,
                string text);
            IHTMLElement GetParentTextEdit();
            bool GetIsTextEdit();
            void Click();
            [return: MarshalAs(UnmanagedType.Interface)] object GetFilters();
            void SetOndragstart(Object p);
            Object GetOndragstart();
            string toString();
            void SetOnbeforeupdate(Object p);
            Object GetOnbeforeupdate();
            void SetOnafterupdate(Object p);
            Object GetOnafterupdate();
            void SetOnerrorupdate(Object p);
            Object GetOnerrorupdate();
            void SetOnrowexit(Object p);
            Object GetOnrowexit();
            void SetOnrowenter(Object p);
            Object GetOnrowenter();
            void SetOndatasetchanged(Object p);
            Object GetOndatasetchanged();
            void SetOndataavailable(Object p);
            Object GetOndataavailable();
            void SetOndatasetcomplete(Object p);
            Object GetOndatasetcomplete();
            void SetOnfilterchange(Object p);
            Object GetOnfilterchange();
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetChildren();
            [return: MarshalAs(UnmanagedType.IDispatch)] object GetAll();
        }
        
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f434-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLElement2 {
            string ScopeName();
            void SetCapture(bool containerCapture);
            void ReleaseCapture();
            void SetOnLoseCapture(object v);
            object GetOnLoseCapture();
            string GetComponentFromPoint(int x, int y);
            void DoScroll(object component);
            void SetOnScroll(object v);
            object GetOnScroll();
            void SetOnDrag(object v);
            object GetOnDrag();
            void SetOnDragEnd(object v);
            object GetOnDragEnd();
            void SetOnDragEnter(object v);
            object GetOnDragEnter();
            void SetOnDragOver(object v);
            object GetOnDragOver();
            void SetOnDragleave(object v);
            object GetOnDragLeave();
            void SetOnDrop(object v);
            object GetOnDrop();
            void SetOnBeforeCut(object v);
            object GetOnBeforeCut();
            void SetOnCut(object v);
            object GetOnCut();
            void SetOnBeforeCopy(object v);
            object GetOnBeforeCopy();
            void SetOnCopy(object v);
            object GetOnCopy(object p);
            void SetOnBeforePaste(object v);
            object GetOnBeforePaste(object p);
            void SetOnPaste(object v);
            object GetOnPaste(object p);
            object GetCurrentStyle();
            void SetOnPropertyChange(object v);
            object GetOnPropertyChange(object p);
            object GetClientRects();
            object GetBoundingClientRect();
            void SetExpression(string propName, string expression, string language);
            object GetExpression(string propName);
            bool RemoveExpression(string propName);
            void SetTabIndex(int v);
            short GetTabIndex();
            void Focus();
            void SetAccessKey(string v);
            string GetAccessKey();
            void SetOnBlur(object v);
            object GetOnBlur();
            void SetOnFocus(object v);
            object GetOnFocus();
            void SetOnResize(object v);
            object GetOnResize();
            void Blur();
            void AddFilter(object pUnk);
            void RemoveFilter(object pUnk);
            int ClientHeight();
            int ClientWidth();
            int ClientTop();
            int ClientLeft();
            bool AttachEvent(string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            void DetachEvent(string ev, [In, MarshalAs(UnmanagedType.IDispatch)] object pdisp);
            object ReadyState();
            void SetOnReadyStateChange(object v);
            object GetOnReadyStateChange();
            void SetOnRowsDelete(object v);
            object GetOnRowsDelete();
            void SetOnRowsInserted(object v);
            object GetOnRowsInserted();
            void SetOnCellChange(object v);
            object GetOnCellChange();
            void SetDir(string v);
            string GetDir();
            object CreateControlRange();
            int GetScrollHeight();
            int GetScrollWidth();
            void SetScrollTop(int v);
            int GetScrollTop();
            void SetScrollLeft(int v);
            int GetScrollLeft();
            void ClearAttributes();
            void MergeAttributes(object mergeThis);
            void SetOnContextMenu(object v);
            object GetOnContextMenu();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement
                InsertAdjacentElement(string @where,
                    [In, MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement insertedElement);
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement
                applyElement([In, MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElement apply,
                    string @where);
            string GetAdjacentText(string @where);
            string ReplaceAdjacentText(string @where,string newText);
            bool CanHaveChildren();
            int AddBehavior(string url, ref object oFactory);
            bool RemoveBehavior(int cookie);
            object GetRuntimeStyle();
            object GetBehaviorUrns();
            void SetTagUrn(string v);
            string GetTagUrn();
            void SetOnBeforeEditFocus(object v);
            object GetOnBeforeEditFocus();
            int GetReadyStateValue();
            [return: MarshalAs(UnmanagedType.Interface)] UnsafeNativeMethods.IHTMLElementCollection GetElementsByTagName(string v);
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f673-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        internal interface IHTMLElement3 {
            void MergeAttributes(object mergeThis, object pvarFlags);
            bool IsMultiLine();
            bool CanHaveHTML();
            void SetOnLayoutComplete(object v);
            object GetOnLayoutComplete();
            void SetOnPage(object v);
            object GetOnPage();
            void SetInflateBlock(bool v);
            bool GetInflateBlock();
            void SetOnBeforeDeactivate(object v);
            object GetOnBeforeDeactivate();
            void SetActive();
            void SetContentEditable(string v);
            string GetContentEditable();
            bool IsContentEditable();
            void SetHideFocus(bool v);
            bool GetHideFocus();
            void SetDisabled(bool v);
            bool GetDisabled();
            bool IsDisabled();
            void SetOnMove(object v);
            object GetOnMove();
            void SetOnControlSelect(object v);
            object GetOnControlSelect();
            bool FireEvent(string bstrEventName, IntPtr pvarEventObject);
            void SetOnResizeStart(object v);
            object GetOnResizeStart();
            void SetOnResizeEnd(object v);
            object GetOnResizeEnd();
            void SetOnMoveStart(object v);
            object GetOnMoveStart();
            void SetOnMoveEnd(object v);
            object GetOnMoveEnd();
            void SetOnMouseEnter(object v);
            object GetOnMouseEnter();
            void SetOnMouseLeave(object v);
            object GetOnMouseLeave();
            void SetOnActivate(object v);
            object GetOnActivate();
            void SetOnDeactivate(object v);
            object GetOnDeactivate();
            bool DragDrop();
            int GlyphMode();
        }
 
        [SuppressUnmanagedCodeSecurity, ComVisible(true), Guid("3050f5da-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IHTMLDOMNode {
            long GetNodeType();
            IHTMLDOMNode GetParentNode();
            bool HasChildNodes();
            object GetChildNodes();
            object GetAttributes();
            IHTMLDOMNode InsertBefore(IHTMLDOMNode newChild, object refChild);
            IHTMLDOMNode RemoveChild(IHTMLDOMNode oldChild);
            IHTMLDOMNode ReplaceChild(IHTMLDOMNode newChild, IHTMLDOMNode oldChild);
            IHTMLDOMNode CloneNode(bool fDeep);
            IHTMLDOMNode RemoveNode(bool fDeep);
            IHTMLDOMNode SwapNode(IHTMLDOMNode otherNode);
            IHTMLDOMNode ReplaceNode(IHTMLDOMNode replacement);
            IHTMLDOMNode AppendChild(IHTMLDOMNode newChild);
            string NodeName();
            void SetNodeValue(object v);
            object GetNodeValue();
            IHTMLDOMNode FirstChild();
            IHTMLDOMNode LastChild();
            IHTMLDOMNode PreviousSibling();
            IHTMLDOMNode NextSibling();
        };
        
        [ComImport(), Guid("3050f60f-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f610-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLAnchorEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f611-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLAreaEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f617-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLButtonElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f612-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLControlElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f614-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLFormElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1007)] bool onsubmit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1015)] bool onreset(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f7ff-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLFrameSiteEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1003)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f616-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLImgEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1003)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1002)] void onerror(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1000)] void onabort(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f61a-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLInputFileElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147412082)] bool onchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147412102)] void onselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1003)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1002)] void onerror(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1000)] void onabort(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f61b-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLInputImageEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147412080)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147412083)] void onerror(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147412084)] void onabort(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f618-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLInputTextElementEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1001)] bool onchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1006)] void onselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1003)] void onload(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1002)] void onerror(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1001)] void onabort(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid("3050f61c-98b5-11cf-bb82-00aa00bdce0b"),
        InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch),
        TypeLibType(TypeLibTypeFlags.FHidden)]
        public interface DHTMLLabelEvents2 {
            [DispId(-2147418102)] bool onhelp(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-600)] bool onclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-601)] bool ondblclick(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-603)] bool onkeypress(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-602)] void onkeydown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-604)] void onkeyup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418103)] void onmouseout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418104)] void onmouseover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-606)] void onmousemove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-605)] void onmousedown(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-607)] void onmouseup(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418100)] bool onselectstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418095)] void onfilterchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418101)] bool ondragstart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418108)] bool onbeforeupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418107)] void onafterupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418099)]  bool onerrorupdate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418106)] bool onrowexit(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418105)] void onrowenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418098)] void ondatasetchanged(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418097)] void ondataavailable(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418096)] void ondatasetcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418094)] void onlosecapture(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418093)] void onpropertychange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1014)] void onscroll(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418111)] void onfocus(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418112)] void onblur(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1016)] void onresize(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418092)] bool ondrag(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418091)] void ondragend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418090)] bool ondragenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418089)]  bool ondragover(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418088)] void ondragleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418087)] bool ondrop(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418083)] bool onbeforecut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418086)] bool oncut(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418082)] bool onbeforecopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418085)] bool oncopy(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418081)] bool onbeforepaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418084)] bool onpaste(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1023)] bool oncontextmenu(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418080)] void onrowsdelete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418079)] void onrowsinserted(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-2147418078)] void oncellchange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(-609)] void onreadystatechange(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1030)] void onlayoutcomplete(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1031)] void onpage(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1042)] void onmouseenter(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1043)] void onmouseleave(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1044)] void onactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1045)] void ondeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1034)] bool onbeforedeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1047)] bool onbeforeactivate(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1048)] void onfocusin(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1049)] void onfocusout(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1035)] void onmove(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1036)] bool oncontrolselect(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1038)] bool onmovestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1039)] void onmoveend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1040)] bool onresizestart(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1041)] void onresizeend(UnsafeNativeMethods.IHTMLEventObj evtObj);
            [DispId(1033)] bool onmousewheel(UnsafeNativeMethods.IHTMLEventObj evtObj);
        }
 
        [ComImport(), Guid(