Printing from a Windows Service

你。 提交于 2019-12-01 23:39:49

I wouldn't recommend using interact with desktop. You will run into compatibility problems on Vista, Windows 7, and later versions of Windows.

You could use WTSQueryUserToken to get a user token for a logged on user and then print from that user's token. You could do this using CreateProcessAsUser to do the actual printing.

To get the logged on sessions you could use WTSGetActiveConsoleSessionId or WTSEnumerateSessions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!