Thread: refreshing windows...

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

    Question refreshing windows...

    Hi,
    Can anybody help me about this..
    I made a dialog based application wich at a point open another dialog (FileDialog) to choose a file.
    When the filedialog exit the main window wich was covered for the filedialog stands like erased.
    I think that is matter of refreshing the main window but I don't know how to do it.
    Thanks-

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Catch the WM_PAINT message in th dialog and repaint your window accordingly

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    You may just have to call for a paint by windows. Sounds like you do ot use HDC's.

    Try grabbing the dlg with the mouse and shake it while it is 'like erased'. If it redraws then all you need is to call for windows to redraw it.
    Do this when you have finished cleaning up the previous dlg in response to its WM_QUIT ect.
    Use
    UpdateWindow(hDialog);//easiest
    or
    GetWindowRect(hDialog,&Rect);
    InvalidateRect(hDialog,&Rect,TRUE);//will redraw background


    If when you shake it it does not redraw then you will need, as Fordy says, to create a response to the WM_PAINT msg.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    142
    or you could also use SendMessage()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Refreshing windows?
    By PaulBlay in forum C Programming
    Replies: 1
    Last Post: 06-18-2009, 07:21 AM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM