mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- PowerPlugin: Fixed crash when waking up from sleep/hibernation in some cases
- Code cleanup
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user