diff --git a/reactos/base/applications/rapps/splitter.c b/reactos/base/applications/rapps/splitter.c index b0126b3055c..12e6e9cc914 100644 --- a/reactos/base/applications/rapps/splitter.c +++ b/reactos/base/applications/rapps/splitter.c @@ -75,36 +75,40 @@ HSplitterWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) hdwp = BeginDeferWindowPos(3); /* Size HSplitBar */ - DeferWindowPos(hdwp, - hHSplitter, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - Point.y, - Width, - SPLIT_WIDTH, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hHSplitter, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + Point.y, + Width, + SPLIT_WIDTH, + SWP_NOZORDER|SWP_NOACTIVATE); /* Size ListView */ - DeferWindowPos(hdwp, - hListView, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - GetWindowHeight(hToolBar), - Width, - Point.y - GetWindowHeight(hToolBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hListView, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + GetWindowHeight(hToolBar), + Width, + Point.y - GetWindowHeight(hToolBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size RichEdit */ - DeferWindowPos(hdwp, - hRichEdit, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - Point.y + SPLIT_WIDTH, - Width, - GetClientWindowHeight(hMainWnd) - (Point.y + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hRichEdit, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + Point.y + SPLIT_WIDTH, + Width, + GetClientWindowHeight(hMainWnd) - (Point.y + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), + SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) + EndDeferWindowPos(hdwp); } break; } @@ -192,54 +196,60 @@ VSplitterWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) hdwp = BeginDeferWindowPos(5); /* Size VSplitBar */ - DeferWindowPos(hdwp, - hwnd, - 0, - Point.x, - GetWindowHeight(hToolBar), - SPLIT_WIDTH, - GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hwnd, + 0, + Point.x, + GetWindowHeight(hToolBar), + SPLIT_WIDTH, + GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size TreeView */ - DeferWindowPos(hdwp, - hTreeView, - 0, - 0, - GetWindowHeight(hToolBar), - Point.x, - GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hTreeView, + 0, + 0, + GetWindowHeight(hToolBar), + Point.x, + GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size ListView */ - DeferWindowPos(hdwp, - hListView, - 0, - Point.x + SPLIT_WIDTH, - GetWindowHeight(hToolBar), - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - GetHSplitterPos() - GetWindowHeight(hToolBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hListView, + 0, + Point.x + SPLIT_WIDTH, + GetWindowHeight(hToolBar), + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + GetHSplitterPos() - GetWindowHeight(hToolBar), + SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, - hRichEdit, - 0, - Point.x + SPLIT_WIDTH, - GetHSplitterPos() + SPLIT_WIDTH, - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - GetClientWindowHeight(hMainWnd) - (GetHSplitterPos() + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hRichEdit, + 0, + Point.x + SPLIT_WIDTH, + GetHSplitterPos() + SPLIT_WIDTH, + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + GetClientWindowHeight(hMainWnd) - (GetHSplitterPos() + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), + SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, - hHSplitter, - 0, - Point.x + SPLIT_WIDTH, - GetHSplitterPos(), - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - SPLIT_WIDTH, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hHSplitter, + 0, + Point.x + SPLIT_WIDTH, + GetHSplitterPos(), + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + SPLIT_WIDTH, + SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) + EndDeferWindowPos(hdwp); } break; } diff --git a/reactos/base/applications/rapps/winmain.c b/reactos/base/applications/rapps/winmain.c index f721990e26e..923a5f1f01b 100644 --- a/reactos/base/applications/rapps/winmain.c +++ b/reactos/base/applications/rapps/winmain.c @@ -517,24 +517,26 @@ MainWndOnSize(HWND hwnd, WPARAM wParam, LPARAM lParam) */ /* Size vertical splitter bar */ - DeferWindowPos(hdwp, - hVSplitter, - 0, - (VSplitterPos = GetWindowWidth(hTreeView)), - GetWindowHeight(hToolBar), - SPLIT_WIDTH, - HIWORD(lParam) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hVSplitter, + 0, + (VSplitterPos = GetWindowWidth(hTreeView)), + GetWindowHeight(hToolBar), + SPLIT_WIDTH, + HIWORD(lParam) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size TreeView */ - DeferWindowPos(hdwp, - hTreeView, - 0, - 0, - GetWindowHeight(hToolBar), - VSplitterPos, - HIWORD(lParam) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hTreeView, + 0, + 0, + GetWindowHeight(hToolBar), + VSplitterPos, + HIWORD(lParam) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); if(wParam != SIZE_MINIMIZED) { @@ -548,36 +550,40 @@ MainWndOnSize(HWND hwnd, WPARAM wParam, LPARAM lParam) SetHSplitterPos(NewPos); /* Size ListView */ - DeferWindowPos(hdwp, - hListView, - 0, - VSplitterPos + SPLIT_WIDTH, - GetWindowHeight(hToolBar), - LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), - GetHSplitterPos() - GetWindowHeight(hToolBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hListView, + 0, + VSplitterPos + SPLIT_WIDTH, + GetWindowHeight(hToolBar), + LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), + GetHSplitterPos() - GetWindowHeight(hToolBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size RichEdit */ - DeferWindowPos(hdwp, - hRichEdit, - 0, - VSplitterPos + SPLIT_WIDTH, - GetHSplitterPos() + SPLIT_WIDTH, - LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), - RichPos, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hRichEdit, + 0, + VSplitterPos + SPLIT_WIDTH, + GetHSplitterPos() + SPLIT_WIDTH, + LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), + RichPos, + SWP_NOZORDER|SWP_NOACTIVATE); /* Size horizontal splitter bar */ - DeferWindowPos(hdwp, - hHSplitter, - 0, - VSplitterPos + SPLIT_WIDTH, - GetHSplitterPos(), - LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), - SPLIT_WIDTH, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hHSplitter, + 0, + VSplitterPos + SPLIT_WIDTH, + GetHSplitterPos(), + LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), + SPLIT_WIDTH, + SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) + EndDeferWindowPos(hdwp); } BOOL IsSelectedNodeInstalled(void) diff --git a/reactos/base/applications/rapps_new/gui.cpp b/reactos/base/applications/rapps_new/gui.cpp index b195b72a366..29a1cda0f1b 100644 --- a/reactos/base/applications/rapps_new/gui.cpp +++ b/reactos/base/applications/rapps_new/gui.cpp @@ -600,14 +600,14 @@ private: int count = m_ClientPanel->CountSizableChildren(); hdwp = BeginDeferWindowPos(count); - hdwp = m_ClientPanel->OnParentSize(r, hdwp); - EndDeferWindowPos(hdwp); + if (hdwp) hdwp = m_ClientPanel->OnParentSize(r, hdwp); + if (hdwp) EndDeferWindowPos(hdwp); // TODO: Sub-layouts for children of children count = m_SearchBar->CountSizableChildren(); hdwp = BeginDeferWindowPos(count); - hdwp = m_SearchBar->OnParentSize(r, hdwp); - EndDeferWindowPos(hdwp); + if (hdwp) hdwp = m_SearchBar->OnParentSize(r, hdwp); + if (hdwp) EndDeferWindowPos(hdwp); } BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) diff --git a/reactos/base/applications/rapps_new/rosui.h b/reactos/base/applications/rapps_new/rosui.h index fcd5aabde8f..2b58f83f796 100644 --- a/reactos/base/applications/rapps_new/rosui.h +++ b/reactos/base/applications/rapps_new/rosui.h @@ -769,8 +769,8 @@ public: HDWP hdwp = NULL; hdwp = BeginDeferWindowPos(count); - hdwp = OnParentSize(m_LastRect, hdwp); - EndDeferWindowPos(hdwp); + if (hdwp) hdwp = OnParentSize(m_LastRect, hdwp); + if (hdwp) EndDeferWindowPos(hdwp); } public: diff --git a/reactos/base/applications/rapps_new/splitter.cpp b/reactos/base/applications/rapps_new/splitter.cpp index 05902ff4452..7d6fba54f23 100644 --- a/reactos/base/applications/rapps_new/splitter.cpp +++ b/reactos/base/applications/rapps_new/splitter.cpp @@ -75,36 +75,40 @@ HSplitterWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) hdwp = BeginDeferWindowPos(3); /* Size HSplitBar */ - DeferWindowPos(hdwp, - hHSplitter, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - Point.y, - Width, - SPLIT_WIDTH, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hHSplitter, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + Point.y, + Width, + SPLIT_WIDTH, + SWP_NOZORDER|SWP_NOACTIVATE); /* Size ListView */ - DeferWindowPos(hdwp, - hListView, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - GetWindowHeight(hToolBar), - Width, - Point.y - GetWindowHeight(hToolBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hListView, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + GetWindowHeight(hToolBar), + Width, + Point.y - GetWindowHeight(hToolBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size RichEdit */ - DeferWindowPos(hdwp, - hRichEdit, - 0, - GetWindowWidth(hTreeView) + SPLIT_WIDTH, - Point.y + SPLIT_WIDTH, - Width, - GetClientWindowHeight(hMainWnd) - (Point.y + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hRichEdit, + 0, + GetWindowWidth(hTreeView) + SPLIT_WIDTH, + Point.y + SPLIT_WIDTH, + Width, + GetClientWindowHeight(hMainWnd) - (Point.y + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), + SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) + EndDeferWindowPos(hdwp); } break; } @@ -192,54 +196,60 @@ VSplitterWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) hdwp = BeginDeferWindowPos(5); /* Size VSplitBar */ - DeferWindowPos(hdwp, - hwnd, - 0, - Point.x, - GetWindowHeight(hToolBar), - SPLIT_WIDTH, - GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hwnd, + 0, + Point.x, + GetWindowHeight(hToolBar), + SPLIT_WIDTH, + GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size TreeView */ - DeferWindowPos(hdwp, - hTreeView, - 0, - 0, - GetWindowHeight(hToolBar), - Point.x, - GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hTreeView, + 0, + 0, + GetWindowHeight(hToolBar), + Point.x, + GetClientWindowHeight(hMainWnd) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), + SWP_NOZORDER|SWP_NOACTIVATE); /* Size ListView */ - DeferWindowPos(hdwp, - hListView, - 0, - Point.x + SPLIT_WIDTH, - GetWindowHeight(hToolBar), - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - GetHSplitterPos() - GetWindowHeight(hToolBar), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hListView, + 0, + Point.x + SPLIT_WIDTH, + GetWindowHeight(hToolBar), + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + GetHSplitterPos() - GetWindowHeight(hToolBar), + SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, - hRichEdit, - 0, - Point.x + SPLIT_WIDTH, - GetHSplitterPos() + SPLIT_WIDTH, - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - GetClientWindowHeight(hMainWnd) - (GetHSplitterPos() + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hRichEdit, + 0, + Point.x + SPLIT_WIDTH, + GetHSplitterPos() + SPLIT_WIDTH, + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + GetClientWindowHeight(hMainWnd) - (GetHSplitterPos() + SPLIT_WIDTH + GetWindowHeight(hStatusBar)), + SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, - hHSplitter, - 0, - Point.x + SPLIT_WIDTH, - GetHSplitterPos(), - GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), - SPLIT_WIDTH, - SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) + hdwp = DeferWindowPos(hdwp, + hHSplitter, + 0, + Point.x + SPLIT_WIDTH, + GetHSplitterPos(), + GetClientWindowWidth(hMainWnd) - (Point.x + SPLIT_WIDTH), + SPLIT_WIDTH, + SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) + EndDeferWindowPos(hdwp); } break; } diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index e3469c9a72d..0036536b912 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -52,11 +52,11 @@ extern void ResizeWnd(int cx, int cy) } GetWindowRect(g_pChildWnd->hAddressBtnWnd, &rb); cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH/2; - DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE); - DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE); - EndDeferWindowPos(hdwp); + if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE); + if (hdwp) EndDeferWindowPos(hdwp); } /*******************************************************************************