mIRC Homepage
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.
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.
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.
Posted By: me0w Re: Changing the font size of the treebar items - 19/08/07 09:22 AM
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!
Posted By: Ook Re: Changing the font size of the treebar items - 26/08/07 02:12 PM
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.
© mIRC Discussion Forums