❔ HwndHost not rendering embedded window
I have this code in a class overriding HwndHost. The process is correctly parented, and I can even send input to the embedded window. It however doesn't show anything (see added image)
8 Replies
Is there some native windows methods I could try calling on the window to make it show?
As you can see I tried ShowWindow, MoveWindow and SetWindowLong with maximize and whatever
Is there mayb a function to set z-ordering?
by doesn't show anything you mean you don't see the "child" window? not even before manipulating it?
It doesn't render. I can give it input (for example the child window has a text input, which I can type into)
However, I just now found out that if I set my main (parent) form to not allow transparency, it works.
random call to make the window style layered it works with transparency
AllowsTransparency="True"
<- This makes it so the child window doesn't get shown
Is there mayb a solution to that? or at least an explanation?
At this point it's just curiosity, the final application doesn't really require transparency
Oh ^-^ when I do a SetWindowLongPtr(_hostedHandle, WINDOW_STYLE_EX, new IntPtr(WINDOW_STYLE_EX_LAYERED));
Windows is weirdit's not weird, it's that they are limited and maybe you don't 100% know what you are doing
have you tried going one style at a time, to understand which one is messing up the form
also are you creating the form or are you taking one already instantiated
because if you are creating it (or i should say them) there should not really be many problems
the container is an mdi right?
i almost always make my windows layered (might have to call setlayeredwindowattributes as well) it makes the window better in subtile ways
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Well theres almost no docs on this
Like yes there is information on the facts, but not on common problems and solutions
Ah well it's fixed anyways. No style was messing it up, just needed to make it layered
It was my own form, and the window I wanted to embed was from a process I started in C#, outside of my general control.
Hmm yeah
just annoying that I've not seen layered style come across when I was googling my issue
All feels so obscure but maybe that is my lack of knowledge
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.