Ask a Question

BuiltIn object's color properties

North-E
Occasional Contributor

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 4
YMinaev
Staff

RE: BuiltIn object's color properties

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.

------
Yuri
TestComplete Customer Care Engineer

North-E
Occasional Contributor

RE: BuiltIn object's color properties

Hm, does it mean that these properties are useless for getting system colors?
YMinaev
Staff

RE: BuiltIn object's color properties

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));


------
Yuri
TestComplete Customer Care Engineer

North-E
Occasional Contributor

RE: BuiltIn object's color properties

Thank you, Jared.

I will do it this way...
cancel
Showing results for 
Search instead for 
Did you mean: