Celebrating the 22th anniversary of the UltraVNC: https://forum.uvnc.com/viewtopic.php?t=38031
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
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- 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

"Menu" button/menuitem in full screen title bar

Any features you would like to see in UltraVNC? Propose it here
Post Reply
Roy

"Menu" button/menuitem in full screen title bar

Post by Roy »

As titled. Currently there's no way to get the menu in full screen without using hotkey.
roytam1
20
20
Posts: 47
Joined: 2006-05-16 08:49
Contact:

Post by roytam1 »

Sure. My ICL build applied this patch. Please check it out.

a Dirty Patch:

Code: Select all

Index: ClientConnection.cpp
===================================================================
RCS file: /cvsroot/ultravnc/ultravnc/vncviewer/ClientConnection.cpp,v
retrieving revision 1.147
diff -u -8 -p -r1.147 ClientConnection.cpp
--- ClientConnection.cpp	24 May 2006 13:14:40 -0000	1.147
+++ ClientConnection.cpp	30 May 2006 04:55:46 -0000
@@ -4763,16 +4771,17 @@ LRESULT CALLBACK ClientConnection::WndPr
 		{
 			switch (iMsg)
 			{
 //			case WM_TIMER:
 //				KillTimer(hwnd,_this->m_FTtimer);
 //				_this->m_FTtimer=0;
 //				_this->m_pFileTransfer->SendFileChunk();
 //				break;
+			case WM_COMMAND: 
 			case WM_SYSCOMMAND:
 				{
 					switch (LOWORD(wParam))
 					{
 					case ID_SW:
 						if (!_this->m_SWselect)
 						{
 							_this->m_SWselect=true;
@@ -4865,25 +4874,31 @@ LRESULT CALLBACK ClientConnection::WndPr
 						}
 						if (_this->m_opts.m_ViewOnly) return 0;
 						_this->SendServerInput(false);
 						break;
 						
 					case SC_MINIMIZE:
 						_this->SetDormant(true);
 						if (_this->m_hwndStatus)ShowWindow(_this->m_hwndStatus,SW_MINIMIZE);
+						if (!IsIconic(_this->m_hwndMain)) ShowWindow(_this->m_hwndMain,SW_MINIMIZE);
 						break;
 
 					case SC_MAXIMIZE: //Added by: Lars Werner (http://lars.werner.no)
 						_this->SetFullScreenMode(!_this->InFullScreenMode());
 						break;
 						
 					case SC_RESTORE:
 						_this->SetDormant(false);
 						if (_this->m_hwndStatus)ShowWindow(_this->m_hwndStatus,SW_NORMAL);
+						if (!IsIconic(_this->m_hwndMain)&&_this->InFullScreenMode()) _this->SetFullScreenMode(!_this->InFullScreenMode());
+						break;
+						
+					case SC_CLOSE:
+						SendMessage(_this->m_hwndMain,WM_CLOSE,(WPARAM)0,(LPARAM)0);
 						break;
 						
 					case ID_NEWCONN:
 						_this->m_pApp->NewConnection();
 						return 0;
 						
 					case ID_CONN_SAVE_AS:
 						_this->SaveConnection();
Index: FullScreenTitleBar.cpp
===================================================================
RCS file: /cvsroot/ultravnc/ultravnc/vncviewer/FullScreenTitleBar.cpp,v
retrieving revision 1.4
diff -u -8 -p -r1.4 FullScreenTitleBar.cpp
--- FullScreenTitleBar.cpp	21 May 2004 14:38:00 -0000	1.4
+++ FullScreenTitleBar.cpp	30 May 2006 12:54:00 -0000
@@ -139,17 +139,17 @@ void CTitleBar::CreateDisplay()
 	wndclass.hCursor		= LoadCursor(NULL, IDC_ARROW);
 	wndclass.hbrBackground	= (HBRUSH) GetStockObject(WHITE_BRUSH);
     wndclass.lpszMenuName	= (const TCHAR *) NULL;
 	wndclass.lpszClassName	= _T("FSTITLEBAR");
 
 	RegisterClass(&wndclass);
 
 	//Create window without any titlbar
-	DWORD winstyle = WS_POPUP | WS_SYSMENU ;
+	DWORD winstyle = WS_POPUP ;
 
 	int CenterX=(lpRect.right-lpRect.left)/2-tbWidth/2;
 	int HeightPlacement=-tbHeigth+1;
 
 	if(tbScrollWindow==FALSE)
 		HeightPlacement=0;
 
 	m_hWnd = CreateWindow(_T("FSTITLEBAR"),
@@ -399,23 +399,28 @@ LRESULT CALLBACK CTitleBar::WndProc(HWND
 	case WM_LBUTTONDBLCLK:
 			//If the default entries on the context menu is activated then doubleclick is restore :)
 			if(tbLastIsStandard==TRUE)
 				::SendMessage(TitleBarThis->m_hWnd,WM_COMMAND,MAKEWPARAM(tbIDC_MAXIMIZE,BN_CLICKED),NULL);
 		break;
 
 	case WM_RBUTTONDOWN:
 		{
-			HMENU Menu=LoadMenu(TitleBarThis->hInstance,MAKEINTRESOURCE (tbMENUID));
-			HMENU SubMenu=GetSubMenu(Menu,0);;
-
+		//	HMENU Menu=LoadMenu(TitleBarThis->hInstance,MAKEINTRESOURCE (tbMENUID));
+		//	HMENU SubMenu=GetSubMenu(Menu,0);
+			HMENU Menu=GetSystemMenu(TitleBarThis->Parent, FALSE);
 			POINT  lpPoint;
 			::GetCursorPos(&lpPoint);
 
-			int Pos=0;
+			::EnableMenuItem(Menu,SC_RESTORE,MF_BYCOMMAND|MF_ENABLED);	// Restore item
+			::EnableMenuItem(Menu,SC_MAXIMIZE,MF_BYCOMMAND|MF_GRAYED);	// Maximize item
+			::EnableMenuItem(Menu,SC_MOVE,MF_BYCOMMAND|MF_GRAYED);	// Move item
+			::EnableMenuItem(Menu,SC_SIZE,MF_BYCOMMAND|MF_GRAYED);	// Size item
+
+		/*	int Pos=0;
 
 			//Set ID values to each item
 			for(int i=0;i<GetMenuItemCount(SubMenu);i++)
 			{
 				TCHAR Text[MAX_PATH];
 				ZeroMemory(Text,sizeof(LPTSTR));
 				int res=::GetMenuString(SubMenu, i, Text, MAX_PATH, MF_BYPOSITION);
 				
@@ -440,22 +445,23 @@ LRESULT CALLBACK CTitleBar::WndProc(HWND
 					{
 						RealPos++;
 
 						if(RealPos==Pos-2)
 						::SetMenuDefaultItem(SubMenu, i, TRUE);
 					}
 				}
 			}
-
-			TrackPopupMenu(SubMenu,TPM_LEFTALIGN, lpPoint.x, lpPoint.y, 0, TitleBarThis->m_hWnd, NULL);
+	   */
+		//	TrackPopupMenu(SubMenu,TPM_LEFTALIGN, lpPoint.x, lpPoint.y, 0, TitleBarThis->m_hWnd, NULL);
+			TrackPopupMenu(Menu,TPM_LEFTALIGN, lpPoint.x, lpPoint.y, 0, TitleBarThis->Parent, NULL);
 
 			SetForegroundWindow (TitleBarThis->m_hWnd);
-			DestroyMenu (SubMenu);
-			DestroyMenu (Menu);
+		//	DestroyMenu (SubMenu);
+		//	DestroyMenu (Menu);
 
 			break;
 		}
 
 	case WM_TIMER:
 		{
 			UINT TimerID=(UINT)wParam;
 			
	
[EDIT] Patch revised. [/EDIT]
Last edited by roytam1 on 2006-05-30 13:04, edited 1 time in total.
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Post by redge »

roytam1,
you added system menu available from mice is a great feature working fine :-)
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
roytam1
20
20
Posts: 47
Joined: 2006-05-16 08:49
Contact:

Post by roytam1 »

redge wrote:roytam1,
you added system menu available from mice is a great feature working fine :-)
This patch also fixes poping up Full Screen Title Bar's own system menu.
Before applying this patch you can popup Full Screen Title Bar's own system menu by giving it focus and press [Alt]+[Space bar].
And you can close/move the Full Screen Title Bar by the items of its system menu.
Keyboard control geeks. xD
Post Reply