(page requirements)


This hint is a little surprise. So, you'd have to either read the code and understand what it does or try it out!
  1. Create a new application (select "File | New Application" from the main menu)
  2. Select the empty form and double click on it's "OnResize" event
  3. 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 );
Listing #1 : 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
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor