L
LEM
Hi all,
Anybody knows a way of doing that? I have tried several things but it
doesn't work.
This is what I have tried:
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SystemParametersInfo(
int uiAction, int uiParam, string pvParam, int fWinIni);
private const int SPI_SETLOWPOWERTIMEOUT = 81;
private const int SPI_SETPOWEROFFTIMEOUT = 82;
private const int SPI_SETSCREENSAVETIMEOUT = 15;
private const int SPI_SETSCREENSAVEACTIVE = 17;
public static void DisableScreenSaver()
{
SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, null, 0);
}
I hope somebody can help me with this, because I don't know what else to
try.
Thanks
Anybody knows a way of doing that? I have tried several things but it
doesn't work.
This is what I have tried:
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SystemParametersInfo(
int uiAction, int uiParam, string pvParam, int fWinIni);
private const int SPI_SETLOWPOWERTIMEOUT = 81;
private const int SPI_SETPOWEROFFTIMEOUT = 82;
private const int SPI_SETSCREENSAVETIMEOUT = 15;
private const int SPI_SETSCREENSAVEACTIVE = 17;
public static void DisableScreenSaver()
{
SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, null, 0);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, null, 0);
}
I hope somebody can help me with this, because I don't know what else to
try.
Thanks