Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Issue with MSGBOX

Jun
762
16
I have had a problem when I run a script that issues a MSGBOX command in a TCC tab in TCMD. If another tab is active when the msgbox opens, I cannot change to the msgbox tab to click a button. Does someone know a solution for this?
 
You could use "start" before the msgbox command.

For example:
Code:
start /min MSGBOX /M /1 OK "Test-Box" Test-Box-Text
Disadvantage: you will have to close the seperate TCC window then somehow ... (you CANNOT use EXIT there, it doesn't works).

So a BIT better would be:
Code:
start /tab MSGBOX /M /1 OK "Test-Box" Test-Box-Text
to start at least within a new TCMD tab ...
 
Last edited:
I have had a problem when I run a script that issues a MSGBOX command in a TCC tab in TCMD. If another tab is active when the msgbox opens, I cannot change to the msgbox tab to click a button.
That's a pretty sad state. I couldn't do anything with TCMD or the two TCCs in it. If I go elsewhere and forcibly kill the TCC which I asked to show the MSGBOX, TCMD is still inoperable. If, again from the outside, I kill the other (non-msgbox) TCC, everything dies (both TCCs and TCMD). If I kill TCMD then I have to deal witj two orphaned TCCs.
 
Yes. A new tab works. You could also switch to the msgbox tab with KEYSTACK Alt-Left (maybe) before issuing MSGBOX but that would probably be troublesome. I wonder if there's a way to switch to a tab by title.
 
Yes, I tried to switch to another tab - till now without success ...
 
This issue came up because I wrote a little timer script for when I'm taking eye drops. One has to wait at least five minutes between drops. At the end of the delay in a thread, an alert sounds, but in case I've stepped away from the computer, I pop up a message box. When I switched to another TCMD tab and the alert sounded, I found that TCMD was effectively dead, since there was no way to switch back to the tab with the message box. (Actually, for the simple message box I was using, I think that I could press the ENTER key to close the box, though I don't remember for sure. I now run the timer in a standalone TCC task while I continue to work in TCMD.

I don't know if there is something that Rex can do to make it possible to switch tabs after a message box has opened in a tab, or to make the message box pop up above all the TCMD tabs.
 
Last edited:
@Jay Sage

Yes, had the same behaviour. Because that, I posted workaround above - this works here. You tried?
 
Used to be that you could Alt-Tab to the message box. Looks like that's no longer the case...?
 
No, unfortunately, Alt-Tab doesn't work in this case. You CAN switch to TCMD but you can't switch to the message box, because the complete TCMD is "freezed".
 
This is waaaaay more complicated than it appears. There are several factors here:

1. A messagebox is either app modal (default) or global modal.
2. TCC and TCMD do a lot of tricky back & forth communication so that dialogs / popup windows / property sheets / messageboxes appear only in the tab window where they were invoked. (Obviously not something that can be done in Windows Terminal, though Microsoft probably hasn't thought a lot about console apps displaying GUI windows.)
3. In order to show the window in the centered and in the proper TCMD tab, TCC sets the parent window of the messagebox to the TCMD tab window.
4. Because the messagebox is app modal, Windows blocks everything in the parent window (i.e., TCMD) from doing anything until you dismiss the messagebox.

After a lot of "heuristics", I have an only moderately awful kludge in the next build that subclasses the messagebox and re-enables the appropriate TCMD windows and menus.
 
Another piece of @Rex magic! The kludge seems to work. After the message box pops up an another tab, I am able to switch to it and engage with the message box.
 
Back
Top