Browse Source

single click on the icon will show ditto

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@90 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 21 years ago
parent
commit
06ee530775
3 changed files with 9 additions and 2 deletions
  1. 1 1
      MainFrm.cpp
  2. 3 1
      SystemTray.cpp
  3. 5 0
      SystemTray.h

+ 1 - 1
MainFrm.cpp

@@ -97,7 +97,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 						NULL,				// balloon icon
 						20 );
 
-
+	m_TrayIcon.SetSingleClickSelect(TRUE);
 	m_TrayIcon.MinimiseToTray(this);
 	m_TrayIcon.SetMenuDefaultItem(ID_FIRST_SHOWQUICKPASTE, FALSE);
 

+ 3 - 1
SystemTray.cpp

@@ -145,6 +145,8 @@ void CSystemTray::Initialise()
 
 	m_bShowWndAnimation = FALSE;
 
+	m_bSingleClickSelect = FALSE;
+
 #ifdef SYSTEMTRAY_USEW2K
     OSVERSIONINFO os = { sizeof(os) };
     GetVersionEx(&os);
@@ -868,7 +870,7 @@ LRESULT CSystemTray::OnTrayNotification(UINT wParam, LONG lParam)
 #if defined(_WIN32_WCE) //&& _WIN32_WCE < 211
     if (LOWORD(lParam) == WM_LBUTTONDBLCLK && bAltPressed)
 #else
-    else if (LOWORD(lParam) == WM_LBUTTONDBLCLK) 
+    else if((LOWORD(lParam) == WM_LBUTTONDBLCLK) ||  (LOWORD(lParam) == WM_LBUTTONUP && m_bSingleClickSelect))
 #endif
     {
         // double click received, the default action is to execute default menu item

+ 5 - 0
SystemTray.h

@@ -120,6 +120,10 @@ public:
 
     UINT  GetTimerID() const   { return m_nTimerID; }
 
+	void	SetSingleClickSelect(BOOL bSel)	{ m_bSingleClickSelect = bSel; }
+	BOOL	GetSingleClickSelect()			{ return m_bSingleClickSelect;	}
+	
+
 // Static functions
 public:
     static void MinimiseToTray(CWnd* pWnd);
@@ -160,6 +164,7 @@ protected:
     UINT         m_DefaultMenuItemID;
     BOOL         m_DefaultMenuItemByPos;
 	UINT         m_uCreationFlags;
+	BOOL		 m_bSingleClickSelect;
 	
 // Static data
 protected: