Can we handle File object events through Shell Extensions?

Can we handle File object events through Shell Extensions?

Post by Ponn Periasam » Wed, 09 Jul 2003 23:44:59



Hi,

By using "copy hook handlers" shell extension, we can handle Folder object
events and can authorize that to the Shell.
(ICopyHook interface gives the necessary environment)

But I want to trap File object events also.
Is there any way to do that?

Thanks in Advance

Rgds
Ponn Periasamy

 
 
 

Can we handle File object events through Shell Extensions?

Post by Jim Barr » Fri, 11 Jul 2003 08:57:34



> But I want to trap File object events also.
> Is there any way to do that?

I don't think so. Of course you can be notified of file system events using SHChangeNotifyRegister, but you can't disallow those file operations.

--
Jim Barry, MVP for Windows SDK

 
 
 

1. Possible to pragmatically "unhide" file extensions in shell objects?

I have been working on a piece of VBScript code that scans a directory
and displays the filename and the "Title" column of the file (as set on
the Summary tab of file properties).  The following is a snippet of the
code (based on code in Technet):

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Files")
For Each strFileName in objFolder.Items
  Wscript.echo strFileName
  Wscript.echo "Title: " & objFolder.GetDetailsOf(strFileName, 11)
Next

The problem is that I do not get the filename's extension when "Hide
file extensions for known file types" is checked in the folder
properties and it is a necessary piece of information.  Since the script
runs on several systems, I do not necessarily have the ability to make
sure the option is not checked.  Is there a method of changing the
setting to unhide extensions pragmatically for the duration of the
script?  Ideally it would be a method attached to the folder object that
would allow me to set the folder display options for this instance of
the object.  

For now, I am using the "Scripting.FileSystemObject" to scan the files
in the directory and then passing the filename via .ParseName to the
.GetDetailsOf function in order to get the summary information I am
interested in.  It would alot cleaner if I simply used the Shell
functions and .Items to list the contents of the directory.

TIA,
Robert

2. CFP: SSCC98 Conference

3. Help!,How Can I handle Key press event In Shell Exention?

4. FS: Indy drives sleds

5. Accessing SaveAs Dialog Event w/in Office 2000 Shell Namespace Extension

6. Print to PDF from remote computer?

7. Shell extension for one file class but several files at once?

8. Enforcing Quotas on an NFS mounted filesystem

9. shell extension for active directory objects

10. Problem when instancing COM object in a shell namespace extension

11. Shell Extension for Printer Objects

12. Installing Shell Extensions with .INF files

13. .lnk files aren't passed to shell extension handlers?