samedi 14 mars 2015

Prevent my app from taking the focus

Our program listens for WM_COPYDATA message from a third party application in the WndProc. After receiving another version of the application every time that we receive WM_COPYDATA our program takes the focus from whatever application is the user working on. I tried ignoring WM_ACTIVATE and doing nothing when WM_COPYDATA comes but still my app gets the focus. I'm sure that their application activates ours but they are refusing it. Is there any way to prevent my app from taking the focus?



protected override void WndProc(ref Message m)
{
if(m.Msg == WM_ACTIVATE)
return;
if(m.Msg == WM_COPYDATA)
{
// ProcessCopyData(m);
}
base.WndProc(ref m);
}

Aucun commentaire:

Enregistrer un commentaire