mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed an issue that TrayMeasure doesn't work with Measure=PLUGIN.
This commit is contained in:
parent
f0f7bd9121
commit
3324084c7f
@ -72,7 +72,12 @@ bool CMeasurePlugin::Update()
|
||||
WCHAR buffer[MAX_PATH];
|
||||
GetCurrentDirectory(MAX_PATH, buffer);
|
||||
|
||||
SetCurrentDirectory((Rainmeter->GetSkinPath() + m_MeterWindow->GetSkinName()).c_str());
|
||||
std::wstring dir = Rainmeter->GetSkinPath();
|
||||
if (m_MeterWindow)
|
||||
{
|
||||
dir += m_MeterWindow->GetSkinName();
|
||||
}
|
||||
SetCurrentDirectory(dir.c_str());
|
||||
|
||||
if(UpdateFunc)
|
||||
{
|
||||
@ -180,7 +185,12 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
WCHAR buffer[MAX_PATH];
|
||||
GetCurrentDirectory(MAX_PATH, buffer);
|
||||
|
||||
SetCurrentDirectory((Rainmeter->GetSkinPath() + m_MeterWindow->GetSkinName()).c_str());
|
||||
std::wstring dir = Rainmeter->GetSkinPath();
|
||||
if (m_MeterWindow)
|
||||
{
|
||||
dir += m_MeterWindow->GetSkinName();
|
||||
}
|
||||
SetCurrentDirectory(dir.c_str());
|
||||
|
||||
// Remove current directory from DLL search path
|
||||
CSystem::RmSetDllDirectory(L"");
|
||||
|
@ -92,8 +92,8 @@ CTrayWindow::~CTrayWindow()
|
||||
KillTimer(m_Window, TRAYTIMER);
|
||||
RemoveTrayIcon();
|
||||
|
||||
if (m_Bitmap) delete m_Bitmap;
|
||||
if (m_Measure) delete m_Measure;
|
||||
delete m_Bitmap;
|
||||
delete m_Measure;
|
||||
|
||||
for (size_t i = 0; i < m_TrayIcons.size(); ++i)
|
||||
{
|
||||
@ -350,10 +350,7 @@ void CTrayWindow::ReadConfig(CConfigParser& parser)
|
||||
if (m_TrayIcons.size() == 0)
|
||||
{
|
||||
// No icons found so load as bitmap
|
||||
if (m_Bitmap)
|
||||
{
|
||||
delete m_Bitmap;
|
||||
}
|
||||
delete m_Bitmap;
|
||||
m_Bitmap = new Bitmap(imageName.c_str());
|
||||
Status status = m_Bitmap->GetLastStatus();
|
||||
if(Ok != status)
|
||||
|
Loading…
Reference in New Issue
Block a user