Skip to content

clMenuBar Renders Black on Windows 2000

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.

{ 2 } Comments

  1. Jim McKeeth | February 29, 2008 at 5:36 pm | Permalink

    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.

  2. Maksym Pyatnytskyy | March 1, 2008 at 4:23 pm | Permalink

    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

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 1846 access attempts in the last 7 days.

Close