author | Michael Krelin <hacker@klever.net> | 2004-07-05 01:53:09 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2004-07-05 01:53:09 (UTC) |
commit | 9938ea772d372ba955b7bc1f1c48a062c3a36f8a (patch) (side-by-side diff) | |
tree | a98185df944e3a763f9557aa74bc2837b343f048 /Trayer.cpp | |
download | pumpkin-9938ea772d372ba955b7bc1f1c48a062c3a36f8a.zip pumpkin-9938ea772d372ba955b7bc1f1c48a062c3a36f8a.tar.gz pumpkin-9938ea772d372ba955b7bc1f1c48a062c3a36f8a.tar.bz2 |
initial commit into svn repository
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@1 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | Trayer.cpp | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/Trayer.cpp b/Trayer.cpp new file mode 100644 index 0000000..6e8c100 --- a/dev/null +++ b/Trayer.cpp @@ -0,0 +1,118 @@ +// Trayer.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "PumpKIN.h"
+#include "Trayer.h"
+
+#include "PumpKINDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CTrayer
+
+CTrayer::CTrayer()
+{
+ m_inMenu=0;
+}
+
+CTrayer::~CTrayer()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CTrayer, CWnd)
+ //{{AFX_MSG_MAP(CTrayer)
+ ON_MESSAGE(WM_TRAYICON, OnTray)
+ ON_COMMAND(ID_TRAY_ABOUTPUMPKIN, OnTrayAboutpumpkin)
+ ON_COMMAND(ID_TRAY_EXIT, OnTrayExit)
+ ON_COMMAND(ID_TRAY_FETCHFILE, OnTrayFetchfile)
+ ON_COMMAND(ID_TRAY_HELP, OnTrayHelp)
+ ON_COMMAND(ID_TRAY_OPENFILESFOLDER, OnTrayOpenfilesfolder)
+ ON_COMMAND(ID_TRAY_OPTIONS, OnTrayOptions)
+ ON_COMMAND(ID_TRAY_SENDFILE, OnTraySendfile)
+ ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CTrayer message handlers
+
+CTrayer::CTrayer(CPumpKINDlg* daddy)
+ : m_Daddy(daddy)
+{
+ m_inMenu=0;
+}
+
+LRESULT CTrayer::OnTray(WPARAM wP,LPARAM lP)
+{
+ ASSERT(wP==IDC_TRAYICON);
+ switch(lP){
+ case WM_RBUTTONDOWN:
+ {
+ CMenu menu;
+ VERIFY(menu.LoadMenu(IDM_POPUPS));
+ CMenu *popUp = menu.GetSubMenu(0);
+ ASSERT(popUp);
+ CPoint pt;
+ VERIFY(::GetCursorPos(&pt));
+ m_inMenu++;
+ SetForegroundWindow();
+ popUp->CheckMenuItem(ID_TRAY_SHOWPUMPKINWINDOW,MF_BYCOMMAND|(IsWindowVisible()?MF_CHECKED:MF_UNCHECKED));
+ popUp->TrackPopupMenu(TPM_RIGHTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,pt.x,pt.y,this);
+ m_inMenu--;
+ SendMessage(WM_NULL);
+ }
+ break;
+ case WM_LBUTTONDOWN:
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SHOWPUMPKINWINDOW);
+ break;
+ }
+ return 0;
+}
+
+void CTrayer::OnTrayAboutpumpkin()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_ABOUTPUMPKIN);
+}
+
+void CTrayer::OnTrayExit()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_EXIT);
+}
+
+void CTrayer::OnTrayFetchfile()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_FETCHFILE);
+}
+
+void CTrayer::OnTrayHelp()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_HELP);
+}
+
+void CTrayer::OnTrayOpenfilesfolder()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_OPENFILESFOLDER);
+}
+
+void CTrayer::OnTrayOptions()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_OPTIONS);
+}
+
+void CTrayer::OnTraySendfile()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SENDFILE);
+}
+
+void CTrayer::OnTrayShowpumpkinwindow()
+{
+ m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SHOWPUMPKINWINDOW);
+}
|