Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Changing the color of each individual box in a list-view

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
bhpianist
Cheater
Reputation: 1

Joined: 17 Apr 2010
Posts: 38

PostPosted: Thu Jul 08, 2010 11:20 pm    Post subject: Changing the color of each individual box in a list-view Reply with quote

How do I tell which box of the list-view it's coloring & handle the WM_CTLCOLOR* message accordingly?

For example:


How can I color Item 1 red, Item 2 orange, Item 3 yellow, and so on?
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jul 11, 2010 8:14 am    Post subject: Reply with quote

Some examples of getting it done:
http://www.codeproject.com/KB/list/CColorListCtrl.aspx
http://www.developer.com/net/cplus/article.php/637411/Personalizing-Highlight-Colors-Through-Custom-Draw.htm

First one is MFC but, you should be able to pick out the important pieces (since MFC is just wrappers anyway).

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
bhpianist
Cheater
Reputation: 1

Joined: 17 Apr 2010
Posts: 38

PostPosted: Tue Jul 13, 2010 11:06 pm    Post subject: Reply with quote

Thanks.

Next, do you know how I could color the box partially?

Basically I saw a trainer where the HP bar was in a list-view and it colored the percentage of health remaining; it looked very cool.

EDIT: Also, do you know how to change the text color? Neither of those articles covered that Sad
EDIT 2: I am raged. I hate owner-drawing.
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Jul 14, 2010 2:02 am    Post subject: Reply with quote

bhpianist wrote:
Thanks.

Next, do you know how I could color the box partially?

Basically I saw a trainer where the HP bar was in a list-view and it colored the percentage of health remaining; it looked very cool.


Look into subclassing and drawing controls inside of other controls. You can use a progress bar to draw inside a Listviews table cells.

bhpianist wrote:
EDIT: Also, do you know how to change the text color? Neither of those articles covered that Sad
EDIT 2: I am raged. I hate owner-drawing.


Personally I have never done it, but if it is like other controls you will need to use the WM_COLORCTLxxxxxxx events. (Not sure if that's the exact name, but it should be similar to that for them.) Which you can find various information regarding how to use those.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites