MainFrm.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #pragma once
  2. #include "SystemTray.h"
  3. #include "QuickPaste.h"
  4. #include "ToolTipEx.h"
  5. #include "EditFrameWnd.h"
  6. #include "MainFrmThread.h"
  7. #define CLOSE_WINDOW_TIMER 1
  8. #define HIDE_ICON_TIMER 2
  9. #define REMOVE_OLD_ENTRIES_TIMER 3
  10. #define REMOVE_OLD_REMOTE_COPIES 6
  11. #define END_DITTO_BUFFER_CLIPBOARD_TIMER 7
  12. #define KEY_STATE_MODIFIERS 8
  13. #define ACTIVE_WINDOW_TIMER 9
  14. #define FOCUS_CHANGED_TIMER 10
  15. class CMainFrame: public CFrameWnd
  16. {
  17. public:
  18. CMainFrame();
  19. protected:
  20. DECLARE_DYNAMIC(CMainFrame)
  21. // Attributes
  22. public:
  23. // Operations
  24. public:
  25. BOOL ResetKillDBTimer();
  26. // Overrides
  27. // ClassWizard generated virtual function overrides
  28. //{{AFX_VIRTUAL(CMainFrame)
  29. public:
  30. virtual BOOL PreCreateWindow(CREATESTRUCT &cs);
  31. // virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
  32. //}}AFX_VIRTUAL
  33. // Implementation
  34. public:
  35. virtual ~CMainFrame();
  36. #ifdef _DEBUG
  37. virtual void AssertValid()const;
  38. virtual void Dump(CDumpContext &dc)const;
  39. #endif
  40. CQuickPaste m_quickPaste;
  41. CSystemTray m_TrayIcon;
  42. ULONG m_ulCopyGap;
  43. CString m_csKeyboardPaste;
  44. CAlphaBlend m_Transparency;
  45. BYTE m_keyStateModifiers;
  46. DWORD m_startKeyStateTime;
  47. bool m_bMovedSelectionMoveKeyState;
  48. short m_keyModifiersTimerCount;
  49. HWND m_tempFocusWnd;
  50. CMainFrmThread m_thread;
  51. void DoDittoCopyBufferPaste(int nCopyBuffer);
  52. void DoFirstTenPositionsPaste(int nPos);
  53. bool PasteQuickPasteEntry(CString csQuickPaste);
  54. bool SaveQuickPasteEntry(CString csQuickPaste, CClipList *pClipList);
  55. void ShowErrorMessage(CString csTitle, CString csMessage);
  56. bool CloseAllOpenDialogs();
  57. void ShowEditWnd(CClipIDs &Ids);
  58. CEditFrameWnd *m_pEditFrameWnd;
  59. // Generated message map functions
  60. protected:
  61. //{{AFX_MSG(CMainFrame)
  62. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  63. afx_msg void OnFirstOption();
  64. afx_msg void OnFirstExit();
  65. afx_msg void OnChangeCbChain(HWND hWndRemove, HWND hWndAfter);
  66. afx_msg void OnDrawClipboard();
  67. afx_msg void OnTimer(UINT nIDEvent);
  68. afx_msg void OnFirstShowquickpaste();
  69. afx_msg void OnFirstToggleConnectCV();
  70. afx_msg void OnUpdateFirstToggleConnectCV(CCmdUI *pCmdUI);
  71. afx_msg void OnFirstHelp();
  72. //}}AFX_MSG
  73. afx_msg LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);
  74. afx_msg LRESULT OnShowTrayIcon(WPARAM wParam, LPARAM lParam);
  75. afx_msg LRESULT OnClipboardCopied(WPARAM wParam, LPARAM lParam);
  76. afx_msg LRESULT OnAddToDatabaseFromSocket(WPARAM wParam, LPARAM lParam);
  77. afx_msg LRESULT OnErrorOnSendRecieve(WPARAM wParam, LPARAM lParam);
  78. afx_msg LRESULT OnFocusChanged(WPARAM wParam, LPARAM lParam);
  79. afx_msg LRESULT OnCustomizeTrayMenu(WPARAM wParam, LPARAM lParam);
  80. afx_msg LRESULT OnEditWndClose(WPARAM wParam, LPARAM lParam);
  81. afx_msg LRESULT OnSetConnected(WPARAM wParam, LPARAM lParam);
  82. afx_msg LRESULT OnLoadClipOnClipboard(WPARAM wParam, LPARAM lParam);
  83. DECLARE_MESSAGE_MAP()public:
  84. virtual BOOL PreTranslateMessage(MSG *pMsg);
  85. afx_msg void OnClose();
  86. afx_msg void OnFirstImport();
  87. afx_msg void OnDestroy();
  88. afx_msg void OnFirstNewclip();
  89. };
  90. class CShowMainFrame
  91. {
  92. public:
  93. CShowMainFrame();
  94. ~CShowMainFrame();
  95. static bool m_bShowingMainFrame;
  96. bool m_bHideMainFrameOnExit;
  97. HWND m_hWnd;
  98. };