Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to write shell extensions to hook context menu's "open" "copy" "cut"

Posted on 2006-07-24
5
Medium Priority
?
431 Views
Last Modified: 2013-11-20
Hi, I want write a shell extensions to hook context menu's "open" "copy" "cut",
when user right-click on a file then choose open or copy or cut or transfer to,
I want it do my hook function first then do origin work.

Please give me some information, and code example,

Thanks for your help~
0
Comment
Question by:rocktilldie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17166501
Though I have not seen any hook implementation for this global file operations and also ICopyHook which available is only works for Folder and Printer objects....
But You may check out API SHChangeNotifyRegister() which sends notifications from the file system or shell about particular operation..this will help you to implement hook..

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotifyregister.asp

-MAHESH
0
 

Author Comment

by:rocktilldie
ID: 17173454
Hi, but seems SHChangeNotifyRegister() can't detect "copy file", "cut file" "open file" event, Could you give me example code? Thanks~
0
 

Author Comment

by:rocktilldie
ID: 17177938
I found someone want hook double click's solution
--------------------------------------------------------------------------------------------------------------------------
You have to implement IContextMenu (return the interface in GetUIObjectOf) and put a default item in it. Normally the flag CMF_DEFAULTONLY will be set, and then you add only your default command. Then in InvokeCommand you display your dialog.
Of course, nowadays it is advised to use CDefFolderMenu_Create2 for your context menu.
---------------------------------------------------------------------------------------------------------------------------
But I'm beginner to shell extension/COM, so can anyone give me sample code explain above solution?
Thanks~
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 1500 total points
ID: 17190753
0
 

Author Comment

by:rocktilldie
ID: 17193616
Thanks, I'll use this example
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question