jacQues Posted August 10, 2009 Share Posted August 10, 2009 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 Link to comment Share on other sites More sharing options...
Authenticity Posted August 10, 2009 Share Posted August 10, 2009 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. Link to comment Share on other sites More sharing options...
jacQues Posted August 10, 2009 Author Share Posted August 10, 2009 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now