unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,CommDlg;
const
InputMessage = WM_USER + 200;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
PrintDialog1: TPrintDialog;
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
procedure InputMess(
var Msg: TMessage);
message InputMessage;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
PostMessage(
Handle, InputMessage, 0, 0);
PrintDialog1.Execute(
handle)
end;
procedure TForm1.InputMess(
var Msg: TMessage);
const LB_FILETYPES_ID = 1089;LB_FILENAME_ID = 1090;LB_DRIVES_ID = 1091;LB_Title=1088;
var eePrintDialog: HWND;a:
string;
begin
eePrintDialog := PrintDialog1.Handle;
//Screen.Forms[0].Handle;
if (eePrintDialog <> 0)
then
begin
a:='
haha';
SetDlgItemText(eePrintDialog,idOK,pchar(a));
a:='
tata';
SetDlgItemText(eePrintDialog,idCancel,pchar(a));
end;
end;
end.