Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Unicode text in Form Captions?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Unicode text in Form Captions?

 Post Reply Post Reply
Author
Message
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Topic: Unicode text in Form Captions?
    Posted: 14 May 2008 at 6:29pm
I wasn't sure where to post this question, so I figured the best place was in the general SuitePro forum.
 
I'm evaluating v12 of the ActiveX Suite Pro, and the only question I have before I decide to buy it is this: is there any way I can set the caption of a VB6 form to a Unicode string?
 
My app has the UI translated into several languages (which the user can change at runtime), but in the past we had run into the problem of not being able to display text that wasn't in the system's default ANSI codepage. So I was basically stuck with translating the UI into Western languages.
 
When I discovered that Suite Pro came with Unicoede versions of the controls, I was extremely happy. However, I still have the problem of setting form captions to Unicode strings, and none of the controls in the suite seem to handle this. I came across a product called UniToolbox which does this, but unfortunately it doesn't work too well with the themed title bar used by the RibbonBar (the caption shows extra characters, as if WM_GETTEXT was returning extra rubbish).
 
Any ideas? If I could get this sorted out, I'd be the happiest developer in the world!
 
PS. Congrats to CodeJock on an amazing product (and in particular on the controls added between v11.2 and v12).
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2008 at 8:43pm
This topic may help:
https://forum.codejock.com/forum_posts.asp?TID=2542

See my post 12th May for code.
Back to Top
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2008 at 9:24pm
I had already seen your post, but your solution only seems to work for MDI child forms - I've tried it on normal forms and MDI parents and it doesn't seem to do anything (all I get are the usual ???s).
 
After posting my message I played around some more with the UniToolbox controls, and adding an extra null character at the end solved the problem with the themed caption for the RibbonBar, so I'm that much closer.
 
Judging from how UniToolbox's UniCaption control appears to work even when the RibbonBar does its own custom painting, I'm wondering what they're doing behind the scenes. For a normal form, I would imagine that subclassing the form and calling DefWindowProcW for the various messages involved (WM_NCPAINT, WM_NCACTIVATE and WM_SETTEXT) might do the trick, but I don't know how they manage not to interfere with the custom drawing that the CJ control does - maybe it's just a matter of handling WM_GETTEXT too?
 
I'll be working on this tomorrow, so as soon as I work it out I'll let you guys now.
Back to Top
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 3:05pm
Confirmed!
 
Calling DefWindowProcW with WM_SETTEXT is only part of the trick - you need to subclass the window to redirect WM_NCPAINT to DefWindowProcW too (to prevent VB from calling DefWindowProcA).
 
Now I need to try this with the themed RibbonBar...
 
Edit: Getting this to work with the RibbonBar is simply a question of processing WM_GETTEXT and WM_GETTEXTLENGTH.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.