• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Refresh GetDc( 0 ) - or it's equivilent

O.K, I'll make  this a quicky - I have made a program that draws directly onto the windows canvas - the handle GetDc(0).  All I want to do is repaint this to remove all the stuff I have drawn on it.  This is all I've done:

var
TheCanvas:Tcanvas;
begin
TheCanvas:=Tcanvas.create;
TheCanvas.handle:=getdc(0);

TheCanvas.draw...
.....
And After, I free TheCanvas.
0
bogieman_
Asked:
bogieman_
  • 2
1 Solution
 
LischkeCommented:
Invalidate(0, nil, True);

Ciao, Mike
0
 
bogieman_Author Commented:
i used invalidateRect(0,Rect(0,0,800,600)) instead - I have D3 and could not find invalidate(..) - was it a typo? Anyway thanks...
0
 
LischkeCommented:
Yes, sorry, a typo. Should be InvalidateRect. You can omit the rectangle (as I did passing nil) to refresh the entire window.

Ciao, Mike
0
 
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now