Forum Discussion

MulgraveTester's avatar
MulgraveTester
Frequent Contributor
9 years ago

How do I get forground and background colour of a text object inside of a code-Jock SysListView32

I need to test the foreground and background colour of text in a ListView table. The listView will be displaying alarms so each cell in this table may have a different foreground and background colour depending on the alarm.

 

The listView is a code-jock object so I have to use text recognition to find the text, which I have already done. Once the text is found I see no properties or styles to help me get the colour. How do I determine the foreground and background colours for text in each cell of this table?

 

My tests are written in VBScript.

All ideas are welcome.

 

Thanks.

 

4 Replies

  • Aaaargh!

     

    Someone posted a routine they'd written a while back. The routine effctively tested the colour of any given pixel on the screen and returned either RGB or HEX values for it.

     

    So, assuming you have screen co-ordinates for the area you want to check, you would be able to use this.

     

    BUT ......

     

    I've just had a search and I can't find the post! Sorry!

     

    I'm hoping by posting this, it will jog someone elses memory who does know the routine I'm talking about and they can point you towards it.

     

    Fingers crossed .....