Delphi 7 - Screenshot without capturing form - Windows 8 - DWM.exe

Friends,

Need to screenshot of the all desktop WITHOUT MY FORM and load in TImage. Success in Windows XP, 7 - with just ALPHABLEND = TRUE + SCREENSHOT PROCEDURE.

But same code does not work in Windows 8 - capture all screen INCLUDING THE FORM.

I know the problem is related to AERO - DWM.EXE - success using pssuspend.exe (sysinternals) - suspending winlogon.exe and killing dwm.exe

Someone could tell me how to capture all desktop without my form also in Windows 8?

prntscr.com/314rix - SUCESS IN WIN7

prntscr.com/314tj7 - FAILED IN WIN8

prntscr.com/31502u - SUSPEND WINLOGON.EXE and KILL DWM.EXE IN WIN8

www sendspace.com/file/b5oxhb - SOURCE CODE

FORM -> ALPHABLEND -> TRUE


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,
Clipbrd;

type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
ScrollBox1: TScrollBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure ScreenShot(DestBitmap: TBitmap);
var
DC: HDC;
begin
DC:=GetDC(GetDesktopWindow);
try
DestBitmap.Width:=GetDeviceCaps(DC, HORZRES);
DestBitmap.Height:=GetDeviceCaps(DC, VERTRES);
BitBlt(DestBitmap.Canvas.Handle,0,0,DestBitmap.Width,DestBitmap.Height,DC,0,0,SRCCOPY);
finally
ReleaseDC(GetDesktopWindow, DC);
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ScreenShot(Image1.Picture.Bitmap);
end;

end.
March 15th, 2014 8:03pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics