mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Remove Platform version helpers and use <VersionHelpers.h> per http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972%28v=vs.85%29.aspx
This commit is contained in:
@@ -261,7 +261,7 @@ INT_PTR DialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam)
|
||||
item = GetControl(Id_CloseButton);
|
||||
SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE);
|
||||
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
item = m_TabLog.GetControl(TabLog::Id_ItemsListView);
|
||||
SetWindowTheme(item, L"explorer", nullptr);
|
||||
@@ -683,7 +683,7 @@ void DialogAbout::TabSkins::Initialize()
|
||||
LVGROUP lvg;
|
||||
lvg.cbSize = sizeof(LVGROUP);
|
||||
lvg.mask = LVGF_HEADER | LVGF_GROUPID | LVGF_STATE;
|
||||
lvg.state = (Platform::IsAtLeastWinVista()) ? LVGS_COLLAPSIBLE : LVGS_NORMAL;
|
||||
lvg.state = (IsWindowsVistaOrGreater()) ? LVGS_COLLAPSIBLE : LVGS_NORMAL;
|
||||
lvg.iGroupId = 0;
|
||||
lvg.pszHeader = GetString(ID_STR_MEASURES);
|
||||
ListView_InsertGroup(item, 0, &lvg);
|
||||
|
||||
@@ -263,7 +263,7 @@ INT_PTR DialogManage::OnInitDialog(WPARAM wParam, LPARAM lParam)
|
||||
item = m_TabSkins.GetControl(TabSkins::Id_FileLabel);
|
||||
SendMessage(item, WM_SETFONT, (WPARAM)m_FontBold, 0);
|
||||
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
// Use arrows instead of plus/minus in the tree for Vista+
|
||||
item = m_TabSkins.GetControl(TabSkins::Id_SkinsTreeView);
|
||||
@@ -1948,7 +1948,7 @@ void DialogManage::TabSettings::Initialize()
|
||||
bool iconEnabled = GetRainmeter().GetTrayWindow()->IsTrayIconEnabled();
|
||||
Button_SetCheck(GetControl(Id_ShowTrayIconCheckBox), iconEnabled);
|
||||
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
Button_SetCheck(GetControl(Id_UseD2DCheckBox), GetRainmeter().GetUseD2D());
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ void MeasureNet::WriteStats(const WCHAR* iniFile, const std::wstring& statsDate)
|
||||
*/
|
||||
void MeasureNet::InitializeStatic()
|
||||
{
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
HMODULE IpHlpApiLibrary = GetModuleHandle(L"IpHlpApi.dll");
|
||||
if (IpHlpApiLibrary)
|
||||
|
||||
@@ -142,7 +142,7 @@ MeterWindow::MeterWindow(const std::wstring& folderPath, const std::wstring& fil
|
||||
m_FontCollection(),
|
||||
m_ToolTipHidden(false)
|
||||
{
|
||||
if (!c_DwmInstance && Platform::IsAtLeastWinVista())
|
||||
if (!c_DwmInstance && IsWindowsVistaOrGreater())
|
||||
{
|
||||
c_DwmInstance = System::RmLoadLibrary(L"dwmapi.dll");
|
||||
if (c_DwmInstance)
|
||||
@@ -1040,7 +1040,7 @@ void MeterWindow::HideBlur()
|
||||
*/
|
||||
void MeterWindow::ResizeBlur(const std::wstring& arg, int mode)
|
||||
{
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
WCHAR* parseSz = _wcsdup(arg.c_str());
|
||||
int type, x, y, w = 0, h = 0;
|
||||
@@ -2149,7 +2149,7 @@ bool MeterWindow::ReadSkin()
|
||||
m_TransitionUpdate = m_Parser.ReadInt(L"Rainmeter", L"TransitionUpdate", INTERVAL_TRANSITION);
|
||||
m_ToolTipHidden = m_Parser.ReadBool(L"Rainmeter", L"ToolTipHidden", false);
|
||||
|
||||
if (Platform::IsAtLeastWinVista())
|
||||
if (IsWindowsVistaOrGreater())
|
||||
{
|
||||
if (m_Parser.ReadBool(L"Rainmeter", L"Blur", false))
|
||||
{
|
||||
@@ -2190,7 +2190,7 @@ bool MeterWindow::ReadSkin()
|
||||
|
||||
HANDLE find = FindFirstFileEx(
|
||||
resourcePath.c_str(),
|
||||
(Platform::IsAtLeastWin7()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
(IsWindows7OrGreater()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
&fd,
|
||||
FindExSearchNameMatch,
|
||||
nullptr,
|
||||
|
||||
@@ -1195,7 +1195,7 @@ void Rainmeter::ScanForLayouts()
|
||||
|
||||
hSearch = FindFirstFileEx(
|
||||
folders.c_str(),
|
||||
(Platform::IsAtLeastWin7()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
(IsWindows7OrGreater()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
&fileData,
|
||||
FindExSearchNameMatch,
|
||||
nullptr,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "../Common/PathUtil.h"
|
||||
#include "../Common/Platform.h"
|
||||
#include "SkinRegistry.h"
|
||||
#include "resource.h"
|
||||
|
||||
@@ -152,7 +151,7 @@ int SkinRegistry::PopulateRecursive(const std::wstring& path, std::wstring base,
|
||||
|
||||
hSearch = FindFirstFileEx(
|
||||
filter.c_str(),
|
||||
(Platform::IsAtLeastWin7()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
(IsWindows7OrGreater()) ? FindExInfoBasic : FindExInfoStandard,
|
||||
&fileData,
|
||||
FindExSearchNameMatch,
|
||||
nullptr,
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <Wininet.h>
|
||||
#include <VersionHelpers.h>
|
||||
|
||||
// STL
|
||||
#include <map>
|
||||
|
||||
@@ -1090,7 +1090,7 @@ void System::ResetWorkingDirectory()
|
||||
void System::InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
||||
{
|
||||
typedef BOOL (WINAPI * FPINITCRITEX)(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags);
|
||||
static FPINITCRITEX InitializeCriticalSectionEx = Platform::IsAtLeastWinVista() ?
|
||||
static FPINITCRITEX InitializeCriticalSectionEx = IsWindowsVistaOrGreater() ?
|
||||
(FPINITCRITEX)GetProcAddress(GetModuleHandle(L"Kernel32"), "InitializeCriticalSectionEx") : nullptr;
|
||||
|
||||
if (InitializeCriticalSectionEx)
|
||||
@@ -1177,7 +1177,7 @@ void System::SetWallpaper(const std::wstring& wallpaper, const std::wstring& sty
|
||||
{
|
||||
wallStyle = L"2";
|
||||
}
|
||||
else if (Platform::IsAtLeastWin7())
|
||||
else if (IsWindows7OrGreater())
|
||||
{
|
||||
if (_wcsicmp(option, L"FIT") == 0)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
#include "../Common/Platform.h"
|
||||
|
||||
struct MonitorInfo
|
||||
{
|
||||
|
||||
@@ -307,7 +307,7 @@ void TrayWindow::ShowNotification(TRAY_NOTIFICATION id, const WCHAR* title, cons
|
||||
wcsncpy_s(nid.szInfoTitle, title, _TRUNCATE);
|
||||
wcsncpy_s(nid.szInfo, text, _TRUNCATE);
|
||||
|
||||
if (Platform::IsAtLeastWin7())
|
||||
if (IsWindows7OrGreater())
|
||||
{
|
||||
nid.dwInfoFlags |= NIIF_LARGE_ICON;
|
||||
nid.hBalloonIcon = GetIcon(IDI_RAINMETER, true);
|
||||
|
||||
Reference in New Issue
Block a user