[DllImport("User32.dll")]i need another method like TurnOnScreenSaver() that stops the screen saver. That is i wanna turn on the screen saver first (already done) then on a specific condition i wanna turn off the screen saver and continue the process(on and off)
public static extern int SendMessage
(IntPtr hWnd,
uint Msg,
uint wParam,
uint lParam);
public const uint WM_SYSCOMMAND = 0x112;
public const uint SC_SCREENSAVE = 0xF140;
public enum SpecialHandles
{
HWND_DESKTOP = 0x0,
HWND_BROADCAST = 0xFFFF
}
public static void TurnOnScreenSaver()
{
SendMessage(
new IntPtr((int)SpecialHandles.HWND_BROADCAST),
WM_SYSCOMMAND,
SC_SCREENSAVE,
0);
}
this code works fine. i found it from this forum.
Loading
learner learnerPosted Oct 13, 2010, 2:09 AM
i visited your given link. But i think that are not so easy as the following method
public static void TurnOnScreenSaver()
{
SendMessage( new IntPtr((int)SpecialHandles.HWND_BROADCAST), WM_SYSCOMMAND, SC_SCREENSAVE, 0);
}
If i could modify this method to turn off screen saver, it would be very much effective
Gomathi PalaniswamyPosted Oct 12, 2010, 12:39 AM
see the below link,
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/b3ece72d-18b1-4267-94f3-5ad57cbdf84c