EM_SETREADONLY

3.1

EM_SETREADONLY
wParam = (WPARAM) (BOOL) fReadOnly;     /* read-only flag         */
lParam = 0L;                            /* not used, must be zero */

An application sends an EM_SETREADONLY message to set the read-only state of an edit control.

Parameters

fReadOnly

Value of wParam. Specifies whether to set or remove the read-only state of the edit control. A value of TRUE sets the state to read-only; a value of FALSE sets the state to read/write.

Return Value

The return value is nonzero if the operation is successful, or it is zero if an error occurs.

Comments

When the state of an edit control is set to read-only, the user cannot change the text within the edit control.

Example

This example sets the state of an edit control to read-only:

SendDlgItemMessage(hdlg, IDD_EDIT, EM_SETREADONLY,
    TRUE, 0L);