hmm, I'm not sure why that doesn't work. If you want to try and override the edit control procedure then you'll have to do something like this -
Code:
//Global WNDPROC storage
WNDPROC DefEditProc;
//Subclassing Procedure
LRESULT CALLBACK EditProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
///.....
///Intercept messages to override
///
default: //Send all messages not processed to default edit proc
return CallWindowProc(DefEditProc,hWnd,message,
wParam,lParam);
}
}
//Main Window Procedure
LRESULT CALLBACK WinProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
//variables etc
static HWND hWndEdit;
switch(message)
{
case WM_CREATE:
{
//Create edit box as normal storing handle in hWndEdit
//GetWindowLong and SetWindowLong calls can be merged
//as SetWindowLong returns old procedure
DefEditProc = (WNDPROC)GetWindowLong(hWndEdit,GWL_WNDPROC);
SetWindowLong(hWndEdit,GWL_WNDPROC,
(LONG)EditProc);
//rest of message handler
return 0;
}
//rest of message handlers
}
}