Skip to content

Commit

Permalink
Update clipboard.h
Browse files Browse the repository at this point in the history
  • Loading branch information
itagagaki committed Dec 11, 2023
1 parent 53b9448 commit 93814c2
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions clipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,26 @@
class CClipBoard
{
public:
CClipBoard()
: m_hParentWnd(nullptr)
, m_bListening(false)
{
}

CClipBoard(int retryTimes, int retryInterval)
: m_hParentWnd(nullptr)
, m_bListening(false)
{
}

CClipBoard() : m_hParentWnd(nullptr), m_bListening(false) {}
virtual ~CClipBoard() {}

void SetParent(HWND hWnd) {
m_hParentWnd = hWnd;
StartListener();
}

void StartListener() {
if (!m_bListening) {
::AddClipboardFormatListener(m_hParentWnd);
m_bListening = true;
}
}

void StopListener() {
::RemoveClipboardFormatListener(m_hParentWnd);
m_bListening = false;
}

bool SetClipboardText(const CString sData, int retryCount, int retryInterval);
bool GetClipboardText(CString& sData, int retryCount, int retryInterval);

Expand Down

0 comments on commit 93814c2

Please sign in to comment.