diff --git a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DHTMLAnchorEvents2.cs b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DHTMLAnchorEvents2.cs index 98372dce76e..3b4d9a83b6e 100644 --- a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DHTMLAnchorEvents2.cs +++ b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DHTMLAnchorEvents2.cs @@ -5,7 +5,7 @@ internal partial class Interop { - internal partial class Mshtml + internal static partial class Mshtml { [ComImport] [Guid("3050f610-98b5-11cf-bb82-00aa00bdce0b")] diff --git a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIDBLCLK.cs b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIDBLCLK.cs deleted file mode 100644 index 6bdb7bf2ab2..00000000000 --- a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIDBLCLK.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -internal static partial class Interop -{ - internal static partial class Mshtml - { - public enum DOCHOSTUIDBLCLK - { - DEFAULT = 0, - SHOWPROPERTIES = 1, - SHOWCODE = 2 - } - } -} diff --git a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIFLAG.cs b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIFLAG.cs deleted file mode 100644 index c77de0d4ad0..00000000000 --- a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIFLAG.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -internal static partial class Interop -{ - internal static partial class Mshtml - { - [Flags] - public enum DOCHOSTUIFLAG - { - DIALOG = 0x00000001, - DISABLE_HELP_MENU = 0x00000002, - NO3DBORDER = 0x00000004, - SCROLL_NO = 0x00000008, - DISABLE_SCRIPT_INACTIVE = 0x00000010, - OPENNEWWIN = 0x00000020, - DISABLE_OFFSCREEN = 0x00000040, - FLAT_SCROLLBAR = 0x00000080, - DIV_BLOCKDEFAULT = 0x00000100, - ACTIVATE_CLIENTHIT_ONLY = 0x00000200, - OVERRIDEBEHAVIORFACTORY = 0x00000400, - CODEPAGELINKEDFONTS = 0x00000800, - URL_ENCODING_DISABLE_UTF8 = 0x00001000, - URL_ENCODING_ENABLE_UTF8 = 0x00002000, - ENABLE_FORMS_AUTOCOMPLETE = 0x00004000, - ENABLE_INPLACE_NAVIGATION = 0x00010000, - IME_ENABLE_RECONVERSION = 0x00020000, - THEME = 0x00040000, - NOTHEME = 0x00080000, - NOPICS = 0x00100000, - NO3DOUTERBORDER = 0x00200000, - DISABLE_EDIT_NS_FIXUP = 0x00400000, - LOCAL_MACHINE_ACCESS_CHECK = 0x00800000, - DISABLE_UNTRUSTEDPROTOCOL = 0x01000000, - HOST_NAVIGATES = 0x02000000, - ENABLE_REDIRECT_NOTIFICATION = 0x04000000, - USE_WINDOWLESS_SELECTCONTROL = 0x08000000, - USE_WINDOWED_SELECTCONTROL = 0x10000000, - ENABLE_ACTIVEX_INACTIVATE_MODE = 0x20000000, - DPI_AWARE = 0x40000000 - } - } -} diff --git a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIINFO.cs b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIINFO.cs deleted file mode 100644 index 40c63da5d3d..00000000000 --- a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.DOCHOSTUIINFO.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -internal static partial class Interop -{ - internal static partial class Mshtml - { - public struct DOCHOSTUIINFO - { - public uint cbSize; - public Mshtml.DOCHOSTUIFLAG dwFlags; - public Mshtml.DOCHOSTUIDBLCLK dwDoubleClick; - public uint dwReserved1; - public uint dwReserved2; - } - } -} diff --git a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.IDocHostUIHandler.cs b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.IDocHostUIHandler.cs index 30fff546859..621a1061a7a 100644 --- a/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.IDocHostUIHandler.cs +++ b/src/System.Windows.Forms.Primitives/src/Interop/Mshtml/Interop.IDocHostUIHandler.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using Windows.Win32.System.Ole; +using MsHtml = Windows.Win32.Web.MsHtml; internal partial class Interop { @@ -24,7 +25,7 @@ HRESULT ShowContextMenu( [PreserveSig] HRESULT GetHostInfo( - DOCHOSTUIINFO* pInfo); + MsHtml.DOCHOSTUIINFO* pInfo); [PreserveSig] HRESULT ShowUI( diff --git a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt index 9a33159f0f6..0195ed35407 100644 --- a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt +++ b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt @@ -114,6 +114,7 @@ DispatchMessage DISPID_* DISPPARAMS DLGC_* +DOCHOSTUIINFO DoDragDrop DPI_AWARENESS_CONTEXT_* DPI_HOSTING_BEHAVIOR diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.WebBrowserSite.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.WebBrowserSite.cs index 1215d6b8a44..be553197750 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.WebBrowserSite.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.WebBrowserSite.cs @@ -3,6 +3,7 @@ using System.Drawing; using Windows.Win32.System.Ole; +using MsHtml = Windows.Win32.Web.MsHtml; using static Interop.Mshtml; using Ole = Windows.Win32.System.Ole; using ComTypes = System.Runtime.InteropServices.ComTypes; @@ -55,7 +56,7 @@ unsafe HRESULT IDocHostUIHandler.ShowContextMenu(uint dwID, Point* pt, object pc return HRESULT.S_OK; } - unsafe HRESULT IDocHostUIHandler.GetHostInfo(DOCHOSTUIINFO* pInfo) + unsafe HRESULT IDocHostUIHandler.GetHostInfo(MsHtml.DOCHOSTUIINFO* pInfo) { if (pInfo is null) { @@ -64,26 +65,26 @@ unsafe HRESULT IDocHostUIHandler.GetHostInfo(DOCHOSTUIINFO* pInfo) WebBrowser wb = (WebBrowser)Host; - pInfo->dwDoubleClick = DOCHOSTUIDBLCLK.DEFAULT; - pInfo->dwFlags = DOCHOSTUIFLAG.NO3DOUTERBORDER | - DOCHOSTUIFLAG.DISABLE_SCRIPT_INACTIVE; + pInfo->dwDoubleClick = MsHtml.DOCHOSTUIDBLCLK.DOCHOSTUIDBLCLK_DEFAULT; + pInfo->dwFlags = MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_NO3DOUTERBORDER | + MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE; if (wb.ScrollBarsEnabled) { - pInfo->dwFlags |= DOCHOSTUIFLAG.FLAT_SCROLLBAR; + pInfo->dwFlags |= MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_FLAT_SCROLLBAR; } else { - pInfo->dwFlags |= DOCHOSTUIFLAG.SCROLL_NO; + pInfo->dwFlags |= MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_SCROLL_NO; } if (Application.RenderWithVisualStyles) { - pInfo->dwFlags |= DOCHOSTUIFLAG.THEME; + pInfo->dwFlags |= MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_THEME; } else { - pInfo->dwFlags |= DOCHOSTUIFLAG.NOTHEME; + pInfo->dwFlags |= MsHtml.DOCHOSTUIFLAG.DOCHOSTUIFLAG_NOTHEME; } return HRESULT.S_OK;