Repainting whole screen on application exit

Hi

When I exit my application the OS does not refresh the menu bars. Both the start menu bar on the bottom of the screen and the "battery" bar don't refresh.

Is there any command I could issue before exiting my application so that all screen components are refreshed on exit

I use C++ so no C# code please.

many thanks,

Martin Malek



Answer this question

Repainting whole screen on application exit

  • Spuddo

    What do you do in your app that causes the caption bar and the command bar to get out of sync Full screen Something else Basically whatever it is you are doing, you need to undo

  • Kolja

    You can try RedrawWindow(GetDesktopWindow(), ...) but I would suggest considering my other advice - creating a fullscreen window and killing it.

  • Raj Parmar

    Hi again Alex

    I noticed that changing CW_USEDEFAULT in CreateWindow helped. It seems the area created otherwise doesn't include the bars. Changing it to actual device screen size helped.

    Thanks for your help,

    Martin Malek


  • Pita69

    Hi again

    Is there anyway to get handles to the two menu bars and invalidating them explicitly

    It seems that they are not children to the main window so invalidating the main window and it's children is not the way to go.

    Thanks,

    Martin Malek


  • Michael_SQL

    Hi Alex

    I don't really do anything with the screen components. I use PocketHAL or sometimes (depending on the device) I use:

    ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);

    and implement my own backbuffering mechanism. Nowhere in my code do I call any standard screen components like the menu bar or the battery/signalstrength bar and I allways take over the entire screen.

    When I exit my application I would like for the whole screen to be updated, which it isn't. Is there any way for me to force a complete refresh

    If I enter the start menu it renders itself but I would like it to render itself when I exit my app.

    Many thanks,

    Martin Malek


  • Nevor

    The cleanest way to do it would be to create a full screen window briefly upon your application exit. This will invalidate everything on the screen.

    You may also try giving a shot to calling RedrawWindow(NULL, RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN)



  • Ashish Derhgawen

    Hi Alex

    I tried your other suggestion but it didn't work either. I actually allready do start a window of my own for my application to run in but I did create an extra window and killed it just before the application exits.

    The results are the same. The two bars still hold old graphics and don't get refreshed at all.

    Do you have any other suggestions I could try Isn't there any way to schedule a redraw of a specific component I'm affraid what happens is that any redraw requests I make before exiting the application get invalid since I kill the thread that issued them when exiting. Could that be the case

    Many thanks,

    Martin Malek


  • Funtowatch

    Hi Alex

    I tried your example:

    RedrawWindow( NULL, NULL, NULL, RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN )

    and

    RedrawWindow( NULL, NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_ALLCHILDREN )

    but none of them repainted the menu bars. Do you know if there are any known issues with repainting the screen on exit Could my problem be device specific I use a qtek 8310 at the moment.

    Thanks,

    Martin Malek


  • Repainting whole screen on application exit