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
...
[options]
custom_caption=Mickey Mouse, rd. To DisneyLand (Paris)
...
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...
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 @@
#else
ReadString(m_desktopName, m_si.nameLength);
#endif
- // 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) {
//AaronP
// MessageBox(m_hwnd, sz_K5, sz_K6, MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
Claudio