I use several WinAPi functions which needs the Handle of the form in order to work, due which the handle of the form is recreated when the vcl styles is changed many of the calls to these functions stop working. So I need a way to detect when the current vcl style is modified (changed) in order to update the calls to these functions.The question is How detect when a vcl style is changed?
I use several WinAPi functions which needs the Handle of the form in order
Share
When a vcl style is changed via the
TStyleManager.SetStylemethod aCM_CUSTOMSTYLECHANGEDmessage is sent to all the forms of the application, then that messgae is processed in theWndProcmethod of the form and then aCM_STYLECHANGEDmessage is sent to inform which the vcl style has changed, so you can listen theCM_STYLECHANGEDmessage to detect when a vcl style has changed.Try this sample Code.