Hi,
Use the following; this seems to be working for me:
private const int WM_WTSSESSION_CHANGE = 0x02B1;
private const int WTS_SESSION_LOCK = 0x07;
private const int WTS_SESSION_UNLOCK = 0x08;
protected override void WndProc(ref Message m)
{
if ( (m.Msg == WM_WTSSESSION_CHANGE) &&
((m.WParam.ToInt32() == WTS_SESSION_LOCK) ||
(m.WParam.ToInt32() == WTS_SESSION_UNLOCK)) )
{
return;
}
base.WndProc(ref m);
}
Regards, AT