Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
info that might be of help--
Compiler: VC++ 6.0
Problem to do with: Win32 SDK
OS: Windows XP
Hi,At the moment I'm reading Sams Tricks of the Windows Game Programming Gurus, I'm just on chapter two (Actually, I got to the end of the DirectX stuff but felt I rushed through and skipped bits I didn't understand so went back to the beginning again)
Anyway, I've just finished the second chapter. At the end of this chapter it gives you a little task to try. Which is to modify the code on the accompanying CD so that two windows open but make it so only one closes at a time.
I made two window classes (WNDCLASSEX) winclass and winclassx, registered both and then created two windows using them.
When a WM_DESTROY message is sent to my windows procedure function, I increment a global (int AmountClosed) then check, if AmountClosed == 2 then PostQuitMessage(0).
However, when I close one, they both close! Has WindowsXP decided to stop programs from doing this or something?

I think I'm going to kill myself!
I was doing this:
[code]
case WM_DESTROY:
{
NumberClosed++;if(NumberClosed = 2)
PostQuitMessage(0);return(0);
} break;
[/code]I only put one = sign, and 2 is true so...
I've changed it to == now. Thanks to anyone who was going to help anyway!!! :P

![]() |
Visual Basic 6.0
|
JavaScript
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |