Window just won't update!

This is a discussion on Window just won't update! within the Windows Programming forums, part of the Platform Specific Boards category; I have a window. When a message is sent to it I process the message and then I want to ...

  1. #1
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293

    Window just won't update!

    I have a window. When a message is sent to it I process the message and then I want to redraw the window.

    So. I do the following --

    InvalidateRect( hwnd, NULL, FALSE );
    UpdateWindow( hwnd );

    And suprise suprise it doesn't update!! Why? Depending on the information this window has it will draw differently. In this message I have changed a variable and so the window should look different. I've even tested the variable and it's right!

  2. #2
    Registered User filler_bunny's Avatar
    Join Date
    Feb 2003
    Posts
    87
    The variable is declared outside of the case block and is declared as static?
    Visual C++ .net
    Windows XP profesional

  3. #3
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    It's not a problem with the variable. At least it shouldn't be. It works on other update times but just not on this specific one which is really weird....

  4. #4
    Registered User filler_bunny's Avatar
    Join Date
    Feb 2003
    Posts
    87
    Can you post a short bit of code that demonstrates the problem?
    Visual C++ .net
    Windows XP profesional

  5. #5
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    Code:
    case MCC_ADDTAB: {
              
              if( ts->active >= 0 ) {
                ShowWindow( ts->pages[ts->active], SW_HIDE );
              }
              ts->active++;
              ts->nTabs++;
              ts->ids = (int*)realloc( ts->ids, ts->nTabs*sizeof(int) );
              ts->titles = (LPSTR*)realloc( ts->titles, ts->nTabs*sizeof(LPSTR) );
              ts->pages = (HWND*)realloc( ts->pages, ts->nTabs*sizeof(HWND) );
              ts->ids[ts->nTabs-1] = lParam;
              ts->titles[ts->nTabs-1] = (LPSTR)wParam;
              ts->pages[ts->nTabs-1] = CreatePage( hwnd, 1 );
              ts->set = true;
              SendMessage( GetParent( hwnd ), MCC_TABSEL, (WPARAM)ts->titles[ts->active],(LPARAM)ts->active );
              InvalidateRect( hwnd, NULL, FALSE );
              UpdateWindow( hwnd );
              return 0;
            }
    In my WM_PAINT function depending on the value of ts->active it'll do something different. It works if I set it in other message cases but not this one for some weird reason.

  6. #6
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    No matter I've fixed it... somehow. :\

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, 09:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21