Archived

This topic is now archived and is closed to further replies.

WildWest

Still an instance open... ???

Recommended Posts

When I quit my game, it closes but there is still an instance open which I have to kill via the task manager. i am using win98 and i destroy my window through a PostQuitMessage(). Can anybody help me? Thanks in advance! The Wild Wild West - Desperado!

Share this post


Link to post
Share on other sites
When do you call PostQuitMessage? You should probably first call "PostMessage(hwnd, WM_CLOSE, 0, 0)", which will generate a WM_DESTROY message. In the handling of the WM_DESTROY message, call "PostQuitMessage(0)". Make sure to pass the WM_DESTROY message on to the default window handler ("DefWindowProc").

Share this post


Link to post
Share on other sites
Do you actuall call:
  
DestroyWindow(hWnd);
UnRegisterClass("WindowClassName");

?
The first line actually destroys the window (and removes it from the taskbar, etc), and the second line unregisters the window class that was registered prior to creating the window (a lot of people seem to forget about this)

HTH, Steve

Share this post


Link to post
Share on other sites