Autor Beitrag
Bomania
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: Sa 03.05.03 22:13 
Hallo,

für das Erstellen eines Screenshots habe ich hier bereits genug gefunden. Das funktioniert soweit auch. Ich möchte aber gerne einen Screenshot vom gerade aktiven Fenster erstellen. Kann mir da jemand weiterhelfen?

Danke
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Sa 03.05.03 22:23 
Benutze einfach mal die Suchfunktion oder schau in die FAQ's, da stehen Beispiele.

Edit : 1. Url ==> ... einen Screenshot erstellen
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 04.05.03 08:05 
Wie ich bereits angedeuted habe, habe ich die Suche natürlich schon benutzt. Und in der FAQ steht ebenfalls nur das Erstellen eines "normalen" Screenshots vom gesamten Desktop.

Was ich suche ist aber das Erstellen eines Screenshots von einem EINZELNEN (aktiven) Fenster.

Gruß,
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 04.05.03 10:21 
Dann probiere es doch mal so :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure ScreenShotActiveWindow(Bild: TBitMap);
var
  c : TCanvas;
  r, t : TRect;
  h : THandle;
begin
  c := TCanvas.Create;
  c.Handle := GetWindowDC(GetDesktopWindow);
  h := GetForeGroundWindow;
  if h<>0 then
    GetWindowRect(h, t);
  try
    r := Rect(0,0,t.Right-t.left, t.Bottom-t.Top);
    Bild.Width := t.Right-t.left;
    Bild.Height := t.Bottom-t.Top;
    Bild.Canvas.CopyRect(r, c, t);
  finally
    ReleaseDC(0, c.handle);
    c.Free;
  end;
end;


Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 04.05.03 12:42 
Vielen Dank!

Eine Sache vielleicht noch. Wie kann man das dann als Datei abspeichern?
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: So 04.05.03 13:47 
müssste theoretisch mi
ausblenden Delphi-Quelltext
1:
bild.savetofile('C:\123.bmp');					

gehen...

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt


Zuletzt bearbeitet von Raphael O. am So 04.05.03 21:12, insgesamt 1-mal bearbeitet
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 04.05.03 14:11 
Ja es funktioniert...vielen Dank!