Subclass dialog item
-
Friends, I want to subclass an edit control present on my dialog template. For this purpose i derived my on class CMyDialog form base CEdit, and assign the instance of edit control to my class instead of CEdit class. Every thing works fine till here and program runs successfully. Then i needed to handle the WM_PAINT message of my edit control, so i override OnPaint in CMyDialog class. Till here everything works fine. Now the problem is that i want to handle WM_CREATE message of edit control also. For this purpose i am overriding OnCreate(), but the trouble is that the program is not calling my overridden OnCreate method. Any idea ???
-
Friends, I want to subclass an edit control present on my dialog template. For this purpose i derived my on class CMyDialog form base CEdit, and assign the instance of edit control to my class instead of CEdit class. Every thing works fine till here and program runs successfully. Then i needed to handle the WM_PAINT message of my edit control, so i override OnPaint in CMyDialog class. Till here everything works fine. Now the problem is that i want to handle WM_CREATE message of edit control also. For this purpose i am overriding OnCreate(), but the trouble is that the program is not calling my overridden OnCreate method. Any idea ???
WM_CREATE is sent to the edit control befeore you get a chance to subclass it, so you have to override
PreSubclassWindow()
instead.
[
](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!