mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I have written a DLL that sets the Treebar font and font size. Only problem is that icons don't center in it's available height when the font size is larger than default.



It would also be nice if the icons could be scaled in size, I have no idea if that is possible either. grin

I'm not very comfortable with using WM_PAINT. With that in mind, can anyone offer any suggestions that could fix these problems? You can download my source here if you want to.


NaquadaBomb
www.mirc-dll.com
Joined: Jan 2003
Posts: 249
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
Just override the NM_CUSTOMDRAW handler for the parts you want to modify. This message is sent multiple times for each stage of the drawing process of the control and each item. Intercept what you want to draw yourself and let the control draw the rest itself.

You can thus draw bigger icons, center them vertically, etc.

Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I tried that, yet Khaled code is drawn as well (slightly offset horizontally), I think because he is modifying the treeview control's WM_PAINT message directly, instead of using custom draw. I've test my custom drawing code with an unaltered treeview control and it works great.


NaquadaBomb
www.mirc-dll.com
Joined: Nov 2006
Posts: 3
M
Self-satisified door
Offline
Self-satisified door
M
Joined: Nov 2006
Posts: 3
Hey NaquadaServ, do you have any intentions updating this to the new mIRC? I would like to use it as treebar fonts are still not skinned properly. Thanks!

Joined: Sep 2003
Posts: 35
O
Ook Offline
Ameglian cow
Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 35
Originally Posted By: NaquadaServ
I tried that, yet Khaled code is drawn as well (slightly offset horizontally), I think because he is modifying the treeview control's WM_PAINT message directly, instead of using custom draw. I've test my custom drawing code with an unaltered treeview control and it works great.


I've managed to take over the drawing of treebar items from mIRC by subclassing the mIRC_Treebar window & the child treeview control.
Then having the NM_CUSTOMDRAW notification sent to the treeviews parent (mIRC_TreeBar) return CDRF_DODEFAULT & the WM_ERASEBKGND message sent to the treeview control itself return FALSE

The normal treeview commands then work fine for changing the controls appearance (icons, colours, etc...)

The problem i'm left with is how to tell which type of window a given item refers too when trying to decide which icon to draw as all items have icon zero set.


Link Copied to Clipboard