   WM_SIZE
  I'm busy doing a re-write of an old windows app of mine. I've managed to break it in the process, and I'm having a lot of difficulty trying to isolate the problem.The problem was that the window can no longer be resized or moved and clicking the minimise/maximise/restore buttons doesn't do anything. I did a bit of digging and it turns out that the window's event handler is not being sent WM_SIZE messages. It IS being sent, and handling, WM_ACTIVATE, WM_CLOSE, WM_KEYDOWN and WM_KEYUP, just not WM_SIZE.I'm going to keep digging, but I thought I'd ask: can anyone think of anything, off the top of their heads, that would cause an WM_SIZE messages to not even be sent?   
  There's all sorts of messages sent before WM_SIZE - are you handling them all properly; I.e. passing them to DefWindowProc()? Can we see your window proc?   ;  Here it is, unaltered. This is from a class that uses the wndproc-as-a-member-function trick.LRESULT CALLBACK Colours::WindowProc(HWND windowHandle, UINT message, WPARAM wparam, LPARAM lparam){  //this is pretty much straight out of NeHe  /*TODO: BUG: Moving, resizing, maximising, minimising or closing the window does not work.    closing the console DOES close the program (might be worth fiddling that so that that doesn't    cause the program to terminate?).    It's NOT because of the console stealing all the input - removing the console all together    does not fix the problem*/  int returnCode = 0;  switch(message)  {  case WM_ACTIVATE:    cout << "activation state changed" << endl;    /*TODO: this isn't actually whether or not it's minimised. I think it's whether or not it has focus. might want to rethink things because of that.*/    if(HIWORD(wparam)) this->minimised = true;    else this->minimised = false;    break;  case WM_SYSCOMMAND:    if(wparam != SC_SCREENSAVE    && wparam == SC_MONITORPOWER)    { returnCode = DefWindowProc(windowHandle, message, wparam, lparam);    }    break;  case WM_CLOSE:    cout << "window closed" << endl;    PostQuitMessage(0);    break;  case WM_KEYDOWN:    this->keys[wparam] = true;    break;  case WM_KEYUP:    this->keys[wparam] = false;    break;  case WM_SIZE:    //TODO: this isn't getting called at all. find out why.    cout << "window resizing" << endl;    this->window->Resize(LOWORD(lparam), HIWORD(lparam));    break;  default:    returnCode = DefWindowProc(windowHandle, message, wparam, lparam);  }  return returnCode;    }In case it was the wndproc-as-a-member-function business that was to blame, I made a test version:LRESULT CALLBACK GLWindowProc(HWND windowHandle, UINT message, WPARAM wparam, LPARAM lparam){  int returnCode = 0;  //cout << "\t\t\t" << message << endl;  switch(message)  {  case WM_ACTIVATE:    cout << "activation state changed" << endl;    /*TODO: this isn't actually whether or not it's minimised. I think it's whether or not it has focus. might want to rethink things because of that.*/#if false    if(HIWORD(wparam)) this->minimised = true;    else this->minimised = false;#endif    break;  case WM_SYSCOMMAND:    if(wparam != SC_SCREENSAVE    && wparam == SC_MONITORPOWER)    { returnCode = DefWindowProc(windowHandle, message, wparam, lparam);    }    break;  case WM_CLOSE:    cout << "window closed" << endl;    PostQuitMessage(0);    break;  case WM_KEYDOWN:    //this->keys[wparam] = true;    break;  case WM_KEYUP:    //this->keys[wparam] = false;    break;  case WM_SIZE:    //TODO: this isn't getting called at all. find out why.    cout << "resizing window goes here" << endl;    //this->window->Resize(LOWORD(lparam), HIWORD(lparam));    break;  default:    returnCode = DefWindowProc(windowHandle, message, wparam, lparam);  }  return returnCode;    }The results are the same - the "resizing window goes here" message is never printed.   ;  D'oh. Found it.I changed it so that DefWindowProc is always called, rather than only being called as the default case of the switch statement. That's fixed the problem and the window is resizing. The thing is, I don't understand why that change fixed the problem. What's the story?   ;Quote:Original post by SoulSkorpionD'oh. Found it.I changed it so that DefWindowProc is always called, rather than only being called as the default case of the switch statement. That's fixed the problem and the window is resizing. The thing is, I don't understand why that change fixed the problem. What's the story?You should always call DefWindowProc, unless you don't want the default behaviour to take place. Passing a message to DefWindowProc means "I want to take the default action for this message".   