Placing window after TaskManager window fails with ERROR_ACCESS_DENIED

220 Views Asked by At

I'm trying to place a window after TaskManager window and it fails with ERROR_ACCESS_DENIED:

if (SetWindowPos(myWindowHndl, taskManagerHndl, left, top, right - left, bottom - top, SWP_NOACTIVATE | flags))
{
    LOG_ERROR("SetWindowPos() succeedded");
}
else
{
    LOG_HIGH("SetWindowPos() failed: " << GetLastError());
} 

Is there something special with the TaskManager window and is it possible to overcome this? Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

Not exactly the task manager, this is a feature introduced with Vista known as UIPI (user interface privilege isolation). Here for more information.

Try running your application elevated. See if it works then. If it does then this is your problem.