Thread: mouse event when resizing window

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    173

    mouse event when resizing window

    Hi

    I want a message box pops up after resizing window, but not during resizing it.

    I tried with
    Code:
    case  WM_LBUTTONDOWN:
      message = FALSE;
      return 0;
    
    case WM_LBUTTONUP: 
      showData = TRUE;
      return 0;
    
    /*...*/
    
    case WM_PAINT:
       if(message)
         MessageBox(0,"the window got resized","ok",MB_OK);
     return 0;
    but it never worked, what can I do for it, thanks!!
    Don't laugh at me,I am just a SuperNewbie.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Whilst the user is resizing the window it is sent a stream of WM_SIZING messages. When the resizing operation is complete, it is sent a WM_SIZE message. Process these if you want to respond to resizing events.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    Thanks, but it always sends a message to WM_SIZE even when I am resizing it.

    All I want is just not updating window until I stop resizing it. any other way else?
    Last edited by SuperNewbie; 05-19-2004 at 04:39 AM.
    Don't laugh at me,I am just a SuperNewbie.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Give WM_EXITSIZEMOVE a try.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    Thanks, it seems ok, but I met some problems:

    Code:
    case WM_EXITSIZEMOVE:
           showData = TRUE;
          return 0;
    
    case WM_PAINT:
      
            hdc = BeginPaint (hwnd, &ps) ;
            GetClientRect (hwnd, &rect) ;
           if(showData)
          {
               Ellipse(hdc, 100, 100, 109, 109);
    			   	  
          }
      
          showData = FALSE;
    
        EndPaint (hwnd, &ps) ;
    			   
        return 0 ;
    it still didn't show the ellipse, seems WM_PAINT message has been sent serveral times after WM_EXITSIZEMOVE, but therotically, WM_PAINT only is called once in my mind, what's wrong with it !!
    Don't laugh at me,I am just a SuperNewbie.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM