MainFrm.h 5.5 KB

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