There seem to be a lot of references to "windowless" on Google searches,
but I want a very basic code sample (preferable with Win32 API in C, but
C++ is OK too).
Thanks,
- Mitch
Michel Gallant wrote:
>
> What is the simplest way to display an image without a window
> container (like when ICQ starts, a floating animated flower image
> is displayed for a few seconds). Are there code samples showing
> this? A simple example would be:
> Display a bitmap image somewhere on the screen for a fixed amount
> of time
They have windows, they just don't have borders. The words you are
looking for is "Splash Screen". Override the normal window create
and don't set WS_BORDER.
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Michel Gallant" <neu...@istar.ca> wrote in message
news:3C473F49...@istar.ca...
- Mitch
Michel Gallant wrote:
>
> Thanks for the "pointer"s. I just working my way through Petzold (5th Edn)
> and was curious about this, but I can see the general idea now.
> I had been looking at his "Scramble" example where no CreateWindow
> was used, but a device context for the entire screen is used (and cut up).
>
The entire desktop is just another window. He uses GetDesktopWindow to get
at it. However, this is not how people tend to do their splash screens.
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Michel Gallant" <neu...@istar.ca> wrote in message
news:3C47483B...@istar.ca...
Agreed. My first attempt at a splash screen involved writing on the desktop
window, but it often didn't display correctly. I have since mended my ways.
--
Quixote
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)
Igor Tandetnik wrote:
>
> This way is asking for trouble. If any painting by any application goes
> on in the place occupied by your splash (e.g. your splash happens to be
> over an IE browser displaying an animated GIF) this painting will occur
> over your splash, creating an unsightly mess. The OS clips painting that
> happens in separate windows, but drawing directly on the screen bypasses
> this mechanism.
Actually it's even worse than that. There's no way to "unpaint" the stuff
if he does it this way. With a window you just destroy the window and the
stuff underneath gets notified it needs to be repainted.
>ICQ flower splash screen is a window. There is (practically) no way of
>displaying anything on the screen without creating a window first.
Well, you could use DirectDraw... and blit directly to the
"DirectDrawSurface" area of the screen. You may want to look into
selective blitting and alpha blending.
Chad
You could, but you don't really want to.
How are you going to erase it?
You can save the contents below the window to a DirectDrawSurface, and
replace them.. but, yes (I know) the contents may change. The easiest
way is your way.
Chad
Well, I could save the current image on the screen before painting my
splash, and then put the saved copy back on. Which again breaks nicely
if anything has changed in the underlying windows since the snapshot was
taken.
I guess these comments explain why Petzold says " .. the SCRAMBLE program ...
is very rude and I probably shouldn't be showing it to you" ;-)
Thanks for all the interesting comments and perspectives.
- Mitch Gallant
http://home.istar.ca/~neutron/java.html
>Well, I could save the current image on the screen before painting my
>splash, and then put the saved copy back on. Which again breaks nicely
>if anything has changed in the underlying windows since the snapshot was
>taken.
Why not just take the snapshot, and use it as the background in your
frameless window? That makes it "look" like it's just a floating
image, but it's just a regular, rectangular window. When it's
destroyed, the desktop is repainted as per usual.
HTH
Chad
Please kindly read the whole thread before buttin in. That's pretty much
what everybody suggests, but the OP wonders whether it is possible to
paint splash screen direcly onto the desktop without creating a window
(see "windowless" in the subject?), and we are trying to convince
him/her that's a bad idea.
- Mitch
>> Why not just take the snapshot, and use it as the background in your
>> frameless window? That makes it "look" like it's just a floating
>> image, but it's just a regular, rectangular window. When it's
>> destroyed, the desktop is repainted as per usual.
>
>Please kindly read the whole thread before buttin in.
Sorry. Just trying to offer help. If I'm getting help, I should be
offering it too.
Chad