The MASM Forum

General => The Campus => Topic started by: Konai on December 17, 2014, 08:25:01 AM

Title: EM_GETCHARFROMPOS message processing
Post by: Konai on December 17, 2014, 08:25:01 AM
I am trying to understand how to process the EM_GETCHARFROMPOS message to determine which character I am closest to within an edit control. Is this message being sent already to the window? or is there some command I have to invoke to get this message sent when I need it based on a mouse interaction? I've been testing with DialogBoxParam window so that may also be an issue. Any information is appreciated.
Title: Re: EM_GETCHARFROMPOS message processing
Post by: jj2007 on December 17, 2014, 09:15:46 AM
You have to send the message in the moment when you want to find that char.

      lea esi, pt  ; a local POINTL structure
      invoke GetCursorPos, esi
      invoke ScreenToClient, hRichEdit, esi
      invoke SendMessage, hRichEdit, EM_CHARFROMPOS, 0, esi