:: FindWindow not working from a service application

The Windows API :: FindWindow function does not work when called from a service application. GetLastError () also returns 0 (success?). Is this issue privilege \ access rights? Do you think this is a design issue and should I use a different IPC method?

+4
source share
2 answers

leppie right, Windows services are usually denied interaction with the desktop. You can get around this in XP and earlier, but you cannot do it in Vista or later. You better delegate the interaction of the desktop and the user with the graphical interface. See more details.

+6
source

Services run in session 0. In XP and earlier, the first user must log in also in session 0, and subsequent users are started in sessions 1 and above. If the service is set to "Interact with the desktop," it can access any user windows that are running in session 0. However, starting with Vista, users no longer work in session 0. FindWindow () only works in the context of a session in which it is called because windows cannot be accessed across session boundaries.

+5
source

All Articles