Recently I discovered a small glitch with e.g. Workbench console output window. While Workbench opens this window, the window title is empty (NULL pointer). There is a slight delay and then the window title is set. There is no difference with windows opened by Workbench directly or by the program itself if this program uses Open() to make up the console window. So, most likely this glitch is located within console-handler?
This glitch breaks some programs which try to change the window title, due to a race condition. For example, the (rather old) Telnet client found at os4depot.net.
I know, it isn´t very clever to do those changes as this "crosses the border" between individual process´ resources, which shouldn´t be done at all (I don´t do this in my own programs).
I would use either a pointer check prior to the window title change, but this would break the title change functionality in whole, or I could use a Delay() to prevent the race condition happening, but this would introduce an user-annoying pause and an additional possibility for a different race condition.
But as there are such programs, still in use, I would like to ask, if there is a recommended way to change the window title of a newly opened console output window in a safe way.