- Use ATL::CWindow methods where appropriate. By Benedikt Freisen.
CORE-9675 #resolve
svn path=/trunk/; revision=68361
WCHAR szWndText[MAX_STR_LEN];
LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
- ::GetWindowTextW(m_SearchBar->m_hWnd, szWndText, MAX_STR_LEN);
+ m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN);
if (wcscmp(szBuf, szWndText) == 0)
{
SearchEnabled = FALSE;
case EN_KILLFOCUS:
{
- ::GetWindowTextW(m_SearchBar->m_hWnd, szBuf, MAX_STR_LEN);
+ m_SearchBar->GetWindowTextW(szBuf, MAX_STR_LEN);
if (wcslen(szBuf) < 1)
{
LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
}
LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
- ::GetWindowTextW(m_SearchBar->m_hWnd, szWndText, MAX_STR_LEN);
+ m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN);
if (wcscmp(szBuf, szWndText) != 0)
{
StringCbCopy(szSearchPattern, sizeof(szSearchPattern),
break;
case ID_EXIT:
- ::PostMessageW(m_hWnd, WM_CLOSE, 0, 0);
+ PostMessageW(WM_CLOSE, 0, 0);
break;
case ID_INSTALL:
break;
case ID_HELP:
- ::MessageBoxW(m_hWnd, L"Help not implemented yet", NULL, MB_OK);
+ MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
break;
case ID_ABOUT:
if (hDwp)
{
- return ::DeferWindowPos(hDwp, m_hWnd, NULL,
+ return DeferWindowPos(hDwp, NULL,
splitter.left, splitter.top,
splitter.right - splitter.left,
splitter.bottom - splitter.top,
RECT* prcMinRect = (RECT*) lParam;
RECT rcItem, rcToolbar;
m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
- ::GetWindowRect(m_TaskBar.m_hWnd, &rcToolbar);
+ m_TaskBar.GetWindowRect(&rcToolbar);
OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
POINT ptItem = { rcItem.left, rcItem.top };
SIZE szItem = { rcItem.right - rcItem.left, rcItem.bottom - rcItem.top };
- ::ClientToScreen(m_hWnd, &ptItem);
+ ClientToScreen(&ptItem);
ptItem.x += szItem.cx / 2;
ptItem.y -= szTip.cy;
INT c, i;
BOOL bRet = TRUE;
- hDC = ::GetDC(m_hWnd);
+ hDC = GetDC();
if (hDC != NULL)
{
if (hFont)
if (hFont)
SelectObject(hDC, hPrevFont);
- ::ReleaseDC(m_hWnd, hDC);
+ ReleaseDC(hDC);
if (bRet)
{
CurrentSize = szWnd;
}
- if (::IsWindowVisible(m_hWnd))
+ if (IsWindowVisible())
{
InvalidateRect(NULL, TRUE);
NMHDR nmh;
nmh.hwndFrom = m_hWnd;
- nmh.idFrom = ::GetWindowLongPtr(m_hWnd, GWLP_ID);
+ nmh.idFrom = GetWindowLongPtr(GWLP_ID);
nmh.code = NTNWM_REALIGN;
SendMessage(hWndNotify,
BOOL GetClockRect(OUT PRECT rcClock)
{
- if (!::IsWindowVisible(m_clock->m_hWnd))
+ if (!m_clock->IsWindowVisible())
return FALSE;
- return ::GetWindowRect(m_clock->m_hWnd, rcClock);
+ return m_clock->GetWindowRect(rcClock);
}
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
m_TrayRects[m_Position] = rcTray;
goto ChangePos;
}
- else if (::GetWindowRect(m_hWnd, &rcTray))
+ else if (GetWindowRect(&rcTray))
{
if (InSizeMove)
{
RECT rcClip, rcWindow;
HRGN hClipRgn;
- if (::GetWindowRect(m_hWnd, &rcWindow))
+ if (GetWindowRect(&rcWindow))
{
/* Disable clipping on systems with only one monitor */
if (GetSystemMetrics(SM_CMONITORS) <= 1)
/* Set the clipping region or make sure the window isn't clipped
by disabling it explicitly. */
- ::SetWindowRgn(m_hWnd, hClipRgn, TRUE);
+ SetWindowRgn(hClipRgn, TRUE);
}
}
{
if (ptmp == NULL &&
GetClientRect(&tmp.rcExclude) &&
- ::MapWindowPoints(m_hWnd,
+ MapWindowPoints(
NULL,
(LPPOINT) &tmp.rcExclude,
2) != 0)
if (m_StartButton.m_hWnd != NULL)
{
/* Resize and reposition the button */
- dwp = ::DeferWindowPos(dwp,
- m_StartButton.m_hWnd,
- NULL,
- 0,
- 0,
- StartSize.cx,
- StartSize.cy,
- SWP_NOZORDER | SWP_NOACTIVATE);
+ dwp = m_StartButton.DeferWindowPos(dwp,
+ NULL,
+ 0,
+ 0,
+ StartSize.cx,
+ StartSize.cy,
+ SWP_NOZORDER | SWP_NOACTIVATE);
if (dwp == NULL)
{
ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
If it was somehow destroyed just create a new tray window. */
if (m_hWnd != NULL && IsWindow())
{
- if (!::IsWindowVisible(m_hWnd))
+ if (!IsWindowVisible())
{
CheckTrayWndPosition();
HWND hwnd;
RECT posRect;
- ::GetWindowRect(m_StartButton.m_hWnd, &posRect);
+ m_StartButton.GetWindowRect(&posRect);
hwnd = CreateWindowEx(0,
WC_STATIC,
NULL,
RECT rect;
int backoundPart;
- ::GetWindowRect(m_hWnd, &rect);
+ GetWindowRect(&rect);
OffsetRect(&rect, -rect.left, -rect.top);
- hdc = ::GetDCEx(m_hWnd, hRgn, DCX_WINDOW | DCX_INTERSECTRGN | DCX_PARENTCLIP);
+ hdc = GetDCEx(hRgn, DCX_WINDOW | DCX_INTERSECTRGN | DCX_PARENTCLIP);
switch (m_Position)
{
}
DrawThemeBackground(m_Theme, hdc, backoundPart, 0, &rect, 0);
- ::ReleaseDC(m_hWnd, hdc);
+ ReleaseDC(hdc);
return 0;
}
HWND hwnd;
RECT posRect;
- ::GetWindowRect(m_StartButton.m_hWnd, &posRect);
+ m_StartButton.GetWindowRect(&posRect);
hwnd = CreateWindowEx(0,
WC_STATIC,
RECTL rcExclude;
DWORD dwFlags = 0;
- if (::GetWindowRect(m_StartButton.m_hWnd, (RECT*) &rcExclude))
+ if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
{
switch (m_Position)
{
UINT state = m_AutoHideState;
GetCursorPos(&pt);
- ::GetWindowRect(m_hWnd, &rcCurrent);
+ GetWindowRect(&rcCurrent);
over = PtInRect(&rcCurrent, pt);
if (m_StartButton.SendMessage( BM_GETSTATE, 0, 0) != BST_UNCHECKED)
SetLastError(ERROR_SUCCESS);
if (GetClientRect(&rcClient) &&
- (::MapWindowPoints(m_hWnd, NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
+ (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
{
pt.x = (SHORT) LOWORD(lParam);
pt.y = (SHORT) HIWORD(lParam);
if (!Locked)
{
/* Apply clipping */
- ::PostMessage(m_hWnd, WM_SIZE, SIZE_RESTORED, 0);
+ PostMessage(WM_SIZE, SIZE_RESTORED, 0);
}
return TRUE;
}
/* temporarily enable the system menu */
SetWindowStyle(m_hWnd, WS_SYSMENU, WS_SYSMENU);
- hSysMenu = ::GetSystemMenu(m_hWnd, FALSE);
+ hSysMenu = GetSystemMenu(FALSE);
if (hSysMenu != NULL)
{
/* Disable all items that are not relevant */
/* Convert the coordinates to client-coordinates */
::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
- hWndAtPt = ::ChildWindowFromPoint(m_hWnd, ptClient);
+ hWndAtPt = ChildWindowFromPoint(ptClient);
if (hWndAtPt != NULL &&
(hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
{
{
case NTNWM_REALIGN:
/* Cause all controls to be aligned */
- ::PostMessage(m_hWnd, WM_SIZE, SIZE_RESTORED, 0);
+ PostMessage(WM_SIZE, SIZE_RESTORED, 0);
break;
}
}
POINT a = { rc.left, rc.top };
POINT b = { rc.right, rc.bottom };
- ::ClientToScreen(m_hWnd, &a);
- ::ClientToScreen(m_hWnd, &b);
+ ClientToScreen(&a);
+ ClientToScreen(&b);
POINTL pt = { a.x, b.y };
RECTL rcl = { a.x, a.y, b.x, b.y };
POINT a = { rc.left, rc.top };
POINT b = { rc.right, rc.bottom };
- ::ClientToScreen(m_hWnd, &a);
- ::ClientToScreen(m_hWnd, &b);
+ ClientToScreen(&a);
+ ClientToScreen(&b);
POINT pt = { a.x, b.y };
RECT rcl = { a.x, a.y, b.x, b.y };
HWND tlw;
m_menuBand->_GetTopLevelWindow(&tlw);
SendMessageW(tlw, WM_CANCELMODE, 0, 0);
- ::PostMessageW(m_hWnd, WM_USER_CHANGETRACKEDITEM, index, MAKELPARAM(m_isTrackingPopup, FALSE));
+ PostMessageW(WM_USER_CHANGETRACKEDITEM, index, MAKELPARAM(m_isTrackingPopup, FALSE));
}
else
m_menuBand->_ChangeHotItem(this, btn.idCommand, 0);
return hr;
LPWSTR input;
- int inputLength = ::GetWindowTextLength(fCombobox.m_hWnd) + 2;
+ int inputLength = fCombobox.GetWindowTextLength() + 2;
input = new WCHAR[inputLength];
- ::GetWindowText(fCombobox.m_hWnd, input, inputLength);
+ fCombobox.GetWindowText(input, inputLength);
LPWSTR address;
int addressLength = ExpandEnvironmentStrings(input, NULL, 0);
fStartPosition.y = GET_Y_LPARAM(msgp);
RECT rc;
- ::GetWindowRect(m_hWnd, &rc);
+ GetWindowRect(&rc);
fStartHeight = rc.bottom - rc.top;