I am trying to create a service which does following:
Note: before step 1, user is not logged on. (something like right after machine is rebooted)
The expected result is, the user should be able to see the UI of launched app at step 2 if user logged onto the desktop with the user account logged on at step
I found this article, but this code will launch the app on current desktop (let's say, currently logged on as userA. Using username/password of userB, the app is still be launched on userA desktop, but using userB's account).
https://support.microsoft.com/en-ca/help/165194/createprocessasuser-windowstations-and-desktops
Please let me know what's the correct way to achieve my goal.
IDE: Visual Studio 2015 C++ on Windows.
Let me answer to my question.
The bottom line is:
Reason:
Alternative solution:
The details explanation of how Windows Session, Window Station, and Desktop works: https://brianbondy.com/blog/100/understanding-windows-at-a-deeper-level-sessions-window-stations-and-desktops
Thank you very much for Harry Johnston for detailed explanation in the comment.