I am developing a Unicode application using MSLU. I am trying to give my
application a Chinese caption without success on Windows 2000 (English
version).
Normally, a window's caption is set by calling SetWindowTextW(). But, my
application's main windows is *not* a unicode window (it is created using
CreateWindow()) so i can't use SetWindowTextW().
Searching on the internet i found this solution: call DefWindowProcW(..,
WM_SETTEXT, ...unicode string...) directly. And, yes it works, on Windows
XP. But, on Windows 2000 (Win2k) it still see only question marks "???".
Notepad has no problem displaying the same Chinese characters in Notepad's
caption.
Any ideas?
- Gerben
Why not bite the bullet and make your application fully Unicode with a
Unicode window?
Dave
"David Lowndes" <Dav...@example.invalid> wrote in message
news:3aks54dc1drgnh703...@4ax.com...
I don't know whay "that's not an option", if you don't ellaborate.
But that's your problem.
What I can tell is that you will continue having bugs.
Patchy stuff, mixing Unicode with non-Unicode calls,
is a recipe for more bugs like this.
You will find a bug, spend two days figuring it out, fix one call,
somethine else will break, and so on.
This might be ok for you, and maybe you really don't have the option
of going Unicode. But at least you know what to expect.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
What i don't understand: calling DefWindowProcW with argument WM_SETTEXT
works under Windows XP (i get a Chinese caption on an English Windows
version), but not under Windows 2000 (i get question marks).
"Mihai N." <nmihai_y...@yahoo.com> wrote in message
news:Xns9AC7E393...@207.46.248.16...
"No time" is relative.
In the long run you will waste more time chasing this kind of bugs.
It is relatively easy to convert tens of thousands of lines of code per day.
It might sound scary, but this is only if you never did it before.
This might help: http://www.mihai-nita.net/article.php?artID=tounicode
> but according to
> information i have found on the Internet it should still be possible to
> call DefWindowProcW().
Not true on XP or Vista.
I am not aware that this is true on 2000.
> What i don't understand: calling DefWindowProcW with argument WM_SETTEXT
> works under Windows XP (i get a Chinese caption on an English Windows
> version), but not under Windows 2000 (i get question marks).
Exactly. And you will have more problems like this.
Mixed calls are major pita, way more than migrating to Unicode.
You must use RegisterClassW, and you must have a
"clean Unicode message pump" (GetMessageW/DispatchMessageW)
But my promise is: fix this one, and you will find another one.
Having spent the last 6 weeks doing a Unicode conversion I have to
speak up here...
It *may* be easy to convert them!
It really depends on the application in question. I've converted some
of my own projects to Unicode in a few hours, but this project is a
dog to do - it is taken weeks and I'm only now starting to debug it.
Dave