public void StopContentChanged() { if (_hwndSource != null) { ClipboardNativeFunctions.RemoveClipboardFormatListener(_hwndSource.Handle); _hwndSource.RemoveHook(OnWmMessage); } else { _pendingStartContentChanged = false; } }
public void StartContentChanged() { if (_hwndSource != null) { _hwndSource.AddHook(OnWmMessage); ClipboardNativeFunctions.AddClipboardFormatListener(_hwndSource.Handle); } else { // Signals the app to hook when it's ready _pendingStartContentChanged = true; } }