Delphi7编程问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 03:11:33
请问有人知道要实现在按确定之后系统自动截图当前窗口,并自动发送到特定的邮箱中的代码吗?
尽可能详细点..谢谢!!

//拷贝屏幕存成一个文件
procedure TForm1.Button1Click(Sender: TObject);
var
B:TBitmap;
begin
B :=TBitmap.Create;
try
B.Width := self.Width ;
B.Height := self.Height;
B.Canvas.CopyRect(Rect(0,0,Self.Width,Self.Height),Self.Canvas,
Rect(0,0,Self.Width,Self.Height));
B.SaveToFile('d:\test.bmp');
finally
B.Free;
end;
end;

然后再调用idSMTP控件把它发出去。

问题分成2部分,截图 --->网上大把的源码
发送附件至指定邮箱 --->Indy控件