I apologize if the question is too easy for experienced programmers. I just got started with the basics of windows with the Petzold but have experience programming in Mathematica and some C and Labview.
What i dont understand about the message loop in windows, which appears implemented as a While loop, seems that in "normal" C programs a while loop runs as long as the condition stays true, then the program goes to the next instruction until the program ends. I visualize that like a sequence of events in time that lead to the execution and end of the program, not the same philosophy of a Labview program where time and sequences matter less and the program may never ever end unless interrumpted by the user.
As far as i understand in windows the message loop keeps going forever unless you interrupt the program. Almost behaving as an infinite loop, always active. If the true/false condition on the message loop changes, given by the boolean result of GetMessage, then how come once you get a false, the program doesnt just end right there?
In Labview programs there is not a strong concept of time or of sequence of operations, any condition could change at any given moment, like the true/false condition of a While loop, and then the loop would start executing a block of code or stop without it implying that the program is somehow closer to its end. Is that how it works in windows too?
All i say is that with a program that looks like this:
WinMain()
{....
while(condition)
{execute code}
....}
I would think it would just execute the block of code and end right there. But in windows it keeps "waiting" for the condition to be true in order to execute the code. I believe i am not getting this right which is why i am asking for anyone to clear up this mechanism for me.