Autor Beitrag
enire
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Fr 14.08.09 11:36 
moin moin,

ich möchte die Windows-Eigenen Visuellen Effekte via API deaktivieren.
Entsprechend der Beschreibung zur Methode SystemParametersInfo()
hab ich mir folgenden Code zusammengefrickelt:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, bool pvParam, uint fWinIni);

private const uint SPIF_UPDATEINIFILE = 0x1;
private const uint SPIF_SENDWININICHANGE = 0x2;
private const uint SPIF_SENDCHANGE = SPIF_SENDWININICHANGE;

private const uint SPI_SETUIEFFECTS = 0x103F;

SystemParametersInfo(SPI_SETUIEFFECTS, 0false, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);


Leider zeigt dieser keinerlei Wirkung, weder auf XP noch auf Windows 7
obwohl die Methode True zurückliefert.

Im Original ist die Methode wie folgt deklariert:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
C#-Code: 
BOOL WINAPI SystemParametersInfo(
  __in     UINT uiAction,
  __in     UINT uiParam,
  __inout  PVOID pvParam,
  __in     UINT fWinIni
);


uiAction [in]

Mehr Infos dazu gibt es hier:
msdn.microsoft.com/e...ms724947(VS.85).aspx

Eine Kurze Zusammenfassung:
SPI_SETUIEFFECTS (0x103F) - Enables or disables UI effects. Set the pvParam parameter to TRUE to enable all UI effects or FALSE to disable all UI effects.

uiAction [in]
The system-wide parameter to be retrieved or set..

uiParam [in]
A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.

pvParam [in, out]
A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter.

fWinIni [in]
If a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change.

This parameter can be zero if you don't want to update the user profile or broadcast the WM_SETTINGCHANGE message, or it can be one or more of the following values.