There is EM_GETMARGINS. I'm not sure if that counts as "simple". :-)
EDIT: Try this:
type
tSynMargins = record
left, right: Word;
end;
function GetLeftMargin(hEdit: HWND): Word;
var
margins: Longint;
begin
margins := SendMessage(hEdit, EM_GETMARGINS, 0, 0);
Result := tsynMargins(Margins).left;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := IntToStr(GetLeftMargin(Edit1.Handle));
Memo1.Text := IntToStr(GetLeftMargin(Memo1.Handle));
end;
(inspired by this)
Ulrich Gerhardt
2009-05-20 07:04:10