Tip: Fix WebBrowser visibilty IssueThere is a bug in the WebBrowser WPF control where it will not show up when Window.AllowTransparency is true. <br><br>Add the following to your window:<br><br>        protected override void OnSourceInitialized(EventArgs e)<br>        {<br>            base.OnSourceInitialized(e);<br>            IntPtr hWnd = new WindowInteropHelper(this).Handle;<br>            int hresult = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP | Win32.WS_CLIPCHILDREN);<br><br>        }<br><br><br>public class Win32<br>{<br>        public const int GWL_EXSTYLE      =    (-20);<br>        public const int GWL_STYLE = -16;<br>        public const long WS_POPUP   =  0x80000000L;<br>        public const long WS_CLIPCHILDREN    =   0x02000000L;<br><br>        [DllImport(&quot;user32.dll&quot; , CharSet = CharSet.Auto)]<br>        public static extern int SetWindowLong(IntPtr hWnd, int nIndex, long dwNewLong);<br><br>}<br> © 2009 Microsoft Corporation. All rights reserved.Wed, 08 Jul 2009 03:19:48 Z17fc75f6-db97-43ef-8ce5-f1aecaa15f86http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#17fc75f6-db97-43ef-8ce5-f1aecaa15f86http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#17fc75f6-db97-43ef-8ce5-f1aecaa15f86Frankenspankhttp://social.msdn.microsoft.com/Profile/en-US/?user=FrankenspankTip: Fix WebBrowser visibilty IssueThere is a bug in the WebBrowser WPF control where it will not show up when Window.AllowTransparency is true. <br><br>Add the following to your window:<br><br>        protected override void OnSourceInitialized(EventArgs e)<br>        {<br>            base.OnSourceInitialized(e);<br>            IntPtr hWnd = new WindowInteropHelper(this).Handle;<br>            int hresult = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP | Win32.WS_CLIPCHILDREN);<br><br>        }<br><br><br>public class Win32<br>{<br>        public const int GWL_EXSTYLE      =    (-20);<br>        public const int GWL_STYLE = -16;<br>        public const long WS_POPUP   =  0x80000000L;<br>        public const long WS_CLIPCHILDREN    =   0x02000000L;<br><br>        [DllImport(&quot;user32.dll&quot; , CharSet = CharSet.Auto)]<br>        public static extern int SetWindowLong(IntPtr hWnd, int nIndex, long dwNewLong);<br><br>}<br> Tue, 11 Nov 2008 13:28:20 Z2008-11-11T13:28:20Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#65816cc6-33ff-49b7-b73f-f10966a501efhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#65816cc6-33ff-49b7-b73f-f10966a501efQuddusAlihttp://social.msdn.microsoft.com/Profile/en-US/?user=QuddusAliTip: Fix WebBrowser visibilty IssueHi Frank,<br/>            I have added the code but i cant get it to work:<br/><br/> <pre lang=x-vbnet>Imports System Imports System.IO Imports System.Net Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Data Imports System.Windows.Media Imports System.Windows.Media.Animation Imports System.Windows.Navigation Imports System.Runtime.InteropServices Imports System.Windows.Interop Partial Public Class Window1 Public Sub New() MyBase.New() Me.InitializeComponent() ' Insert code required on object creation below this point. End Sub Private Sub NavButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles NavButton.Click WebBrowser.Navigate(New Uri(&quot;http://www.bl.uk/news/pdf/googlegen.pdf&quot;)) End Sub Protected Overloads Overrides Sub OnSourceInitialized(ByVal e As EventArgs) MyBase.OnSourceInitialized(e) Dim hWnd As IntPtr = New WindowInteropHelper(Me).Handle Dim hresult As Integer = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP Or Win32.WS_CLIPCHILDREN) End Sub End Class Public Class Win32 Public Const GWL_EXSTYLE As Integer = (-20) Public Const GWL_STYLE As Integer = -16 Public Const WS_POPUP As Long = 2147483648L Public Const WS_CLIPCHILDREN As Long = 33554432L &lt;DllImport(&quot;user32.dll&quot;, CharSet:=CharSet.Auto)&gt; _ Public Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Integer End Function End Class</pre> When i click the button - the browser doesnt show up.<br/><br/>Can you help?Thu, 23 Apr 2009 05:57:50 Z2009-04-23T05:57:50Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#67e02a4a-6a34-4dca-9455-81737be9e92ahttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#67e02a4a-6a34-4dca-9455-81737be9e92aFrankenspankhttp://social.msdn.microsoft.com/Profile/en-US/?user=FrankenspankTip: Fix WebBrowser visibilty IssueIs the browser visible before you click the button? <br/> <br/> You can also check the HRESULT when you call SetWindowLong and look up the code.  If it isn't 0, then look it up in Winerror.h.  You can find it in the platform SDK, or here: http://msdn.microsoft.com/en-us/library/ms819772.aspx.<br/> <br/>Mon, 27 Apr 2009 19:43:35 Z2009-04-27T19:43:35Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#26ae73b2-dfef-497c-88bb-8e35a23cea90http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#26ae73b2-dfef-497c-88bb-8e35a23cea90QuddusAlihttp://social.msdn.microsoft.com/Profile/en-US/?user=QuddusAliTip: Fix WebBrowser visibilty IssueHi. The browser isnt visible before i click the button.Tue, 28 Apr 2009 07:48:55 Z2009-04-28T07:48:55Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#95140bd8-258b-4d60-b86c-c000264a4fa2http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#95140bd8-258b-4d60-b86c-c000264a4fa2Frankenspankhttp://social.msdn.microsoft.com/Profile/en-US/?user=FrankenspankTip: Fix WebBrowser visibilty IssueWhat do you get here (what is the value of hresult)?<br/> <br/> <pre> <span style="color:blue">Dim</span> hresult <span style="color:blue">As</span> <span style="color:blue">Integer</span> = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP <span style="color:blue">Or</span> Win32.WS_CLIPCHILDREN)<br/> </pre>Tue, 28 Apr 2009 18:22:26 Z2009-04-28T18:25:53Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#701fa5c9-740c-4c43-9d56-ee9a3dd87827http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#701fa5c9-740c-4c43-9d56-ee9a3dd87827QuddusAlihttp://social.msdn.microsoft.com/Profile/en-US/?user=QuddusAliTip: Fix WebBrowser visibilty Issue114229248<br/>Tue, 28 Apr 2009 18:35:35 Z2009-04-28T18:35:52Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#7af42e77-bcee-4944-8bef-7d083bc649f3http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#7af42e77-bcee-4944-8bef-7d083bc649f3Frankenspankhttp://social.msdn.microsoft.com/Profile/en-US/?user=FrankenspankTip: Fix WebBrowser visibilty IssueWell the API failed, so you'll need to backtrack and check that everything before that is happening as it should be.Tue, 28 Apr 2009 21:24:51 Z2009-04-28T21:24:51Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#5c353dd2-ffd0-4aa5-9190-50c22381cd28http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#5c353dd2-ffd0-4aa5-9190-50c22381cd28QuddusAlihttp://social.msdn.microsoft.com/Profile/en-US/?user=QuddusAliTip: Fix WebBrowser visibilty IssueThanksTue, 28 Apr 2009 21:27:22 Z2009-04-28T21:27:22Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#d173aaae-ed6d-4ec9-907d-4a5a83cc4f93http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#d173aaae-ed6d-4ec9-907d-4a5a83cc4f93brentalhttp://social.msdn.microsoft.com/Profile/en-US/?user=brentalTip: Fix WebBrowser visibilty IssueI am attempting to implement this fix, but it is not working for me. I have attempted to look up the hresult code that I get back from the call to SetWindowLong in Winerror.h, but I am unable to find it.  Can anyone help in this regard? I am using the code exactly as per the original post and the hresult I am getting is 101646336.Tue, 30 Jun 2009 05:27:59 Z2009-06-30T05:34:03Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#2636b623-4d7c-4a6a-a44a-c34285d842f7http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#2636b623-4d7c-4a6a-a44a-c34285d842f7Frankenspankhttp://social.msdn.microsoft.com/Profile/en-US/?user=FrankenspankTip: Fix WebBrowser visibilty IssueDid you get a valid hwnd back? <br/> <br/> Here is why properties I have set for my window if this helps at all:<br/> <br/> &lt;Setter Property=&quot;AllowsTransparency&quot; Value=&quot;True&quot; /&gt;<br/> &lt;Setter Property=&quot;WindowStyle&quot; Value=&quot;None&quot; /&gt;Tue, 30 Jun 2009 15:52:53 Z2009-06-30T15:52:53Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#91658ed8-81c5-49f8-90eb-8e6f482e592chttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#91658ed8-81c5-49f8-90eb-8e6f482e592cbrentalhttp://social.msdn.microsoft.com/Profile/en-US/?user=brentalTip: Fix WebBrowser visibilty Issue<p>Thanks for getting back to me on this Frankenspank<br/><br/>I am a bit confused about the meaning of the hresult that is getting returned when I call SetWindowLong.  In one of the posts above you state that if the hresult is NOT 0 then look up the error code.  So, I thought that the fact that it is returning 101646336 meant that an error was occurring.  However, from reading more on the SetWindowLong method it is actually if it returns 0 that an error has occurred, and if it returns a number (such as 101646336 that I am getting) then it has succeeded (I read this here: <a href="http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx</a>).  So, if that is the case, then it looks like the SetWindowLong method is executing correctly.  This is further backed up by the fact that I call Marshal.GetLastWin32Error after the SetWindowLong method and dont get any error code back.<br/><br/>However, this does not solve my problem as even though the SetWindowLong method is executing correctly the WebBrowser control still remains invisible.  I am fairly sure that I am getting a valid hwnd back so I will give a bit more information on the application.  Basically I have created a brand new WPF application and haven't modified anything besides the XAML of Window1 and the code behind that window.  Here is the XAML of Window1:</p> <pre lang=x-xml>&lt;Window x:Class=&quot;WpfApplication1.Window1&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; Title=&quot;Window1&quot; Height=&quot;300&quot; Width=&quot;300&quot; AllowsTransparency=&quot;True&quot; WindowStyle=&quot;None&quot;&gt; &lt;StackPanel&gt; &lt;WebBrowser Name=&quot;wbTest&quot; Source=&quot;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86&quot; Height=&quot;240&quot;&gt;&lt;/WebBrowser&gt; &lt;Button Name=&quot;btnBrowse&quot; Click=&quot;btnBrowse_Click&quot; Height=&quot;20&quot;&gt;&lt;/Button&gt; &lt;/StackPanel&gt; &lt;/Window&gt;</pre> And here is the code behind Window1:<br/><br/> <pre lang="x-c#">using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Interop; using System.Runtime.InteropServices; namespace WpfApplication1 { /// &lt;summary&gt; /// Interaction logic for Window1.xaml /// &lt;/summary&gt; public partial class Window1 : Window { public Window1() { InitializeComponent(); } protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); IntPtr hWnd = new WindowInteropHelper(this).Handle; int hresult = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP | Win32.WS_CLIPCHILDREN); int lastError = Marshal.GetLastWin32Error(); } private void btnBrowse_Click(object sender, RoutedEventArgs e) { wbTest.Navigate(new Uri(&quot;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86&quot;)); } } public class Win32 { public const int GWL_EXSTYLE = (-20); public const int GWL_STYLE = (-16); public const long WS_POPUP = 0x80000000L; public const long WS_CLIPCHILDREN = 0x02000000L; [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, long dwNewLong); } } </pre> <br/>Any other thoughts on what could be going wrong?Fri, 03 Jul 2009 01:29:06 Z2009-07-03T01:30:02Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#d19188ad-aac9-4a67-8e98-d60dc5e19e92http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#d19188ad-aac9-4a67-8e98-d60dc5e19e92Sean Yaohttp://social.msdn.microsoft.com/Profile/en-US/?user=Sean%20YaoTip: Fix WebBrowser visibilty Issue<blockquote> <p>Thanks for getting back to me on this Frankenspank<br/><br/>I am a bit confused about the meaning of the hresult that is getting returned when I call SetWindowLong.  In one of the posts above you state that if the hresult is NOT 0 then look up the error code.  So, I thought that the fact that it is returning 101646336 meant that an error was occurring.  However, from reading more on the SetWindowLong method it is actually if it returns 0 that an error has occurred, and if it returns a number (such as 101646336 that I am getting) then it has succeeded (I read this here: <a href="http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx</a>).  So, if that is the case, then it looks like the SetWindowLong method is executing correctly.  This is further backed up by the fact that I call Marshal.GetLastWin32Error after the SetWindowLong method and dont get any error code back.<br/><br/>However, this does not solve my problem as even though the SetWindowLong method is executing correctly the WebBrowser control still remains invisible.  I am fairly sure that I am getting a valid hwnd back so I will give a bit more information on the application.  Basically I have created a brand new WPF application and haven't modified anything besides the XAML of Window1 and the code behind that window.  Here is the XAML of Window1:</p> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">&lt;</span><span style="color:#A31515">Window</span> <span style="color:Red">x:Class</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">WpfApplication1.Window1</span><span style="color:Black">&quot;</span> <span style="color:Red">xmlns</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">http://schemas.microsoft.com/winfx/2006/xaml/presentation</span><span style="color:Black">&quot;</span> <span style="color:Red">xmlns:x</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">http://schemas.microsoft.com/winfx/2006/xaml</span><span style="color:Black">&quot;</span> <span style="color:Red">Title</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">Window1</span><span style="color:Black">&quot;</span> <span style="color:Red">Height</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">300</span><span style="color:Black">&quot;</span> <span style="color:Red">Width</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">300</span><span style="color:Black">&quot;</span> <span style="color:Red">AllowsTransparency</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">True</span><span style="color:Black">&quot;</span> <span style="color:Red">WindowStyle</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">None</span><span style="color:Black">&quot;</span><span style="color:Blue">&gt;</span> <span style="color:Blue">&lt;</span><span style="color:#A31515">StackPanel</span><span style="color:Blue">&gt;</span> <span style="color:Blue">&lt;</span><span style="color:#A31515">WebBrowser</span> <span style="color:Red">Name</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">wbTest</span><span style="color:Black">&quot;</span> <span style="color:Red">Source</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86</span><span style="color:Black">&quot;</span> <span style="color:Red">Height</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">240</span><span style="color:Black">&quot;</span><span style="color:Blue">&gt;</span><span style="color:Blue">&lt;/</span><span style="color:#A31515">WebBrowser</span><span style="color:Blue">&gt;</span> <span style="color:Blue">&lt;</span><span style="color:#A31515">Button</span> <span style="color:Red">Name</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">btnBrowse</span><span style="color:Black">&quot;</span> <span style="color:Red">Click</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">btnBrowse_Click</span><span style="color:Black">&quot;</span> <span style="color:Red">Height</span><span style="color:Blue">=</span><span style="color:Black">&quot;</span><span style="color:Blue">20</span><span style="color:Black">&quot;</span><span style="color:Blue">&gt;</span><span style="color:Blue">&lt;/</span><span style="color:#A31515">Button</span><span style="color:Blue">&gt;</span> <span style="color:Blue">&lt;/</span><span style="color:#A31515">StackPanel</span><span style="color:Blue">&gt;</span> <span style="color:Blue">&lt;/</span><span style="color:#A31515">Window</span><span style="color:Blue">&gt;</span> </pre> </div> And here is the code behind Window1:<br/><br/> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">using</span> System; <span style="color:Blue">using</span> System.Collections.Generic; <span style="color:Blue">using</span> System.Linq; <span style="color:Blue">using</span> System.Text; <span style="color:Blue">using</span> System.Windows; <span style="color:Blue">using</span> System.Windows.Controls; <span style="color:Blue">using</span> System.Windows.Data; <span style="color:Blue">using</span> System.Windows.Documents; <span style="color:Blue">using</span> System.Windows.Input; <span style="color:Blue">using</span> System.Windows.Media; <span style="color:Blue">using</span> System.Windows.Media.Imaging; <span style="color:Blue">using</span> System.Windows.Navigation; <span style="color:Blue">using</span> System.Windows.Shapes; <span style="color:Blue">using</span> System.Windows.Interop; <span style="color:Blue">using</span> System.Runtime.InteropServices; <span style="color:Blue">namespace</span> WpfApplication1 { <span style="color:Gray">///</span> <span style="color:Gray">&lt;summary&gt;</span><span style="color:Green"> </span> <span style="color:Gray">///</span><span style="color:Green"> Interaction logic for Window1.xaml </span> <span style="color:Gray">///</span> <span style="color:Gray">&lt;/summary&gt;</span><span style="color:Green"> </span> <span style="color:Blue">public</span> <span style="color:Blue">partial</span> <span style="color:Blue">class</span> Window1 : Window { <span style="color:Blue">public</span> Window1() { InitializeComponent(); } <span style="color:Blue">protected</span> <span style="color:Blue">override</span> <span style="color:Blue">void</span> OnSourceInitialized(EventArgs e) { <span style="color:Blue">base</span>.OnSourceInitialized(e); IntPtr hWnd = <span style="color:Blue">new</span> WindowInteropHelper(<span style="color:Blue">this</span>).Handle; <span style="color:Blue">int</span> hresult = Win32.SetWindowLong(hWnd, Win32.GWL_STYLE, Win32.WS_POPUP | Win32.WS_CLIPCHILDREN); <span style="color:Blue">int</span> lastError = Marshal.GetLastWin32Error(); } <span style="color:Blue">private</span> <span style="color:Blue">void</span> btnBrowse_Click(<span style="color:Blue">object</span> sender, RoutedEventArgs e) { wbTest.Navigate(<span style="color:Blue">new</span> Uri(<span style="color:#A31515">&quot;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86&quot;</span>)); } } <span style="color:Blue">public</span> <span style="color:Blue">class</span> Win32 { <span style="color:Blue">public</span> <span style="color:Blue">const</span> <span style="color:Blue">int</span> GWL_EXSTYLE = (-20); <span style="color:Blue">public</span> <span style="color:Blue">const</span> <span style="color:Blue">int</span> GWL_STYLE = (-16); <span style="color:Blue">public</span> <span style="color:Blue">const</span> <span style="color:Blue">long</span> WS_POPUP = 0x80000000L; <span style="color:Blue">public</span> <span style="color:Blue">const</span> <span style="color:Blue">long</span> WS_CLIPCHILDREN = 0x02000000L; [DllImport(<span style="color:#A31515">&quot;user32.dll&quot;</span>, CharSet = CharSet.Auto, SetLastError = <span style="color:Blue">true</span>)] <span style="color:Blue">public</span> <span style="color:Blue">static</span> <span style="color:Blue">extern</span> <span style="color:Blue">int</span> SetWindowLong(IntPtr hWnd, <span style="color:Blue">int</span> nIndex, <span style="color:Blue">long</span> dwNewLong); } } </pre> </div> <br/>Any other thoughts on what could be going wrong?</blockquote> <div><strong><br/></strong></div> Anybody have suggestion on this? I encountered the same problem after the method &quot;SetWindowLong&quot; executed correctly. <div><br/></div><hr class="sig">SeanMon, 06 Jul 2009 05:35:07 Z2009-07-06T05:35:07Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#7d086402-3bab-4aa1-9258-056f7fadb547http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/17fc75f6-db97-43ef-8ce5-f1aecaa15f86#7d086402-3bab-4aa1-9258-056f7fadb547brentalhttp://social.msdn.microsoft.com/Profile/en-US/?user=brentalTip: Fix WebBrowser visibilty Issue<p>I managed to find another fix to this issue (outlined here <a title="http://blogs.msdn.com/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx" href="http://blogs.msdn.com/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx"><span style="font-size:x-small;font-family:Arial">http://blogs.msdn.com/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx</span></a>) but other issues arise in this fix, so I am still looking for some advice on how to properly implement the fix outlined in this thread.</p>Wed, 08 Jul 2009 03:19:48 Z2009-07-08T03:19:48Z