MFC问题(关于窗口函数)
WNDPROC prevProc;LRESULT CALLBACK NewEditProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam,// first message parameter
LPARAM lParam // second message parameter
)
{
if( uMsg == WM_CHAR && wParam == 0x0d)
{
// ::SetFocus(GetNextWindow(hwnd,GW_HWNDNEXT));
// SetFocus(::GetWindow(hwnd,GW_HWNDNEXT));
SetFocus(::GetNextDlgTabItem(::GetParent(hwnd),hwnd,FALSE));
return 1;
}
else
{
return prevProc(hwnd,uMsg,wParam,lParam);
}
}
BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
prevProc=(WNDPROC)SetWindowLong(GetDlgItem(IDC_EDIT1)->m_hWnd,GWL_WNDPROC,
(LONG)NewEditProc);
return TRUE;// return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
问题是 : NewEditProc的函数中,为什么可以这样返回return prevProc(hwnd,uMsg,wParam,lParam);
页:
[1]