Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ES_READONLY Problem...

80 views
Skip to first unread message

James M. O'Brien, Jr.

unread,
Apr 21, 1994, 12:03:31 PM4/21/94
to
I create a Edit control in the client area of my win app. One of the style
flags passed is ES_READONLY. The control gets created, but it appears as
if the readonly flag is ignored. Am I missing something obvious?

I am using Borland C++ 3.1 coding in C.

TIA

Jim O'Brien, CNE University of Maryland Eastern Shore
job...@mcs.umes.umd.edu Network Manager

Thomas Heller

unread,
Apr 22, 1994, 5:55:36 AM4/22/94
to
James M. O'Brien, Jr. (job...@mcs.umes.umd.edu) wrote:
: I create a Edit control in the client area of my win app. One of the style

: TIA

If I remeber correctly, this is a known bug since Windows 3.0.
Try sending an EM_SETREADONLY after creation of the Edit control.

Thomas Heller

James M. O'Brien, Jr.

unread,
Apr 22, 1994, 9:33:51 AM4/22/94
to
In article <2p86uo$v...@obelix.uni-muenster.de> hel...@asterix.uni-muenster.de (Thomas Heller) writes:

>James M. O'Brien, Jr. (job...@mcs.umes.umd.edu) wrote:
>: I create a Edit control in the client area of my win app. One of the style
>: flags passed is ES_READONLY. The control gets created, but it appears as
>: if the readonly flag is ignored. Am I missing something obvious?

>If I remeber correctly, this is a known bug since Windows 3.0.


>Try sending an EM_SETREADONLY after creation of the Edit control.

I found EM_SETREADONLY shortly after posting... Ah well... Thanks.
This brought up another 'problem', maybe its a feature. When the
edit control is set to read only, one can not clear it until its READONLY is
set to FALSE? So to clear the edit control I've got to essentially send 5
messages? Any other way to do this?

Thanks

- Jim

Zweitze de Vries

unread,
Apr 22, 1994, 2:08:52 PM4/22/94
to
In article <jobrien.38...@mcs.umes.umd.edu>
job...@mcs.umes.umd.edu (James M. O'Brien, Jr.) writes:

>I create a Edit control in the client area of my win app. One of the style
>flags passed is ES_READONLY. The control gets created, but it appears as
>if the readonly flag is ignored. Am I missing something obvious?

>I am using Borland C++ 3.1 coding in C.

A few weeks ago I had a discussion with Michael Vincze (vin...@lobby.ti.com)
who had the same problems using BPW 7.0. It turns out that Borland implemeted
validators in their Edit objects, but accidently forgot that the control
could be read only / had to give up read only controls.

Try overriding the following messages:
WM_KEYUP, WM_KEYDOWN, WM_CHAR, WM_CUT, WM_PASTE. All responses should be:
DefWndProc(Msg)

Using this direction, you get the default (Windows) behavior. Another
direction is forgetting about the Borland object and do everything with
CreateWindow() and the EM_ messages.
--
Zweitze de Vries zwe...@et.tudelft.nl
Faculty of Electrotechnics
Delft University of Technology
Netherlands Never trust a virtual machine

Ron Levi

unread,
Apr 27, 1994, 2:03:16 AM4/27/94
to
In article <jobrien.38...@mcs.umes.umd.edu> job...@mcs.umes.umd.edu (James M. O'Brien, Jr.) writes:

You should also send the edit control a em_setReadOnly message in your
setupWindow method.

Ron.

aa...@miguelina.inesc.pt

unread,
Apr 29, 1994, 8:58:32 AM4/29/94
to
In article <ZWEITZE.7...@et.tudelft.nl> ZWE...@et.tudelft.nl (Zweitze de Vries) writes:

Newsgroups: comp.os.ms-windows.programmer.controls
From: ZWE...@et.tudelft.nl (Zweitze de Vries)
Date: Fri, 22 Apr 1994 10:08:52 UNDEFINED
Organization: Faculteit der Elektrotechniek, TU Delft

In article <jobrien.38...@mcs.umes.umd.edu>
job...@mcs.umes.umd.edu (James M. O'Brien, Jr.) writes:

>I create a Edit control in the client area of my win app. One of the style
>flags passed is ES_READONLY. The control gets created, but it appears as
>if the readonly flag is ignored. Am I missing something obvious?

>I am using Borland C++ 3.1 coding in C.

A few weeks ago I had a discussion with Michael Vincze (vin...@lobby.ti.com)
who had the same problems using BPW 7.0. It turns out that Borland implemeted
validators in their Edit objects, but accidently forgot that the control
could be read only / had to give up read only controls.

Try overriding the following messages:
WM_KEYUP, WM_KEYDOWN, WM_CHAR, WM_CUT, WM_PASTE. All responses should be:
DefWndProc(Msg)

Using this direction, you get the default (Windows) behavior. Another
direction is forgetting about the Borland object and do everything with
CreateWindow() and the EM_ messages.
--

I think the guy is already using the WIndows API (Createwindow("EDIT", ...)).
I'm saying this because I had the same problem. However, the solution is quite simple (in my case worked) : Just after creating the edit control, send a message to it, saying that it is readonly. I don't have here any doc but is something like EM_READONLY.

Hope this helps
Anonio
--
------
Antonio A. V. Melo | INESC - Instituto de Engenharia de Sistemas e
Email: | Computadores (room 613)
aa...@lamparina.inesc.pt | Rua Alves Redol, 9 1000 Lisboa - Portugal

0 new messages