Detecting a live VNC session.
Mark A. Bertenshaw
MarkB "at" leax.co.uk
Wed Jun 2 11:23:00 2004
Thanks for the reply. First of all: yes. As to the situation, it is
the second. You are correct that I can check to see whether the service
is running; however, this doesn't mean that it is necessary in use.
Actually, the answer to the first situation seems to be appropriate:
I'll try to do a sockets connection on startup, and if it fails, I know
that the session is in use.
From: Seak, Teng-Fong [mailto:tfseak "at" futurmaster.com]
Sent: 02 June 2004 10:27
To: Mark A. Bertenshaw; vnc-list "at" realvnc.com
Subject: RE: Detecting a live VNC session.
I think your last sentence actually is "... the VNC session is
The answer to your question depends on where you're. Are you in
one PC and want to determine if VNC is active in another? Or you're in
one PC and want to know if VNC is active in that SAME PC?
For the first, supposing that VNC is listening port 5900, I
imagine you could write a script to telnet to a host at port 5900 and if
you get "RFB 003...", that means VNC is active. You could ask webmaster
of http://gotomyvnc.com/ to get more details how he does the website.
For the second, supposing that VNC server is run as service, I
imagine you could write a script to check if "winvnc" service is
> Hi -
> I am currently working on an application that is designed primarily to
> access via a touchscreen PC. However, there are a few configuration
> options which require a keyboard. It is possible to detect that a
> keyboard is connected using WMI. However, we are hoping not to have
> to use a separate keyboard, and instead connect to the machine via a
> network cable, and use VNC to control the current session.
> Unfortunately, I can't use WMI in this instance (although I was
> wondering whether VNC uses some sort of virtual keyboard device). Is
> there a standard way of determining whether the WMI session is active?