Do this:
while(!done)
{
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
//Dostuff;
}
//Dostuff2;
}
If that is what you actually have and Dostuff2 is never reached, then you must be doing something within the inner loop to generate new messages.
You may want to post your actual code again