Bummer. Wrote two pages, wrong password. Gone.
You can retrieve your
this directly from your static wndproc via GetWindowLong because the control has not been subclassed until after wnd creation.
Consider, within your static wndproc:
Code:
//beware: pseudocode!!!
MyClass *pWnd=(MyClass*)GetWindowLong(...);
if (!pWnd)
{
/*must be a diy registered and created wnd class
so get and set this from WM_NCCREATE*/
}
//this is good so do stuff
pWnd->MyMsgHandler(...);
When you register a diy wnd class and create windows of that class, ALL the msgs go to your wndproc because that's the way it's set up. When you create a control, the initial creation messages go to the system defined wndproc; your diy wndproc does not kick in until you subclass the control after you have created the control using CreateWindowEx.
When you superclass a control what you are doing is copying the details - including the default wndproc - for a control and then registering those details with a different class name,instance and diy wndproc; in effect you are creating a 'normal' window but based on the original control. Now, just like your normal window, ALL messages go to YOUR wndproc, because that's how that particular class of window was registered with the system. When you want default 'control' behaviour for it just ensure you use CallWindowProc using the original, system wndproc returned in the WNDCLASSEX when you initially called GetClassInfoEx.
edit: just about everything.