- PowerPlugin: Fixed crash when waking up from sleep/hibernation in some cases

- Code cleanup
This commit is contained in:
Birunthan Mohanathas
2011-10-12 13:34:04 +00:00
parent 7091b46689
commit 7790449f2a
30 changed files with 278 additions and 359 deletions

View File

@ -455,18 +455,13 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
if (SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
{
InstanceCreated = true;
LSLog(LOG_NOTICE, L"Rainmeter", L"iTunesPlugin: iTunesApp initialized successfully.");
initEventHandler();
}
else
{
LSLog(LOG_WARNING, L"Rainmeter", L"iTunesPlugin: Unable to create the iTunesApp instance.");
LSLog(LOG_ERROR, NULL, L"iTunesPlugin.dll: Unable to create instance");
}
}
else
{
LSLog(LOG_WARNING, L"Rainmeter", L"iTunesPlugin: Unable to find the iTunes window.");
}
const wchar_t* type = ReadConfigString(section, L"Command", L"");
for (int i = 0; i < COMMAND_COUNT; i++)
@ -500,12 +495,11 @@ UINT Update(UINT id)
if (!iTunesAboutToPromptUserToQuit && SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
{
InstanceCreated = true;
LSLog(LOG_NOTICE, L"Rainmeter", L"iTunesPlugin: iTunesApp initialized successfully.");
initEventHandler();
}
else
{
LSLog(LOG_WARNING, L"Rainmeter", L"iTunesPlugin: Unable to create the iTunesApp instance.");
LSLog(LOG_ERROR, NULL, L"iTunesPlugin.dll: Unable to create instance");
return 0;
}
}
@ -779,7 +773,7 @@ void ExecuteBang(LPCTSTR args, UINT id)
}
else
{
LSLog(LOG_NOTICE, L"Rainmeter", L"iTunesPlugin: Invalid command.");
LSLog(LOG_NOTICE, NULL, L"iTunesPlugin.dll: Invalid Command");
return;
}
}