MainFrm.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #pragma once
  2. //#include "SystemTray.h"
  3. #include "QuickPaste.h"
  4. #include "ToolTipEx.h"
  5. #include "EditFrameWnd.h"
  6. #include "MainFrmThread.h"
  7. #include "ClipboardSaveRestore.h"
  8. #include "PowerManager.h"
  9. #include "DittoPopupWindow.h"
  10. #include "NTray.h"
  11. #define CLOSE_WINDOW_TIMER 1
  12. #define HIDE_ICON_TIMER 2
  13. #define REMOVE_OLD_ENTRIES_TIMER 3
  14. #define REMOVE_OLD_TEMP_FILES 6
  15. #define END_DITTO_BUFFER_CLIPBOARD_TIMER 7
  16. #define KEY_STATE_MODIFIERS 8
  17. #define ACTIVE_WINDOW_TIMER 9
  18. #define TEXT_ONLY_PASTE 11
  19. #define READ_RANDOM_DB_FILE 12
  20. #define GROUP_DOUBLE_CLICK 13
  21. #define CLOSE_POPUP_MSG_WND 14
  22. #define SCREEN_RESOLUTION_CHANGED 15
  23. #define DELAYED_SHOW_DITTO_TIMER 16
  24. class CMainFrame: public CFrameWnd
  25. {
  26. public:
  27. CMainFrame();
  28. protected:
  29. DECLARE_DYNAMIC(CMainFrame)
  30. // Attributes
  31. public:
  32. // Operations
  33. public:
  34. BOOL ResetKillDBTimer();
  35. // Overrides
  36. // ClassWizard generated virtual function overrides
  37. //{{AFX_VIRTUAL(CMainFrame)
  38. public:
  39. virtual BOOL PreCreateWindow(CREATESTRUCT &cs);
  40. // virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. virtual ~CMainFrame();
  45. #ifdef _DEBUG
  46. virtual void AssertValid()const;
  47. virtual void Dump(CDumpContext &dc)const;
  48. #endif
  49. CQuickPaste m_quickPaste;
  50. //CSystemTray m_TrayIcon;
  51. CTrayNotifyIcon m_trayIcon;
  52. ULONG m_ulCopyGap;
  53. CString m_csKeyboardPaste;
  54. CAlphaBlend m_Transparency;
  55. BYTE m_keyStateModifiers;
  56. DWORD m_startKeyStateTime;
  57. bool m_bMovedSelectionMoveKeyState;
  58. short m_keyModifiersTimerCount;
  59. HWND m_tempFocusWnd;
  60. CMainFrmThread m_thread;
  61. CDialog *m_pGlobalClips;
  62. CDialog *m_pDeleteClips;
  63. CPropertySheet *m_pOptions;
  64. int m_doubleClickGroupId;
  65. DWORD m_doubleClickGroupStartTime;
  66. CPowerManager m_PowerManager;
  67. int m_startupScreenWidth;
  68. int m_startupScreenHeight;
  69. void DoDittoCopyBufferPaste(int nCopyBuffer);
  70. void DoFirstTenPositionsPaste(int nPos);
  71. void PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarget, BOOL sendPaste, bool pastedFromGroup);
  72. void StartKeyModifyerTimer();
  73. bool PasteQuickPasteEntry(CString csQuickPaste);
  74. bool SaveQuickPasteEntry(CString csQuickPaste, CClipList *pClipList);
  75. void ShowErrorMessage(CString csTitle, CString csMessage);
  76. bool CloseAllOpenDialogs();
  77. void DoTextOnlyPaste();
  78. void RefreshShowInTaskBar();
  79. void ShowEditWnd(CClipIDs &Ids);
  80. CEditFrameWnd *m_pEditFrameWnd;
  81. // Generated message map functions
  82. protected:
  83. //{{AFX_MSG(CMainFrame)
  84. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  85. afx_msg void OnFirstOption();
  86. afx_msg void OnFirstExit();
  87. afx_msg void OnChangeCbChain(HWND hWndRemove, HWND hWndAfter);
  88. afx_msg void OnDrawClipboard();
  89. afx_msg void OnTimer(UINT_PTR nIDEvent);
  90. afx_msg void OnFirstShowquickpaste();
  91. afx_msg void OnFirstToggleConnectCV();
  92. afx_msg void OnUpdateFirstToggleConnectCV(CCmdUI *pCmdUI);
  93. afx_msg void OnFirstHelp();
  94. //}}AFX_MSG
  95. afx_msg LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);
  96. void ShowQPasteWithActiveWindowCheck();
  97. afx_msg LRESULT OnShowTrayIcon(WPARAM wParam, LPARAM lParam);
  98. afx_msg LRESULT OnClipboardCopied(WPARAM wParam, LPARAM lParam);
  99. afx_msg LRESULT OnAddToDatabaseFromSocket(WPARAM wParam, LPARAM lParam);
  100. afx_msg LRESULT OnErrorOnSendRecieve(WPARAM wParam, LPARAM lParam);
  101. afx_msg LRESULT OnEditWndClose(WPARAM wParam, LPARAM lParam);
  102. afx_msg LRESULT OnSetConnected(WPARAM wParam, LPARAM lParam);
  103. afx_msg LRESULT OnOpenCloseWindow(WPARAM wParam, LPARAM lParam);
  104. afx_msg LRESULT OnLoadClipOnClipboard(WPARAM wParam, LPARAM lParam);
  105. afx_msg LRESULT OnGlobalClipsClosed(WPARAM wParam, LPARAM lParam);
  106. afx_msg LRESULT OnDeleteClipDataClosed(WPARAM wParam, LPARAM lParam);
  107. afx_msg LRESULT OnOptionsClosed(WPARAM wParam, LPARAM lParam);
  108. afx_msg LRESULT OnShowOptions(WPARAM wParam, LPARAM lParam);
  109. afx_msg LRESULT OnSaveClipboardMessage(WPARAM wParam, LPARAM lParam);
  110. afx_msg LRESULT OnReAddTaskBarIcon(WPARAM wParam, LPARAM lParam);
  111. DECLARE_MESSAGE_MAP()public:
  112. virtual BOOL PreTranslateMessage(MSG *pMsg);
  113. afx_msg void OnClose();
  114. afx_msg void OnFirstImport();
  115. afx_msg void OnDestroy();
  116. afx_msg void OnFirstNewclip();
  117. afx_msg void OnFirstGlobalhotkeys();
  118. afx_msg void OnFirstDeleteclipdata();
  119. afx_msg void OnFirstSavecurrentclipboard();
  120. afx_msg LRESULT OnReOpenDatabase(WPARAM wParam, LPARAM lParam);
  121. afx_msg LRESULT OnShowMsgWindow(WPARAM wParam, LPARAM lParam);
  122. afx_msg LRESULT OnShowDittoGroup(WPARAM wParam, LPARAM lParam);
  123. afx_msg void OnFirstFixupstickycliporder();
  124. afx_msg LRESULT OnResolutionChange(WPARAM wParam, LPARAM lParam);
  125. afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam);
  126. afx_msg LRESULT OnPlainTextPaste(WPARAM wParam, LPARAM lParam);
  127. };