Click here to Skip to main content
16,018,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am displaying context menu of a file in my application. When user clicks Delete in it, then using API, delete will be called as below.

C#
ShellAPI.CMINVOKECOMMANDINFOEX invoke = new ShellAPI.CMINVOKECOMMANDINFOEX();
           invoke.cbSize = ShellAPI.cbInvokeCommand;
           invoke.lpVerb = (IntPtr)cmd;
           invoke.lpDirectory = parentDir;
           invoke.lpVerbW = (IntPtr)cmd;
           invoke.lpDirectoryW = parentDir;
           invoke.fMask = ShellAPI.CMIC.UNICODE | ShellAPI.CMIC.PTINVOKE |
               ((Control.ModifierKeys & Keys.Control) != 0 ? ShellAPI.CMIC.CONTROL_DOWN : 0) |
               ((Control.ModifierKeys & Keys.Shift) != 0 ? ShellAPI.CMIC.SHIFT_DOWN : 0);
           invoke.ptInvoke = new ShellAPI.POINT(ptInvoke.X, ptInvoke.Y);
           invoke.nShow = ShellAPI.SW.SHOWNORMAL;

           iContextMenu.InvokeCommand(ref invoke);

here the problem is, on clicking dialog Confirm Delete dialog appears but it is not Modal dialog.
Please help me regard this.
Posted
Updated 26-Jan-12 0:44am
v2

1 solution

It's already a lot of time ago that I did some C++. But I think the problem is in the line:
C++
invoke.nShow = ShellAPI.SW.SHOWNORMAL; 

Shouldn't that be SHOWDIALOG instead of SHOWNORMAL?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900