Abuse of WM_WININICHANGE?
Abuse of WM_WININICHANGE?
I'm using Delphi action toolbars (like Delphi IDE does) and it is already for quite some time that I noticed continues refresh/redesign on IDE menu/toolbars (or on my software menu/toolbars). I took some time to investigate and I discoverd that sysop/other applications fires often the WM_WININICHANGE message and it is broadcasted to all open windows. Delphi action toolbars react to that message redesigning themselvs. If this message is managed when I'm selecting a menu item I get AVs.
I don'tn know if it is the best way to do it but I solved this annoying refresh, setting the Application.UpdateFormatSettings and Application.UpdateMetricSettings variables to false.
Just for fun if you want to simulate the case open internet explorer settings and clear the cronology/cache/..: while you are doing that take a look at Delphi IDE toolbars...
I'm using Delphi action toolbars (like Delphi IDE does) and it is already for quite some time that I noticed continues refresh/redesign on IDE menu/toolbars (or on my software menu/toolbars). I took some time to investigate and I discoverd that sysop/other applications fires often the WM_WININICHANGE message and it is broadcasted to all open windows. Delphi action toolbars react to that message redesigning themselvs. If this message is managed when I'm selecting a menu item I get AVs.
I don'tn know if it is the best way to do it but I solved this annoying refresh, setting the Application.UpdateFormatSettings and Application.UpdateMetricSettings variables to false.
Just for fun if you want to simulate the case open internet explorer settings and clear the cronology/cache/..: while you are doing that take a look at Delphi IDE toolbars...
Lars Fosdal maybe could be an impression of mine but I think that in Windows 10 the frequency is higher then previous Windows versions.
ReplyDeleteDavide Angeli Not unlikely. I am currently on 8.1, and it is pretty frequent there as well.
ReplyDeleteDavid Millington I just did little debug: WM_WININICHANGE is managed in TApplication.WndProc calling the CheckIniChange method. This method calls Screen.GetMetricSettings in which is recreated the FIcontFont.Handle and this assignement broadcast to other open windows a CM_SYSFONTCHANGED. This message is the one that is managed in TCustomActionBar to force the redraw. I don't know why this is done.
ReplyDelete