Advertisement

Blank button on taskbar

Started by April 25, 2000 01:08 PM
41 comments, last by mkoday 24 years, 7 months ago
Ampere: When exactly do you do the ShowWindow(hWnd, SW_HIDE);? Right before the PostQuitMessage(0);?

email: chickawow@netzero.net

annex software: http://annexsoftware.cjb.net
I believe it just went:

ShowWindow(hWnd, SW_HIDE);
PostQuitMessage(0);
return 0;

Something to that effect anyway.
Advertisement
Oh, I always thought it had something to do with MSVC++ compiling. Well, I have an OpenGL skeleton that does the same thing. If there''re too many of them, the system seems to become unstable (as if Windows wasn''t unstable enough!) I use

case WM_CLOSE: PostQuitMessage(0); return 0;

Maybe a break statement would help?


Lack

Christianity, Creation, metric, Dvorak, and BeOS for all!
Lack
Christianity, Creation, metric, Dvorak, and BeOS for all!
I prefer to put a DestroyWindow() in my WM_CLOSE so that I only have one path out, so to speak.
Well, here are the things that I have right now that deal with window closing and destruction:

case WM_DESTROY:
Game_End();
ShowWindow(hWnd, SW_HIDE);
PostQuitMessage(0);
break;

case WM_CLOSE:
DestroyWindow(hWnd);
break;

and i still get the blank button. Wierd.

email: chickawow@netzero.net

annex software: http://annexsoftware.cjb.net
I've never had a problem with it before -- it's gotta be a bug in the Windows 95 GUI (a really early version) or a bug in your code. The latter is 1000x more probable... BTW, some commercial apps and games (mostly stuff around the launch of Windows 95, meaning 16-bit) say this is fine, but we all know it isn't!

If it was a bug, you could try searching the MS KB, as I'm sure something like that would have made it in there. Otherwise, why not post some code? Can't rule out all the possibilities...without knowing the code...


You must've posted right when I was writing -- I'll look at the code now. Well, here's what I do in my WM_DESTROY handler:


PostQuitMessage(0);
return DefWindowProc(...);



I never handle a WM_CLOSE message. If you look at the Win32 EXE skeleton code from VC, you'll find that it doesn't either. If you want to quit the app, you just call DestroyWindow on the main window handle and you're set.



- null_pointer
Sabre Multimedia


Edited by - null_pointer on 4/27/00 4:43:59 PM
Advertisement
I tried this code about 15 times and the blank button was there twice. It''s odd how it would appear sometimes, and not others.

case WM_DESTROY:

Game_End();
ShowWindow(hWnd, SW_HIDE);
PostQuitMessage(0);
return DefWindowProc(hWnd, uMsg, wParam, lParam);

break;

email: chickawow@netzero.net

annex software: http://annexsoftware.cjb.net
I''m pretty sure it''s just the App in the process of killing itself. If you have large quantities of surfaces, or other allocated data, it might take a few seconds to go away.
If you process WM_DESTROY it should return 0. In most cases only messages not explicitly handled by the app should use DefWindowProc().
Buster: My app''s small, even has no textures loaded, and these things stick around indefinitely.


Lack

Christianity, Creation, metric, Dvorak, and BeOS for all!
Lack
Christianity, Creation, metric, Dvorak, and BeOS for all!

This topic is closed to new replies.

Advertisement