请教下面的MDI加背景语句,有一过程需要参数,但不知道加那一个,请帮忙修改,谢谢 (0分)

  • 主题发起人 主题发起人 topdelphi
  • 开始时间 开始时间
T

topdelphi

Unregistered / Unconfirmed
GUEST, unregistred user!
请教下面的MDI加背景语句,有一过程需要参数,但不知道加那一个,请帮忙修改,谢谢
private
{ Private declarations }
foldclientproc,fnewclientproc:tfarproc;
fdrawdc:hdc;
procedure drawtiled;
procedure createwnd;override;
procedure ClientWndProc(var Message: TMessage);

public
{ Public declarations }
end;

var
frmmain: Tfrmmain;

implementation

{$R *.dfm}

procedure tfrmmain.createwnd ;
begin
inherited createwnd;
fnewclientproc:=makeobjectinstance(clientwndproc);
foldclientproc:=pointer(getwindowlong(clienthandle,gwl_wndproc));
setwindowlong(clienthandle,gwl_wndproc,longint(fnewclientproc));
end;

procedure TfrmMain.ClientWndProc(var Message: TMessage);

var Dc : hDC;
row,col:word;
begin

case Message.Msg of

WM_ERASEBKGND:

begin
callwindowproc(foldclientproc,clienthandle,message.Msg,message.WParam ,message.LParam);
fdrawdc:=twmerasebkgnd(message).DC;
drawtiled;
message.Result :=1;

end;

wm_vscroll,wm_hscroll:
begin
message.Result:=callwindowproc(foldclientproc,clienthandle,message.Msg ,
message.WParam,message.LParam );
invalidaterect(clienthandle,nil,true);
end;
else
message.Result:=callwindowproc(foldclientproc,clienthandle,message.Msg ,
message.WParam,message.LParam );

end;
end;

procedure tfrmmain.drawtiled ;
var
row,col:integer;
cr,ir:trect;
numrows,numcols:integer;
begin
getwindowrect(clienthandle,cr);
ir:=frmmain.ClientRect ;
numrows:=cr.Bottom div ir.Bottom;
numcols:=cr.Right div ir.Right ;
with frmmain do
for row :=0 to numrows+1 do
for col:=0 to numcols+1 do
bitblt(fdrawdc,col*image1.Picture.Width,row*image1.Picture.Height ,image1.Picture.Width ,image1.Picture.Height,
image1.Picture.Bitmap.Canvas.Handle,0,0,srccopy);
end;

procedure Tfrmmain.FormCreate(Sender: TObject);
begin
frmmain.Width :=700;
drawtiled;
createwnd;
ClientWndProc ;//程序运行到这里说需要参数,请问是上面的过程语句那个参数啊!



 
后退
顶部