Re: Transparent Windows

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

From: Aaron Pfeifer (Pfeifer_at_discussions.microsoft.com)
Date: 03/20/05


Date: Sat, 19 Mar 2005 19:31:02 -0800

Hey Carl,

Thanks for the reply. I think I was not so clear on the type of feature I
was looking for. I kept saying transparent, when I actually meant opaque.
So I was looking to display a form (with no borders) that would have an
opaque background image. I wanted to be able to click on this form, but for
that event to actually go through the form to the window beneath it.

Making a certain part of the window completely transparent is a good idea,
but i always want the form completely shown.

It's probably best to understand if you looked at a project I found on
codeproject.com that acted as the base for my solution. The link is:

http://www.codeproject.com/csharp/floatingForm.asp

In this solution, the person has actually subclassed NativeWindow and caught
the WM_NCHITTEST message. When this message is caught, the Result property
is changed to (IntPtr) -1. As a result, for any windows in the same thread,
this event will pass through and go to the window beneath it.

If you try running the sample program at the link above and move the
floating form above a regular windows form, you'll notice that clicking
anywhere below the titlebar on the floating form will pass right through it
to the form beneath it (even though it's opaque).

Also, this example showed me how to create a window that won't show up by
pressing Alt+Tab or in the taskbar. It's a really interesting piece of code.

Anyway, thanks for the help! Take care.

Aaron



Relevant Pages

  • Re: painting a window?
    ... I need to opaque out a windows. ... I was thinking of painting the window white so it would not ... My big issue is how to clean off the paint when the need no longer ... (We have 30 to 60 mph winds out here.) ...
    (alt.home.repair)
  • Re: painting a window?
    ... I need to opaque out a windows. ... I was thinking of painting the window white so it would not ... (We have 30 to 60 mph winds out here.) ...
    (alt.home.repair)
  • Re: painting a window?
    ... I need to opaque out a windows. ... I was thinking of painting the window white so it would not ... At line-ups they have lights shining in their eyes. ...
    (alt.home.repair)
  • Re: painting a window?
    ... I need to opaque out a windows. ... I was thinking of painting the window white so it would not ... My big issue is how to clean off the paint when the need no longer ... 1/4" foam board cut to fit inside the glass area is yet another option ...
    (alt.home.repair)
  • Re: painting a window?
    ... I need to opaque out a windows. ... I was thinking of painting the window white so it would not ... My big issue is how to clean off the paint when the need no longer ...  (We have 30 to 60 mph winds out here.) ...
    (alt.home.repair)