Hi @teadrinker,
Sorry for taking so long to respond, but it has, in fact, taken me this long to find something that works...I think.
I tried WinSet back in March, but it did not solve the problem consistently. In addition to your
Sleep,100 suggestion, I tried a half-dozen other values...some lower...some higher...with same result...works a lot of the time, but not all of the time (also tried no sleep, which caused the background to fail immediately and consistently). Also, this approach created an annoying flicker, although I may have been willing to live with it if it had solved the problem.
I then hit on the idea of simply doing a second
Gui,Show. That worked...until it didn't.
Then went to a third
Gui,Show, then five, then ten. It was getting so crazy, I created a variable for the
Gui,Show count, which I tried as high as 20. Turns out that 10 was the best during testing, but still got the occasional failure.
Over the past two days, I think I found the answer...via dumb luck. I got the usual failure, then happened to click on one of the colors with no background and, voilà, the background color appeared. Clicked on several other colors...each time, the background color appeared. Seems that giving it focus created the background. So, I put a simple loop in my program with a
GuiControl,Focus,%Color% for each color. After the loop, I added a
GuiControl,Focus for the item that I actually want to have focus (and the default). The performance is fine (can't see the focus loop doing its thing), there is no flicker, and, so far...no failures...in two days, across several machines, including W7, W8.1, W10, and W11.
It's too early to declare victory, but I have high hopes. Will post back here if any failures occur. Thanks again to everyone who helped in this thread. Regards, Joe