Not gettting WM_CREATE in subclassed edit control

Nov 10, 2014 at 6:48pm
I have an edit control, who is a child of the main window and I have subclassed the edit control procedure and I never get WM_CREATE. Please help
Nov 10, 2014 at 10:34pm
Well, think about it. You have a CreateWindowEx() call to create the edit control. Before that call returns and the HWND of the edit control is assigned to whatever variable you have assigned to capture it, the WM_CREATE handler code within the system dlls will execute. So only after the internal WM_CREATE returns, will the HWND be assigned to your variable. At that point you call SetWindowLong() to subclass the control, but at that point the WM_CREATE message is long gone.
Nov 11, 2014 at 4:36am
You're spot on freddie1! Didn't think about that. Thanks
Last edited on Nov 11, 2014 at 4:46am
Topic archived. No new replies allowed.