This hint is a little surprise. So, you'd have to either read the code and understand what it does or try it out!
- Create a new application (select "File | New Application" from the main menu)
- Select the empty form and double click on it's "OnResize" event
- Change the generated "FormResize()" function to look like the following and run the program.
procedure TForm1.FormResize( Sender: TObject );
R : TRect;
DC : HDc;
Canv : TCanvas;
R := Rect( 0, 0, Screen.Width, Screen.Height );
DC := GetWindowDC( GetDeskTopWindow );
Canv := TCanvas.Create;
Canv.Handle := DC;
Canvas.CopyRect( R, Canv, R );
ReleaseDC( GetDeskTopWindow, DC );
: Delphi code. Download surprise (0.33 KB)
Doesn't do anything? Try resizing the form by dragging its top left corner while running the program.
Applicable Keywords : Delphi, Delphi 2.x, Delphi 3.x, Functions, Source Code