Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Window transparency while hosting a Flash ActiveX component
    primarykey
    data
    text
    <p>My application has a custom window design, which means that every window has the following parameters set (XAML): WindowStyle="None" AllowsTransparency="False"</p> <p>One of the sub windows needs to display a Flash component, the Flash ActiveX component is hosted thrugh XAML: </p> <p>With regards to window <strong>transparency</strong>, there is a known issue with WPF and hosted winforms components, it just doesn't work out of the box. In order to be able to view the Flash component, AllowsTransparency must be set to "False", otherwise, the flash component will simply not be displayed.</p> <p>To maintain the window's transparency (and general L&amp;F), I have modified this piece of code: <a href="http://blogs.msdn.com/b/adam_nathan/archive/2006/05/04/589686.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/adam_nathan/archive/2006/05/04/589686.aspx</a></p> <pre><code> IntPtr hwnd = new WindowInteropHelper(window).Handle; // Set the background to transparent from both the WPF and Win32 perspectives window.Background = Brushes.Transparent; HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent; MARGINS margins = new MARGINS(margin); DwmExtendFrameIntoClientArea(hwnd, ref margins); </code></pre> <p>So everything is now working great, until I started checking it on <strong>XP</strong>. Obviously, the above piece of code doesn't work on XP since the DLL used (dwmapi.dll) is a Vista DLL.</p> <p>The question is whether the same result can be achieved in XP and if so, how? </p> <p>I've tried altering this piece of code: <a href="https://stackoverflow.com/questions/2842667/how-to-create-a-semi-transparent-window-in-wpf-that-allows-mouse-events-to-pass-t">How to create a semi transparent window in WPF that allows mouse events to pass through</a> or similar other examples, yet, I didn't manage to achieve any window transparency.</p> <p>Would appreciate any advice.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload