0

I want to gather the state of a Windows shell file copy/move dialog, especially if the process is paused or running right now.

I can find the dialog easily with Windows UI Automation, but the Pause button is just a toggle with no meaningful data attached that I could find.

I don't want to poke inside Explorer, but rather use official APIs.

Any ideas?

Martin Walter
  • 540
  • 5
  • 11
  • have you considered tracking the size of the file and if the size doesn't change x milliseconds, the process may have been paused? ( eg. https://stackoverflow.com/questions/10541401 ) – Rand Random Jun 15 '23 at 10:21
  • 1
    Is there a reason the copy happens out-of-process ? – Fildor Jun 15 '23 at 10:24
  • I want to monitor copy processes of Explorer, so my program isn't the one starting the operation. I also don't know what is being copied, so tracking the files is out of the question. It wouldn't be reliable anyway. – Martin Walter Jun 15 '23 at 10:41
  • 1
    "It wouldn't be reliable". It will never be reliable since there's no official way of doing this. Plus the Shell UI heavily depends on machine configuration and speed (this dialog is not always displayed), on the process calling the copy API, on Shell extensions, on 3rd parties installed, and obviously on the version of Windows. – Simon Mourier Jun 15 '23 at 10:45
  • Ok, so I am in File Explorer. I do ... say Ctrl-C/Ctrl-V, Copy operation starts and your App is to tell me "x% Done copying" ? Is that what you want to do? – Fildor Jun 15 '23 at 10:45
  • Something like that, yes. I want to know the source and destination of the operation, and the state. I already have source and destination, but not if the operation is running or paused. – Martin Walter Jun 15 '23 at 11:31
  • @Simon But that is the question: is there an official way? There is for getting some info or the operation, as well as pausing and resuming. If there is nothing official, then that is an answer, not a comment. – Martin Walter Jun 15 '23 at 12:24
  • No there isn't. What you can do is create a copy hook handler: https://learn.microsoft.com/en-us/windows/win32/shell/how-to-create-copy-hook-handlers at least you may get some information. – Simon Mourier Jun 15 '23 at 12:56

0 Answers0