Registriert seit: 23. Dez 2011
1 Beiträge
|
Screenshot Windows 7 Win Server 2008 R' taskbar extension
25. Apr 2014, 15:37
Delphi-Version: XE3
Hi,
Windows 7, right click the System menu. I want to take a screenshot of the menu.
Thumbnail Bar or Customizing Jump List or Jump List
Example: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
I need help in this regard.
Thanks to everyone in advance
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
I: integer;
b: TBitMap;
begin
fwin := True;
while True do
begin
if fwin = FALSE then
exit;
b := TBitMap.Create;
try
Application.ProcessMessages;
Sleep(100);
// ScreenShot(0, 0, 1364, 768, b);
Capture(1364, 768,b);
Image1.Picture.Assign(b);
finally
b.Free;
end;
end;
end;
function TForm1.Capture(Width, Height: integer;bm: TBitMap): Boolean;
var
dc: HDC;
RasterOp, ExStyle: DWORD;
begin
result := FALSE;
if ((Width = 0) or (Height = 0)) then
exit;
bm.Width := Width;
bm.Height := Height;
RasterOp := SRCCOPY;
ExStyle := GetWindowLong( Handle, GWL_EXSTYLE);
if (ExStyle and WS_EX_LAYERED) = WS_EX_LAYERED then
RasterOp := SRCCOPY or CAPTUREBLT;
dc := GetDCEx(0, 0, DCX_WINDOW or DCX_NORESETATTRS or DCX_CACHE);
//dc := GetDCEx(0, 0, DCX_WINDOW or DCX_NORESETATTRS or DCX_CACHE or DCX_CLIPCHILDREN or DCX_CLIPSIBLINGS or DCX_PARENTCLIP or DCX_EXCLUDERGN or
//DCX_INTERSECTRGN or DCX_EXCLUDEUPDATE or DCX_INTERSECTUPDATE or DCX_LOCKWINDOWUPDATE or DCX_VALIDATE);
//dc := GetWindowDC(GetDesktopWindow);
if ( dc = 0) then
exit;
try
SelectClipRgn(bm.Canvas.Handle, FRgn);
result := BitBlt(bm.Canvas.Handle, 0, 0, 1320, 768, dc, 0, 0, RasterOp);
SelectClipRgn(bm.Canvas.Handle, 0);
finally
ReleaseDc(0, dc);
// ReleaseDC(GetDesktopWindow, dc);
end;
end;
Geändert von Gate (25. Apr 2014 um 16:19 Uhr)
|
|
Zitat
|