RE: Masked Windows

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kevin Cochran (KevinCochran_at_discussions.microsoft.com)
Date: 08/08/04


Date: Sat, 7 Aug 2004 17:01:02 -0700

I think I'm using the wrong terminology. What I want is a window that is text
only with a completely transparent background (no title bar or anything, just
my text). And for a bonus look, I'd like for a semi-transparent window to
popup behind the text when the mouse moves into the client area.

I seem to be able to do one without the other, but not together. :(

Please help,
Kevin

"Steve S" wrote:

> Kevin
>
> What do you mean by 'masked off' ?
> You don't want the normal background fill around the text?
> If so, just use
> UINT oMode = SetBkMode(hDC, TRANSPARENT);
>
> // do your drawing
>
> SetBkMode(hDC, oMode);
>
> On the other hand, if you really mean mask in the painting sense, then it
> sounds like you do need to use a memory DC and a bitmap, followed by your
> DrawText and some BitBlt command with a particular ROP code.
>
> There used to be an article on MSDN which talked about producing a
> transparent bitmap given a particular background colour (KB was Q79212,
> search for "How To Drawing Transparent Bitmaps" and see if that helps.
>
> Steve S
>
> "Kevin Cochran" wrote:
>
> > Greetings,
> >
> > I would like to have a window where I can do a DrawText (or equivalent) and
> > have everything else masked off, so that only the text I type shows up. I
> > figure this should be possible by creating a compatible DC and a bitmap in
> > memory, right? But how do I apply the mask? I have never done window masks
> > before and I can't find much on google.
> >
> > Any help would be greatly appreciated.
> >
> > Thanks,
> > Kevin
> >



Relevant Pages

  • RE: Masked Windows
    ... only with a completely transparent background (no title bar or anything, ... I'd like for a semi-transparent window to ... > sounds like you do need to use a memory DC and a bitmap, ... But how do I apply the mask? ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Transparent Form with Opaque Text
    ... I've also tried writing directly to the form in FormPaint instead of a Label and both give same result. ... If another window goes on top of your non-painting window, then its image will remain even after it goes away. ... moved while maintaining a transparent background? ... As of Windows 2000, you can make what's called a "layered" window, and then you can use the SetLayeredWindowAttributes API function and some other related functions to control the opacity of various parts of your window. ...
    (alt.comp.lang.borland-delphi)
  • Re: Flash Player in my app
    ... The Flash player is installed as a browser plug-in. ... WebView object in your window, and load your swf file in there. ... even a non-rectangular shape, what Carbon/Cocoa API mechanisms could I ... Windows are rectangular, but they can have a transparent background, so ...
    (comp.sys.mac.programmer.help)
  • Need help with drag-and-drop visual representation (beyond cursor change)
    ... I would like to be able to have a drag-and-drop operation from one ... window to another give the visual appearance of a simple image being ... transparent background. ...
    (microsoft.public.vc.mfc)
  • Re: Copying Bitmap
    ... Remember I said that my code does not work when the window is obscured by another window. ... CDC dc_bitmap; ... // Copy output bitmap onto display target ... Add your control notification handler code here ...
    (microsoft.public.vc.mfc)