Willy-Kimura / SharpClipboard

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

Fix: listener will stop after run for a long time or stopped by some application like GIMP #34

Closed rainyl closed 11 months ago

rainyl commented 11 months ago

More details at #30

I have tested other WinForm and WPF apps that listening clipboard using SetClipboardViewer(), WM_DRAWCLIPBOARD, and WndProc(), which will also be blocked after closing GIMP, but after replacing SetClipboardViewer() with newer API AddClipboardFormatListener(), the problem has been solved. Actually, I'm still confused that why WndProc() can't receive WM_DRAWCLIPBOARD message after GIMP was closed, maybe it's a bug of GIMP or even windows itself, like something that the message listener list is broken...

But, finally, the problem has been solved, and I'm happy to open this PR to help other developers.

Best wishes.