From 307d14e5c5fd2d37f73d808831c1531c511a0288 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 24 Jan 2008 18:29:50 +0000 Subject: [PATCH] fix building with gcc 4.3.0 svn path=/trunk/; revision=31976 --- reactos/base/applications/regedit/childwnd.c | 56 ++++++++++++-------- reactos/base/applications/regedit/hexedit.c | 11 +++- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index 88e4fad2f90..232a846aa55 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -21,6 +21,7 @@ #include ChildWnd* g_pChildWnd; +static int last_split; HBITMAP SizingPattern = 0; HBRUSH SizingBrush = 0; static TCHAR Suggestions[256]; @@ -94,6 +95,24 @@ static void OnPaint(HWND hWnd) EndPaint(hWnd, &ps); } +/******************************************************************************* + * finish_splitbar [internal] + * + * make the splitbar invisible and resize the windows + * (helper for ChildWndProc) + */ +static void finish_splitbar(HWND hWnd, int x) +{ + RECT rt; + + draw_splitbar(hWnd, last_split); + last_split = -1; + GetClientRect(hWnd, &rt); + g_pChildWnd->nSplitPos = x; + ResizeWnd(g_pChildWnd, rt.right, rt.bottom); + ReleaseCapture(); +} + /******************************************************************************* * * FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG) @@ -305,7 +324,6 @@ void FixPointIfContext(POINTS *pt, HWND hWnd) */ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - static int last_split; BOOL Result; ChildWnd* pChildWnd = g_pChildWnd; @@ -376,10 +394,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa break; case WM_LBUTTONDOWN: { RECT rt; - POINTS pt; - pt = MAKEPOINTS(lParam); + int x = (short)LOWORD(lParam); GetClientRect(hWnd, &rt); - if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.xnSplitPos+SPLIT_WIDTH/2+1) { + if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && xnSplitPos+SPLIT_WIDTH/2+1) { last_split = pChildWnd->nSplitPos; draw_splitbar(hWnd, last_split); SetCapture(hWnd); @@ -388,17 +405,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa } case WM_LBUTTONUP: + case WM_RBUTTONDOWN: if (GetCapture() == hWnd) { - RECT rt; - POINTS pt; - pt = MAKEPOINTS(lParam); - GetClientRect(hWnd, &rt); - pt.x = (SHORT) min(max(pt.x, SPLIT_MIN), rt.right - SPLIT_MIN); - draw_splitbar(hWnd, last_split); - last_split = -1; - pChildWnd->nSplitPos = pt.x; - ResizeWnd(pChildWnd, rt.right, rt.bottom); - ReleaseCapture(); + finish_splitbar(hWnd, LOWORD(lParam)); } break; @@ -425,7 +434,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa HDC hdc; RECT rt; HGDIOBJ OldObj; - POINTS pt; + int x = LOWORD(lParam); if(!SizingPattern) { const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA}; @@ -436,19 +445,18 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa SizingBrush = CreatePatternBrush(SizingPattern); } - pt = MAKEPOINTS(lParam); GetClientRect(hWnd, &rt); - pt.x = (SHORT) min(max(pt.x, SPLIT_MIN), rt.right - SPLIT_MIN); - if(last_split != pt.x) + x = (SHORT) min(max(x, SPLIT_MIN), rt.right - SPLIT_MIN); + if(last_split != x) { rt.left = last_split-SPLIT_WIDTH/2; rt.right = last_split+SPLIT_WIDTH/2+1; hdc = GetDC(hWnd); OldObj = SelectObject(hdc, SizingBrush); PatBlt(hdc, rt.left, rt.top, rt.right - rt.left, rt.bottom - rt.top, PATINVERT); - last_split = pt.x; - rt.left = pt.x-SPLIT_WIDTH/2; - rt.right = pt.x+SPLIT_WIDTH/2+1; + last_split = x; + rt.left = x-SPLIT_WIDTH/2; + rt.right = x+SPLIT_WIDTH/2+1; PatBlt(hdc, rt.left, rt.top, rt.right - rt.left, rt.bottom - rt.top, PATINVERT); SelectObject(hdc, OldObj); ReleaseDC(hWnd, hdc); @@ -575,7 +583,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa { int i, cnt; BOOL IsDefault; - pt = MAKEPOINTS(lParam); + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); cnt = ListView_GetSelectedCount(pChildWnd->hListWnd); i = ListView_GetNextItem(pChildWnd->hListWnd, -1, LVNI_FOCUSED | LVNI_SELECTED); FixPointIfContext(&pt, pChildWnd->hListWnd); @@ -612,7 +621,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa int iLastPos; WORD wID; - pt = MAKEPOINTS(lParam); + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); hti.pt.x = pt.x; hti.pt.y = pt.y; ScreenToClient(pChildWnd->hTreeWnd, &hti.pt); diff --git a/reactos/base/applications/regedit/hexedit.c b/reactos/base/applications/regedit/hexedit.c index d05146cd476..b360d828513 100644 --- a/reactos/base/applications/regedit/hexedit.c +++ b/reactos/base/applications/regedit/hexedit.c @@ -869,6 +869,7 @@ INT_PTR CALLBACK HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { PHEXEDIT_DATA hed; + POINTS p; hed = (PHEXEDIT_DATA)(LONG_PTR)GetWindowLongPtr(hWnd, (DWORD_PTR)0); switch(uMsg) @@ -889,7 +890,11 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return HEXEDIT_WM_SIZE(hed, (DWORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_LBUTTONDOWN: - return HEXEDIT_WM_LBUTTONDOWN(hed, (INT)wParam, MAKEPOINTS(lParam)); + { + p.x = LOWORD(lParam); + p.y = HIWORD(lParam); + return HEXEDIT_WM_LBUTTONDOWN(hed, (INT)wParam, p); + } case WM_MOUSEWHEEL: { @@ -900,7 +905,9 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) delta -= (SHORT)HIWORD(wParam); if(abs(delta) >= WHEEL_DELTA && nScrollLines != 0) { - return HEXEDIT_WM_MOUSEWHEEL(hed, nScrollLines * (delta / WHEEL_DELTA), LOWORD(wParam), &MAKEPOINTS(lParam)); + p.x = LOWORD(lParam); + p.y = HIWORD(lParam); + return HEXEDIT_WM_MOUSEWHEEL(hed, nScrollLines * (delta / WHEEL_DELTA), LOWORD(wParam), &p); } break; }