#27 Support Unicode for Textfield and Richedit controls

1.07 (5)

I'll open this tracker in response to the email below.
Perhaps it should be generalized to other controls
containing text, such as ListBox, ComboBox, etc., if
that is possible. I've already generalized it to
Textfield ... thinking that it should be about the same
support for Textfield and RichEdit, and maybe even
easier for Textfield... and Textfield doesn't have the
extra formatting baggage that RichEdit does, so could
be simpler to use for simple text entry work.



$re->Text() behind the scenes calls the win32api
GetWindowText API, which in turn sends a WM_GETTEXT
message to the richedit control. As far as I can see
there is no Unicode version of GetWindowText.. You
actually need to send a EM_GETTEXTEX message (see msdn
for more information). This message can be set to get
the text in unicode (UCS-2) and that then needs to be
converted to perl characters.

As Win32::GUI does not support the EM_GETTEXTEX
message, calling it is somewhat tricky, but the
following seems to work here. If you'd like native
support for EM_GETTEXTEX, then please raise a RFC.



  • Robert May

    Robert May - 2005-11-30
    • priority: 5 --> 3
  • Robert May

    Robert May - 2008-01-31

    Logged In: YES
    Originator: NO

    I think we should add native support for EM_GETTEXTEX to the next release (post 1.06). I have the code for the 'thunking' between Latin-1/UTF-8 and UCS-2 (or is it UCS-16 these days?). Should be an easy one.

  • Robert May

    Robert May - 2008-01-31
    • priority: 3 --> 7
    • assigned_to: nobody --> robertemay
  • Robert May

    Robert May - 2008-01-31
    • labels: --> 1.07

Log in to post a comment.