Re: Trapping and suppressing Enter key in a rich edit
- Posted by jtemple at yhti.net Apr 13, 2004
- 513 views
Mario, Thanks for the code example. I probably should have clarified one point, though. I was able to trap the Enter key in a rich edit with the w32HKeyDown event handler but what I'm trying to do is stop the rich edit from inserting a CR/LF. Thanks for the help! Jonas Hey Jonas, Reason why you'r not stopping the VK_ENTER/VK_RETURN, is the fact that by default, RichEdit Controls have their own Proccessor for Key Events. Win32lib never receives these events, unless you specify to the control that you want to receive these events. I had this same problem myself, and found this solution to my problem: void = sendMessage(InputBox,WM_USER+69,0,#04020003) -- EM_SETEVENTMASK, ENM_UPDATE+ENM_CHANGE+ENM_LINK void = sendMessage(InputBox,WM_USER+91,1,0) These two combines will allow Win32lib to receive the Key Events for ya. It will also notify you of Links, and stuff, and I'm not certian of the masks for this, but I am sure you can find this information in a Win32 Raw API Library in the Archives. Once you do the two above sendMessage() functions, you'll be able to receive the events by the normal KeyPress, KeyDown, and KeyUp defs in Win32lib. Hope this helps ya out, EuMario