PDA

Click to See Complete Forum and Search --> : Repaint screen?


softwareguy74
Feb 27th, 2002, 09:56 PM
After painting to the screen's dc, how do I tell the screen dc to repaint itself so that what ever I drew will disappear?

I tried the following, but it doesn't work:

SendMessage HWND_BROADCAST, WM_PAINT, 0, 0

Any help would be appreciated..

Dan

darrenl
Mar 1st, 2002, 10:43 AM
InvalidateRect will do it. You will need the hwnd of the desktop though.

darrenl
Mar 1st, 2002, 11:01 AM
Try this code, I got it from ALLAPI.net, a very usefull website!

Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As Long, ByVal bErase As Long) As Long

' This will repaint all windows and the desktop
InvalidateRect 0&, 0&, False

Steve Stunning
Aug 7th, 2004, 10:40 AM
Thanks for the refresh code. Worked like a charm!

Programmer.NET
Aug 10th, 2004, 05:10 PM
i think u can use the RedrawWindow API
or UpdateWindow

ice_531
Aug 10th, 2004, 05:16 PM
YAY another response to a 2 year old post :D

Programmer.NET
Aug 10th, 2004, 05:35 PM
i did't saw the date of submition