After applying a new style at runtime the MainForm of my application creates a new window handle – is there any way to stop this or reassign the Handle as I a getting a tonne of the following error:
'System Error. Code: 1400. Invalid window handle'
Is there any way to manipulate the process that forces the new handle to be assigned?
I solved this doing the following:
My main form created an unseen 'helper' form that is never displayed, but that does have visual components - it was throwing the handle error when it was trying to redraw these visual components, so I replaced the relevant components with objects instead (note I did not write this code originally).