I'm experiencing a very weird problem with VCL styles. Sometimes, when either starting the program with a predefined style, or setting one later on, one or some of the program windows dissapear.
This happens very randomly, maybe once every 10-20 times, and not in any specific window. I have 2 forms open at runtime, sometimes it's one, sometimes the other.
When this happens, I check some properties while the window is not visible, the Visible property is true, the window boundaries are correct; if I try to show the window through Aero DWM live thumbnails.. it's also empty; if I capture the window DC however, I get a bitmap with the window as if it was showing normally (and the style has been applied).
It doesn't show any errors, no warnings, no exceptions.. nothing seems wrong, just the window isn't there. If I hover the mouse over the taskbar button to see a preview, it shows the box, but it's empty.
Any ideas what to check?
Edit: calling RecreateWnd fixes the issue as a temporal workaround, however, it might fail again.