Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shushu789 opened this issue Apr 29, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@shushu789
Copy link

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

  • windows 10 20H2
  • visual studio 17.5.0
  • net 7
  • SharpClipboard 3.5.2
@rainyl
Copy link

rainyl commented Jul 25, 2023

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
Copy link

rainyl commented Aug 16, 2023

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.

protected override void WndProc(ref Message m)

Maybe this can help you to reproduce this problem.

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

@rainyl
Copy link

rainyl commented Aug 18, 2023

UPDATE:

  • newly created winform and wpf apps will also be influenced
  • replacing SetClipboardViewer() with AddClipboardFormatListener() solved this problem

@shushu789
Copy link
Author

@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
Copy link

rainyl commented Aug 18, 2023

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

@shushu789
Copy link
Author

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

@rainyl
Copy link

rainyl commented Aug 18, 2023

@shushu789 Well, Thanks~

@Willy-Kimura
Copy link
Owner

Willy-Kimura commented Sep 7, 2023

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.

@Willy-Kimura Willy-Kimura added the enhancement New feature or request label Sep 7, 2023
@rainyl
Copy link

rainyl commented Sep 8, 2023

Great, Thanks for your works 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants