change character Insert / Overwrite in richedit?
Posted on 1997-05-04
Unlike memo's, richedit components handle switching between Insert and Overwrite modes. I would like to know how to progamaticaly detect which mode it is in and also set the mode.
I took a pot shot and tried using
SendMessage( form.Handle, WM_CHAR, VK_INSERT, 24 );
to toggle Insert/Overwrite but no joy.
Thanks in advance
To clarify my situation, I have a made a tabbed multipage editor similar to the one found in the Delphi IDE, along the bottom is a panel which show various things like cursor position, caplocks state etc.. I recently added an Insert / Overwrite status using getkeystate(VK_INSERT) = 1 and SetKeyboardState to set the virtual keys. This works fine except the state it shows bears no relation to the state inside a particular richedit. Furthermore if I press insert while a particular richedit has focus the Insert/Overwrite state for that richedit changes but none of the other ones do. You can imagine how this might piss the users off. In Delphi editor I notice all the windows stay in sync.
My guess is that the richedits each have there own variable which dictates their Insert / Overwrite state and that Borland decided not to wrap this variable in the Trichedit component.