Click here to Skip to main content
13,452,641 members (55,768 online)
Rate this:
Please Sign up or sign in to vote.
See more:
The project here is in WPF and the main shell is using GlassWindow appearance, meaning AllowTransparency property is set to true.
The problem with this property is that it doesn`t go well with DirectX.
We have a user control inside our app and inside that user control we display streaming video.

The user control cannot internally control the transparency. The property AllowTransparency must relate to a window with a handle.

How can I make the user control ignore the transparency?

Posted 25-Dec-12 23:08pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Well, obviously there is no workaround on your request.
As far as your control is hosted in WPF window , so it fully controlling by parent object.
If we look at your problem from interop mechanism , we can conclude that in WPF there is only one HWND (window's handle from WIN32 API terminology) for all childs control, so as a result transparency of your video ctrl is dependant from main Window..
And one more for more compelling words look what MS said:
"OS cannot render any object without having a reference to HWND to its kernel. Hence is the case with WPF. So WPF window actually holds a reference to one window handle. Even you can get Window Handle for any Visual inside the WPF window"

So as a rusult -> Every Visual of WPF does not have its own HANDLE associated with it, rather it is a content for the outside window element, Hence you can say, every WPF control is owned by its parent window.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02-2016 | 2.8.180318.3 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100