Pelles C forum

C language => Windows questions => Topic started by: tpekar on October 30, 2012, 03:45:29 PM

Title: reversing EM_SETREADONLY
Post by: tpekar on October 30, 2012, 03:45:29 PM
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.
Title: Re: reversing EM_SETREADONLY
Post by: tpekar on October 30, 2012, 04:29:36 PM
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).
Title: Re: reversing EM_SETREADONLY
Post by: CommonTater on October 30, 2012, 04:47:42 PM
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 (http://www.microsoft.com/en-us/download/details.aspx?id=18950)  (You only need the Documentation. Pelles C supplies the rest)