>A desktop VFP9 program (not a service) is running on the Windows XP or Server 2003 console. If a user logs in remotely and captures the console via a Windows Remote Desktop, is there any code to detect such a remote login?
I suspect any solution would require BINDEVENTS() hooked to various Windows events.
Windows XP (Pro) supports only 1 remote session at a time:
- If a remote user logs on under a different account than the currently logged-on console user, the console user's session is forcibly closed ("blown away") and the remote user gets a session. In this case any desktop VFP9 app in the console session would be forcibly closed. It might be possible to hook the "force close" event and record that it happened. Or, maybe use ON SHUTDOWN - you'd have to experiment.
- If the remote user logs on under the same account as the console user, as you note the remote user "captures" the session. In this case BINDEVENTS() would need to hook some Terminal Server/RDP session initiation event(s). I have no idea what these events might be.
Server 2003 supports up to 2 simultaneous remote sessions. I haven't done enough testing to know:
- if this 2 connection limit includes a console session (i.e. 1 console + 1 remote) or whether you can have 2 remote sessions + 1 console session simultaneously
- if a console session can get "captured" by a remote user (like with XP) or whether the remote user would get their own session (if one is available)
If the console session can get captured remotely on Server 2003 (and again, I'm not sure of that) then the issues would be the same as with XP Pro.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up