if (!bFontLoaded)
{
CWindowDC dc (CWnd::GetDesktopWindow ());
- NONCLIENTMETRICS info;
- info.cbSize = sizeof(info);
+ NONCLIENTMETRICS info{ sizeof(info) };
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);
memcpy (&m_LogFont, &info.lfMessageFont, sizeof (LOGFONT));
m_LogFont.lfHeight = -MulDiv (11, dc.GetDeviceCaps (LOGPIXELSY), 72);
void CCrystalTextView::
RecalcVertScrollBar (bool bPositionOnly /*= false*/, bool bRedraw /*= true */)
{
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si{ sizeof (si) };
if (bPositionOnly)
{
si.fMask = SIF_POS;
CView::OnVScroll (nSBCode, nPos, pScrollBar);
// Note we cannot use nPos because of its 16-bit nature
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si{ sizeof(si) };
si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;
VERIFY (GetScrollInfo (SB_VERT, &si));
void CCrystalTextView::
RecalcHorzScrollBar (bool bPositionOnly /*= false*/, bool bRedraw /*= true */)
{
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si{ sizeof(si) };
const int nScreenChars = GetScreenChars();
const TextLayoutMode layoutMode = GetTextLayoutMode ();
//CView::OnHScroll (nSBCode, nPos, pScrollBar);
// Again, we cannot use nPos because it's 16-bit
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si { sizeof(si) };
si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;
VERIFY (GetScrollInfo (SB_HORZ, &si));
BOOL CCrystalTextView::
OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
{
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si{ sizeof(si) };
si.fMask = SIF_PAGE | SIF_RANGE;
VERIFY (GetScrollInfo (SB_VERT, &si));
bool bSplitPanesInHalf = true;
if (hLeftMonitor != hRightMonitor)
{
- MONITORINFO info;
- info.cbSize = sizeof(MONITORINFO);
+ MONITORINFO info{ sizeof(MONITORINFO) };
GetMonitorInfo(hLeftMonitor, &info);
int iDesiredWidthOfLeftPane = info.rcMonitor.right - vSplitterWndRect.left;
m_bFirstTime = false;
- WINDOWPLACEMENT wp = {};
- wp.length = sizeof(WINDOWPLACEMENT);
+ WINDOWPLACEMENT wp = { sizeof(WINDOWPLACEMENT) };
GetWindowPlacement(&wp);
wp.rcNormalPosition.left=theApp.GetProfileInt(_T("Settings"), _T("MainLeft"),0);
wp.rcNormalPosition.top=theApp.GetProfileInt(_T("Settings"), _T("MainTop"),0);
}
// save main window position
- WINDOWPLACEMENT wp = {};
- wp.length = sizeof(WINDOWPLACEMENT);
+ WINDOWPLACEMENT wp = { sizeof(WINDOWPLACEMENT) };
GetWindowPlacement(&wp);
theApp.WriteProfileInt(_T("Settings"), _T("MainLeft"),wp.rcNormalPosition.left);
theApp.WriteProfileInt(_T("Settings"), _T("MainTop"),wp.rcNormalPosition.top);
return;
// Note we cannot use nPos because of its 16-bit nature
- SCROLLINFO si = {0};
- si.cbSize = sizeof (si);
+ SCROLLINFO si{ sizeof(si) };
si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;
VERIFY (GetScrollInfo (SB_VERT, &si));
// If we are not, do nothing and let the active frame do the job.\r
if (GetParentFrame()->GetActiveFrame() == this)\r
{\r
- WINDOWPLACEMENT wp = {};\r
- wp.length = sizeof(WINDOWPLACEMENT);\r
+ WINDOWPLACEMENT wp = { sizeof(WINDOWPLACEMENT) };\r
GetWindowPlacement(&wp);\r
GetOptionsMgr()->SaveOption(OPT_ACTIVE_FRAME_MAX, (wp.showCmd == SW_MAXIMIZE));\r
}\r
__super::ActivateFrame(nCmdShow);
if (CView *const pView = GetActiveView())
{
- WINDOWPLACEMENT wp = {};
- wp.length = sizeof wp;
+ WINDOWPLACEMENT wp = { sizeof wp };
GetWindowPlacement(&wp);
CRect rc;
pView->GetWindowRect(&rc);
if (pFrameWnd == GetTopLevelFrame()->GetActiveFrame())
{
m_constraint.Persist(true, false);
- WINDOWPLACEMENT wp = {};
- wp.length = sizeof wp;
+ WINDOWPLACEMENT wp = { sizeof wp };
pFrameWnd->GetWindowPlacement(&wp);
CRect rc;
GetWindowRect(&rc);
// that cannot be determined (why?), 9-point "Segoe UI" is used (typical since Win7).
LOGFONT fontDir = {0};
const int pointsDir = 9;
- NONCLIENTMETRICS ncm = { 0 };
- ncm.cbSize = sizeof(NONCLIENTMETRICS);
+ NONCLIENTMETRICS ncm{ sizeof(NONCLIENTMETRICS) };
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))
{
const int lfHeight = -::MulDiv(pointsDir, logPixelsY, 72);
*/\r
void WildcardDropList::OnDropDown(HWND hCb, int columns, LPCTSTR fixedPatterns, bool allowUserAddedPatterns)\r
{\r
- COMBOBOXINFO info;\r
- info.cbSize = sizeof info;\r
+ COMBOBOXINFO info{ sizeof info };\r
if (!::GetComboBoxInfo(hCb, &info))\r
return;\r
RECT rc, rcCombo;\r
*/\r
bool WildcardDropList::OnCloseUp(HWND hCb)\r
{\r
- COMBOBOXINFO info;\r
- info.cbSize = sizeof info;\r
+ COMBOBOXINFO info{ sizeof info };\r
if (!::GetComboBoxInfo(hCb, &info))\r
return false;\r
::UnregisterHotKey(info.hwndList, IDCANCEL);\r
if (dwMajorVersion || dwMinorVersion || dwBuildNumber)
{
// Is the DLL up to date?
- DLLVERSIONINFO dvi;
- dvi.cbSize = sizeof dvi;
+ DLLVERSIONINFO dvi{ sizeof dvi };
dvi.dwMajorVersion = 0;
dvi.dwMinorVersion = 0;
dvi.dwBuildNumber = 0;