Re: Trouble subclassing listview to display unicode (chinese)



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
----------------------------------------------------------------------

.



Relevant Pages

  • Re: Listviw SHOWSELALWAYS
    ... You are *really* trying to do much with the API when it's not necessary. ... Use the API to do things that the control doesn't ... SelectedItem property to Nothing. ... Perhaps you should spend more time reading MSDN Library on the ListView ...
    (microsoft.public.vb.controls)
  • Re: Item text from listview in foreign app
    ... am fairly sure they are using API hooking to hook the API text drawing ... I mentioned the Spyworks DLL ... listview data cross process, ... a buffer in the foreign process to hold the text from the listview, ...
    (microsoft.public.vb.general.discussion)
  • Re: Hide/Show Columns Listview
    ... There is no API. ... listview with the data minus column two. ... listview that provides for column hiding. ... subclassing of the header to trap mouse action on the specific header ...
    (microsoft.public.vb.winapi)
  • Re: Listview size
    ... Internally, the .NET ListView is making the same API calls, you just don't know it. ... times the Border3DSize + the width of a vertical scrow bar ... Read the number of items that will fit using the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Listview/Imagelist
    ... Also make sure you give your Api imagelist room ... > Also which version of the VB ocx listview are you using? ... > subclassing included. ... I have verified that the API IL has the correct icon images in it. ...
    (microsoft.public.vb.winapi)