windows_programming_notes.nbk: Home | Index | Next Page: Embed an HTML control in your own window using plain C | Previous Page: EM_SETBKGNDCOLOR
Sets or removes the read-only style (ES_READONLY) of an edit control. You can send this message to either an edit control or a rich edit control.
To send this message, call the SendMessage function as follows.
    lResult = SendMessage(        // returns LRESULT in lResult     
       (HWND)   hWndControl,      // handle to destination control     
       (UINT)   EM_SETREADONLY,   // message ID     
       (WPARAM) wParam,           // = (WPARAM) () wParam;    
       (LPARAM) lParam            // = 0; not used, must be zero 
    );   
If the operation succeeds, the return value is nonzero. If the operation fails, the return value 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.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
windows_programming_notes.nbk: Home | Index | Next Page: Embed an HTML control in your own window using plain C | Previous Page: EM_SETBKGNDCOLOR
Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time