Article View: comp.windows.ms.programmer
Article #3343Re: Multiline Edit Control in Dialog
From: Paul Bonneau
Date: Fri, 21 Jun 1991 17:04
Date: Fri, 21 Jun 1991 17:04
25 lines
1630 bytes
1630 bytes
In article <1991Jun20.144858.11588@spider.co.uk> brianw@spider.co.uk (Brian Wyld) writes:
>As Paul Bonneau said, Win 3 takes RETURN as default button. <CTRL><RETURN>
>puts in a return.
>
>You can change this behaviour by subclassing the edit control. I have code
>to do this (email me if you want it) or simply subclass, catch the
>VK_RETURN, fiddle the keyboard map (Get/SetKeyboardState) to say CTRL is
>pressed, call the default proc and then refiddle the map back again.
>
This is not true. The MLE *will* move down a line *without*
the control key pressed. Fiddling the keymap is unnecessary.
I wrote the following case to test it:
CreateWindow((LSZ)"edit", lszNull,
WS_POPUP | WS_CAPTION | WS_SYSMENU | ES_MULTILINE | WS_VISIBLE |
ES_AUTOVSCROLL, 0, 0, 200, 200, hwndAppMainWindow, hmnuNull,
hinstApplication, 0L);
The result was a MLE in a popup which had no problem with
<return>. The problem is that the dialog manager is eating
the <return>, and activating the default button. Using
<ctrl>-<return> prevents the dialog manager from performing
this translation.
cheers - Paul Bonneau.
Technical Details
Message-ID:
<1991Jun21.170401.12773@hyper.hyper.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneauReferences:
<STERGIOS.91Jun18103411@kt22.Stanford.EDU> <1991Jun19.185843.2195@hyper.hyper.com> <1991Jun20.144858.11588@spider.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau From: bonneau@hyper.hyper.com (Paul Bonneau) Subject: Re: Multiline Edit Control in Dialog Message-ID: <1991Jun21.170401.12773@hyper.hyper.com> Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,) Organization: HyperCube Inc. References: <STERGIOS.91Jun18103411@kt22.Stanford.EDU> <1991Jun19.185843.2195@hyper.hyper.com> <1991Jun20.144858.11588@spider.co.uk> Date: Fri, 21 Jun 1991 17:04:01 GMT