mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed the crash bug in the iTunesPlugin.
This commit is contained in:
parent
86f75fe243
commit
3c98bd5de4
@ -294,6 +294,7 @@ static bool updateCurrentTrack()
|
|||||||
if (0 == lastClock || currentClock - lastClock > CLOCKS_PER_SEC)
|
if (0 == lastClock || currentClock - lastClock > CLOCKS_PER_SEC)
|
||||||
{
|
{
|
||||||
wsprintf(CurrentTrackArtworkPath, L"%s%s", BaseDir, DefaultTrackArtworkPath);
|
wsprintf(CurrentTrackArtworkPath, L"%s%s", BaseDir, DefaultTrackArtworkPath);
|
||||||
|
if (CurrentTrack != NULL)
|
||||||
CurrentTrack.Release();
|
CurrentTrack.Release();
|
||||||
if (FAILED(iTunes->get_CurrentTrack(&CurrentTrack)) || !CurrentTrack)
|
if (FAILED(iTunes->get_CurrentTrack(&CurrentTrack)) || !CurrentTrack)
|
||||||
return false;
|
return false;
|
||||||
@ -362,10 +363,21 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
|
|||||||
CoInitialized = true;
|
CoInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CoInitialized && !InstanceCreated && ::FindWindow(L"iTunes", L"iTunes") &&
|
if (CoInitialized && !InstanceCreated /*&& ::FindWindow(L"iTunes", L"iTunes") */) // rainy: Removed the FindWindow since it fails in 64-bit OS
|
||||||
SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
|
{
|
||||||
|
if (SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
|
||||||
{
|
{
|
||||||
InstanceCreated = true;
|
InstanceCreated = true;
|
||||||
|
LSLog(LOG_DEBUG, L"Rainmeter", L"iTunesApp initialized successfully.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LSLog(LOG_DEBUG, L"Rainmeter", L"Unable to create the iTunesApp instance.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LSLog(LOG_DEBUG, L"Rainmeter", L"Unable to find the iTunes window.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t* type = ReadConfigString(section, L"Command", L"");
|
const wchar_t* type = ReadConfigString(section, L"Command", L"");
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
const int revision_number = 117;
|
const int revision_number = 119;
|
Loading…
Reference in New Issue
Block a user