I am unable to open a MsgBox with focus under Windows 10.
I use VBA 6 (Sax ActiveX Scripting Control, © 1993-2006, Polar Engineering) to write commands for Dragon speech recognition software. These "commands" are small programs triggered by specific verbal utterances. I have observed the problem described below in literally hundreds other computer installations.
The commands are written within and executed from the Dragon application. I have written several hundred commands that incorporate the MsgBox function.
Under Windows XP, dialog boxes created using MsgBox worked properly.
However, under Windows 7, such boxes do not gain focus (do not appear in the foreground); instead, they remain "trapped" on the taskbar. Altering the ForegroundFlashCount and ForegroundLockTimeout registry entries (HKEY_CURRENT_USER\Control Panel\Desktop) resolves the problem.
Under Windows 10, the above registry hack does not solve the issue.
It is my understanding a MsgBox call, by default under Windows 7 and Windows 10, can only be granted focus if executed from the program which has focus. However, since Dragon runs in the background, it never has focus.
I noticed the MsgBox button argument vbSystemModal forces the dialog box onto the screen, but without focus. Therefore, this does not resolve the problem. vbMsgBoxSetForeground does nothing.
It appears that the custom dialog boxes I create are usually granted focus. However, it would be extraordinarily time consuming to rewrite hundreds of such dialog boxes.
Does anyone know of a fix/hack or have any suggestions?