Forum Discussion

North-E's avatar
North-E
Occasional Contributor
15 years ago

BuiltIn object's color properties

Hello all!



I'm TestComplete 7.5 user, and my problem is that I can't receive system colors from BuiltIn properites.



function Test()

{

  Log.Message(BuiltIn.clYellow);

  Log.Message(BuiltIn.clWindow);

  Log.Message(BuiltIn.clBtnFace);

}



This simple test logs the following numbers: 65535, -16777211, -16777201.

The first one is seemed to be ok, but what are the signed numbers for system colors?

Thank you...

4 Replies

  • Hi Dmitriy,



    Actually, this is correct. Such constants as clWindow don't have static colors assigned to them. The color is identified dynamically at run time according to the system settings, so they have special values. You will see the same behavior if you look at the values of these constants in Delphi, for example.

  • North-E's avatar
    North-E
    Occasional Contributor
    Hm, does it mean that these properties are useless for getting system colors?
  • Hi Dmitriy,



    If you want to get a numeric color value, these constants seem to be useless. You can do this by using the GetSysColor API function.

    For example:

    Log.Message(Win32API.GetSysColor(Win32API.COLOR_WINDOW));