Hallo,
ich bin ein totaler Delphi - Neuling und habe folgendes Problem:
Ich brauche eine .exe Datei, die aus einem anderen Programm aus gestartet, einen Screenshot macht, als Screenshot.bmp speichert und sich wieder schließt.
Ich hab zwar das Speichern hingepfriemelt, aber nur über einen Buttonklick. Soll aber kein Formular werden. Ich habe keine Ahnung wie das mit Turbo Delphi geht. Bin über jede Hilfe dankbar.
Viele Grüße
Benny
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| unit Unit3;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm3 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end;
var Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject); var DCDesk: HDC; bmp: TBitmap; begin bmp := TBitmap.Create; bmp.Height := Screen.Height; bmp.Width := Screen.Width;
DCDesk := GetWindowDC(GetDesktopWindow);
BitBlt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DCDesk, 0, 0, SRCCOPY);
bmp.SaveToFile('ScreenShot.bmp');
ReleaseDC(GetDesktopWindow, DCDesk);
bmp.Free; end; end. |