Splash Screen

I've created a splash screen, and works very well, but I was wondering if this is the way it's usually done. To wit --

I use hwnd=CreateDialog() at the beginning of my program, and then when my main app is about ready to display, I send the WM_CLOSE message to the hwnd.

As I say, this works very well, but I want to know if this is the way it's usually done, and if not, how is it usually done.
How do you handle WM_CLOSE in your callback loop? The default handling will eventually close your app so I would say no, this is not how it's done.
It's simple: i simply end it like I would any other dialog, i.e., --

1
2
3
4
case WM_CLOSE:
	DestroyWindow(hSp);
	EndDialog(hSp, LOWORD(wp));
	return (INT_PTR)TRUE;


I actually DO think this is how it's normally done, as I don't see any other efficient way to do it, but that's why I asked. If you know how it's normally done, please reveal.

In the above, by the way, sending the the WM_CLOSE message to the callback just before my main app displays works flawlessly.
Last edited on
Well, after further investigation, apparently my way is the way it's normally done. I thought I had read about some sort of Windows API dealing with splash screens, but that is nowhere to be found. My way appears to be the way it's always been done. Here's just one variation --

http://www.codeproject.com/KB/dialog/SplashScreenNoMFC.aspx

But still, he's using the same method as me, i.e., creating the resource and then displaying it and closing it before his main app window is displayed. Very simple, very straightforward.
I haven't ever used a splash screen outside of C#, and that was a long time ago. But to me it seems to make sense that you just create a borderless window and close it when you are done loading.
Topic archived. No new replies allowed.