|
Prev: Port MFC CCriticalSection::CSingleLock to ACE or ??? (NEWBIE ALERT
Next: PropertySheet Question.
From: fiversen on 2 May 2008 10:41 Hallo, I have a problem with a transparent window. My message windows are simple CWnd-Windows, whitch are hide. Only, if I want to see the window, I bring them into front with 'bringWindowToTop()'. Problem: I want to give the window a transparent border ( later I want to display a transparent bitmap ). So I have a - CtrlColor-Func it returns NULLBRUSH - OnEraseBkgnd-Func first I paint the full area with NULLBRUSH FillRect(..) then I reduce the Rect r.left += 20 r.right -= 20 and fill the small area with a color. - No OnPaint-Func But the window is grey. I have already solutions with transparent Buttons and MarqueeText. But I hope, only to display a window with transparent background is a little bit easier. -- Thanks Frank Iversen
From: David Ching on 2 May 2008 17:25 "fiversen" <fiversen(a)wedding.in-berlin.de> wrote in message news:5dbfc1ef-7c4c-48b5-b970-7f229b7f270d(a)c65g2000hsa.googlegroups.com... > Hallo, > > I have a problem with a transparent window. > > My message windows are simple CWnd-Windows, whitch are hide. > > Only, > if I want to see the window, > I bring them into front with > 'bringWindowToTop()'. > > Problem: > I want to give the window a transparent border > ( later I want to display a transparent bitmap ). > > So I have a > - CtrlColor-Func > it returns NULLBRUSH > > - OnEraseBkgnd-Func > first I paint the full area with NULLBRUSH > FillRect(..) > then I reduce the Rect > r.left += 20 > r.right -= 20 > and fill the small area with a color. > > - No OnPaint-Func > > But the window is grey. > > I have already solutions with transparent Buttons and MarqueeText. > But I hope, only to display a window with transparent background is a > little bit easier. > If this is not a child window, then for transparency, I would make it a WS_EX_LAYERED_WINDOW. Only with layered windows and Windows regions can you truly achieve transparency. Painting with a null brush has no effect at all. As for why the window is gray, are you by chance calling the inherited OnEraseBkgnd()? -- David
From: fiversen on 5 May 2008 03:53 Hello David, > > I have a problem with a transparent window. > > > > Problem: > > I want to give the window a transparent border > > ( later I want to display a transparent bitmap ). > If this is not a child window, then for transparency, I would make it a > WS_EX_LAYERED_WINDOW. Only with layered windows and Windows regions can you > truly achieve transparency. > > Painting with a null brush has no effect at all. As for why the window is > gray, are you by chance calling the inherited OnEraseBkgnd()? So, to make a window transparent is a complicate thing to do ! In my - CStatic, with CtlColor, NULLBRUSH .. I was successfull - CButton, I need a background-bitmap - CMarqueeText, I need a background-bitmap I try - CWnd, with a background-bitmap WS_EX_LAYERED I cannot use, because the programms runs also on WinNT computer. Thanks. --- Frank Iversen
From: David Ching on 5 May 2008 10:34 "fiversen" <fiversen(a)wedding.in-berlin.de> wrote in message news:9dc5535a-3ec2-45c4-8299-5eb287f0b953(a)k13g2000hse.googlegroups.com... > So, > to make a window transparent is a complicate thing to do ! > > In my > - CStatic, with CtlColor, NULLBRUSH .. I was successfull > - CButton, I need a background-bitmap > - CMarqueeText, I need a background-bitmap > > I try > - CWnd, with a background-bitmap > > WS_EX_LAYERED I cannot use, because the programms runs also on WinNT > computer. > Oh, these kind of windows are typically WS_CHILD windows, so you don't use WS_EX_LAYERED with these anyway. With CButton, I would override WM_ERASEBKGND and draw the bitmap. Same with CMarqueeText. -- David
|
Pages: 1 Prev: Port MFC CCriticalSection::CSingleLock to ACE or ??? (NEWBIE ALERT Next: PropertySheet Question. |