unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TWindowproc =
function(AHandle: Cardinal; uMsg: Cardinal; AWPARAM: wParam; ALPARAM: lParam): LResult;
TForm1 =
class(TForm)
Button1: TButton;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
procedure SaveDialog1Show(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var GOldProc: TWindowProc;
function NewWindowProc(AHandle: Cardinal; uMsg: Cardinal; AWPARAM: wParam; ALPARAM: lParam): LResult;
Stdcall;
begin
result := GOldProc(AHandle, uMsg, AWParam, ALParam);
end;
procedure TForm1.SaveDialog1Show(Sender: TObject);
begin
GOldProc := TWindowProc(SetWindowLong(SaveDialog1.Handle, GWL_WNDPROC, Integer(@NewWindowProc)));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SaveDialog1.Execute();
end;
end.