K
KK
Dear All
I want to prevent the screen saver getting activated when my application is
running.
I have the following code, but still screen saver is activated. What
corrections I should make to prevent screen saver running to the following
code.
public class MainForm : System.Windows.Forms.Form
{
private static readonly int SC_SCREENSAVE = 0xF140;
private static readonly int WM_SYSCOMMAND = 0x0112;
private static readonly int WM_CLOSE = 0x0010;
protected override void WndProc(ref Message m)
{
if (WM_SYSCOMMAND == m.Msg && SC_SCREENSAVE == (int)m.WParam)
{
m.Result = (IntPtr)(-1);
System.Diagnostics.Trace.WriteLine("Screen Saver event handled");
return;
}
base.WndProc(ref m)
}
}
Krishna Rao K Lucid Software Ltd 104, NSIC STP Complex | Guindy Industrial
Estate | Ekkattuthangal | Chennai 600032 ' +91 44 2225 2273 / 76 , +91 98407
28998
I want to prevent the screen saver getting activated when my application is
running.
I have the following code, but still screen saver is activated. What
corrections I should make to prevent screen saver running to the following
code.
public class MainForm : System.Windows.Forms.Form
{
private static readonly int SC_SCREENSAVE = 0xF140;
private static readonly int WM_SYSCOMMAND = 0x0112;
private static readonly int WM_CLOSE = 0x0010;
protected override void WndProc(ref Message m)
{
if (WM_SYSCOMMAND == m.Msg && SC_SCREENSAVE == (int)m.WParam)
{
m.Result = (IntPtr)(-1);
System.Diagnostics.Trace.WriteLine("Screen Saver event handled");
return;
}
base.WndProc(ref m)
}
}
Krishna Rao K Lucid Software Ltd 104, NSIC STP Complex | Guindy Industrial
Estate | Ekkattuthangal | Chennai 600032 ' +91 44 2225 2273 / 76 , +91 98407
28998