P
pengxiaolin
Unregistered / Unconfirmed
GUEST, unregistred user!
问题2已解决,多谢了
问题1未解决,请继续指教:
if para1='/P' then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
{aCanvas := TCanvas.Create;
aCanvas.Handle:= GetDC(strtoint(para2 ));
aCanvas.CopyMode := cmSrcCopy;
acanvas.draw(0,0,form1.picshow.Picture.Bitmap); }
form1.hide;
//form1.parentwindow:=strtoint(para2);
form1.visible:=false;
hprewnd:= StrToInt( para2 );
WHILE NOT IsWindowVisible( hPreWnd ) DO
Application.ProcessMessages;
GetWindowRect( hPreWnd, Rect1 );
Rect1 := Rect( 0, 0, Rect1.Right-Rect1.Left, Rect1.Bottom-Rect1.Top );
sCanvas := TCanvas.Create;
sCanvas.Handle:= GetDC( hPreWnd );
sCanvas.CopyMode := cmSrcCopy;
WHILE IsWindowVisible( hPreWnd ) DO
BEGIN
formscreen:=tbitmap.create;
Rect1:= Rect( 0, 0, form1.width,form1.height );
formscreen.canvas.copyrect(rect2,form1.canvas,rect2);//把整个屏幕复制到BITMAP中
sCanvas.Draw(0,0, formscreen );
Sleep(1);
Application.ProcessMessages;
END;
sCanvas.Free;
以上程序执行小窗口没任何反映,是什么问题?
问题1未解决,请继续指教:
if para1='/P' then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
{aCanvas := TCanvas.Create;
aCanvas.Handle:= GetDC(strtoint(para2 ));
aCanvas.CopyMode := cmSrcCopy;
acanvas.draw(0,0,form1.picshow.Picture.Bitmap); }
form1.hide;
//form1.parentwindow:=strtoint(para2);
form1.visible:=false;
hprewnd:= StrToInt( para2 );
WHILE NOT IsWindowVisible( hPreWnd ) DO
Application.ProcessMessages;
GetWindowRect( hPreWnd, Rect1 );
Rect1 := Rect( 0, 0, Rect1.Right-Rect1.Left, Rect1.Bottom-Rect1.Top );
sCanvas := TCanvas.Create;
sCanvas.Handle:= GetDC( hPreWnd );
sCanvas.CopyMode := cmSrcCopy;
WHILE IsWindowVisible( hPreWnd ) DO
BEGIN
formscreen:=tbitmap.create;
Rect1:= Rect( 0, 0, form1.width,form1.height );
formscreen.canvas.copyrect(rect2,form1.canvas,rect2);//把整个屏幕复制到BITMAP中
sCanvas.Draw(0,0, formscreen );
Sleep(1);
Application.ProcessMessages;
END;
sCanvas.Free;
以上程序执行小窗口没任何反映,是什么问题?