Index: src/ch/StaticEx.cpp =================================================================== diff -u -rc435ab507c8b8280264188b49e9ada56d46c0261 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) +++ src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -33,23 +33,23 @@ case WM_NCCREATE: { STATICEXSETTINGS* pSett=new STATICEXSETTINGS; - pSett->hFontNormal=NULL; - pSett->hFontUnderline=NULL; - pSett->pszLink=NULL; - pSett->pszText=NULL; + pSett->hFontNormal=nullptr; + pSett->hFontUnderline=nullptr; + pSett->pszLink=nullptr; + pSett->pszText=nullptr; pSett->bActive=false; pSett->bDown=false; - pSett->hLink=NULL; - pSett->hNormal=NULL; + pSett->hLink=nullptr; + pSett->hNormal=nullptr; pSett->rcText.left=0; pSett->rcText.right=0; pSett->rcText.top=0; pSett->rcText.bottom=0; ::SetWindowLongPtr(hwnd, 0, (LONG_PTR)pSett); // create cursors - pSett->hNormal=::LoadCursor(NULL, IDC_ARROW); - pSett->hLink=::LoadCursor(NULL, IDC_HAND); + pSett->hNormal=::LoadCursor(nullptr, IDC_ARROW); + pSett->hLink=::LoadCursor(nullptr, IDC_HAND); break; } @@ -59,11 +59,11 @@ const TCHAR* pSep=_tcsrchr(pcs->lpszName, _T('|')); - if (!(pcs->style & SES_LINK) || pSep == NULL || pSep-pcs->lpszName < 0) + if (!(pcs->style & SES_LINK) || pSep == nullptr || pSep-pcs->lpszName < 0) { pSettings->pszText=new TCHAR[_tcslen(pcs->lpszName)+1]; _tcscpy(pSettings->pszText, pcs->lpszName); - pSettings->pszLink=NULL; + pSettings->pszLink=nullptr; } else { @@ -119,8 +119,8 @@ } else { - pSettings->hFontNormal=NULL; - pSettings->hFontUnderline=NULL; + pSettings->hFontNormal=nullptr; + pSettings->hFontUnderline=nullptr; } break; @@ -137,11 +137,11 @@ LPCTSTR psz=(LPCTSTR)lParam; const TCHAR* pSep=_tcsrchr(psz, _T('|')); - if (!(lStyle & SES_LINK) || pSep == NULL || pSep-psz < 0) + if (!(lStyle & SES_LINK) || pSep == nullptr || pSep-psz < 0) { pSettings->pszText=new TCHAR[_tcslen(psz)+1]; _tcscpy(pSettings->pszText, psz); - pSettings->pszLink=NULL; + pSettings->pszLink=nullptr; } else { @@ -153,13 +153,12 @@ _tcscpy(pSettings->pszLink, pSep); } - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); break; } case WM_ERASEBKGND: { return (LRESULT)FALSE; - break; } case WM_PAINT: { @@ -171,7 +170,7 @@ HDC hdc=::CreateCompatibleDC(hDC); HBITMAP hBmp=::CreateCompatibleBitmap(hDC, ps.rcPaint.right-ps.rcPaint.left+1, ps.rcPaint.bottom-ps.rcPaint.top+1); HBITMAP hOldBitmap=(HBITMAP)::SelectObject(hdc, hBmp); - ::SetWindowOrgEx(hdc, ps.rcPaint.left, ps.rcPaint.top, NULL); + ::SetWindowOrgEx(hdc, ps.rcPaint.left, ps.rcPaint.top, nullptr); // paint the background ::FillRect(hdc, &ps.rcPaint, ::GetSysColorBrush(COLOR_BTNFACE)); @@ -181,9 +180,9 @@ ::GetClientRect(hwnd, &rcCtl); // draw text - DWORD dwFlags=DT_LEFT | DT_VCENTER | (::GetWindowLong(hwnd, GWL_STYLE) & SES_PATHELLIPSIS ? DT_PATH_ELLIPSIS : 0) - | (::GetWindowLong(hwnd, GWL_STYLE) & SES_ELLIPSIS ? DT_END_ELLIPSIS : 0) - | (::GetWindowLong(hwnd, GWL_STYLE) & SES_WORDBREAK ? DT_WORDBREAK : 0); + DWORD dwFlags=DT_LEFT | DT_VCENTER | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_PATHELLIPSIS) ? DT_PATH_ELLIPSIS : 0) + | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_ELLIPSIS) ? DT_END_ELLIPSIS : 0) + | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_WORDBREAK) ? DT_WORDBREAK : 0); pSettings->rcText=rcCtl; if (::GetWindowLong(hwnd, GWL_STYLE) & SES_LINK) @@ -260,7 +259,7 @@ { pSettings->bActive=false; ::ReleaseCapture(); - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); ::SetCursor(pSettings->hNormal); } @@ -270,7 +269,7 @@ if (::PtInRect(&pSettings->rcText, pt)) { pSettings->bActive=true; - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); ::SetCapture(hwnd); ::SetCursor(pSettings->hLink); } @@ -290,13 +289,13 @@ { if (::GetWindowLong(hwnd, GWL_STYLE) & SES_NOTIFY) { - ::SendMessage((HWND)::GetWindowLong(hwnd, GWLP_HWNDPARENT), WM_COMMAND, (WPARAM)(SEN_CLICKED << 16 | ::GetWindowLong(hwnd, GWL_ID)), (LPARAM)hwnd); + ::SendMessage((HWND)::GetWindowLongPtr(hwnd, GWLP_HWNDPARENT), WM_COMMAND, (WPARAM)(SEN_CLICKED << 16 | ::GetWindowLong(hwnd, GWL_ID)), (LPARAM)hwnd); } else { TRACE("Executing %s...\n", pSettings->pszLink); - ShellExecute(NULL, _T("open"), pSettings->pszLink, NULL, NULL, SW_SHOWNORMAL); + ShellExecute(nullptr, _T("open"), pSettings->pszLink, nullptr, nullptr, SW_SHOWNORMAL); } } pSettings->bDown=false; @@ -319,7 +318,6 @@ _tcscpy((PTSTR)lParam, _T("")); return (LRESULT)TRUE; - break; } } @@ -338,10 +336,10 @@ wndcls.cbClsExtra = 0; wndcls.cbWndExtra = sizeof(STATICEXSETTINGS*); wndcls.hInstance = hInstance; - wndcls.hIcon = NULL; - wndcls.hCursor = NULL; // will load each time needed - wndcls.hbrBackground = NULL; - wndcls.lpszMenuName = NULL; + wndcls.hIcon = nullptr; + wndcls.hCursor = nullptr; // will load each time needed + wndcls.hbrBackground = nullptr; + wndcls.lpszMenuName = nullptr; wndcls.lpszClassName = STATICEX_CLASS; if (!RegisterClass(&wndcls))