In Delphi 2007, you may notice some newer color constants towards the end of the list, with names like clMenuBar and clMenuHighlight. Beware! These color constants aren’t supported on Windows 2000, and they render as black. Since the default menu text is also black, this makes the menus rather tough to read! If you use them then you should detect Win2000 (and possibly earlier OSs) in code and replace them with a supported constant such as clBtnFace.
-
RSS Links
Categories
-
Recent Comments
- Craig Stuntz on LINQ to SQL : Entity Framework :: WinForms : WPF
- tcmaster on LINQ to SQL : Entity Framework :: WinForms : WPF
- Giel on My CodeRage Presentation: Functional Programming in Delphi 2009
- Craig Stuntz’s Weblog : My CodeRage Presentation: Functional Programming in Delphi 2009 on Implementing Memoize in Delphi 2009
- Paweł Głowacki : Delphi 2009 Online Resources on An Enumeration of Prime Numbers with Anonymous Methods
-
{ 2 } Comments
Good to know, although I always thought Delphi should detect that for us behind the scenes and gracefully degrade. There were a few other times I had seen OS version specific features. Like the new Vista dialogs, they just throw an exception if you are not on Vista.
it’s better to use the following check:
var
B: BOOL;
….
if SystemParametersInfo(SPI_GETFLATMENU, 0, @B, 0) and B then {use clMenuBar} else {use clBtnFace};
Post a Comment