Re: Transparent Windows
From: Aaron Pfeifer (Pfeifer_at_discussions.microsoft.com)
Date: 03/20/05
- Next message: Michael Gray: "Re: Exporting to excel (when someone doesn't have excel on his pc)"
- Previous message: Guest: "Re: Error Generating Win32 resource.... (bug in VS.NET 2003)"
- In reply to: carlmanaster: "Re: Transparent Windows"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Michael Gray: "Re: Exporting to excel (when someone doesn't have excel on his pc)"
- Previous message: Guest: "Re: Error Generating Win32 resource.... (bug in VS.NET 2003)"
- In reply to: carlmanaster: "Re: Transparent Windows"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|