Platform SDK Shell >> can not track paste, copy, cut event of view created by ShCreateShellFolderView

by xuhang » Sat, 25 Dec 2004 15:53:44 GMT

hi,all:
I am developing a NSE app. The Implementation of IShellFolder
CreateViewObject, I return a system default view created by
ShCreateShellFolderView. It works fine, but I can not handle event when user
press accelerate key (ctrl-v,c,x)to paste, copy or cut.
I tried to implement IShellFolderViewCB interface MessageSFVCB function and
could not track the event still. When I press ctrl-v, the uMsg is 33 and
lParam is 20xxxxx (I can not recall it exactly) and wParam is null. When
ctrl-c and ctrl-x, the uMsg is 33 and lParam is 0 and wParam is null.

My question is:
1.Is it correct to catch the event by implement MessageSFVCB?
2.If it is correct, how can I distinguish these thress event?
3.After catching these three events, how can I supply my dataobject info to
clipboard, similar source code is appreciated.

my source code:
---------------------------------------------------------
public void CreateViewObject(IWin32Window hwndOwner, ref Guid riid, out
IntPtr ppv)
{
if (NsExtension.IID_IShellView.Equals(riid))
{
ShellFolderViewCreate sfvc = new ShellFolderViewCreate(this, this);
Marshal.ThrowExceptionForHR(Shell32.SHCreateShellFolderView(ref sfvc,
out ppv));

if (ppv == IntPtr.Zero)
{
throw new COMException();
}
}
}
-----------------------------------------------------
void IShellFolderViewCB.MessageSFVCB(ShellFolderViewMessage uMsg, ref IntPtr
wParam, ref IntPtr lParam)
{
switch (uMsg)
{
case ShellFolderViewMessage.GetNotify:
using (Malloc m = Shell32.GetMalloc())
{
wParam = ItemIdList.Create(m, folderObj.PathData).Ptr;
lParam = new IntPtr((int) (ShellChangeEvents.RenameFolder |
ShellChangeEvents.RenameItem));
}
break;

default:
throw new NotSupportedException();
}
}