I finally gave up on this approach. The TCTOOLBAR command with the /W option does not work correctly. In both versions 25 and 27, when I specify a simple file name (tctoolbar /w temp.txt), no file is written out, even when I have a very complex toolbar with multiple tabs and buttons clearly visible. If I use a file name with a path (tctoolbar /w c:\temp.txt), a file is created. But now I discovered that it does not necessarily contain the data for the currently visible toolbar. When I started up TCMD, no toolbar appeared. I then issued the command, and a file was written with what looked like the content of the toolbar I wanted to have but which was not visible.
My new approach is to test for the first TCC tab in TCMD. In that case, I clear and reload the toolbar from my configuration file. After that, new TCC tabs leave the toolbar alone, so it stays in the tab I have selected instead of reverting to the first tab.
Rex, can you explain what is going on with the /W option?