inherited WndProc(Message);
이 빠졌네요
procedure TForm1.WndProc(var Message: TMessage);
begin
if Message.LParam = Longint(Panel1) then begin
if (Message.Msg = CM_MOUSELEAVE) then begin
Panel1.Caption := '마우스가 떠날때';
Panel1.Color := clLime;
end;
if (Message.Msg = CM_MOUSEENTER) then begin
Panel1.Caption := '마우스가 들어올때';
Panel1.Color := clRed;
end;
end;
inherited WndProc(Message);
end;
end;
함수원형입니다
procedure WndProc(var Message: TMessage); override;
함수코딩은
Message.LParam에는 컴포넌트 포인트이구요
Message.Msg에는 VCL control message입니다
procedure TForm1.WndProc(var Message: TMessage);
begin
if Message.LParam = Longint(Panel1) then begin
if (Message.Msg = CM_MOUSELEAVE) then begin
Panel1.Caption := '마우스가 떠날때';
Panel1.Color := clLime;
end;
if (Message.Msg = CM_MOUSEENTER) then begin
Panel1.Caption := '마우스가 들어올때';
Panel1.Color := clRed;
end;
end;
inherited WndProc(Message);
end;