G
Guest
I have an application that when it is locked I activate a password dialog. I
trigger it by adding a message filter.
public class AuthenticationMessageFilter : IMessageFilter
{
private const int SC_RESTORE = 0xF120;
private const int SC_MAXIMIZE = 0xF030;
private const int WM_SYSCOMMAND = 0x112;
public bool PreFilterMessage(ref Message m)
{
bool bKeepLocked = false;
if (m.Msg == WM_SYSCOMMAND)
{
if ((int)m.WParam == SC_MAXIMIZE || (int)m.WParam == SC_RESTORE)
{
...... here do the authentication
}
}
}
}
and activated through:
AuthenticationMessageFilter filter = new AuthenticationMessageFilter();
Application.AddMessageFilter(filter);
This code works great if you switch using either alt-tab or the task bar,
however when you use task manager switch to ---- I cannot for the life of me
figure out what message to trap.
So my question is how do I trap the switchTo message from task manager.
Thanks,
SwedeFlyer
trigger it by adding a message filter.
public class AuthenticationMessageFilter : IMessageFilter
{
private const int SC_RESTORE = 0xF120;
private const int SC_MAXIMIZE = 0xF030;
private const int WM_SYSCOMMAND = 0x112;
public bool PreFilterMessage(ref Message m)
{
bool bKeepLocked = false;
if (m.Msg == WM_SYSCOMMAND)
{
if ((int)m.WParam == SC_MAXIMIZE || (int)m.WParam == SC_RESTORE)
{
...... here do the authentication
}
}
}
}
and activated through:
AuthenticationMessageFilter filter = new AuthenticationMessageFilter();
Application.AddMessageFilter(filter);
This code works great if you switch using either alt-tab or the task bar,
however when you use task manager switch to ---- I cannot for the life of me
figure out what message to trap.
So my question is how do I trap the switchTo message from task manager.
Thanks,
SwedeFlyer