An application sends an EM_SETREADONLY message to set or remove the read-only style (ES_READONLY) of an edit control.
EM_SETREADONLY
wParam = (WPARAM) (BOOL) fReadOnly; // read-only flag
lParam = 0; // not used; must be zero
If the operation succeeds, the return value is nonzero; otherwise, it is zero.
When an edit control has the ES_READONLY style, the user cannot change the text within the edit control.
To determine whether an edit control has the ES_READONLY style, use the GetWindowLong function with the GWL_STYLE flag.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Edit Controls Overview, Edit Control Messages, GetWindowLong