T
So hab die Lösung
Das Problem ist der "Windows Desktop Manager", um eigene Overlays in die Primary zu rendern muss zu erst dieses AeroGlass ausgestellt werden und das geht so:
void DisableDesktopManager( const bool bDisable ) {
// Load "dwmapi.dll"
HMODULE hDWM = LoadLibrary( "dwmapi.dll" );
if( hDWM != NULL ) {
// define functionpointer
typedef HRESULT ( __stdcall *fpDwmIsCompositionEnabled )( BOOL *bEnabled );
typedef HRESULT ( __stdcall *fpDwmEnableComposition )( UINT uCompositionAction );
// Get pointer to functions
fpDwmIsCompositionEnabled dwmCompEnabled = (fpDwmIsCompositionEnabled)GetProcAddress( hDWM, "DwmIsCompositionEnabled" );
fpDwmEnableComposition dwmEnableComp = (fpDwmEnableComposition)GetProcAddress( hDWM, "DwmEnableComposition" );
// Check if enabled
HRESULT hRes = 0;
BOOL bComp = false;
hRes = dwmCompEnabled( &bComp );
if( hRes != S_OK ) {
MessageBox( 0, "Could not determine compositions status.", "Error!", MB_OK | MB_ICONERROR );
}
else {
// Disable
if( ( bComp == true ) && ( bDisable == true ) ) {
hRes = dwmEnableComp( 0 );
if( hRes != S_OK ) {
MessageBox( 0, "Could not disable composition.", "Error!", MB_OK | MB_ICONERROR );
}
m_bDWM = true;
}
// Enable
else if( ( bComp == false ) && ( bDisable == false ) ) {
hRes = dwmEnableComp( 1 );
if( hRes != S_OK ) {
MessageBox( 0, "Could not enable composition.", "Error!", MB_OK | MB_ICONERROR );
}
m_bDWM = false;
}
// Else do nothing
}
// Free library
FreeLibrary( hDWM );
}
}
Lg Tobi