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

截取屏幕扫码崩溃 #22

Open
narfa0215 opened this issue Aug 30, 2023 · 4 comments
Open

截取屏幕扫码崩溃 #22

narfa0215 opened this issue Aug 30, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@narfa0215
Copy link

narfa0215 commented Aug 30, 2023

如果原有剪贴板内容为图片等二进制格式的话,截取屏幕扫描二维码程序会崩溃,调试后发现ClipWindow类的134行的Clipboard.SetText(Result);会出现异常,异常为HRESULT:0x800401D0 (CLIPBRD_E_CANT_OPEN),将此处变更为Clipboard.SetDataObject(Result);就不再报错了

@narfa0215 narfa0215 changed the title Windows11截取屏幕扫描崩溃 截取屏幕扫描崩溃 Aug 30, 2023
@narfa0215 narfa0215 changed the title 截取屏幕扫描崩溃 截取屏幕扫码崩溃 Aug 30, 2023
@1357310795
Copy link
Owner

win10无法复现

扫描前:
image

扫描后:
image

根据网上的信息,应该是偶然性错误,有别的程序占用了剪切板
https://blog.csdn.net/u010265681/article/details/76651740

(没记错的话向日葵就经常把我的剪切板搞坏,复制不了东西

@1357310795 1357310795 added the bug Something isn't working label Aug 30, 2023
@narfa0215
Copy link
Author

win10无法复现

扫描前: image

扫描后: image

根据网上的信息,应该是偶然性错误,有别的程序占用了剪切板 https://blog.csdn.net/u010265681/article/details/76651740

(没记错的话向日葵就经常把我的剪切板搞坏,复制不了东西

我使用的版本是Windows11,而且我没有安装向日葵,可以使用Win徽标键+Shift+S进行截图,此时再截取屏幕就会程序就会崩溃。

@1357310795
Copy link
Owner

既然能稳定复现,方便用剪切板查看器看看扫码前有什么东西吗

ClipboardViewer.zip

@narfa0215
Copy link
Author

narfa0215 commented Aug 30, 2023

好像是我的剪贴板历史记录工具有时会在处理大体积内容(如图片)占用我的剪贴板导致该工具异常报错,但还是建议对这部分代码进行异常捕获防止崩溃,相关问题参考https://stackoverflow.com/questions/68666/clipbrd-e-cant-open-error-when-setting-the-clipboard-from-net
十分感谢您进行排查

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants