I derive a my own drawn button from CButton
When I used GetCtrlManager().InstallHook()
my own drawn cannot work as it was.How did I
disable the button function of yours and didn't
effect other's controls?
It's really cool job!
But studying this work, I wonder why there isn't virtual destructor for CCMControl... The classes inherited from CCMControl are deleted in RemoveControl(), but they are the type of CCMControl. So they are destructed as the object of CCMControl type, right? Is it safe for the memory leakage?
Yes, indeed it is an excellent set of codes. Thank you very much for sharing such knowledge. However, it seems to have a minor glitch in displaying horizontal scroll bars. When the control is not active, it displays a combination of both the original and the new control. The thumb doesn't seem to appear in a single location thus producing a duplicate image. I'll try to trace the problem but since this is your work, you maybe able to track it faster than I could. And if you want a snap shot of the said control, please tell me and I'll email you the image.
Hi, first an excellent piece of code, with which I am very happy.
When the check is made for "SysTabControl32" I suggest a loop which then calls AddControl() for
ALL children of the tab control, not just the first child found. The first child is not always the up-down
control, which is optional.
I use a lot of tab controls with Edit / List / Tree controls set to have the tab control as the parent.
I suggest this code after the check for "SysTabControl32":
// Add all children of the tab control...
HWND hChildWnd = GetTopWindow(hWnd);
hChildWnd = GetNextWindow(hChildWnd, GW_HWNDNEXT);
// Instead of just the first control.
As a programmer of more years than I care to remember, I would just like to add my congratulations to the
author. He has done an enormous amount of work, and quite generously offers his source code to us in the
programming community gratis. Well done Bogdan! and thank you very much for such a beautiful piece of work.
I personally think that this is worthy of Code Guru status.