iTunes is not opened automatically anymore when Rainmeter starts because it caused flickering in Rainmeter's windows.

This commit is contained in:
Kimmo Pekkola 2009-08-02 08:35:00 +00:00
parent 0edd9d392e
commit 9cc9310ad8
2 changed files with 20 additions and 3 deletions

View File

@ -363,7 +363,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
CoInitialized = true;
}
if (CoInitialized && !InstanceCreated /*&& ::FindWindow(L"iTunes", L"iTunes") */) // rainy: Removed the FindWindow since it fails in 64-bit OS
if (CoInitialized && !InstanceCreated && ::FindWindow(L"iTunes", L"iTunes"))
{
if (SUCCEEDED(iTunes.CreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER)))
{
@ -404,7 +404,24 @@ UINT Update(UINT id)
{
if (!CoInitialized || !InstanceCreated)
{
return 0;
// Check if the iTunes window has appeared
if (::FindWindow(L"iTunes", L"iTunes"))
{
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.");
return 0;
}
}
else
{
return 0;
}
}
CCommandIdMap::const_iterator it = CommandIdMap.find(id);

View File

@ -1,2 +1,2 @@
#pragma once
const int revision_number = 123;
const int revision_number = 133;