Rich Edit: EM_CHARFROMPOS / EM_POSFROMCHAR problem

Hi,

I just tried the EM_CHARFROMPOS / EM_POSFROMCHAR messages with an Rich
Edit Control.

Therefore I filled a Rich Edit with some stupid text and called the
following:

[It's Delphi]

procedure TForm1.Button4Click(Sender: TObject);
var
  CharOffs: longint;
begin
  CharOffs := SENDMESSAGE(RichEdit1.Handle, EM_POSFROMCHAR,
                        WPARAM (10), 0);
  ShowMessage('Parent: '+'X='+IntToStr(LOWORD(CharOffs))+
                        ' Y='+IntToStr(HIWORD(CharOffs)));
end;

Normally it should give some numbers back (the X and Y coordinate of
the 10th character) but it only gives an exception while sending this
message :-(

Can you help?

---
Alexander Lucke                          lu...@chez.com
LUCKE Software Development               http://www.chez.com/lucke/