After step 3 there will be a redraw error in the menu (the white rectangle in the picture), but it will disappear if you move focus to TC's window. But after step 4, buttons in menu bar will shrink and it stays that way until you restart TC or switch back to Aero.
Image: http://i1057.photobucket.com/albums/t399/uumbra8/TC/bugs/changetheme.jpg
BTW, TCx32 makes funny colors during these changes but it always ends up in a correct state after a second or two.
Indeed you need to restart the 64bit version after such changes, sorry. It's a problem somewhere deep in Lazarus, I don't have the time to debug that in detail. I will make a short check, but cannot promise anything.
Unfortunately I could not reproduce the problem. I tried with my own settings and with a fresh ini, and with beta 20, 15 and 10 (all 64-bit), no problem at all. It may be a timing problem on your system, e.g. TC gets the notification when the new theme isn't active yet. Or maybe it's a problem with your settings. Do you get this also with a fresh wincmd.ini?
Here is a screen-capture so you can see what I mean: video
There is TCx32, TCx64 and Notepad (for reference). Also I always test with clean ini.
It may be a timing problem on your system
It is possible, because when I repeated it over 20 times, three or four times the error did not happen. Hard to tell why - as far as I can remember, every time I repeated the same steps.
However this applies only to the shrunk menu in TCx64. The other redraw errors happened every time.
Hmm, when I tried to reproduce it in a virtual machine (which is obviously a bit slower) I got inverted results - the shrunk menu buttons appeared only a few times, most of the time not. I'll try to get another real machine and test it there.
EDIT
On a different computer (different HW, same OS) it behaves similarly to my virtual machine - the bug appears only rarely.
Last edited by umbra on 2012-02-24, 22:32 UTC, edited 1 time in total.
Ok, it's starting to be a little bit confusing here, so I've decided to create a separate bug report for the redraw issue (the upper half of image in my first post).
About the shrinking menu items, I did a little debugging and I can answer the question, why they do it. But no, don't get excited, I don't have a solution. But for the record:
When the function for measuring item size is called after switching to Classic theme, sometimes Lazarus still thinks that themes are enabled. So it calls another function for measuring themed menu items, it fails and returns zero. I didn't investigate why, because that is not the source of the problem. Few strategicaly placed OutputDebugString() calls in WindowProc revealed, that sometimes WM_MEASUREITEM for all menubar items come before WM_THEMECHANGED. It explains it. But the real question is how it's possible. System sending messages in wrong order doesn't seem likely and I'm not sure if application has any chance to reoder them somehow. So unfortunately, no happy end yet.
OK, I will try to call DrawMenuBar delayed with a timer after receiving WM_THEMECHANGED. I wonder whether these is any kind of MeasureMenuBar command which would force Windows to send again WM_MEASUREITEM for each item...
I can confirm that. I tried changing themes with running TC and separate Lazarus application. And menu in TC stayed correct even when the one in Lazarus application shrinked.