type
TForm1=class(TForm)
Image1: TImage;
Panel1: TPanel;
private
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
public
end;
....
procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
var
pt: TPoint;
begin
inherited;
pt := ScreenToClient(SmallPointToPoint(Message.Pos));
if (GetAsyncKeyState(VK_LEFT) < 0) and (ptinrect(Panel1.BoundsRect,Pt) or ptinrect(Image1.BoundsRect, pt)) then
message.result := HTCAPTION;
end;