0

Pretty simple question. I was just curious why I would use PostQuitMessage(0) to break out of my Message Loop, instead of just doing something like:

bool isRunning;

case WM_DESTROY:
{
    isRunning = false;
    break;
}

Honestly, I don't really see any harm in doing it this way, but maybe there is some minutia I am not quite seeing.

user2776326
  • 45
  • 1
  • 7
  • it is not necessary, just a way to let GetMessage() return FALSE. Not so sure that adding your own global variable scores any elegance points. – Hans Passant Jun 11 '18 at 11:47
  • 1
    A post on this from the horse's mouth [here](https://blogs.msdn.microsoft.com/oldnewthing/20051104-33/?p=33453). It does more than just break out of `GetMessage()`. – Paul Sanders Jun 11 '18 at 15:50

0 Answers0