[RESOLVED] How do i "disable desktop composition" for my application automatically?
Hello , do you know how can i "disable desktop composition" for my application automatically?
Do i have to attach a specific manifest file ? Or something else ?
Thank you !
Re: How do i "disable desktop composition" for my application automatically?
Re: How do i "disable desktop composition" for my application automatically?
I mean when you right click on a executable file in windows and select properties
there is a tab in the screen that opens that is named "Compatibility".
There you can check "Disable Desktop Composition".
I want that my application does that automatically without the need for the user to do that by hand.
Re: How do i "disable desktop composition" for my application automatically?
I think it's not possible to do that with a specific code, because there are many OS also in different versions. Anyway, thanks for explaining it:). But don't worry, wait for some time, so that others may help you:). Best wishes...
Re: How do i "disable desktop composition" for my application automatically?
I suspect that the only way to do this is to have your installer merge a Compatibility Database during installation. I'm not really saying this is the only way, just the way that I have seen recommended.
I believe you use the Application Compatibility Toolkit (5.0) to create the new SDB. Then you script a custom action in your MSI package that looks something like (Microsoft example):
Code:
'InstallSDB.vbs
Function Install
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "sdbinst.exe -q " & CHR(34) & "%ProgramFiles%\MyOrganizationSDB\MyOrg.sdb" & CHR(34), 0, true
WshShell.Run "cmd.exe /c " & CHR(34) & "del " & CHR(34) & "%ProgramFiles%\MyOrganizationSDB\MyOrg.sdb" & CHR(34) & CHR(34), 0
WshShell.Run "reg.exe delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{guidFromMyOrgsSdb}.sdb /f", 0
End Function
Function UnInstall
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "sdbinst.exe -q -u -g {guidFromMyOrgsSdb}", 0
End Function
Being sure to specify "no impersonate" when you define the MSI VBScript custom action.
If you use a legacy installer such as the PDW you'd need to customize Setup1 to perform these actions. Other legacy packaging and deployment tools offer ways to perform custom actions as well.
Any way you do it, the script above must run elevated. Note that the entry for your program probably includes the checksum of your EXE so you'd need to make a new one each time unless you exclude the checksum as part of the matching attributes Windows uses to apply compatibility.
Caveat: I haven't done this myself, I just did some reasearch into it a year ago.
Re: How do i "disable desktop composition" for my application automatically?
Just to clarify:
No, sadly there is nothing as easy as a manifest entry that will do this.
Re: How do i "disable desktop composition" for my application automatically?
I found it...
Code:
Les valeurs d'entrees sont
Private Const DWM_EC_DISABLECOMPOSITION As Long = 0
Private Const DWM_EC_ENABLECOMPOSITION As Long = 1
'La declaration en VB6 semble etre:
Private Declare Function DwmEnableComposition Lib "dwmapi" (uCompositionAction As Long) As Long
'Pour un HRESULT, il faut tester le retour sur SUCCEEDED, comme suite;
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
Re: [RESOLVED] How do i "disable desktop composition" for my application automatically?