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
Setting list of files #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments which potentially might fix issue
I'll give it a better look tomorrow
@mchels I applied comments myself, please check |
Noticed there is some issue, let me try to see if I can write test for this code |
@mchels I fixed memory corruption in my code, so now it should correctly set file from string. Let me know how it looks to you. |
Absolutely agree. The code I pushed was just what I was able to do myself. |
@DoumanAsh I have pushed a commit that sets a list of strings rather than a single string. It seems to work for me. |
I released version 4.5.0 |
I want to add setting files on the clipboard according to these links
https://stackoverflow.com/questions/25708895/how-to-copy-files-by-win32-api-functions-and-paste-by-ctrlv-in-my-desktop
https://forums.codeguru.com/showthread.php?565003-SetClipboardData()-to-Copy-File
https://forum.lazarus.freepascal.org/index.php?topic=51601.0
https://stackoverflow.com/questions/27278659/copy-a-file-to-clipboard-in-delphi
https://devblogs.microsoft.com/oldnewthing/20130520-00/?p=4313
https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cf_hdrop
https://github.com/luapower/winapi/blob/master/winapi/clipboard.lua#L187
https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/ns-shlobj_core-dropfiles
https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/UI/Shell/struct.DROPFILES.html
https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Foundation/struct.BOOL.html
https://github.com/gabdube/native-windows-gui/blob/10f2ac484b25368abc286f4d90562c3a27f22595/native-windows-gui/src/events.rs
https://github.com/alex8088/clipboard-files/blob/master/src/clip_win.cc
I get an error in the test that I added, though:
Occasionally, I will get
instead of
so I suspect I am doing memory management wrong somehow. If anyone has any pointers (pun) on how to figure that part out, I would greatly appreciate it!
I had to disable
no_std
because I couldn't figure out how to get the code to run otherwise. Apologies for my rookie Rust skills.Background: I am writing a file manager app in the tauri framework (https://tauri.app/) to learn rust. I come from a python background.
The funny thing is that the code above works for the first copy action in the sense that I am actually able to paste the file in Explorer. If I try to copy another file afterwards my Tauri app crashes with no stack trace