I do this exact thing for both edit and richedit but for the latter there is an access violation, why? The same thing happens when done for tabctrl too. What am I doing wrong? How can I get it to work?
WNDPROC OriginalProc;
LRESULT CALLBACK MyProc(HWND h, UINT m, WPARAM w, LPARAM p)
{
return OriginalProc (h, m, w, p);// access violation for common controls
}
// elsewhere
HWND h = CreateWindow(....)
OriginalProc = (WNDPROC)SetWindowLong(h, GWL_WNDPROC, (LONG)MyProc);
I am using vc++ 6.
Thanks in advance.