Author Topic: Microsoft makes progress on MessageBox  (Read 1228 times)

jj2007

  • Member
  • *****
  • Posts: 8776
  • Assembler is fun ;-)
    • MasmBasic
Microsoft makes progress on MessageBox
« on: November 25, 2017, 05:48:18 AM »
Fascinating stuff...
Code: [Select]
include \masm32\include\masm32rt.inc

.data
HelpID dd 123456789
mbxp MSGBOXPARAMS <MSGBOXPARAMS, 0, 0, 1, 2, MB_YESNOCANCEL or MB_HELP, 0, 0, 0, 0>

.code
cbMbx proc uses esi arg
  mov esi, arg
  mov eax, [esi.HELPINFO.dwContextId]
  invoke MessageBox, 0, str$([eax]), chr$("cbMbx"), MB_OK
  ret
cbMbx endp

start:
  mov mbxp.lpszText, chr$("This is a text") ; 1
  mov mbxp.lpszCaption, chr$("This is a title") ; 2
  mov mbxp.dwLanguageId, LANG_ENGLISH ; *** you can specify your language here ***
  mov mbxp.dwContextHelpId, offset HelpID
  mov mbxp.lpfnMsgBoxCallback, cbMbx
  invoke MessageBoxIndirect, addr mbxp
  exit
end start

Win32.hlp, June 1998:
Quote
Note that each localized release of Windows typically contains resources only for a limited set of languages. Thus, for example, the U.S. version offers LANG_ENGLISH, the French version offers LANG_FRENCH, the German version offers LANG_GERMAN, and the Japanese version offers LANG_JAPANESE. Each version offers LANG_NEUTRAL. This limits the set of values that can be used with the wLanguageId parameter.

MSDN, November 2017:
Quote
Note that each localized release of Windows typically contains resources only for a limited set of languages. Thus, for example, the U.S. version offers LANG_ENGLISH, the French version offers LANG_FRENCH, the German version offers LANG_GERMAN, and the Japanese version offers LANG_JAPANESE. Each version offers LANG_NEUTRAL. This limits the set of values that can be used with the dwLanguageId parameter.

And then there is MessageBoxEx (Win32.hlp, 1998):
Quote
The MessageBoxEx function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons. The wLanguageId parameter specifies which set of language resources is used for the predefined push buttons.

However: Currently MessageBoxEx and MessageBox work the same way ::)

Don't despair, according to user Leo Lei (in Community Additions)
Quote
"Windows 2000 will have the ability to display the pushbutton text in the language specified in wLanguageID."

AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #1 on: November 25, 2017, 06:12:59 PM »
If you have the language pack installed it will work for that language.  :t


jj2007

  • Member
  • *****
  • Posts: 8776
  • Assembler is fun ;-)
    • MasmBasic
Re: Microsoft makes progress on MessageBox
« Reply #2 on: November 25, 2017, 10:14:40 PM »
If you have Windows Ultimate, that is. Not available for ordinary mortals :(

But wait, there is a free language pack for Luxemburgish :t

AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #3 on: November 25, 2017, 11:15:22 PM »
Not free anymore, Black Friday is over.  :(

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5850
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Microsoft makes progress on MessageBox
« Reply #4 on: November 26, 2017, 12:23:21 AM »
Unless you have heard something that I haven't the last Windows Ultimate version was Win7 64 bit. I have a retail version on my old i7 and it was among the reasons why I intentionally blocked the attempt to force the Win10 upgrade as I did not want a $400.00 plus edition that worked perfectly PHUKED by a shitty update.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #5 on: November 26, 2017, 01:19:18 AM »
Unless you have heard something that I haven't the last Windows Ultimate version was Win7 64 bit. I have a retail version on my old i7 and it was among the reasons why I intentionally blocked the attempt to force the Win10 upgrade as I did not want a $400.00 plus edition that worked perfectly PHUKED by a shitty update.
The restriction on language packs does not exist anymore in Windows 10. Both Home and Pro versions can add them.

Vortex

  • Member
  • *****
  • Posts: 1851
Re: Microsoft makes progress on MessageBox
« Reply #6 on: November 26, 2017, 07:43:32 PM »
The Vistalizator tool changing the display language :

Quote
Did you buy a Windows laptop from abroad and want it to talk to you in your mother tongue?

Try Vistalizator - this tool allows you to change display language in Windows editions other than (officially supported) Ultimate, like Starter, Home Basic, Home Premium and Business/Professional.

Vistalizator overrides the limit of one MUI language on non-Ultimate Windows editions.

http://www.froggie.sk/en/index.html

jj2007

  • Member
  • *****
  • Posts: 8776
  • Assembler is fun ;-)
    • MasmBasic
Re: Microsoft makes progress on MessageBox
« Reply #7 on: November 26, 2017, 08:11:29 PM »
@José: I tried on Win10 but get a message that the LIP is corrupted ::)

@Erol: Thanks, looks interesting but here it reveals that your choices are extremely limited. For example, having English and Italian at the same time is apparently not possible :(

I am not that keen anyway to install something unofficial on this machine, there is too much valuable stuff on it. Sometimes it would be handy, because I get Italian error messages, for which you get little support by our friend G°°gle. And the built-in Windows "help" is a joke and has always been a joke.

IMHO it's a dumb decision by Micros**t to limit a computer to one language. One language pack is 4MB, they could include one-hundred languages and nobody would notice that their harddisk has lost 0.4GB of free space.

AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #8 on: November 26, 2017, 08:31:46 PM »
Here it shows English and French at the same time. However, if I add Spanish it will not. It can only speak Spanish MessageBoxes when the default language is Spanish.



AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #9 on: November 26, 2017, 09:32:15 PM »
On the other hand, when the default language is Spanish it accepts as well English and French MessageBoxes.




hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5850
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Microsoft makes progress on MessageBox
« Reply #10 on: November 26, 2017, 09:39:19 PM »
Does this sound like a good reason to roll your own ?  :biggrin:

I remember with XP SP3 having to download a massive number of East Asian fonts and installing them so I could at least display non western characters.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

AW

  • Member
  • *****
  • Posts: 1509
  • Let's Make ASM Great Again!
Re: Microsoft makes progress on MessageBox
« Reply #11 on: November 26, 2017, 10:01:19 PM »
Does this sound like a good reason to roll your own ?  :biggrin:

I remember with XP SP3 having to download a massive number of East Asian fonts and installing them so I could at least display non western characters.

Once, I was convinced to produce a Japanese (Shift JIS, not Unicode) version of some software. Believe me, it did not pay for the time. It is still online here