Note that this example is debugged by Delphi7.0.
(1) Establishing a project new items -> Projects -> MDI Application (2) Redesign the MDI Subform - CHILDWIN, which is displayed in the captory. Remove the original MEMO1 control in the Childwin sub-form, add an Image control, Image1.Align = AlClient. Image1.autosize = TURE Indicates the original size display, STRECH = FALSE means that it is not displayed in the object box.
(3) Main Interface Modification 1) Remove the Menu, Toolbar, ActionList to Paste, New Related Item 2) Add PrinterSetupDialog1, SaveDialog Control to Mainform. Add Menu item file / print, attribute name is fileprintItem; add menu item file / print Setting, property enabled = false, name is fileprintset; add menu item EDIT / DRAW, its property enabled = false; add menu item EDIT / Preferences, set it to include the word submenu; add menu item Edit / Preferences / PREFERENCES / Configuration; adding a menu item edit / Preferences / ToolBar, it is checked = true, name = toolbarItem; add menu Image; add a menu item Image / Capture Desktop; adding a menu item Image / Capture Area; adding a menu item Image / Capture Windows or Controls Add menu item Image / Capture Icon Add four Toolbar Button to Toolbar, and correspond to the four menu items under the Image menu. Add four action to ActionList: CPTDestop, cptarea, cptwindows, cpticon; respectively correspond to four anctions under the image menu, respectively, corresponding to the above four Actions; four of the four Toolbar Button respectively correspond to four Action. 3) Main unit in the implementation of the interface uses uses CHILDWIN move added to ScrnCpt uses the interface; and adding the public definition of TMainForm: Child: TMDIChild; CaptureNum: integer; FileName: String; DefaultDirectory: string; 4) adding private function TMainForm: procedure delay (msecs: integer) procedure TMainForm.Delay (msecs: integer); // delay implemented var FirstTickCount: // windows start time to the current (;:; = GetTickCount Longint begin FirstTickCount秒) Repeat Begin Application.ProcessMessages; // Interrupt The program allows Windows to respond to event End; Until (GetTickCount-firstTickcount)> = longint (msecs));