In a Delphi 10.4.2 32-bit VCL Application in Windows 10, I draw on the desktop with this code:
var FTempCanvas := TCanvas.Create;
try
// get the device context of the desktop and assign it to the canvas.
// Then all drawing on the canvas will appear on the desktop until refreshing the desktop:
FTempCanvas.Handle := Winapi.Windows.GetDC(0);
try
// drawing on the desktop canvas here
finally
Winapi.Windows.ReleaseDC(0, FTempCanvas.Handle);
end;
finally
FTempCanvas.Handle := 0;
FTempCanvas.Free;
end;
How can I REMOVE and CLEANUP all the drawings without leaving any traces?