Code cleanup & cosmetic.

This commit is contained in:
spx 2010-09-17 08:47:22 +00:00
parent 5ab0192d41
commit df146e4eb4
22 changed files with 240 additions and 276 deletions

View File

@ -220,7 +220,7 @@ void Bang(const WCHAR* command)
}
else
{
if (wcsicmp(L"!rainmeterquit", command) != 0)
if (_wcsicmp(L"!rainmeterquit", command) != 0)
{
MessageBox(NULL, L"Rainmeter is not running.\nUnable to send the !bang to it.", L"Rainmeter", MB_OK);
}

View File

@ -115,7 +115,7 @@ void UpdateAboutDialog()
std::map<std::wstring, CMeterWindow*>::const_iterator iter = windows.begin();
for( ; iter != windows.end(); ++iter)
{
if (wcsicmp(selectedItemName, (*iter).first.c_str()) == 0)
if (_wcsicmp(selectedItemName, (*iter).first.c_str()) == 0)
{
SendMessage(widget, LB_SETCURSEL, sel, 0);
break;
@ -190,7 +190,7 @@ void UpdateAboutStatistics(LPCTSTR entryName)
{
if (current == selected)
{
if (entryName == NULL || wcsicmp(entryName, (*iter).first.c_str()) == 0)
if (entryName == NULL || _wcsicmp(entryName, (*iter).first.c_str()) == 0)
{
int count = ListView_GetItemCount(widget);

View File

@ -658,7 +658,7 @@ CMeasure* CConfigParser::GetMeasure(const std::wstring& name)
std::map<std::wstring, CMeasure*>::const_iterator iter = m_Measures.begin();
for ( ; iter != m_Measures.end(); ++iter)
{
if (wcsicmp((*iter).first.c_str(), name.c_str()) == 0)
if (_wcsicmp((*iter).first.c_str(), name.c_str()) == 0)
{
return (*iter).second;
}
@ -1021,7 +1021,7 @@ void CConfigParser::ReadIniFile(const std::vector<std::wstring>& iniFileMappings
buffer = new WCHAR[bufferSize];
}
if (wcsnicmp(strKey.c_str(), L"@include", 8) == 0)
if (_wcsnicmp(strKey.c_str(), L"@include", 8) == 0)
{
std::wstring strIncludeFile = buffer;
ReadVariables();

View File

@ -172,7 +172,7 @@ void CMeasureCalc::FormulaReplace()
while ((loc = m_Formula.find_first_of(L"Rr", loc)) != std::wstring::npos)
{
if (wcsnicmp(L"Random", m_Formula.c_str() + loc, 6) == 0 &&
if (_wcsnicmp(L"Random", m_Formula.c_str() + loc, 6) == 0 &&
(loc == 0 || IsDelimiter(*(m_Formula.c_str() + loc - 1))) &&
(loc == (m_Formula.length() - 6) || IsDelimiter(*(m_Formula.c_str() + loc + 6))))
{

View File

@ -139,11 +139,11 @@ bool CMeasureTime::Update()
FileTimeToSystemTime(&ftToday, &sysToday);
if (wcsicmp(L"locale-time", m_Format.c_str()) == 0)
if (_wcsicmp(L"locale-time", m_Format.c_str()) == 0)
{
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysToday, NULL, tmpSz, MAX_LINE_LENGTH);
}
else if (wcsicmp(L"locale-date", m_Format.c_str()) == 0)
else if (_wcsicmp(L"locale-date", m_Format.c_str()) == 0)
{
GetDateFormat(LOCALE_USER_DEFAULT, 0, &sysToday, NULL, tmpSz, MAX_LINE_LENGTH);
}
@ -203,11 +203,11 @@ const WCHAR* CMeasureTime::GetStringValue(bool autoScale, double scale, int deci
// Create the string
if (m_Format.size() > 0)
{
if (wcsicmp(L"locale-time", m_Format.c_str()) == 0)
if (_wcsicmp(L"locale-time", m_Format.c_str()) == 0)
{
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysToday, NULL, tmpSz, MAX_LINE_LENGTH);
}
else if (wcsicmp(L"locale-date", m_Format.c_str()) == 0)
else if (_wcsicmp(L"locale-date", m_Format.c_str()) == 0)
{
GetDateFormat(LOCALE_USER_DEFAULT, 0, &sysToday, NULL, tmpSz, MAX_LINE_LENGTH);
}
@ -244,7 +244,7 @@ void CMeasureTime::ReadConfig(CConfigParser& parser, const WCHAR* section)
GetLocalTime(&sysLocalTime);
GetSystemTime(&sysUTCTime);
if (wcsicmp(L"local", timezone.c_str()) == 0)
if (_wcsicmp(L"local", timezone.c_str()) == 0)
{
FILETIME ftLocalTime, ftUTCTime;
SystemTimeToFileTime(&sysLocalTime, &ftLocalTime);

View File

@ -495,7 +495,7 @@ bool CMeter::Update()
/*
** SetAllMeasures
**
** Creates a vector containing all the defined measures (Histogram)
** Creates a vector containing all the defined measures (for Histogram)
*/
void CMeter::SetAllMeasures(CMeasure* measure)
{
@ -504,6 +504,11 @@ void CMeter::SetAllMeasures(CMeasure* measure)
m_AllMeasures.push_back(measure);
}
/*
** SetAllMeasures
**
** Creates a vector containing all the defined measures (for Line/String)
*/
void CMeter::SetAllMeasures(std::vector<CMeasure*> measures)
{
m_AllMeasures.clear();
@ -527,9 +532,8 @@ std::wstring CMeter::ReplaceMeasures(std::wstring source)
if (!m_AllMeasures.empty())
{
stringValues.push_back(m_AllMeasures.front()->GetStringValue(true, 1, 0, false));
// Get the values for the other measures
for (size_t i = 1; i < m_AllMeasures.size(); ++i)
// Get the values for the measures
for (size_t i = 0; i < m_AllMeasures.size(); ++i)
{
stringValues.push_back(m_AllMeasures[i]->GetStringValue(true, 1, 0, false));
}
@ -573,13 +577,17 @@ std::wstring CMeter::ReplaceMeasures(std::wstring source)
*/
void CMeter::CreateToolTip(CMeterWindow* meterWindow)
{
HWND hwndTT;
if(!m_ToolTipType)
DWORD style = WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP;
if (m_ToolTipType)
{
hwndTT = CreateWindowEx(WS_EX_TOPMOST,
style |= TTS_BALLOON;
}
HWND hwndTT = CreateWindowEx(WS_EX_TOPMOST,
TOOLTIPS_CLASS,
NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
style,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
@ -588,76 +596,23 @@ void CMeter::CreateToolTip(CMeterWindow* meterWindow)
NULL,
m_MeterWindow->GetMainObject()->GetInstance(),
NULL);
}
else
if (hwndTT)
{
hwndTT = CreateWindowEx(WS_EX_TOPMOST,
TOOLTIPS_CLASS,
NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
m_MeterWindow->GetWindow(),
NULL,
m_MeterWindow->GetMainObject()->GetInstance(),
NULL);
}
SetWindowPos(hwndTT, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(TOOLINFO);
TOOLINFO ti = {sizeof(TOOLINFO)};
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = m_MeterWindow->GetWindow();
ti.hinst = m_MeterWindow->GetMainObject()->GetInstance();
std::wstring text = ReplaceMeasures(m_ToolTipText);
ti.lpszText = (PTSTR) text.c_str();
ti.rect = GetMeterRect();
SendMessage(hwndTT, TTM_ADDTOOL, NULL, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, m_ToolTipWidth);
if (!m_ToolTipTitle.empty())
{
HICON hIcon = NULL;
if (!m_ToolTipIcon.empty())
{
if (!_wcsicmp(m_ToolTipIcon.c_str(), L"INFO"))
{
hIcon = (HICON) TTI_INFO;
}
else if (!_wcsicmp(m_ToolTipIcon.c_str(), L"WARNING"))
{
hIcon = (HICON) TTI_WARNING;
}
else if (!_wcsicmp(m_ToolTipIcon.c_str(), L"ERROR"))
{
hIcon = (HICON) TTI_ERROR;
}
else if (!_wcsicmp(m_ToolTipIcon.c_str(), L"QUESTION"))
{
hIcon = LoadIcon(NULL, IDI_QUESTION);
}
else if (!_wcsicmp(m_ToolTipIcon.c_str(), L"SHIELD"))
{
hIcon = LoadIcon(NULL, IDI_SHIELD);
}
else
{
hIcon = (HICON) LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
}
}
text = ReplaceMeasures(m_ToolTipTitle);
SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM) text.c_str());
DestroyIcon(hIcon);
}
if (IsHidden())
{
SendMessage(hwndTT, TTM_ACTIVATE, FALSE, NULL);
}
m_ToolTipHandle = hwndTT;
UpdateToolTip();
}
}
/*
@ -669,8 +624,7 @@ void CMeter::UpdateToolTip()
{
HWND hwndTT = m_ToolTipHandle;
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(TOOLINFO);
TOOLINFO ti = {sizeof(TOOLINFO)};
ti.hwnd = m_MeterWindow->GetWindow();
SendMessage(hwndTT, TTM_GETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti);
@ -680,10 +634,13 @@ void CMeter::UpdateToolTip()
ti.rect = GetMeterRect();
SendMessage(hwndTT, TTM_SETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, m_ToolTipWidth);
if (!m_ToolTipTitle.empty())
{
HICON hIcon = NULL;
bool destroy = false;
if (!m_ToolTipIcon.empty())
{
if (!_wcsicmp(m_ToolTipIcon.c_str(), L"INFO"))
@ -709,12 +666,18 @@ void CMeter::UpdateToolTip()
else
{
hIcon = (HICON) LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
destroy = true;
}
}
text = ReplaceMeasures(m_ToolTipTitle);
SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM) text.c_str());
if (destroy)
{
DestroyIcon(hIcon);
}
}
SendMessage(hwndTT, TTM_ACTIVATE, !IsHidden(), NULL);
}

View File

@ -69,7 +69,7 @@ public:
std::wstring CMeter::ReplaceMeasures(std::wstring source);
std::wstring& GetToolTipText() { return m_ToolTipText; };
const std::wstring& GetToolTipText() { return m_ToolTipText; };
HWND GetToolTipHandle() { return m_ToolTipHandle; };
void SetToolTipHandle(HWND handle) { m_ToolTipHandle = handle; };

View File

@ -913,7 +913,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
std::list<CMeasure*>::const_iterator iter = m_Measures.begin();
for( ; iter != m_Measures.end(); ++iter)
{
if (wcsicmp((*iter)->GetName(), measure.c_str()) == 0)
if (_wcsicmp((*iter)->GetName(), measure.c_str()) == 0)
{
(*iter)->ExecuteBang(args.c_str());
return;
@ -980,7 +980,7 @@ void CMeterWindow::ShowMeter(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*j)->GetName(), name) != 0) continue;
if (_wcsicmp((*j)->GetName(), name) != 0) continue;
}
(*j)->Show();
@ -1014,7 +1014,7 @@ void CMeterWindow::HideMeter(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*j)->GetName(), name) != 0) continue;
if (_wcsicmp((*j)->GetName(), name) != 0) continue;
}
(*j)->Hide();
@ -1048,7 +1048,7 @@ void CMeterWindow::ToggleMeter(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*j)->GetName(), name) != 0) continue;
if (_wcsicmp((*j)->GetName(), name) != 0) continue;
}
if ((*j)->IsHidden())
@ -1087,7 +1087,7 @@ void CMeterWindow::MoveMeter(int x, int y, const WCHAR* name)
std::list<CMeter*>::const_iterator j = m_Meters.begin();
for( ; j != m_Meters.end(); ++j)
{
if (wcsicmp((*j)->GetName(), name) == 0)
if (_wcsicmp((*j)->GetName(), name) == 0)
{
(*j)->SetX(x);
(*j)->SetY(y);
@ -1118,7 +1118,7 @@ void CMeterWindow::EnableMeasure(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*i)->GetName(), name) != 0) continue;
if (_wcsicmp((*i)->GetName(), name) != 0) continue;
}
(*i)->Enable();
@ -1148,7 +1148,7 @@ void CMeterWindow::DisableMeasure(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*i)->GetName(), name) != 0) continue;
if (_wcsicmp((*i)->GetName(), name) != 0) continue;
}
(*i)->Disable();
@ -1178,7 +1178,7 @@ void CMeterWindow::ToggleMeasure(const WCHAR* name, bool group)
}
else
{
if (wcsicmp((*i)->GetName(), name) != 0) continue;
if (_wcsicmp((*i)->GetName(), name) != 0) continue;
}
if ((*i)->IsDisabled())
@ -1927,9 +1927,9 @@ bool CMeterWindow::ReadSkin()
{
std::wstring strSection = arraySections[i];
if(wcsicmp(L"Rainmeter", strSection.c_str()) != 0 &&
wcsicmp(L"Variables", strSection.c_str()) != 0 &&
wcsicmp(L"Metadata", strSection.c_str()) != 0)
if(_wcsicmp(L"Rainmeter", strSection.c_str()) != 0 &&
_wcsicmp(L"Variables", strSection.c_str()) != 0 &&
_wcsicmp(L"Metadata", strSection.c_str()) != 0)
{
std::wstring meterName, measureName;
@ -2018,18 +2018,13 @@ bool CMeterWindow::ReadSkin()
}
else
{
// Bind the meters to the measures and create tooltips
// Bind the meters to the measures
std::list<CMeter*>::const_iterator j = m_Meters.begin();
for( ; j != m_Meters.end(); ++j)
{
try
{
(*j)->BindMeasure(m_Measures);
if (!(*j)->GetToolTipText().empty())
{
(*j)->CreateToolTip(this);
}
}
catch (CError& error)
{
@ -2079,6 +2074,11 @@ void CMeterWindow::InitializeMeters()
try
{
(*j)->Initialize();
if (!(*j)->GetToolTipText().empty())
{
(*j)->CreateToolTip(this);
}
}
catch (CError& error)
{
@ -2469,11 +2469,14 @@ void CMeterWindow::Update(bool nodraw)
}
// Update tooltips
if (!((*j)->GetToolTipHandle() != NULL) && (!(*j)->GetToolTipText().empty()))
if ((*j)->GetToolTipHandle() == NULL)
{
if (!(*j)->GetToolTipText().empty())
{
(*j)->CreateToolTip(this);
}
if ((*j)->GetToolTipHandle() != NULL)
}
else
{
(*j)->UpdateToolTip();
}
@ -4502,9 +4505,9 @@ LRESULT CMeterWindow::OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam)
std::wstring str = (const WCHAR*)pCopyDataStruct->lpData;
if (wcsnicmp(L"PLAY ", str.c_str(), 5) == 0 ||
wcsnicmp(L"PLAYLOOP ", str.c_str(), 9) == 0 ||
wcsnicmp(L"PLAYSTOP", str.c_str(), 8) == 0)
if (_wcsnicmp(L"PLAY ", str.c_str(), 5) == 0 ||
_wcsnicmp(L"PLAYLOOP ", str.c_str(), 9) == 0 ||
_wcsnicmp(L"PLAYSTOP", str.c_str(), 8) == 0)
{
// Audio commands are special cases.
Rainmeter->ExecuteCommand(str.c_str(), this);
@ -4527,7 +4530,7 @@ LRESULT CMeterWindow::OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam)
bang = str;
}
if (wcsicmp(bang.c_str(), L"!RainmeterWriteKeyValue") == 0)
if (_wcsicmp(bang.c_str(), L"!RainmeterWriteKeyValue") == 0)
{
// !RainmeterWriteKeyValue is a special case.
if (CRainmeter::ParseString(arg.c_str()).size() < 4)

View File

@ -487,11 +487,11 @@ void RainmeterActivateConfig(HWND, const char* arg)
for (size_t i = 0; i < configs.size(); ++i)
{
if (wcsicmp(configs[i].config.c_str(), subStrings[0].c_str()) == 0)
if (_wcsicmp(configs[i].config.c_str(), subStrings[0].c_str()) == 0)
{
for (size_t j = 0; j < configs[i].iniFiles.size(); ++j)
{
if (wcsicmp(configs[i].iniFiles[j].c_str(), subStrings[1].c_str()) == 0)
if (_wcsicmp(configs[i].iniFiles[j].c_str(), subStrings[1].c_str()) == 0)
{
Rainmeter->ActivateConfig(i, j);
return;
@ -1037,8 +1037,8 @@ void RainmeterWriteKeyValue(HWND, const char* arg)
return;
}
if (wcsnicmp(iniFile.c_str(), Rainmeter->GetSkinPath().c_str(), Rainmeter->GetSkinPath().size()) != 0 &&
wcsnicmp(iniFile.c_str(), Rainmeter->GetPath().c_str(), Rainmeter->GetPath().size()) != 0)
if (_wcsnicmp(iniFile.c_str(), Rainmeter->GetSkinPath().c_str(), Rainmeter->GetSkinPath().size()) != 0 &&
_wcsnicmp(iniFile.c_str(), Rainmeter->GetPath().c_str(), Rainmeter->GetPath().size()) != 0)
{
DebugLog(L"!RainmeterWriteKeyValue: Illegal path outside of Rainmeter directories: %s", iniFile.c_str());
return;
@ -1346,7 +1346,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
{
iniFile += L"Rainmeter.ini";
}
else if (iniFile.length() <= 4 || wcsicmp(iniFile.substr(iniFile.length() - 4).c_str(), L".ini") != 0)
else if (iniFile.length() <= 4 || _wcsicmp(iniFile.substr(iniFile.length() - 4).c_str(), L".ini") != 0)
{
iniFile += L"\\Rainmeter.ini";
}
@ -1370,7 +1370,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
// Set the log file location
m_LogFile = m_IniFile;
size_t logFileLen = m_LogFile.length();
if (logFileLen > 4 && wcsicmp(m_LogFile.substr(logFileLen - 4).c_str(), L".ini") == 0)
if (logFileLen > 4 && _wcsicmp(m_LogFile.substr(logFileLen - 4).c_str(), L".ini") == 0)
{
m_LogFile.replace(logFileLen - 4, 4, L".log");
}
@ -1479,7 +1479,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
TestSettingsFile(bDefaultIniLocation);
// If the skin folder is somewhere else than in the program path
if (wcsnicmp(m_Path.c_str(), m_SkinPath.c_str(), m_Path.size()) != 0)
if (_wcsnicmp(m_Path.c_str(), m_SkinPath.c_str(), m_Path.size()) != 0)
{
CheckSkinVersions();
}
@ -1878,7 +1878,7 @@ bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex)
const std::wstring skinConfig = meterWindow->GetSkinName();
for (size_t i = 0; i < m_ConfigStrings.size(); ++i)
{
if (wcsicmp(skinConfig.c_str(), m_ConfigStrings[i].config.c_str()) == 0)
if (_wcsicmp(skinConfig.c_str(), m_ConfigStrings[i].config.c_str()) == 0)
{
m_ConfigStrings[i].active = 0;
break;
@ -1989,7 +1989,7 @@ CMeterWindow* CRainmeter::GetMeterWindow(const std::wstring& config)
for (; iter != m_Meters.end(); ++iter)
{
if (wcsicmp((*iter).first.c_str(), config.c_str()) == 0)
if (_wcsicmp((*iter).first.c_str(), config.c_str()) == 0)
{
return (*iter).second;
}
@ -2033,11 +2033,11 @@ void CRainmeter::SetConfigOrder(int configIndex)
if (GetPrivateProfileString(m_ConfigStrings[configIndex].config.c_str(), L"LoadOrder", L"", buffer, 256, m_IniFile.c_str()) > 0)
{
if (wcsicmp(buffer, L"LAST") == 0)
if (_wcsicmp(buffer, L"LAST") == 0)
{
order = INT_MAX;
}
else if (wcsicmp(buffer, L"FIRST") == 0)
else if (_wcsicmp(buffer, L"FIRST") == 0)
{
order = INT_MIN;
}
@ -2205,7 +2205,7 @@ int CRainmeter::ScanForConfigsRecursive(std::wstring& path, std::wstring base, i
// Check whether the extension is ".ini"
std::wstring ext = fileDataIni.cFileName;
std::wstring::size_type pos = ext.find_last_of(L'.');
if (pos != std::wstring::npos && wcsicmp(&(ext.c_str()[pos]), L".ini") == 0)
if (pos != std::wstring::npos && _wcsicmp(&(ext.c_str()[pos]), L".ini") == 0)
{
CONFIGMENU menuItem;
menuItem.name = fileDataIni.cFileName;
@ -2300,239 +2300,239 @@ void CRainmeter::SaveSettings()
BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg, CMeterWindow* meterWindow)
{
if (wcsicmp(bang.c_str(), L"!RainmeterRefresh") == 0)
if (_wcsicmp(bang.c_str(), L"!RainmeterRefresh") == 0)
{
BangWithArgs(BANG_REFRESH, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterRefreshApp") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterRefreshApp") == 0)
{
RainmeterRefreshApp(NULL, NULL);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterRedraw") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterRedraw") == 0)
{
BangWithArgs(BANG_REDRAW, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHide") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHide") == 0)
{
BangWithArgs(BANG_HIDE, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShow") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShow") == 0)
{
BangWithArgs(BANG_SHOW, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggle") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggle") == 0)
{
BangWithArgs(BANG_TOGGLE, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHideFade") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHideFade") == 0)
{
BangWithArgs(BANG_HIDEFADE, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShowFade") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShowFade") == 0)
{
BangWithArgs(BANG_SHOWFADE, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleFade") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleFade") == 0)
{
BangWithArgs(BANG_TOGGLEFADE, arg.c_str(), 0);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHideMeter") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHideMeter") == 0)
{
BangWithArgs(BANG_HIDEMETER, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShowMeter") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShowMeter") == 0)
{
BangWithArgs(BANG_SHOWMETER, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleMeter") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleMeter") == 0)
{
BangWithArgs(BANG_TOGGLEMETER, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDisableMeasure") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDisableMeasure") == 0)
{
BangWithArgs(BANG_DISABLEMEASURE, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterEnableMeasure") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterEnableMeasure") == 0)
{
BangWithArgs(BANG_ENABLEMEASURE, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleMeasure") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleMeasure") == 0)
{
BangWithArgs(BANG_TOGGLEMEASURE, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterActivateConfig") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterActivateConfig") == 0)
{
RainmeterActivateConfig(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDeactivateConfig") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDeactivateConfig") == 0)
{
RainmeterDeactivateConfig(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleConfig") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleConfig") == 0)
{
RainmeterToggleConfig(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterMove") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterMove") == 0)
{
BangWithArgs(BANG_MOVE, arg.c_str(), 2);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterChangeZPos") == 0) // For backwards compatibility
else if (_wcsicmp(bang.c_str(), L"!RainmeterChangeZPos") == 0) // For backwards compatibility
{
BangWithArgs(BANG_ZPOS, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterZPos") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterZPos") == 0)
{
BangWithArgs(BANG_ZPOS, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterClickThrough") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterClickThrough") == 0)
{
BangWithArgs(BANG_CLICKTHROUGH, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDraggable") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDraggable") == 0)
{
BangWithArgs(BANG_DRAGGABLE, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSnapEdges") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSnapEdges") == 0)
{
BangWithArgs(BANG_SNAPEDGES, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreen") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreen") == 0)
{
BangWithArgs(BANG_KEEPONSCREEN, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparency") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSetTransparency") == 0)
{
BangWithArgs(BANG_SETTRANSPARENCY, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetVariable") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSetVariable") == 0)
{
BangWithArgs(BANG_SETVARIABLE, arg.c_str(), 2);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterRefreshGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterRefreshGroup") == 0)
{
RainmeterRefreshGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterRedrawGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterRedrawGroup") == 0)
{
RainmeterRedrawGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHideGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHideGroup") == 0)
{
RainmeterHideGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShowGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShowGroup") == 0)
{
RainmeterShowGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleGroup") == 0)
{
RainmeterToggleGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHideFadeGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHideFadeGroup") == 0)
{
RainmeterHideFadeGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShowFadeGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShowFadeGroup") == 0)
{
RainmeterShowFadeGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleFadeGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleFadeGroup") == 0)
{
RainmeterToggleFadeGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterHideMeterGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterHideMeterGroup") == 0)
{
BangWithArgs(BANG_HIDEMETERGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterShowMeterGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterShowMeterGroup") == 0)
{
BangWithArgs(BANG_SHOWMETERGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleMeterGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleMeterGroup") == 0)
{
BangWithArgs(BANG_TOGGLEMETERGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDisableMeasureGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDisableMeasureGroup") == 0)
{
BangWithArgs(BANG_DISABLEMEASUREGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterEnableMeasureGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterEnableMeasureGroup") == 0)
{
BangWithArgs(BANG_ENABLEMEASUREGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterToggleMeasureGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterToggleMeasureGroup") == 0)
{
BangWithArgs(BANG_TOGGLEMEASUREGROUP, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDeactivateConfigGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDeactivateConfigGroup") == 0)
{
RainmeterDeactivateConfigGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterZPosGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterZPosGroup") == 0)
{
RainmeterZPosGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterClickThroughGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterClickThroughGroup") == 0)
{
RainmeterClickThroughGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDraggableGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterDraggableGroup") == 0)
{
RainmeterDraggableGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSnapEdgesGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSnapEdgesGroup") == 0)
{
RainmeterSnapEdgesGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreenGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreenGroup") == 0)
{
RainmeterKeepOnScreenGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparencyGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSetTransparencyGroup") == 0)
{
RainmeterSetTransparencyGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetVariableGroup") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSetVariableGroup") == 0)
{
RainmeterSetVariableGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterAbout") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterAbout") == 0)
{
RainmeterAbout(NULL, NULL);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSkinMenu") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterSkinMenu") == 0)
{
RainmeterSkinMenu(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterTrayMenu") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterTrayMenu") == 0)
{
RainmeterTrayMenu(NULL, NULL);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterResetStats") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterResetStats") == 0)
{
RainmeterResetStats(NULL, NULL);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterMoveMeter") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterMoveMeter") == 0)
{
BangWithArgs(BANG_MOVEMETER, arg.c_str(), 3);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterWriteKeyValue") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterWriteKeyValue") == 0)
{
RainmeterWriteKeyValue(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterPluginBang") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterPluginBang") == 0)
{
BangWithArgs(BANG_PLUGIN, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterLsBoxHook") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterLsBoxHook") == 0)
{
// Nothing to do here (this works only with Litestep)
}
else if (wcsicmp(bang.c_str(), L"!RainmeterQuit") == 0)
else if (_wcsicmp(bang.c_str(), L"!RainmeterQuit") == 0)
{
RainmeterQuit(NULL, NULL);
}
else if (wcsicmp(bang.c_str(), L"!Execute") == 0)
else if (_wcsicmp(bang.c_str(), L"!Execute") == 0)
{
// Special case for multibang execution
std::wstring::size_type start = std::wstring::npos;
@ -2587,7 +2587,7 @@ std::wstring CRainmeter::ParseCommand(const WCHAR* command, CMeterWindow* meterW
{
std::wstring strCommand = command;
if (wcsnicmp(L"!execute", command, 8) == 0)
if (_wcsnicmp(L"!execute", command, 8) == 0)
{
return strCommand;
}
@ -2617,7 +2617,7 @@ std::wstring CRainmeter::ParseCommand(const WCHAR* command, CMeterWindow* meterW
std::list<CMeasure*>::const_iterator iter = meterWindow->GetMeasures().begin();
for( ; iter != meterWindow->GetMeasures().end(); ++iter)
{
if (wcsicmp((*iter)->GetName(), measureName.c_str()) == 0)
if (_wcsicmp((*iter)->GetName(), measureName.c_str()) == 0)
{
std::wstring value = (*iter)->GetStringValue(false, 1, -1, false);
strCommand.replace(start, (end - start) + 1, value);
@ -2655,8 +2655,8 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow)
if (!strCommand.empty())
{
// Check for built-ins
if (wcsnicmp(L"PLAY ", strCommand.c_str(), 5) == 0 ||
wcsnicmp(L"PLAYLOOP ", strCommand.c_str(), 9) == 0)
if (_wcsnicmp(L"PLAY ", strCommand.c_str(), 5) == 0 ||
_wcsnicmp(L"PLAYLOOP ", strCommand.c_str(), 9) == 0)
{
// Strip built-in command
size_t pos = strCommand.find(L' ');
@ -2949,13 +2949,13 @@ void CRainmeter::RefreshAll()
std::wstring skinConfig = mw->GetSkinName();
for (size_t i = 0; i < m_ConfigStrings.size(); ++i)
{
if (wcsicmp(skinConfig.c_str(), m_ConfigStrings[i].config.c_str()) == 0)
if (_wcsicmp(skinConfig.c_str(), m_ConfigStrings[i].config.c_str()) == 0)
{
found = 1;
std::wstring skinIniFile = mw->GetSkinIniFile();
for (size_t j = 0; j < m_ConfigStrings[i].iniFiles.size(); ++j)
{
if (wcsicmp(skinIniFile.c_str(), m_ConfigStrings[i].iniFiles[j].c_str()) == 0)
if (_wcsicmp(skinIniFile.c_str(), m_ConfigStrings[i].iniFiles[j].c_str()) == 0)
{
found = 2;
if (m_ConfigStrings[i].active != j + 1)
@ -3536,7 +3536,7 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU con
for (size_t i = 0; i < m_ConfigStrings.size(); ++i)
{
const CONFIG& config = m_ConfigStrings[i];
if (wcsicmp(config.config.c_str(), skinName.c_str()) == 0)
if (_wcsicmp(config.config.c_str(), skinName.c_str()) == 0)
{
HMENU variantsMenu = CreatePopupMenu();
for (size_t j = 0; j < config.iniFiles.size(); ++j)
@ -3573,7 +3573,7 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU con
itemInfo.cch = MAX_PATH;
if (GetMenuItemInfo(configMenu, (UINT)i, TRUE, &itemInfo))
{
if (wcsicmp(root.c_str(), buffer) == 0)
if (_wcsicmp(root.c_str(), buffer) == 0)
{
HMENU configRootMenu = GetSubMenu(configMenu, i);
if (configRootMenu)

View File

@ -53,8 +53,6 @@ bool CSystem::c_ShowDesktop = false;
OSPLATFORM CSystem::c_Platform = OSPLATFORM_UNKNOWN;
FPSETDLLDIRECTORYW CSystem::c_SetDllDirectoryW = NULL;
extern CRainmeter* Rainmeter;
/*
@ -1050,6 +1048,8 @@ BOOL CSystem::RmSetDllDirectory(LPCWSTR lpPathName)
{
if (GetOSPlatform() >= OSPLATFORM_XP_SP1)
{
static FPSETDLLDIRECTORYW c_SetDllDirectoryW = NULL;
if (!c_SetDllDirectoryW)
{
c_SetDllDirectoryW = (FPSETDLLDIRECTORYW)GetProcAddress(GetModuleHandle(L"Kernel32.dll"), "SetDllDirectoryW");
@ -1262,7 +1262,7 @@ std::wstring CSystem::GetTemporaryFile(const std::vector<std::wstring>& iniFileM
for (size_t i = 0; i < iniFileMappings.size(); ++i)
{
if (wcsicmp(iniFileMappings[i].c_str(), filename.c_str()) == 0)
if (_wcsicmp(iniFileMappings[i].c_str(), filename.c_str()) == 0)
{
WCHAR buffer[MAX_PATH];

View File

@ -116,8 +116,6 @@ private:
static bool c_ShowDesktop;
static OSPLATFORM c_Platform;
static FPSETDLLDIRECTORYW c_SetDllDirectoryW;
};
#endif

View File

@ -321,13 +321,13 @@ void CTrayWindow::ReadConfig(CConfigParser& parser)
m_MeterType = TRAY_METER_TYPE_NONE;
std::wstring type = parser.ReadString(L"TrayMeasure", L"TrayMeter", L"HISTOGRAM");
if (wcsicmp(type.c_str(), L"HISTOGRAM") == 0)
if (_wcsicmp(type.c_str(), L"HISTOGRAM") == 0)
{
m_MeterType = TRAY_METER_TYPE_HISTOGRAM;
m_TrayColor1 = parser.ReadColor(L"TrayMeasure", L"TrayColor1", Color(0, 100, 0));
m_TrayColor2 = parser.ReadColor(L"TrayMeasure", L"TrayColor2", Color(0, 255, 0));
}
else if (wcsicmp(type.c_str(), L"BITMAP") == 0)
else if (_wcsicmp(type.c_str(), L"BITMAP") == 0)
{
m_MeterType = TRAY_METER_TYPE_BITMAP;

View File

@ -114,7 +114,7 @@ bool CheckProcess(CPUMeasure* measure, const std::wstring& name)
{
for (size_t i = 0; i < measure->excludes.size(); i++)
{
if (wcsicmp(measure->excludes[i].c_str(), name.c_str()) == 0)
if (_wcsicmp(measure->excludes[i].c_str(), name.c_str()) == 0)
{
return false; // Exclude
}
@ -125,7 +125,7 @@ bool CheckProcess(CPUMeasure* measure, const std::wstring& name)
{
for (size_t i = 0; i < measure->includes.size(); i++)
{
if (wcsicmp(measure->includes[i].c_str(), name.c_str()) == 0)
if (_wcsicmp(measure->includes[i].c_str(), name.c_str()) == 0)
{
return true; // Include
}
@ -303,7 +303,7 @@ void UpdateProcesses()
{
if(pObjInst->GetObjectInstanceName(name, 256))
{
if (wcsicmp(name, L"_Total") == 0)
if (_wcsicmp(name, L"_Total") == 0)
{
continue;
}

View File

@ -97,19 +97,19 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"PowerState", L"");
if(type)
{
if (wcsicmp(L"ACLINE", type) == 0)
if (_wcsicmp(L"ACLINE", type) == 0)
{
powerState = POWER_ACLINE;
}
else if (wcsicmp(L"STATUS", type) == 0)
else if (_wcsicmp(L"STATUS", type) == 0)
{
powerState = POWER_STATUS;
}
else if (wcsicmp(L"STATUS2", type) == 0)
else if (_wcsicmp(L"STATUS2", type) == 0)
{
powerState = POWER_STATUS2;
}
else if (wcsicmp(L"LIFETIME", type) == 0)
else if (_wcsicmp(L"LIFETIME", type) == 0)
{
powerState= POWER_LIFETIME;
@ -119,11 +119,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
g_Formats[id] = format;
}
}
else if (wcsicmp(L"MHZ", type) == 0)
else if (_wcsicmp(L"MHZ", type) == 0)
{
powerState= POWER_MHZ;
}
else if (wcsicmp(L"PERCENT", type) == 0)
else if (_wcsicmp(L"PERCENT", type) == 0)
{
powerState = POWER_PERCENT;
}

View File

@ -90,11 +90,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"RecycleType", L"COUNT");
if (type)
{
if (wcsicmp(L"COUNT", type) == 0)
if (_wcsicmp(L"COUNT", type) == 0)
{
dataType = NUMRECYCLE;
}
else if (wcsicmp(L"SIZE", type) == 0)
else if (_wcsicmp(L"SIZE", type) == 0)
{
dataType = SIZERECYCLE;
}
@ -152,7 +152,7 @@ double Update2(UINT id)
SHQUERYRBINFO RecycleBinInfo = { 0 };
RecycleBinInfo.cbSize = sizeof( RecycleBinInfo ); // Tell size of structure
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHQueryRecycleBin( NULL, &RecycleBinInfo ) == S_OK)
{
@ -224,9 +224,9 @@ void ExecuteBang(LPCTSTR args, UINT id)
std::wstring bang = args;
std::wstring driveSet = g_DriveList[id];
if (wcsicmp(bang.c_str(), L"EmptyBin") == 0)
if (_wcsicmp(bang.c_str(), L"EmptyBin") == 0)
{ //Empty the Recycle Bin
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHEmptyRecycleBin( NULL, NULL, NULL ) == S_OK)
{
@ -250,9 +250,9 @@ void ExecuteBang(LPCTSTR args, UINT id)
}
else
{
if (wcsicmp(bang.c_str(), L"EmptyBinSilent") == 0)
if (_wcsicmp(bang.c_str(), L"EmptyBinSilent") == 0)
{ //Empty the Recycle Bin (no prompt)
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHEmptyRecycleBin( NULL, NULL, SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND ) == S_OK)
{
@ -274,7 +274,7 @@ void ExecuteBang(LPCTSTR args, UINT id)
}
return;
}
else if (wcsicmp(bang.c_str(), L"OpenBin") == 0)
else if (_wcsicmp(bang.c_str(), L"OpenBin") == 0)
{ //Open the Recycle Bin folder
//system("explorer.exe /N,::{645FF040-5081-101B-9F08-00AA002F954E}");
std::wstring szCmd = L"explorer.exe";

View File

@ -95,19 +95,19 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
/* Read our own settings from the ini-file */
if (type)
{
if ( wcsicmp ( L"GDI", type ) == 0 )
if ( _wcsicmp ( L"GDI", type ) == 0 )
{
g_Counters[id] = GDI_COUNT;
}
else if ( wcsicmp ( L"USER", type ) == 0 )
else if ( _wcsicmp ( L"USER", type ) == 0 )
{
g_Counters[id] = USER_COUNT;
}
else if ( wcsicmp ( L"HANDLE", type ) == 0 )
else if ( _wcsicmp ( L"HANDLE", type ) == 0 )
{
g_Counters[id] = HANDLE_COUNT;
}
else if ( wcsicmp ( L"WINDOW", type ) == 0 )
else if ( _wcsicmp ( L"WINDOW", type ) == 0 )
{
g_Counters[id] = WINDOW_COUNT;
}
@ -188,7 +188,7 @@ UINT Update(UINT id)
{
if (GetModuleBaseName(hProcess, hMod[0], buffer, sizeof(buffer)))
{
if (wcsicmp(buffer, processName) != 0)
if (_wcsicmp(buffer, processName) != 0)
{
CloseHandle ( hProcess );
continue;

View File

@ -90,22 +90,22 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"SpeedFanType", L"TEMPERATURE");
if (type)
{
if (wcsicmp(L"TEMPERATURE", type) == 0)
if (_wcsicmp(L"TEMPERATURE", type) == 0)
{
g_Types[id] = TYPE_TEMP;
LPCTSTR scale = ReadConfigString(section, L"SpeedFanScale", L"C");
if (scale)
{
if (wcsicmp(L"C", scale) == 0)
if (_wcsicmp(L"C", scale) == 0)
{
g_Scales[id] = SCALE_CENTIGRADE;
}
else if (wcsicmp(L"F", scale) == 0)
else if (_wcsicmp(L"F", scale) == 0)
{
g_Scales[id] = SCALE_FARENHEIT;
}
else if (wcsicmp(L"K", scale) == 0)
else if (_wcsicmp(L"K", scale) == 0)
{
g_Scales[id] = SCALE_KELVIN;
}
@ -117,11 +117,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
}
}
else if (wcsicmp(L"FAN", type) == 0)
else if (_wcsicmp(L"FAN", type) == 0)
{
g_Types[id] = TYPE_FAN;
}
else if (wcsicmp(L"VOLTAGE", type) == 0)
else if (_wcsicmp(L"VOLTAGE", type) == 0)
{
g_Types[id] = TYPE_VOLT;
}

View File

@ -104,104 +104,104 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"SysInfoType", L"");
if(type)
{
if (wcsicmp(L"COMPUTER_NAME", type) == 0)
if (_wcsicmp(L"COMPUTER_NAME", type) == 0)
{
g_Types[id] = COMPUTER_NAME;
}
else if (wcsicmp(L"USER_NAME", type) == 0)
else if (_wcsicmp(L"USER_NAME", type) == 0)
{
g_Types[id] = USER_NAME;
}
else if (wcsicmp(L"WORK_AREA", type) == 0)
else if (_wcsicmp(L"WORK_AREA", type) == 0)
{
g_Types[id] = WORK_AREA;
}
else if (wcsicmp(L"SCREEN_SIZE", type) == 0)
else if (_wcsicmp(L"SCREEN_SIZE", type) == 0)
{
g_Types[id] = SCREEN_SIZE;
}
else if (wcsicmp(L"RAS_STATUS", type) == 0)
else if (_wcsicmp(L"RAS_STATUS", type) == 0)
{
g_Types[id] = RAS_STATUS;
}
else if (wcsicmp(L"OS_VERSION", type) == 0)
else if (_wcsicmp(L"OS_VERSION", type) == 0)
{
g_Types[id] = OS_VERSION;
}
else if (wcsicmp(L"OS_BITS", type) == 0)
else if (_wcsicmp(L"OS_BITS", type) == 0)
{
g_Types[id] = OS_BITS;
}
else if (wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
else if (_wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
{
g_Types[id] = ADAPTER_DESCRIPTION;
}
else if (wcsicmp(L"NET_MASK", type) == 0)
else if (_wcsicmp(L"NET_MASK", type) == 0)
{
g_Types[id] = NET_MASK;
}
else if (wcsicmp(L"IP_ADDRESS", type) == 0)
else if (_wcsicmp(L"IP_ADDRESS", type) == 0)
{
g_Types[id] = IP_ADDRESS;
}
else if (wcsicmp(L"GATEWAY_ADDRESS", type) == 0)
else if (_wcsicmp(L"GATEWAY_ADDRESS", type) == 0)
{
g_Types[id] = GATEWAY_ADDRESS;
}
else if (wcsicmp(L"HOST_NAME", type) == 0)
else if (_wcsicmp(L"HOST_NAME", type) == 0)
{
g_Types[id] = HOST_NAME;
}
else if (wcsicmp(L"DOMAIN_NAME", type) == 0)
else if (_wcsicmp(L"DOMAIN_NAME", type) == 0)
{
g_Types[id] = DOMAIN_NAME;
}
else if (wcsicmp(L"DNS_SERVER", type) == 0)
else if (_wcsicmp(L"DNS_SERVER", type) == 0)
{
g_Types[id] = DNS_SERVER;
}
else if (wcsicmp(L"WORK_AREA_TOP", type) == 0)
else if (_wcsicmp(L"WORK_AREA_TOP", type) == 0)
{
g_Types[id] = WORK_AREA_TOP;
}
else if (wcsicmp(L"WORK_AREA_LEFT", type) == 0)
else if (_wcsicmp(L"WORK_AREA_LEFT", type) == 0)
{
g_Types[id] = WORK_AREA_LEFT;
}
else if (wcsicmp(L"WORK_AREA_WIDTH", type) == 0)
else if (_wcsicmp(L"WORK_AREA_WIDTH", type) == 0)
{
g_Types[id] = WORK_AREA_WIDTH;
}
else if (wcsicmp(L"WORK_AREA_HEIGHT", type) == 0)
else if (_wcsicmp(L"WORK_AREA_HEIGHT", type) == 0)
{
g_Types[id] = WORK_AREA_HEIGHT;
}
else if (wcsicmp(L"SCREEN_WIDTH", type) == 0)
else if (_wcsicmp(L"SCREEN_WIDTH", type) == 0)
{
g_Types[id] = SCREEN_WIDTH;
}
else if (wcsicmp(L"SCREEN_HEIGHT", type) == 0)
else if (_wcsicmp(L"SCREEN_HEIGHT", type) == 0)
{
g_Types[id] = SCREEN_HEIGHT;
}
else if (wcsicmp(L"NUM_MONITORS", type) == 0)
else if (_wcsicmp(L"NUM_MONITORS", type) == 0)
{
g_Types[id] = NUM_MONITORS;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_TOP", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_TOP", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_TOP;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_LEFT", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_LEFT", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_LEFT;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_WIDTH", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_WIDTH", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_WIDTH;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_HEIGHT", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_HEIGHT", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_HEIGHT;
}

View File

@ -1536,7 +1536,7 @@ BYTE* DownloadUrl(std::wstring& url, DWORD* dwDataSize, bool forceReload)
hUrlDump = InternetOpenUrl(hRootHandle, url.c_str(), NULL, NULL, flags, 0);
if (hUrlDump == NULL)
{
if (wcsnicmp(url.c_str(), L"file://", 7) == 0) // file scheme
if (_wcsnicmp(url.c_str(), L"file://", 7) == 0) // file scheme
{
std::string urlACP = ConvertWideToAscii(url.c_str());
hUrlDump = InternetOpenUrlA(hRootHandle, urlACP.c_str(), NULL, NULL, flags, 0);

View File

@ -112,7 +112,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Select a WLAN interface, default 0.
LPCTSTR data = ReadConfigString(section, L"WifiIntfID", L"");
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if(_wtoi(data) < (int)pIntfList->dwNumberOfItems){
pInterface = &pIntfList->InterfaceInfo[_wtoi(data)];
} else {
@ -127,7 +127,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Select LIST style
data = ReadConfigString(section, L"WifiListStyle", L"");
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if ( (_wtoi(data) >= 0) && (_wtoi(data) <= 3)){
g_meas_data[id].listStyle = _wtoi(data);
} else {
@ -143,7 +143,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Set maxmimum number of list items
data = ReadConfigString(section, L"WifiListLimit", L"");
g_meas_data[id].listInit = false;
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if (_wtoi(data) > 0){
g_meas_data[id].listMax = _wtoi(data);
} else {
@ -159,22 +159,22 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
MEASURETYPE infoType = UNKNOWN;
LPCTSTR type = ReadConfigString(section, L"WifiInfoType", L"");
if(type){
if (wcsicmp(L"SSID", type) == 0){
if (_wcsicmp(L"SSID", type) == 0){
infoType=SSID;
}
else if (wcsicmp(L"QUALITY", type) == 0){
else if (_wcsicmp(L"QUALITY", type) == 0){
infoType=QUALITY;
}
else if (wcsicmp(L"ENCRYPTION", type) == 0){
else if (_wcsicmp(L"ENCRYPTION", type) == 0){
infoType=ENCRYPTION;
}
else if (wcsicmp(L"AUTH", type) == 0){
else if (_wcsicmp(L"AUTH", type) == 0){
infoType=AUTH;
}
else if (wcsicmp(L"LIST", type) == 0){
else if (_wcsicmp(L"LIST", type) == 0){
infoType=LIST;
}
else if (wcsicmp(L"PHY", type) == 0){
else if (_wcsicmp(L"PHY", type) == 0){
infoType=PHY;
} else {
WCHAR buffer[256];
@ -288,7 +288,7 @@ LPCTSTR GetString(UINT id, UINT flags)
mbstowcs(buffer,(char*)pwnl->Network[i].dot11Ssid.ucSSID,pwnl->Network[i].dot11Ssid.uSSIDLength);
//Prevent duplicates that result from profiles, check using SSID
if((wcsstr(g_meas_data[id].netlist,buffer)== NULL)&&(wcsicmp(L"", buffer) != 0)){
if((wcsstr(g_meas_data[id].netlist,buffer)== NULL)&&(_wcsicmp(L"", buffer) != 0)){
printed++;
if(listStyle > 0){
wsprintf(g_meas_data[id].netlist,L"%s%s",g_meas_data[id].netlist,buffer);

View File

@ -190,7 +190,7 @@ void ExecuteBang(LPCTSTR args, UINT id)
std::wstring bang = wholeBang.substr(0, pos);
wholeBang.erase(0, pos + 1);
if (wcsicmp(bang.c_str(), L"SendMessage") == 0)
if (_wcsicmp(bang.c_str(), L"SendMessage") == 0)
{
// Parse parameters
DWORD uMsg, wParam, lParam;

View File

@ -472,7 +472,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
const wchar_t* type = ReadConfigString(section, L"Command", L"");
for(int i = 0; i < COMMAND_COUNT; i++)
{
if (CommandName[i] && type && wcsicmp(CommandName[i], type) == 0)
if (CommandName[i] && type && _wcsicmp(CommandName[i], type) == 0)
{
CommandIdMap[id] = (COMMAND_TYPE)i;