Newsgroups: comp.windows.ms.programmer Path: utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau From: bonneau@hyper.hyper.com (Paul Bonneau) Subject: Re: EM_SETMODIFY Message-ID: <1991Jun25.194227.5890@hyper.hyper.com> Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,) Organization: HyperCube Inc. References: <1991Jun24.210619.13889@athena.mit.edu> Date: Tue, 25 Jun 1991 19:42:27 GMT In article <1991Jun24.210619.13889@athena.mit.edu> memetral@athena.mit.edu (Max E. Metral) writes: >I am trying to make an edit control read-only. > >The parent window is Parent, and the control is EDITCNT. > > SendMessage(EDITCNT, EM_SETMODIFY, FALSE, NULL); > > or > > SendMessage(Parent, EM_SETMODIFY, FALSE, NULL); > >don't work. What am I doing wrong? The SDK man never says what value I should >set the flag to to make it read-only... > EM_SETMODIFY merely sets (or clears) the "dirty" bit. This is set automatically whenever the contents of an edit are changed. This allows the app to know if they have been changed since the last time it looked (by sending EM_GETMODIFY). As has been discussed recently, you can subclass the edit and eat messages that can affect its contents. These include: WM_CHAR, WM_CUT, WM_COPY, WM_PASTE, and WM_CLEAR. cheers - Paul Bonneau.