AFX_STATIC_DATA const TCHAR _afxOldWndProc[] = _T("AfxOldWndProc423");
LRESULT CALLBACK
_AfxActivationWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC oldWndProc = (WNDPROC)::GetProp(hWnd, _afxOldWndProc);
ASSERT(oldWndProc != NULL);
LRESULT lResult = 0;
TRY
{
BOOL bCallDefault = TRUE;
switch (nMsg)
{
case WM_INITDIALOG:
{
DWORD dwStyle;
CRect rectOld;
CWnd* pWnd = CWnd::FromHandle(hWnd);
_AfxPreInitDialog(pWnd, &rectOld, &dwStyle);
bCallDefault = FALSE;
lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam);
_AfxPostInitDialog(pWnd, rectOld, dwStyle);
}
break;
case WM_ACTIVATE:
_AfxHandleActivate(CWnd::FromHandle(hWnd), wParam,
CWnd::FromHandle((HWND)lParam));
break;
case WM_SETCURSOR:
bCallDefault = !_AfxHandleSetCursor(CWnd::FromHandle(hWnd),
(short)LOWORD(lParam), HIWORD(lParam));
break;
case WM_NCDESTROY:
SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)oldWndProc);
RemoveProp(hWnd, _afxOldWndProc);
GlobalDeleteAtom(GlobalFindAtom(_afxOldWndProc));
break;
}
// call original wndproc for default handling
if (bCallDefault)
lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam);
// my app crashes here :(
// the values are : 0 =
CallWindowProc(0x00d48ca8, 0x07cb0760, 28, 0, 162);
}
CATCH_ALL(e)
{
// handle exception
MSG msg;
msg.hwnd = hWnd;
msg.message = nMsg;
msg.wParam = wParam;
msg.lParam = lParam;
lResult = AfxGetThread()->ProcessWndProcException(e, &msg);
TRACE1("Warning: Uncaught exception in _AfxActivationWndProc (returning
%ld).\n",
lResult);
DELETE_EXCEPTION(e);
}
END_CATCH_ALL
return lResult;
}
Greetings
Kurt.S...@vartec.be
--
John Joelle Cruz
Software Engineer
Nortel Networks Inc.
[e-mail] johnc...@usa.net
[homepage] http://members.xoom.com/johncruise
Kurt Santelé <Kurt.S...@vartec.be> wrote in message
news:eByFj1Qd#GA...@cppssbbsa02.microsoft.com...