本人在寫遠程控制程序時,遇到被控方鎖屏時,傳回來的圖像為白屏,且模擬鍵盤按鍵功能失效,模擬鼠標有效,還請高手提供解決方法.下為大致的截屏函數,還忘高手指點思路.procedure Tform1.CaptureScreen();
var
Fullscreen: TBitmap;
FullscreenCanvas: TCanvas;
DC: HDC;
begin
Fullscreen := TBitmap.Create;
Fullscreen.Width := screen.width;
Fullscreen.Height := screen.Height;
DC := GetDC(0);
FullscreenCanvas := TCanvas.Create;
FullscreenCanvas.Handle := DC;
Fullscreen.Canvas.CopyRect(Rect(0, 0, screen.Width, screen.Height),
fullscreenCanvas, Rect(0, 0, Screen.Width, Screen.Height));
FullscreenCanvas.Free;
ReleaseDC(0, DC);
Image1.Picture.Bitmap := fullscreen;
Image1.Width := fullscreen.Width;
Image1.Height := fullscreen.Height;
fullscreen.free;
end;
var
Fullscreen: TBitmap;
FullscreenCanvas: TCanvas;
DC: HDC;
begin
Fullscreen := TBitmap.Create;
Fullscreen.Width := screen.width;
Fullscreen.Height := screen.Height;
DC := GetDC(0);
FullscreenCanvas := TCanvas.Create;
FullscreenCanvas.Handle := DC;
Fullscreen.Canvas.CopyRect(Rect(0, 0, screen.Width, screen.Height),
fullscreenCanvas, Rect(0, 0, Screen.Width, Screen.Height));
FullscreenCanvas.Free;
ReleaseDC(0, DC);
Image1.Picture.Bitmap := fullscreen;
Image1.Width := fullscreen.Width;
Image1.Height := fullscreen.Height;
fullscreen.free;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货