Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalidating whole desktop

Status
Not open for further replies.

Skute

Programmer
Joined
Jul 21, 2003
Messages
272
Location
GB
Hi,

how can i get the whole screen to be repainted?

im just running a little test application which draws an ellipse from one corner of the screen to another when the left mouse button is pressed down and then it tries to invalidate the rect to redraw everthing when the button goes up, but this doesnt work.

The title bar of my program doesnt get drawn again and all the windows in the background dont get redrawn. this is the code ive tried:


void CMainWindow::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect rect;
::GetWindowRect(::GetDesktopWindow(), &rect);

CClientDC dc(NULL);

dc.Ellipse(&rect);
}

void CMainWindow::OnLButtonUp(UINT nFlags, CPoint point)
{
CRect rect;
::GetWindowRect(::GetDesktopWindow(), &rect);

InvalidateRect(&rect);

::InvalidateRect(::GetDesktopWindow(), NULL, TRUE);
}


But that doesnt work, the ellipse is still left on screen (the text printed by OnPaint gets updated, but nothing else)
 
I think you should use UpdateWindow(wndDesktop)

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
hmm, i tried

::UpdateWindow(::GetDesktopWindow());

but that still didnt work :-/

it made a couple of icons appear, but the ellipse was still shown
 
its not actually necessarily the desktop i want to invalidate is it? it could be several other windows behind my application?

is there no possible way to make the whole screen invalidate?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top