Search code examples
windowswinapiservicemfcmessagebox

How to prompt message box in remote computer where application is running as service?


I have an C++ MFC application running in master machine that installs update from a server in remote computers through an agent service. This service takes care of authorization in remote machines before update. Now, I need to prompt the currently active user in remote machines for confirmation. AfxMessagebox or MessageBox in the service context doesn't show up any window in remote machines. Is there a way to achieve this?


Solution

  • Look at WTSSendMessage():

    Displays a message box on the client desktop of a specified Remote Desktop Services session.