D
Dephic
Unregistered / Unconfirmed
GUEST, unregistred user!
定义变量:
FClientInstance,
FPrevClientProc : TFarProc;
PROCEDURE ClientWndProc(VAR Message: TMessage);
onformcreate事件:
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));
过程
PROCEDURE TSystemMain_F.ClientWndProc(VAR Message: TMessage);
VAR
MyDC : hDC;
Ro, Co : Word;
begin
with Message do
case Msg of
WM_ERASEBKGND,
WM_PAINT:
begin
MyDC := TWMEraseBkGnd(Message).DC;
StretchBlt(MyDC,
0 , 0 , ClientWidth , ClientHeight - 80 ,
Image1.Picture.Bitmap.canvas.Handle ,
0, 0 ,Image1.Picture.Width, Image1.Picture.Height,
SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;
end;
这样做可以进行自动缩放,但当要打开一MDI子窗口时,并执行SQL语
句,窗口就出现异常! 不能正确显示打开的子窗口
FClientInstance,
FPrevClientProc : TFarProc;
PROCEDURE ClientWndProc(VAR Message: TMessage);
onformcreate事件:
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));
过程
PROCEDURE TSystemMain_F.ClientWndProc(VAR Message: TMessage);
VAR
MyDC : hDC;
Ro, Co : Word;
begin
with Message do
case Msg of
WM_ERASEBKGND,
WM_PAINT:
begin
MyDC := TWMEraseBkGnd(Message).DC;
StretchBlt(MyDC,
0 , 0 , ClientWidth , ClientHeight - 80 ,
Image1.Picture.Bitmap.canvas.Handle ,
0, 0 ,Image1.Picture.Width, Image1.Picture.Height,
SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;
end;
这样做可以进行自动缩放,但当要打开一MDI子窗口时,并执行SQL语
句,窗口就出现异常! 不能正确显示打开的子窗口