1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 07:43:50 +00:00

Fixed Alert and MessageBox on windows to work with non-english characters

This commit is contained in:
Bryan Roe
2020-06-09 15:45:46 -07:00
parent fedd70072b
commit 946bbd5cb9
2 changed files with 10 additions and 9 deletions

View File

@@ -128,9 +128,10 @@ function messageBox()
case 'ALERT':
this.GM = require('_GenericMarshal');
this.user32 = this.GM.CreateNativeProxy('user32.dll');
this.user32.CreateMethod('MessageBoxA');
this.user32.CreateMethod('MessageBoxW');
layout = msg.command == 'YESNO' ? (MB_YESNO | MB_DEFBUTTON2 | MB_ICONEXCLAMATION | MB_TOPMOST | MB_SYSTEMMODAL) : (MB_OK | MB_DEFBUTTON2 | MB_ICONEXCLAMATION | MB_TOPMOST | MB_SYSTEMMODAL);
this.user32.MessageBoxA.async(0, this.GM.CreateVariable(msg.caption), this.GM.CreateVariable(msg.title), layout)
this.user32.MessageBoxW.async(0, this.GM.CreateVariable(msg.caption, { wide: true }), this.GM.CreateVariable(msg.title, { wide: true }), layout)
.then(function (r)
{
try