//画背景
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));
**************************************************************************
hmenu := GetSystemMenu(handle,false);
AppendMenu(hmenu,MF_SEPARATOR,0,nil);
AppendMenu(hmenu,MF_STRING,100,'关于...');
***********************************************************************
procedure TMainForm.ClientWndProc(var Message: TMessage); //平铺函数
VAR
MyDC : hDC;
Ro,Co : Word;
begin
with Message do
case Msg of WM_ERASEBKGND:
begin
MyDC := TWMEraseBkGnd(Message).DC;
For Ro := 0 to ClientHeight div Image1.Picture.Height do
For Co := 0 to ClientWIDTH div Image1.Picture.Width do
BitBlt(MyDC, Co*Image1.Picture.Width, Ro*Image1.Picture.Height,
Image1.Picture.Width, Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;end;
********************************************************************
procedure TMainForm.MySystemMenu(var msg: twmmenuselect); //什么意思?????
begin
if msg.IDItem = 100 then N8Click(nil)
else inherited;
end;
********************************************************
分不多了谢了!
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));
**************************************************************************
hmenu := GetSystemMenu(handle,false);
AppendMenu(hmenu,MF_SEPARATOR,0,nil);
AppendMenu(hmenu,MF_STRING,100,'关于...');
***********************************************************************
procedure TMainForm.ClientWndProc(var Message: TMessage); //平铺函数
VAR
MyDC : hDC;
Ro,Co : Word;
begin
with Message do
case Msg of WM_ERASEBKGND:
begin
MyDC := TWMEraseBkGnd(Message).DC;
For Ro := 0 to ClientHeight div Image1.Picture.Height do
For Co := 0 to ClientWIDTH div Image1.Picture.Width do
BitBlt(MyDC, Co*Image1.Picture.Width, Ro*Image1.Picture.Height,
Image1.Picture.Width, Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam);
end;end;
********************************************************************
procedure TMainForm.MySystemMenu(var msg: twmmenuselect); //什么意思?????
begin
if msg.IDItem = 100 then N8Click(nil)
else inherited;
end;
********************************************************
分不多了谢了!
begin
if msg.IDItem = 100 then N8Click(nil)
else inherited;
end;
begin
if msg.IDItem = 100 then //100是自定义的一个系统菜单项标识符的ID,是按常量定义的 //如果用户单击了添加的系统菜单项,则执行N8Click过程,否则执行默认过程
N8Click(nil)//这是一个自编的系统菜单的处理过程,
else inherited;
end;
********************************************************