Proper c++ code would be...
code:
bool IsCompositionEnabled()
{
HMODULE library = ::LoadLibrary(L"dwmapi.dll");
bool result = false;
if (0 != library)
{
if (0 != ::GetProcAddress(library, "DwmIsCompositionEnabled"))
{
BOOL enabled = FALSE;
result = SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled;
}
VERIFY(::FreeLibrary(library));
}
return result;
}
which will take into account Windows XP that do not have this library installed as it is Vista, and Win 7 applicable only.
Anyway i just wanted to know if this is the correct API...