不要吓着啊~~~
procedure TForm1.Button1Click(Sender: TObject);
var
dc:hdc;
DeskCanvas:TCanvas;
i,j:Integer;
begin
dc := GetDc(0);
DeskCanvas:=TCanvas.Create ;
DeskCanvas.Handle :=dc;
DeskCanvas.Pen.Color :=clRed;
DeskCanvas.Pen.Width :=5;
for j:=0 to Screen.Height-30 do
begin
MoveToEx(Dc, 0, j, nil);
LineTo(Dc, Screen.Width , Screen.Height-30 );
end;
for i:=0 to Screen.Width-1 do
begin
MoveToEx(Dc, i, 0, nil);
LineTo(Dc, Screen.Width , Screen.Height-30 );
end;
ReleaseDc(0, Dc);
end;