Re: Potential issue with message_box() function
- Posted by petelomax Feb 17, 2016
- 1699 views
Hmm. Quite amazing something that old, that simple, and that heavily used could be hiding that for quite so long..
First off, clearly it is a serious omission that you cannot supply a better hwnd to message_box() if you know one. I was thinking of a 4th defaulted parameter, and a new set_mb_hwnd() routine to allow an app to make the top-level window (or whatever) the default in all future message_box() calls.
Secondly, I'm a bit shocked and dismayed that Raymond Chen - the Raymond Chen, mind you, (bit of a big-time fan of his) did not mention MB_TASKMODAL, as that seems to be the thing you need when hwnd is NULL, assuming you want it to be modal. According to the docs, it suspends all top-level windows associated with the current thread. I've even gone so far as to (add said 4th param, rip out GetActiveWindow,) and add
if hWnd=NULL then style = or_bits(style,MB_TASKMODAL) end if
to my copy of msgbox.e - and I guess I'll find out in the next few days if there's anything amiss with that.
Pete