I have a custom form which does not have any type of border. I\'m drawing some custom borders of my own instead, which do not extend up to the far edges of the form. Instead, wh
Actually it would make sense to define two constants instead of the only EDGEDETECT
since
you require horizontal and vertical offsets to be different and write it from scratch, but here is a quick patch:
procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
const
EDGEDETECT = 17; //adjust to suit yourself // <- increased to suit outer offset
var
deltaRect: TRect; //not really used as a rect, just a convenient structure
OuterRect: TRect; // used as a rect
begin
inherited;
if BorderStyle = bsNone then begin
with Message, deltaRect do begin
..
else if (Right<EDGEDETECT) then
Result := HTRIGHT;
..
OuterRect := BoundsRect; // patch
InflateRect(OuterRect, -10, -3);
if not PtInRect(OuterRect, SmallPointToPoint(Message.Pos)) then
Message.Result := HTTRANSPARENT;
end;
end;
end;