Willy-Kimura / SharpClipboard

A library for anonymously monitoring clipboard entries.
183 stars 34 forks source link

It won't be able to listen to the clipboard data after running for a long time #30

Open shushu789 opened 1 year ago

shushu789 commented 1 year ago

I'm not sure why, I'm using it in .NET 7 WPF, but sometimes it somehow doesn't work after more than an hour or two of runtime, many users have reported this problem because my WPF application is installed on many user devices, I have no other more options, I just use "clipboard. ClipboardChanged += ClipboardChanged;" like this:

InitializeComponent(). clipboard.ClipboardChanged += ClipboardChanged. ... if (e.ContentType == SharpClipboard.ContentTypes.Text) { string clipboardText = clipboard. log.Debug("clipboardText:" + clipboardText). }

It happens regularly, but not regularly, sometimes it is normal for several days, sometimes it may happen every day in a row, and when it happens, I don't get debug data in the user's logs. I would like to know where this problem may occur? Or is there any other way to debug or some possible options to solve this problem? Thanks

Development Environment

rainyl commented 1 year ago

Any progress? It also happened in my plugin, also WPF and .NET 7

After working for a long time, it seems the clipboard listener will stop and app can't record copy actions.

rainyl commented 11 months ago

I just suddenly find that after I close GIMP (v2.10.34), the SharpClipboard will stop listening the changes of clipboard, I tried to debug it, but it seems that WndProc function stops receiving messages like WM_DRAWCLIPBOARD after GIMP closed, I am not familiar with this project so I don't know why. Other clipboard tools like windows builtin clipboard viewer (shortcut: Win+V) worked normally.

https://github.com/Willy-Kimura/SharpClipboard/blob/6584fccb08de7d039074cba4c96dd3f59630e5b6/SharpClipboard/Views/ClipboardHandle.cs#L145

Maybe this can help you to reproduce this problem.

BTW, I debugged it using the two test project in this repo.

rainyl commented 11 months ago

UPDATE:

shushu789 commented 11 months ago

@rainyl I have given up on using this project, and I noticed that the project has not been updated in a long time, and has not responded to these questions. I think the author has stopped maintaining the project, so I have given up

rainyl commented 11 months ago

@shushu789 ☹️ , I have noticed that too, do you know better alternative libraries ?

shushu789 commented 11 months ago

@rainyl Sorry, I don't know, I'm using the traditional solution now, no third-party libraries are used

rainyl commented 11 months ago

@shushu789 Well, Thanks~

Willy-Kimura commented 10 months ago

Hello @shushu789 @rainyl

I'll be updating the library with a fix to this issue and some few more updates. Will let you know once the update is ready. Nope, it's not dead yet.

rainyl commented 10 months ago

Great, Thanks for your works 😄