c++ - WIndows service run desktop program in Remote Desktop -


i need launch program in remote desktop, program open window , need user interact, application windows service.

i'm using windows 2008. i'm created application success launch program session connect mouse, keyboard, need launch in rdp.

now i'm using these functions.

wtsenumeratesessions (enum sessions, here know if rdp) wtsqueryusertoken (get user token) duplicatetokenex ( make primary token) createprocessasuser (run application si.lpdesktop = _t("winsta0\\default")) 

but work success run application in console connect keyboard, mouse, monitor, not rdp.

anyway can me ? thanks.

so you're trying launch gui application in particular rdp session on machine? have right idea, more or less, though may missing few pieces. take @ processhelper class in source automated tests of cassia library. can remove lot of managed cruft use in c++. can omit gettokeninformation( ...tokeninformationclass.tokenlinkedtoken... ) nonsense if don't need run process elevated permissions. code has been tested on every version of windows since windows xp.

note calling wtsqueryusertoken requires se_tcb_name privilege (which localsystem account has default).


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -