I have a child window with a light-colored background color brush, which I want to be transparent so that the underlying parent window shows through the background. A layered window does not work with a child window. Is there any way I can do this with a child window ?
On Jul 21, 12:37 pm, Edward Diener wrote: > I have a child window with a light-colored background color brush, which > I want to be transparent so that the underlying parent window shows > through the background. A layered window does not work with a child > window. Is there any way I can do this with a child window ? Hi, Have you tried the following Windows style to create a transparent window: CreateWindowEx() WS_EX_TRANSPARENT Or, SetWindowRgn() http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx http://msdn.microsoft.com/en-us/library/ms534845(VS.85).aspx Kellie.
Kellie Fitton wrote: > On Jul 21, 12:37 pm, Edward Diener > wrote: >> I have a child window with a light-colored background color brush, which >> I want to be transparent so that the underlying parent window shows >> through the background. A layered window does not work with a child >> window. Is there any way I can do this with a child window ? > > > > Hi, > > Have you tried the following Windows style to create > a transparent window: > > CreateWindowEx() WS_EX_TRANSPARENT This does not work at all. I am not painting the window but just creating it with a brush of a certain color. When I show the window, even with the WS_EX_TRANSPARENT style specified as the extended style when the window is created, the window completely obscures its parent window. > > Or, > > SetWindowRgn() I do not understand how transparency is to be achieved using SetWindowRgn().
Kellie Fitton wrote: > On Jul 21, 12:37 pm, Edward Diener > wrote: >> I have a child window with a light-colored background color brush, which >> I want to be transparent so that the underlying parent window shows >> through the background. A layered window does not work with a child >> window. Is there any way I can do this with a child window ? > > > > Hi, > > Have you tried the following Windows style to create > a transparent window: > > CreateWindowEx() WS_EX_TRANSPARENT > > Or, > > SetWindowRgn() > I was able to switch my window type from WS_CHILD to WS_POPUP and use the WS_EX_LAYERED extended style as well as the SetLayeredWindowAttributes to achieve my goals. Thanks for your help !
Have you tried to drag the parent window around? What happes to the child window if you drag the parent window? My expectation is that the popup window will not move with the parent, but I haven't tried this. joe On Tue, 22 Jul 2008 09:48:45 -0400, Edward Diener wrote: >Kellie Fitton wrote: >> On Jul 21, 12:37 pm, Edward Diener >> wrote: >>> I have a child window with a light-colored background color brush, which >>> I want to be transparent so that the underlying parent window shows >>> through the background. A layered window does not work with a child >>> window. Is there any way I can do this with a child window ? >> >> >> >> Hi, >> >> Have you tried the following Windows style to create >> a transparent window: >> >> CreateWindowEx() WS_EX_TRANSPARENT >> >> Or, >> >> SetWindowRgn() >> > >I was able to switch my window type from WS_CHILD to WS_POPUP and use >the WS_EX_LAYERED extended style as well as the >SetLayeredWindowAttributes to achieve my goals. Thanks for your help !