>Hi Fabio!
>
>Did you find a Solution?
>We have the Same behavior sometimes...
>
>>We have this problem.
>>When the program executes a MessageBox,
>>the message window does not appear in the foreground.
>>By pressing ALT in some cases it appears, but very often
>>we have to try several times.
>>
>>Does anyone have a solution?
Don't use messagebox. It's a foreign body, a form outside the app, the whole app loses focus, and besides it's so limited - you don't even get to define the buttons, you get to choose a combination of preset buttons. And the return values make no sense, why would 6 mean "yes"? And now with M$ changing its mind several times about new app windows taking focus or not, you can't even rely on messagebox always showing up.
Which is why I wrote alert.prg (
https://www.levelextreme.com/Home/ShowHeader?Activator=17&ID=9445), or why Frederico Tomazetti adapted it into alert2:
https://www.levelextreme.com/Home/ShowHeader?Activator=17&ID=16185.
BTW, later this year that piece of code will be 25 years old.