SHFileOperation -> IFileOperation conversion?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

SHFileOperation -> IFileOperation conversion?

23 Jun 2017, 15:16

Hello!

Im using this external version of the SHFileOperation (written by just me) in order to keep my GUI operational during file moves/copy of very large files, which has been working nicely up to now. Lately I have come across some issues with it (or rather more correct a lacking of feature). I do like to sort files using created date attribute and this attribute vanishes in cross-volume copy operations. Im abled to workaround that with some awkward coding, but instead of using messy workarounds I was wondering if anyone might be interested in converting it to the more modern IFileOperation, which supports the FOFX_MOVEACLSACROSSVOLUMES (0x02000000) flag which allows "copy the security attributes of the source item to the destination item when performing a cross-volume move operation. Without this flag, the destination item receives the security attributes of its new folder"? This c++ stuff is so over my head.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Spoiler
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: SHFileOperation -> IFileOperation conversion?

31 Jan 2018, 10:19

Oh man! MS has developed their IFileOperation function even further, which i noticed during copy of two individually separated copy oprerations. Only one dialog was used in this case (instead of opening two separate dialogs like the SHFileOperation does) where each operation was stacked in a scrollable list within the dialog. Pretty cool I have to say :D

So again are anyone willing/qualified to build an AHK function of the IFileOperation? Unfortunatley the smartest one in here (@just me) doesnt involve himself in the hardest MS integration stuff, which elevates whats possible to do with AHK to much higher levels, as he used to and the old AHK dragons (which produced fantastic stuff, but in many areas dated) are hardly active anymore (the likes of SKAN), which sadly slows down progress of AHK. Guys like that (who have the ability to revolutionize/elevate the language) do not seem to come around that often. It might be time to start investigating a second language, cuz I dont see how V2 elevates the AHK experience the slightest (to me it just appears as an continuously ongoing syntax squabble). It sure looks like Im never going to use V2 at all (too much hassle with converting already made scripts). Haha...well with this kind of reflection Im never gonna get any help with this, but who cares! There are no takers anyway :problem:
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SHFileOperation -> IFileOperation conversion?

04 Feb 2018, 18:06

- Once in every lifetime, comes a COM object job like this. Or for me, two of them, two object implementations, and tutorial links, which I mentioned as possible templates for DigiDon:
RichEdit : New Features to All - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 61#p198061
- Sometimes the pain of anticipation of how difficult it's going to be, is worse than actually doing it. I usually work out a list of what I want to investigate, research and test, and then ask questions if I get stuck.
- I would recommend to have a go, and ask questions along the way.
- It would be a good idea to try and produce here, a list of all the interfaces and methods, that you think you are going to need. If people have some idea of your objective, it'll be easier to help. Also, it might turn out that some of what you want has already been partially done by other people, or that it ties in/overlaps with something that they've wanted to do, meaning that they already have some degree of motivation.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: SHFileOperation -> IFileOperation conversion?

06 Feb 2018, 06:10

@jeeswg, your motivation to help people and the desire/drive to elevate AHK as a language is admirable. Imagine what AHK would be like if that motivation and drive would match your COM object programming skills ;) Regarding myself im an intermediate AHK user, but an absolute beginner when it comes to DLL calls. So starting to develop AHK COM objects functions out of the blue is very far fetched. Heck, when studying @just me`s dragndrop COM interface makes my head feel dizzy.

More interestingly, when reading about @DigiDon`s adventures where he managed to successfully convert an AutoIt COM object class to AHK, which makes me wonder...why has AutoIt come so much further compared to AHK! Do they pay for COM object classes or what? If not what makes AutoIt more interesting for the absolutely most knowledgable programmers who amongst others also are abled to do COM object programming. And what in the world are the best AHK programmers we have thinking (just me excluded) when they are not motivated to bring AHK to the absolute forefront? Pretty much useless I say, except for AHK newbies ;) AHK is in dire straits if the most knowledgable guy of them all are forced to syntax tinker with v2 and fix petty bugs in v1, in the same time AutoIt and others are passing by faster then hell. The need to investigate AutoIt for the first time is here. I cant come any further with my applications using AHK, which makes me sad cuz AHK (as my first language) is very dear to me.
just me
Posts: 9485
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: SHFileOperation -> IFileOperation conversion?

06 Feb 2018, 06:26

Back to the roots:
zcooler wrote:I do like to sort files using created date attribute and this attribute vanishes in cross-volume copy operations. Im abled to workaround that with some awkward coding, but instead of using messy workarounds I was wondering if anyone might be interested in converting it to the more modern IFileOperation, which supports the FOFX_MOVEACLSACROSSVOLUMES (0x02000000) flag ...
Access Control Lists have nothing to do with the 'created date attribute'.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SHFileOperation -> IFileOperation conversion?

07 Feb 2018, 10:35

- How much evidence do you have that AutoIt is progressing faster? I don't have any information on this. (Maybe sometimes AutoIt people think, I wish we had that AutoHotkey feature/script.) Personally, AutoHotkey has all the functionality I need, it's just a question of completing my projects.
- We are in the age of COM, and we need to attract/grow more COM programmers. I'm going to add a bit more on object implementation to my objects tutorial, and do beginner/DllCall/mathematics/other tutorials, to get more people/experts into AutoHotkey.
- This might be useful for learning DllCall for now:
AutoHotkey via DllCall: AutoHotkey functions as custom functions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=37871
- just me's library is difficult only because it's large. Take the hello world approach: you find a way 'in' to an interface, and then you implement one method. To understand the library better, list all of the interfaces/methods/CLSIDs, and look them up on MSDN, that's mostly what you'd need to do.
- Do outline what interfaces/methods you are interested in, and your goals.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: SHFileOperation -> IFileOperation conversion?

08 Feb 2018, 05:19

just me wrote:Back to the roots:
zcooler wrote:I do like to sort files using created date attribute and this attribute vanishes in cross-volume copy operations. Im abled to workaround that with some awkward coding, but instead of using messy workarounds I was wondering if anyone might be interested in converting it to the more modern IFileOperation, which supports the FOFX_MOVEACLSACROSSVOLUMES (0x02000000) flag ...
Access Control Lists have nothing to do with the 'created date attribute'.
Oh crap, a classic zcooler misunderstanding :o Well, its not the first time ;)
FOFX_MOVEACLSACROSSVOLUMES (0x02000000)

Copy the security attributes of the source item to the destination item when performing a cross-volume move operation. Without this flag, the destination item receives the security attributes of its new folder.
I thought it sounded spot on if crossing out "security" ;) Didnt know the meaning of a security attribute, but does now, thanks! Right now im writing over all file attributes for copied files in destination when SHFileOperation is done. I dont know how to do it in any other way and should not SHFileOp or IFileOperation take care of the cross-volume copy case in some way in the first place?

Code: Select all

  If (DropEffect = 1) {
   For k, v in FileArray {
	  FileGetTime, CreatedTime, % v, C
	  SplitPath, v, FileName
	  File := {FilNamn: FileName, CTime: CreatedTime, DestDir: TargetPath}
	  FileSetTime, % File.CTime, % File.DestDir "\" File.FilNamn, C, 1, 0 ; 20170623 sets the old created date for copied files.
   }
  }

jeeswg wrote:- How much evidence do you have that AutoIt is progressing faster? I don't have any information on this. (Maybe sometimes AutoIt people think, I wish we had that AutoHotkey feature/script.) Personally, AutoHotkey has all the functionality I need, it's just a question of completing my projects.
- We are in the age of COM, and we need to attract/grow more COM programmers. I'm going to add a bit more on object implementation to my objects tutorial, and do beginner/DllCall/mathematics/other tutorials, to get more people/experts into AutoHotkey.
- This might be useful for learning DllCall for now:
AutoHotkey via DllCall: AutoHotkey functions as custom functions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=37871
- just me's library is difficult only because it's large. Take the hello world approach: you find a way 'in' to an interface, and then you implement one method. To understand the library better, list all of the interfaces/methods/CLSIDs, and look them up on MSDN, that's mostly what you'd need to do.
- Do outline what interfaces/methods you are interested in, and your goals.
I do not have any evidence, that is what I intend to find out. I just assumed AutoIt has progressed faster based on the fact when they are doing classes (DigiDon example) out of COM Obejcts they have nailed it pretty well, which makes it easier (my assumption again) for others to build upon and develop further with other COM objects. Other than that I think these listed points are awesome, even though I have no idea how you are going to attract COM object programmers into AHK. Im quite possitive folks with these kind of skills do not involve themselves in a free scripting language, which has always been profiling itself as easy to learn and for newbies. Its as of late when lexikos took over it has become the awesome flully fledged and powerful language it is today. But doing what you are doing is defintely the right track, motivating and supporting the people already into AHK. Also you never know if contributions from a few shining stars (like the one im adressing above) might arrive, and if so its a party :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, Google [Bot], Rohwedder and 264 guests