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,7 +294,8 @@ 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);
|
||||||
CurrentTrack.Release();
|
if (CurrentTrack != NULL)
|
||||||
|
CurrentTrack.Release();
|
||||||
if (FAILED(iTunes->get_CurrentTrack(&CurrentTrack)) || !CurrentTrack)
|
if (FAILED(iTunes->get_CurrentTrack(&CurrentTrack)) || !CurrentTrack)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -362,11 +363,22 @@ 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)))
|
|
||||||
{
|
{
|
||||||
InstanceCreated = true;
|
if (SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
|
||||||
|
{
|
||||||
|
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"");
|
||||||
for(int i = 0; i < COMMAND_COUNT; i++)
|
for(int i = 0; i < COMMAND_COUNT; i++)
|
||||||
|
@ -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