Posts

Showing posts from August, 2018

Interaction with UI from windows service

I nteract ion with UI from windows service Introduction Windows service has no UI and it has never been easy to prompt users with some notifications from windows service. To interact with UI from windows service, we used to opt, allow service to interact with desktop and by launching another process from the windows service. But it is not expected to work with windows vista and upwards. So now the question is how to implement this in newer versions of windows i.e. windows 8, windows 10 etc. Here is the answer: Display a dialog box in the user's session using the  WTSSendMessage function. It can be used to display messages from windows service on all supported windows operating systems. WTSSendMessage Displays a message box on the client desktop of a specified Remote Desktop Services session. Syntax BOOL WTSSendMessageA(   IN HANDLE hServer,   IN DWORD   SessionId,   LPSTR      pTitle,   IN DWORD ...