Or you could use subclassing:
Code:
// Global
WNDPROC OldEditProc;
LRESULT CALLBACK DummyProc(HWND, UINT, WPARAM, LPARAM);
// Inside WndProc
HWND hEdit = CreateWindow(...);
OldEditProc = (WNDPROC)SetWindowLong(hEdit, GWL_WNDPROC, (long)DummyProc);
/* This "dummy" window proc only processes the WM_MOUSEMOVE
message. It sends all messages the the original window proc
stored in OldEditProc */
LRESULT CALLBACK DummyProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if(msg == WM_MOUSEMOVE) {
// The cursor is inside the client area of the edit window
}
// Make sure the edit box functions properly
return CallWindowProc(OldEditProc, hwnd, msg, wParam, lParam);
}
I hope this makes sense. If not, just say it and I'll make a full working example.