Código:
Private Const DWM_EC_DISABLECOMPOSITION As Long = 0
Private Const DWM_EC_ENABLECOMPOSITION As Long = 1
Private Declare Function DwmEnableComposition Lib "dwmapi" (uCompositionAction As Long) As Long
Private Function SUCCEEDED(hr As Long) As Boolean
SUCCEEDED = (hr >= 0)
End Function
Private Function FAILED(hr As Long) As Boolean
FAILED = (hr < 0)
End Function
Private Sub Form_Load()
If SUCCEEDED(DwmEnableComposition(DWM_EC_DISABLECOMPOSITION)) Then
MsgBox "Vista Aero est Desactive"
Else
MsgBox "Vista Aero n'a pas pu etre Desactive"
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
MsgBox Cancel
MsgBox UnloadMode
If SUCCEEDED(DwmEnableComposition(DWM_EC_ENABLECOMPOSITION)) Then
MsgBox "Vista Aero est Active"
Else
MsgBox "Vista Aero n'a pas pu etre active"
End If
End Sub