Hi,
a thread in my application must change it’s associated desktop to the input
desktop of the currently logged user.
The code I’ve written follows these steps:
HWINSTA station = OpenWindowStation(“WinSta0”, FALSE, MAXIMUM_ALLOWED);
SetProcessStation(station);
HDESK desk = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
SetThreadDesktop(desk);
Everything goes well except that SetThreadDesktop() keeps returning
ERROR_BUSY (“The requested resource is in use”) no matter what I do. I
already tried to change the flags in OpenWindowStation() and
OpenInputDesktop(). And it isn’t a matter of access permissions either,
because in that case I get an “Access Denied” earlier when calling
OpenWindowStation().
My working environment consists of VC++6, MFC and Windows 2000 Professional.
Has anyone run into the same problem? Or does anyone know where I can get
more info on this subject?
Thanks,
Jos?