MainFrm.h 4.8 KB

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