Jump to content
Sign in to follow this  
jacQues

Unicode with GuiMenu.au3?

Recommended Posts

jacQues

This week I was writing an application in AutoIt, using all kinds of fancy things. And everything works perfect; AutoIt rocks!

Just one thing is nagging me. The application is multi-lingual and some of them I cannot read. lol Fancy symbols all over the place using UniCode except when using _GUICtrlMenu_AddMenuItem() and _GUICtrlMenu_TrackPopupMenu(). I looked at the source in GuiMenu.au3 but cannot find anything to adjust this. In English and most other languages the menu is fine...

The strings passed to _GUICtrlMenu_AddMenuItem() are the exact same as that are passed to other GUI functions, which are collected from a database and stored in an array. So I know for sure its not the encoding or anything.

So, is this a known issue? Maybe there is already a fix? Or is this a Windows limitation? (I am using XP)

jacQues

Share this post


Link to post
Share on other sites
Authenticity

The _GUICtrlMenu_AddMenuItem(), has this line, among others:

DllStructCreate("char Text[" & StringLen($sText) + 1 & "]")

...so try changing it to wchar instead, or better, add your own flag to check if to use char or wchar.

Share this post


Link to post
Share on other sites
jacQues

The _GUICtrlMenu_AddMenuItem(), has this line, among others:

DllStructCreate("char Text[" & StringLen($sText) + 1 & "]")

...so try changing it to wchar instead, or better, add your own flag to check if to use char or wchar.

Thank you thank you!!

DllStructCreate("wchar Text[" & (2*StringLen($sText)+1) & "]")

Then, instead of "InsertMenuItem" use "InsertMenuItemW" and everything works... W007

jacQues

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×