G
Guest
Hello,
I am developping an application (using C#) and I need, whenever the user
click on the form, this one not to be activated. (the system mustn't give the
focus to the form).
After several search I saw a way : overriding the WndProc (wich belongs to
form class) and replace the WM_MOUSEACTIVATE message with WM_NULL message.
Here is the sample of code :
//Override wndProc method
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOUSEACTIVATE)
{
m = Message.Create(new IntPtr(0), 0, new IntPtr(0), new
IntPtr(0));
}
base.WndProc(ref m);
}
But this doesn't work, am I in the wrong way, is there any other messages... ?
Thanks for your answer.
I am developping an application (using C#) and I need, whenever the user
click on the form, this one not to be activated. (the system mustn't give the
focus to the form).
After several search I saw a way : overriding the WndProc (wich belongs to
form class) and replace the WM_MOUSEACTIVATE message with WM_NULL message.
Here is the sample of code :
//Override wndProc method
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOUSEACTIVATE)
{
m = Message.Create(new IntPtr(0), 0, new IntPtr(0), new
IntPtr(0));
}
base.WndProc(ref m);
}
But this doesn't work, am I in the wrong way, is there any other messages... ?
Thanks for your answer.