subclass the control
HWND hParent;
WNDPROC wpEdit;
LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
LRESULT lRes;
if(msg != WM_MOUSEMOVE) {
lRes = CallWindowProc(wpEdit, hwnd, msg, wParam, lParam);
} else {
return DefWindowProc(hwnd, msg, wParam, lParam);
}
if(msg == WM_LBUTTONDOWN) {
// code
MessageBox(hwnd, TEXT("lbutton click test"), TEXT(""), MB_OK);
}
return lRes;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
// bits of code
static HWND hEdit1; // handle to edit control
switch(msg) {
WM_CREATE : // bits of code
hParent = hwnd;
wpEdit = (WNDPROC) SetWindowLong(hEdit1, GWL_WNDPROC, (LONG) EditProc);
// bits of code
break;
WM_DESTORY : // bits of code
SetWindowLong(hEdit1, GWL_WNDPROC, (LONG) wpEdit);
// bits of code
}
// bits of code
}
something like that, I think.