DonationCoder.com Software > N.A.N.Y. 2021
NANY 2021: MoveFileHere
tomos:
^ Nod5 thanks for that info :up:
The error you describe is a bug but I haven't found a way to reproduce it yet. It could be an issue with file permissions or Windows 10 security (partially) blocking the exe, hard to say.
-Nod5 (January 17, 2021, 10:31 AM)
--- End quote ---
it's a user account (there is no problem with elevating permissions though when necessary). Not sure what the security settings are. Will get back to it again in a couple of days time, and try a few variations and report back then.
tomos:
I did get another chance -- I seem to get error messages no matter what I do:
1) With exe, pressing enter after F7 gets same error as above
2) with AHK file, pressing enter/spacebar/left-click after F7 gets:
---------------------------
MoveFileHere.ahk
---------------------------
Error: 0x8000FFFF - Catastrophic failure
Specifically: hwnd
Line#
216: Hotkey,Lbutton,hotkey_lbutton,vState
217: Hotkey,Esc,hotkey_esc,vState
218: }
224: {
225: vHwnd := WinActive("ahk_class CabinetWClass")
226: if (vHwnd)
227: For window, in ComObjCreate("Shell.Application").Windows
---> 228: if (window.hwnd = vHwnd)
229: {
230: path := window.Document.Folder.Self.Path
232: Return,SubStr(path, 1, 2) = "::" ? "" : path
233: }
234: }
244: {
246: vHwnd := vHwnd ? vHwnd : WinExist("A")
Continue running the script?
---------------------------
Yes No
---------------------------
3) I get the same error using a different folder -- note it does find the folder and displays the correct file
Do you think is it to do with it being a user account? (UAC at "Default", which appears to be high). I can try it in the admin account, but not tonight ;-)
Nod5:
I seem to get error messages no matter what I do
-tomos (January 17, 2021, 06:16 PM)
--- End quote ---
Ok, sorry that it isn't working. That error message points to the a step in the code that uses COM to loop over all open File Explorer windows. It seems to find a File Explorer window but crash when that window's handle is accessed. I don't know what is causing that error though, I'm not able to reproduce it on any PC I have tried. It is also a pretty commonly used method in AutoHotkey scripts and I haven't found similar errors reported in the AHK forums. Guessing: maybe related to Win 10 security permissions settings or a conflict with some other app or script that is running on your computer but not on mine. If you have another Win 10 computer at hand you could try it there, to help narrow down the issue.
meoow:
I can confirm that I too had the exactly same issue, when accessing hwnd, the program would crash.
Nod5:
I can confirm that I too had the exactly same issue, when accessing hwnd, the program would crash.
-meoow (July 18, 2021, 02:49 AM)
--- End quote ---
I seem to get error messages no matter what I do
-tomos (January 17, 2021, 06:16 PM)
--- End quote ---
I have still not been able to reproduce the crash so cannot yet explain what the root cause is. Here is a test .ahk version (requires AutoHotkey installed) with an attempted workaround. Can you test it and tell me if the error still happens?
https://github.com/nod5/MoveFileHere/blob/210721/MoveFileHere.ahk
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version