Customizing viewer dialog caption

Any feature you'd like to see in Ultr@VNC? Just propose it here.

Customizing viewer dialog caption

Postby nicorac » 2009-03-26 14:03

Hello everybody, I'm a long time user of Ultr@VNC and currently I'm working on a web-based remote assistance system.

I have a web page which lists all of my customers requiring assistance. For each customer I show its account details like name, address, billing info, IP address, etc.
Since this is a web application, I put a link for each listed item (customer) to download a dynamically generated .vnc settings file. The file contains all of the required info to start a VNC session, like host, port, password and so on.

Here is the request: since remote desktops I'm used to connect are really look alike, I need a quick and safe way to distinguish sessions if I open two or more at the same time.

The viewer dialog caption shows remote host name and IPs, which are not clearly (and quickly) associable to a customer.
I tried a way to change this caption, but it's a dead end.

Now my proposal and patch: I added a new parameter to .vnc file:
Code: Select all
custom_caption=Mickey Mouse, rd. To DisneyLand (Paris)

and I read it in ClientConnectionFile.cpp.
If this new parameter is not present, everything works as before.

"custom_caption" is limited to 255 chars; with a remote resolution of 800x600 there's space for about 128.

Please let me know what you think about it... :wink:

Code: Select all
Index: UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.cpp
--- UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.cpp   (revision 409)
+++ UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.cpp   (working copy)
@@ -289,6 +289,7 @@
   m_hwndcn = 0;
   m_desktopName = NULL;
   m_desktopName_viewonly = NULL;
+   m_customCaption[0] = '\0';
   m_port = -1;
   m_proxyport = -1;
//   m_proxy = 0;
@@ -2364,8 +2365,14 @@
     ReadString(m_desktopName, m_si.nameLength);
-    // TCHAR tcDummy [MAX_PATH * 3];
+   // nicorac: added custom caption management
+   if (strlen(m_customCaption) > 0)
+      strcpy(m_desktopName, m_customCaption);
+   // TCHAR tcDummy [MAX_PATH * 3];
   // sprintf(tcDummy,"%s ",m_desktopName);
   strcat(m_desktopName, " ");

Index: UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.h
--- UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.h   (revision 409)
+++ UltraVNC Project Root/UltraVNC/vncviewer/ClientConnection.h   (working copy)
@@ -485,6 +485,7 @@
   TCHAR *m_desktopName;
   TCHAR *m_desktopName_viewonly;
+   char m_customCaption[255];   // nicorac: added custom caption to vncviewer dialog
   unsigned char m_encPasswd[8];
   unsigned char m_encPasswdMs[32];
   char m_ms_user[256];  // act: add user storage for mslogon autoreconnect
Index: UltraVNC Project Root/UltraVNC/vncviewer/ClientConnectionFile.cpp
--- UltraVNC Project Root/UltraVNC/vncviewer/ClientConnectionFile.cpp   (revision 409)
+++ UltraVNC Project Root/UltraVNC/vncviewer/ClientConnectionFile.cpp   (working copy)
@@ -175,6 +175,9 @@
         return -1;

+   // nicorac: reading custom caption from .vnc settings file
+   GetPrivateProfileString("options", "custom_caption", "", m_customCaption, 255, fname);
   if (GetPrivateProfileString("connection", "host", "", m_host, MAX_HOST_NAME_LEN, fname) == 0) {
//      MessageBox(m_hwnd, sz_K5, sz_K6, MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);

Thanks for your work.
Posts: 5
Joined: 2005-02-08 12:24

Re: Customizing viewer dialog caption

Postby nicorac » 2009-03-30 15:32

Please tell me what you think about it...

EDIT: Did I post into the wrong section? :-]
Last edited by nicorac on 2009-04-11 07:51, edited 1 time in total.
Posts: 5
Joined: 2005-02-08 12:24

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 5 guests