SetWindowLong怎么调用不成功?
请高手帮我看看:
LRESULT CALLBACK WProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
TRACE("aaa\r\n");
return 0L;
}
void CTestqDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
POINT pt;
::GetCursorPos(&pt);
CWnd* pwnd=FindWindow(NULL,"未定标题 - 记事本");//跟踪时发现pwnd不为空
CString title;
pwnd->GetWindowText(title);
LONG a=::SetWindowLong(pwnd->GetSafeHwnd(),GWL_WNDPROC,(LONG)WProc);//返回0
CDialog::OnLButtonDown(nFlags, point);
}