Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Customizing viewer dialog caption

Any features you would like to see in UltraVNC? Propose it here
Post Reply
nicorac
Posts: 5
Joined: 2005-02-08 12:24
Contact:

Customizing viewer dialog caption

Post by nicorac »

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

...
[options]
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 @@
 #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);

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

Re: Customizing viewer dialog caption

Post by nicorac »

Anyone?
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.
Post Reply