reversing EM_SETREADONLY

Started by tpekar, October 30, 2012, 03:45:29 PM

Previous topic - Next topic

tpekar

If I use SetWindowLong to disable input to an edit control with style EM_SETREADONLY, how do I reverse it to once again allow input to the edit control?  EM_UNDO doesn't seem to work.

tpekar

Got it figured out.  Just needed to use SendMessage instead of SetWindowLong to set EM_SETREADONLY.  The third parameter sets the read only attribute based on a 1 or 0 (zero).

CommonTater

#2
You can also use EnableWindow() which is faster, greys the window and prevents tabbing to it when it's disabled.

If you don't have the Windows SDK you should download it... HERE  (You only need the Documentation. Pelles C supplies the rest)