From 06afcd3dd6988ba2d744c028371dbf4bc5f0e0da Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 20 Mar 2011 01:29:39 +0000 Subject: [PATCH] [User32] - Finishing with setting window class types from the window proc. Next step will be checking it in the User32 message exchange instead of using the class structure. This was recognized with the MDI tests, this too could fix the combo listbox issue. - Minor static test fixes and miscellaneous notes. svn path=/trunk/; revision=51095 --- reactos/dll/win32/user32/controls/icontitle.c | 17 ++++++++++ .../dll/win32/user32/controls/regcontrol.c | 17 +++++++++- reactos/dll/win32/user32/controls/scrollbar.c | 19 +++++++++++ reactos/dll/win32/user32/controls/static.c | 3 ++ reactos/dll/win32/user32/windows/menu.c | 33 +++++++++++++++++++ 5 files changed, 88 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/user32/controls/icontitle.c b/reactos/dll/win32/user32/controls/icontitle.c index 467ca076c52..6daf27ec125 100644 --- a/reactos/dll/win32/user32/controls/icontitle.c +++ b/reactos/dll/win32/user32/controls/icontitle.c @@ -189,6 +189,18 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, HWND owner = GetWindow( hWnd, GW_OWNER ); if (!IsWindow(hWnd)) return 0; +#ifdef __REACTOS__ // Do this now, remove after Server side is fixed. + PWND pWnd; + + pWnd = ValidateHwnd(hWnd); + if (pWnd) + { + if (!pWnd->fnid) + { + NtUserSetWindowFNID(hWnd, FNID_ICONTITLE); + } + } +#endif switch( msg ) { @@ -201,6 +213,11 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, hIconTitleFont = CreateFontIndirectA( &logFont ); } return (hIconTitleFont ? 0 : -1); +#ifdef __REACTOS__ + case WM_DESTROY: + NtUserSetWindowFNID(hWnd, FNID_DESTROY); + break; +#endif case WM_NCHITTEST: return HTCAPTION; case WM_NCMOUSEMOVE: diff --git a/reactos/dll/win32/user32/controls/regcontrol.c b/reactos/dll/win32/user32/controls/regcontrol.c index 47a45cebc7d..9980f06a6df 100644 --- a/reactos/dll/win32/user32/controls/regcontrol.c +++ b/reactos/dll/win32/user32/controls/regcontrol.c @@ -87,8 +87,23 @@ LRESULT WINAPI MsgWindowProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { + PWND pWnd; + + pWnd = ValidateHwnd(hwnd); + if (pWnd) + { + if (!pWnd->fnid) + { + NtUserSetWindowFNID(hwnd, FNID_MESSAGEWND); + } + } + if (message == WM_NCCREATE) return TRUE; - return 0; + + if (message == WM_DESTROY) + NtUserSetWindowFNID(hwnd, FNID_DESTROY); + + return DefWindowProc(hwnd, message, wParam, lParam ); } LRESULT diff --git a/reactos/dll/win32/user32/controls/scrollbar.c b/reactos/dll/win32/user32/controls/scrollbar.c index ad0f4f25729..b238b64532a 100644 --- a/reactos/dll/win32/user32/controls/scrollbar.c +++ b/reactos/dll/win32/user32/controls/scrollbar.c @@ -1248,12 +1248,31 @@ ScrollBarWndProc(WNDPROC DefWindowProc, HWND Wnd, UINT Msg, WPARAM wParam, LPARA return 0; } +#ifdef __REACTOS__ // Do this now, remove after Server side is fixed. + PWND pWnd; + + pWnd = ValidateHwnd(Wnd); + if (pWnd) + { + if (!pWnd->fnid) + { + NtUserSetWindowFNID(Wnd, FNID_SCROLLBAR); + } + } +#endif + switch (Msg) { case WM_CREATE: IntScrollCreateScrollBar(Wnd, (LPCREATESTRUCTW) lParam); break; +#ifdef __REACTOS__ + case WM_DESTROY: + NtUserSetWindowFNID(Wnd, FNID_DESTROY); + return DefWindowProc(Wnd, Msg, wParam, lParam ); +#endif + //#if 0 /* FIXME */ case WM_ENABLE: { diff --git a/reactos/dll/win32/user32/controls/static.c b/reactos/dll/win32/user32/controls/static.c index bc0b92b361c..d421eae4671 100644 --- a/reactos/dll/win32/user32/controls/static.c +++ b/reactos/dll/win32/user32/controls/static.c @@ -813,6 +813,9 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style ) GetClientRect( hwnd, &rc); /* FIXME: send WM_CTLCOLORSTATIC */ +#ifdef __REACTOS__ + hBrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); // Always sent.... +#endif switch (style & SS_TYPEMASK) { case SS_BLACKRECT: diff --git a/reactos/dll/win32/user32/windows/menu.c b/reactos/dll/win32/user32/windows/menu.c index 768cf65c3f3..9b500dbd8a0 100644 --- a/reactos/dll/win32/user32/windows/menu.c +++ b/reactos/dll/win32/user32/windows/menu.c @@ -1792,9 +1792,24 @@ MenuMoveSelection(HWND WndOwner, PROSMENUINFO MenuInfo, INT Offset) MenuCleanupRosMenuItemInfo(&ItemInfo); } +// +// This breaks some test results. Should handle A2U if called! +// LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) { TRACE("YES! hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); +#ifdef __REACTOS__ + PWND pWnd; + + pWnd = ValidateHwnd(Wnd); + if (pWnd) + { + if (!pWnd->fnid) + { + NtUserSetWindowFNID(Wnd, FNID_MENU); + } + } +#endif switch(Message) { @@ -1834,6 +1849,9 @@ LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM l top_popup = NULL; top_popup_hmenu = NULL; } +#ifdef __REACTOS__ + NtUserSetWindowFNID(Wnd, FNID_DESTROY); +#endif break; case WM_SHOWWINDOW: @@ -1868,6 +1886,18 @@ LRESULT WINAPI PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) { TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); +#ifdef __REACTOS__ // Do this now, remove after Server side is fixed. + PWND pWnd; + + pWnd = ValidateHwnd(Wnd); + if (pWnd) + { + if (!pWnd->fnid) + { + NtUserSetWindowFNID(Wnd, FNID_MENU); + } + } +#endif switch(Message) { @@ -1907,6 +1937,9 @@ PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) top_popup = NULL; top_popup_hmenu = NULL; } +#ifdef __REACTOS__ + NtUserSetWindowFNID(Wnd, FNID_DESTROY); +#endif break; case WM_SHOWWINDOW: