Guess waht Disch, it speeded up but only by 13% I would say, rough estimate...still, it wasn't as fast as I hoped. |
I wonder if you aren't validating your window properly. Failure to validate would cause an endless stream of WM_PAINT messages to be sent, causing your program to waste all it's time redrawing the same thing over and over.
What does your WM_PAINT handler look like?
I noticed that GetMessage() can pick up WM_QUIT but for some reason PeekMessage() doesn't pick it up.[snip]It works if I look for SC_CLOSE from WM_SYSCOMMAND but thats only from the control menu |
I have
always had this problem with WinAPI. Always always. I never understood how anyone ever got WM_QUIT to work right -- I never could.
I always looked for SC_CLOSE via WM_SYSCOMMAND anyway. It is sent by
everything that tries to close the program -- and can be vetoed, whereas other messages are too late in the process to veto. (For example if you ask the user if they want to save changes before quitting, and they hit "cancel" indicating they want to leave the program running -- SC_CLOSE can be cancelled, but if you got WM_QUIT it's already too late and the program will quit anyway)
but for some reason the windows minimize, restore and close buttons that are located to the right of a windows box have no effect at all. |
Welcome to WinAPI hell. This is another reason why I recommend you use something else. XD Especially for a game.
Anyway, does your WndProc call DefWindowProc? If not that might explain it.
Maybe you should just post you whole WndProc.
Call me crazy but I think those buttons are sending different messages, since the Win32 API is pretty old could it be a possibility that these buttons send different messages? |
I couldn't begin to tell you all the messages everything sends. What's more, some things send multiple messages, and some messages trigger other messages to be sent. It's a huge tangled mess. The best you can do is pick out the important messages and ignore the rest.
Here, WM_SYSCOMMAND + SC_CLOSE is the important one. Forget about the others (WM_DESTROY, WM_CLOSE, WM_QUIT -- all useless. Well maybe WM_DESTROY would be good for cleanup....)