Hello, I'm writing a remote-control application for a Windows GUI application. The application works nice when I start it from a cmd-prompt on my host. However, I would like to start if from a remote-login session to my host. I currently using CYGWIN sshd to login to the host. However, if I run my program in the ssh-session it is not associated with the "interactive windows station" (winsta0). I found the calls OpenWindowStation() and SetProcessWindowStation() which I was planning to use to attach my program to the winsta0.
Now, my problem is that OpenWindowStation() fails (GetLastError returns Access Denied). I try to call OpenWindowStation() with the following parameters (which I think represent the access rights I need to read and manipulate GUI objects):
hwinsta = OpenWindowStation("winsta0", FALSE,
Does any one know a solution to this problem? Can I prepare winsta0 to allow access? Should I use some other method to gain access to the GUI objects?
I'm currently logged in as myself (administrators rights) at the desktop and also log in as myself via ssh. In the future I'd like to be able to logged in as someone else (no administrators rights) in the desktop and login as myself (administrators rights) on ssh and still get access to the winsta0. (That is, as an administator I would like to be able to remotely access any desktop owned by any user.)
I think I'm stuck here. Any help is appreciated. (BTW I'm not a Windows programmer by birth so I may have missed some really obvious things.)