I'm trying to get WindowProc from another window, and set my WindowProc to it. I use:
but it gives me an LVALUE needed error message. can someone help me out?
LRESULT CALLBACK Proc1(HWND, UINT, LPARAM, WPARAM); // or WPARAM, LPARAM, I can't remember what order
LRESULT CALLBACK Proc2(HWND, UINT, LPARAM, WPARAM);
Proc1 = (LRESULT CALLBACK) SetWindowLong(hwnd, SWL_WNDPROC, Proc2);
is it clear?
//here is the code to swap it with one from the other window:
WNDPROC theOtherWndProc = (WNDPROC)GetWindowLong(hwndOther, GWL_WNDPROC);
WNDPROC yourOldWndProc = (WNDPROC)SetWindowLong(hwndYour, GWL_WNDPROC, (DWORD)theOtherWndProc);
ok, that seemed to work, but I'm making it in my WM_CREATE message and I get an Error on case WM_LBUTTONDOWN: (my next message handler) that says "case bypasses initialization of local variable"
scratch that, i got it to work.