Re: Trouble subclassing listview to display unicode (chinese)
- From: "Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 06:53:32 -0800
kevin.bourque@xxxxxxxxx schrieb im Beitrag
<1164065397.796709.115170@xxxxxxxxxxxxxxxxxxxxxxxxxxx>...
I've been studying how to subclass forms and controls using the windows
API in VB/VBA to display unicode characters (chinese and japanese,
among others). Specifically, I have a form with a listview on it which
does not display the unicode characters; I need to subclass the
listview in order to display them (as far as I know; perhaps there is
another way). I'm having trouble figuring out what message to trap,
whether WM_SETTEXT for the window or LMV_SETITEMTEXT for the ListView.
AFAIK the control isn't enabled to display Unicode strings, you have to do
that by your own code. For this you have to create the ListView window with
the LVS_OWNERDRAWFIXED style which AFAIK is supported only in report view
of the ListView control.
After getting a WM_DRAWITEM message you have to draw the text e.g. with the
API function TextOutW() - note the trailing "W" which designates the wide
character (= Unicode) string version of TextOut(); in addition note that
you have to pass a string to a function's "W" version not "ByVal/ByRef As
String" but "ByVal As Long" and Call xyz(StrPtr(MyString)).
--
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
.
- Follow-Ups:
- Re: Trouble subclassing listview to display unicode (chinese)
- From: kevin.bourque@xxxxxxxxx
- Re: Trouble subclassing listview to display unicode (chinese)
- References:
- Trouble subclassing listview to display unicode (chinese)
- From: kevin . bourque
- Trouble subclassing listview to display unicode (chinese)
- Prev by Date: Re: Customizing WINCE5.0 UserInterface
- Next by Date: Re: C++ DLL Side Of a VB Call-back function Problem
- Previous by thread: Trouble subclassing listview to display unicode (chinese)
- Next by thread: Re: Trouble subclassing listview to display unicode (chinese)
- Index(es):
Relevant Pages
|