Thread: OSD or transparent window

  1. #1
    Registered User
    Join Date
    Aug 2001

    Question OSD or transparent window


    I hope you can help me, because I can't find the answer: How do you make an overlay window like the office assistant.
    I want to be able to draw something on top of everything else. But it has to be partly transparent.
    This is exactly what the office assistant is, but I can't find how it is done.

    I tried it using overlay surfaces with directdraw. But my video card doesn't support it. And this seems really odd to me, because the office assistant does work. So that must use something else than an overlay surface.
    I found something a while back about making a window transparent, but that only worked for win2k and xp.

    You could also call this a OSD and that is just what I want. Maybe you've seen them, not for your monitor (which probably works with hardware in the monitor) but for a keyboard with special keys or something. When you press the key, it shows an OSD (simple letters, with transparent background) telling which action will be taken.
    That's just what I want...

    I hope someone can help me.


  2. #2
    Registered User
    Join Date
    Feb 2002
    I believe the function you're requesting is SetWindowRgn().

  3. #3
    Registered User
    Join Date
    Aug 2001
    I don't know if that will cut it...
    I know you can setup regions that will be transparent, but is that really the way to go if you want to make an OSD or something like the office assistant.
    With the office assistant the regions would change all the time to make animation possible. But that won't be good for the speed. And in general regions aren't the best way to go.
    And with the OSD thing I mean, I want to blit text with a transparent background. I don't know if you can do that with regions. Simple shapes, ok. But letters?

    If anybody knows another way (or something to improve this), please let me know...


  4. #4
    Registered User
    Join Date
    Jan 2003
    I think what you need to do is call CreateDC with the first argument set to "DISPLAY" and the rest set to NULL. Then just use that as your window handle and you can bitblit till your hearts content. I am not really a c coder, but I have done this many times from masm, and it works great, unless you need real speed. but it should work fine for something as simple as an office assistant.
    I hope this helps out, it took me forever to find what I needed on MSDN, and I didn't want anyone else to have to go through that experience.

    P.S. - Sorry no example, but i'm primarily an assembly coder, and all of my stuff would be useless to you unless you know how to use MASM.

    Edit- Oops, I didn't notice how old this one was. HeHe, probably still not hanging around trying to do this are you Mox?
    Last edited by emonk; 01-28-2003 at 03:22 PM.

  5. #5
    Registered User
    Join Date
    Aug 2001
    Well actually I still haven't found anything, and was recently thinking about it again. So thanks on the input.
    I could indeed use the display DC. But won't that be overwritten when some other window draws in that region of the screen?
    Or could I monitor drawings and redraw if neccesary?

    It's worth trying...

  6. #6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  3. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM