diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index ed5398a3..88641cf9 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -195,9 +195,9 @@ void CMeterString::Initialize() } // Adjust the font size with screen DPI - HDC dc = GetDC(GetDesktopWindow()); + HDC dc = GetDC(0); int dpi = GetDeviceCaps(dc, LOGPIXELSX); - ReleaseDC(GetDesktopWindow(), dc); + ReleaseDC(0, dc); REAL size = (REAL)m_FontSize * (96.0f / (REAL)dpi); diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 13cf3d62..68a20805 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1705,9 +1705,9 @@ bool CMeterWindow::ReadSkin() if (_waccess(iniFile.c_str(), 0) == -1) { std::wstring message = L"Unable to refresh skin \""; - message += m_SkinName.c_str(); + message += m_SkinName; message += L"\\"; - message += m_SkinIniFile.c_str(); + message += m_SkinIniFile; message += L"\": Ini-file not found."; LSLog(LOG_DEBUG, APPNAME, message.c_str()); MessageBox(m_Window, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); @@ -2295,14 +2295,14 @@ bool CMeterWindow::ResizeWindow(bool reset) */ Bitmap* CMeterWindow::GrabDesktop(int x, int y, int w, int h) { - HDC desktopDC = GetDC(GetDesktopWindow()); + HDC desktopDC = GetDC(0); HDC dc = CreateCompatibleDC(desktopDC); HBITMAP desktopBM = CreateCompatibleBitmap(desktopDC, w, h); HBITMAP oldBM = (HBITMAP)SelectObject(dc, desktopBM); BitBlt(dc, 0, 0, w, h, desktopDC, x, y, SRCCOPY); SelectObject(dc, oldBM); DeleteDC(dc); - ReleaseDC(GetDesktopWindow(), desktopDC); + ReleaseDC(0, desktopDC); Bitmap* background = new Bitmap(desktopBM, NULL); DeleteObject(desktopBM); return background; @@ -2551,14 +2551,14 @@ void CMeterWindow::UpdateTransparency(int alpha, bool reset) szWindow.cy = m_WindowH; } - HDC dcScreen = GetDC(GetDesktopWindow()); + HDC dcScreen = GetDC(0); HDC dcMemory = CreateCompatibleDC(dcScreen); HBITMAP dbBitmap; m_DoubleBuffer->GetHBITMAP(Color(0, 0, 0, 0), &dbBitmap); HBITMAP oldBitmap = (HBITMAP)SelectObject(dcMemory, dbBitmap); UpdateLayeredWindow(m_Window, dcScreen, &ptWindowScreenPosition, &szWindow, dcMemory, &ptSrc, 0, &blendPixelFunction, ULW_ALPHA); - ReleaseDC(GetDesktopWindow(), dcScreen); + ReleaseDC(0, dcScreen); SelectObject(dcMemory, oldBitmap); DeleteDC(dcMemory); DeleteObject(dbBitmap); diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 6bc34fe5..748230e6 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -359,9 +359,9 @@ private: std::list m_Measures; // All the measures std::list m_Meters; // All the meters - std::wstring m_SkinPath; // Path of the skin folder - std::wstring m_SkinName; // Name of the current skin folder - std::wstring m_SkinIniFile; // Name of the current skin iniFile + const std::wstring m_SkinPath; // Path of the skin folder + const std::wstring m_SkinName; // Name of the current skin folder + const std::wstring m_SkinIniFile; // Name of the current skin iniFile int m_UpdateCounter;