Click here to Skip to main content
15,885,546 members

Comments by Patrick Skelton (Top 200 by date)

Patrick Skelton 8-Jun-23 3:55am View    
Yes, it does work on file, but unsurprisingly catches only some applications (Libre Writer is reported, Notepad isn't). I can deliver a part solution that is at least an improvement on what they have now. Thank you for the help.
Patrick Skelton 8-Jun-23 3:48am View    
Mmm... interesting. It's a pain but I guess I could pass it the files in the subfolders to see if that works...
Patrick Skelton 8-Jun-23 3:44am View    
Hi Richard, Just tried it with elevated permission and still get 5. Wonder if it is because the folder is on a network-mapped drive letter. It does seem unlikely it will offer any value on the client's system, since they are not going to let standard users run with elevated permission anyway. I feel a bit of an idiot for blithely assuming this problem would simply be a matter of finding the right chunk of Win32 code.
Patrick Skelton 8-Jun-23 3:21am View    
Hi, Richard, The code fails at the line res = RmGetList(...), which looks like it should return ERROR_MORE_DATA (234) but returns 5. This is not listed as a return value here: https://learn.microsoft.com/en-us/windows/win32/api/restartmanager/nf-restartmanager-rmgetlist.
Not sure how to proceed with that really. It seems to do no 'better' than the method in my code, in that it fails to spot an application such as Notepad opening a file (the code does not give an error but doesn't spot that Notepad has opened the file, which is no surprise since even Explorer will simply allow it to be renamed without complaint).

Seems like I have over-promised to the client. ://)
Patrick Skelton 8-Jun-23 2:37am View    
Hi,

Unfortunately (and despite my warnings about the pitfalls) the client made a specific request for the the folders to be renamed. So option #1 won't work.

Option #2 is elegant. I'd like to implement it but will have to wait for fresh work on which I can piggyback it or I'll be doing it for free. :-|

Thank you!

Kind wishes - Patrick