TreeView notifications fix
Dimitrie O. Paun
dpaun at rogers.com
Wed Mar 19 06:48:17 CST 2003
On March 19, 2003 06:39 am, Mike Hearn wrote:
> -
> + LONG *dlgWndProc;
> +
> if (!(wndPtr = WIN_FindWndPtr(hwnd))) return FALSE;
> - retvalue = (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W);
> + /* dialog boxes store their window proc in a different location, so check where we should look here */
> + dlgWndProc = (LONG *)(((char *)wndPtr->wExtra) + DWL_DLGPROC);
> +
> + if (wndPtr->flags & WIN_ISDIALOG)
> + retvalue = (WINPROC_GetProcType( (WNDPROC)*dlgWndProc ) == WIN_PROC_32W);
> + else
> + retvalue = (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W);
> + TRACE("hwnd=%p, proc=%p, retvalue=%d\n", hwnd, wndPtr->winproc,
> retvalue);
Very nice! But why not code it a bit more "streamlined" (hand made diff):
+ WNDPROC wndproc = (wndPtr->flags & WIN_ISDIALOG) ?
+ *(WNDPROC *)(((char *)wndPtr->wExtra) + DWL_DLGPROC) : wndPtr->winproc;
+
- retvalue = (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W);
+ retvalue = (WINPROC_GetProcType( winproc ) == WIN_PROC_32W);
--
Dimi.
More information about the wine-devel
mailing list