Commented out unused code. (Reserved for future use.)

This commit is contained in:
spx 2011-02-21 16:16:24 +00:00
parent 9f152e0076
commit 3d6615522b
2 changed files with 65 additions and 65 deletions

View File

@ -29,14 +29,14 @@
enum TIMER enum TIMER
{ {
TIMER_SHOWDESKTOP = 1, TIMER_SHOWDESKTOP = 1,
TIMER_COMPOSITION = 2, // TIMER_COMPOSITION = 2,
TIMER_NETSTATS = 3, TIMER_NETSTATS = 3,
TIMER_DELETELATER = 4 TIMER_DELETELATER = 4
}; };
enum INTERVAL enum INTERVAL
{ {
INTERVAL_SHOWDESKTOP = 250, INTERVAL_SHOWDESKTOP = 250,
INTERVAL_COMPOSITION = 250, // INTERVAL_COMPOSITION = 250,
INTERVAL_NETSTATS = 60000, INTERVAL_NETSTATS = 60000,
INTERVAL_DELETELATER = 1000 INTERVAL_DELETELATER = 1000
}; };
@ -48,7 +48,7 @@ HWND CSystem::c_HelperWindow = NULL;
HWINEVENTHOOK CSystem::c_WinEventHook = NULL; HWINEVENTHOOK CSystem::c_WinEventHook = NULL;
bool CSystem::c_DwmCompositionEnabled = false; //bool CSystem::c_DwmCompositionEnabled = false;
bool CSystem::c_ShowDesktop = false; bool CSystem::c_ShowDesktop = false;
OSPLATFORM CSystem::c_Platform = OSPLATFORM_UNKNOWN; OSPLATFORM CSystem::c_Platform = OSPLATFORM_UNKNOWN;
@ -109,7 +109,7 @@ void CSystem::Initialize(HINSTANCE instance)
c_Monitors.monitors.reserve(8); c_Monitors.monitors.reserve(8);
SetMultiMonitorInfo(); SetMultiMonitorInfo();
c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE); // c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE);
c_WinEventHook = SetWinEventHook( c_WinEventHook = SetWinEventHook(
EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND,
@ -134,7 +134,7 @@ void CSystem::Initialize(HINSTANCE instance)
void CSystem::Finalize() void CSystem::Finalize()
{ {
KillTimer(c_Window, TIMER_SHOWDESKTOP); KillTimer(c_Window, TIMER_SHOWDESKTOP);
KillTimer(c_Window, TIMER_COMPOSITION); // KillTimer(c_Window, TIMER_COMPOSITION);
KillTimer(c_Window, TIMER_NETSTATS); KillTimer(c_Window, TIMER_NETSTATS);
KillTimer(c_Window, TIMER_DELETELATER); KillTimer(c_Window, TIMER_DELETELATER);
@ -905,29 +905,29 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
CheckDesktopState(GetWorkerW()); CheckDesktopState(GetWorkerW());
return 0; return 0;
case TIMER_COMPOSITION: //case TIMER_COMPOSITION:
{ // {
if (GetShellDesktopWindow() || DesktopCompositionCheckCount >= 10) // 250ms * 10 = 2.5s // if (GetShellDesktopWindow() || DesktopCompositionCheckCount >= 10) // 250ms * 10 = 2.5s
{ // {
KillTimer(c_Window, TIMER_COMPOSITION); // KillTimer(c_Window, TIMER_COMPOSITION);
c_WinEventHook = SetWinEventHook( // c_WinEventHook = SetWinEventHook(
EVENT_SYSTEM_FOREGROUND, // EVENT_SYSTEM_FOREGROUND,
EVENT_SYSTEM_FOREGROUND, // EVENT_SYSTEM_FOREGROUND,
NULL, // NULL,
MyWinEventProc, // MyWinEventProc,
0, // 0,
0, // 0,
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); // WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL); // SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL);
} // }
else // else
{ // {
++DesktopCompositionCheckCount; // ++DesktopCompositionCheckCount;
} // }
} // }
return 0; // return 0;
case TIMER_NETSTATS: case TIMER_NETSTATS:
CMeasureNet::UpdateIFTable(); CMeasureNet::UpdateIFTable();
@ -944,24 +944,24 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
} }
break; break;
case WM_DWMCOMPOSITIONCHANGED: //case WM_DWMCOMPOSITIONCHANGED:
Log(LOG_NOTICE, L"System: DWM desktop composition has been changed."); // Log(LOG_NOTICE, L"System: DWM desktop composition has been changed.");
KillTimer(c_Window, TIMER_SHOWDESKTOP); // KillTimer(c_Window, TIMER_SHOWDESKTOP);
KillTimer(c_Window, TIMER_COMPOSITION); // KillTimer(c_Window, TIMER_COMPOSITION);
if (c_WinEventHook) // if (c_WinEventHook)
{ // {
UnhookWinEvent(c_WinEventHook); // UnhookWinEvent(c_WinEventHook);
c_WinEventHook = NULL; // c_WinEventHook = NULL;
} // }
c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE); // c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE);
DesktopCompositionCheckCount = 0; // DesktopCompositionCheckCount = 0;
SetTimer(c_Window, TIMER_COMPOSITION, INTERVAL_COMPOSITION, NULL); // SetTimer(c_Window, TIMER_COMPOSITION, INTERVAL_COMPOSITION, NULL);
return 0; // return 0;
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:
Log(LOG_NOTICE, L"System: Display setting has been changed."); Log(LOG_NOTICE, L"System: Display setting has been changed.");
@ -1093,30 +1093,30 @@ HMODULE CSystem::RmLoadLibrary(LPCWSTR lpLibFileName, DWORD* dwError, bool ignor
** Returns TRUE if the DWM desktop composition is enabled. ** Returns TRUE if the DWM desktop composition is enabled.
** **
*/ */
BOOL CSystem::DwmIsCompositionEnabled() //BOOL CSystem::DwmIsCompositionEnabled()
{ //{
BOOL fEnabled = FALSE; // BOOL fEnabled = FALSE;
//
typedef HRESULT (WINAPI * FPDWMISCOMPOSITIONENABLED)(BOOL* pfEnabled); // typedef HRESULT (WINAPI * FPDWMISCOMPOSITIONENABLED)(BOOL* pfEnabled);
//
if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA) // if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA)
{ // {
HINSTANCE h = RmLoadLibrary(L"dwmapi.dll"); // HINSTANCE h = RmLoadLibrary(L"dwmapi.dll");
if (h) // if (h)
{ // {
FPDWMISCOMPOSITIONENABLED DwmIsCompositionEnabled = (FPDWMISCOMPOSITIONENABLED)GetProcAddress(h, "DwmIsCompositionEnabled"); // FPDWMISCOMPOSITIONENABLED DwmIsCompositionEnabled = (FPDWMISCOMPOSITIONENABLED)GetProcAddress(h, "DwmIsCompositionEnabled");
if (DwmIsCompositionEnabled) // if (DwmIsCompositionEnabled)
{ // {
if (DwmIsCompositionEnabled(&fEnabled) != S_OK) // if (DwmIsCompositionEnabled(&fEnabled) != S_OK)
{ // {
fEnabled = FALSE; // fEnabled = FALSE;
} // }
} // }
FreeLibrary(h); // FreeLibrary(h);
} // }
} // }
return fEnabled; // return fEnabled;
} //}
/* /*
** CopyFiles ** CopyFiles

View File

@ -66,7 +66,7 @@ public:
static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; } static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; }
static size_t GetMonitorCount(); static size_t GetMonitorCount();
static bool GetDwmCompositionEnabled() { return c_DwmCompositionEnabled; } // static bool GetDwmCompositionEnabled() { return c_DwmCompositionEnabled; }
static bool GetShowDesktop() { return c_ShowDesktop; } static bool GetShowDesktop() { return c_ShowDesktop; }
static HWND GetShellDesktopWindow(bool findWorkerW = false); static HWND GetShellDesktopWindow(bool findWorkerW = false);
@ -107,7 +107,7 @@ private:
static MULTIMONITOR_INFO c_Monitors; // Multi-Monitor info static MULTIMONITOR_INFO c_Monitors; // Multi-Monitor info
static bool c_DwmCompositionEnabled; // static bool c_DwmCompositionEnabled;
static bool c_ShowDesktop; static bool c_ShowDesktop;
static OSPLATFORM c_Platform; static OSPLATFORM c_Platform;