Aha,
after consulting MSDN (even though it's Microsoft, it is a great resource) I
needed to pass in a pointer to TPoint
SendMessage(myrichedit.handle, EM_CHARFROMPOS, 0, longint(@myPoint))
as opposed to
SendMessage(myrichedit.handle, EM_CHARFROMPOS, 0, MAKELPARAM(X, Y))
All good now.
Tony Sinclair
Holliday Group Limited
Christchurch
New Zealand
-----Original Message-----
From: Tony Sinclair [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 6 July 2000 11:28
To: Multiple recipients of list delphi
Subject: RE: [DUG]: EM_CHARFROMPOS (Was EM_CHARATPOS)
I have been doing a sendmessage to a TRichEdit using the EM_CHARFROMPOS
message to determine at what character position the drop occured from xy
coords. It seems that every second or third 'drop' raises an exception. I
have heard rumors to the effect that the underlying rich edit control is
flawed, is this true? Are there ways around it (Apart from try / except)?
I tried the process on a memo control and didn't get the exception but got
some strange numbers back if the 'drop' occured after the last character or
somewhere on a line, after the first line ie > 65000. Looking at it, the
memo one is returning a high/low order word indicating position and line.
thanks in advance
Tony Sinclair
Holliday Group Limited
Christchurch
New Zealand
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz