المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Windows Shell Context Menu



C# Programming
03-25-2010, 07:11 PM
Hello everyone,
I'm new to the forum and this is only my second post, so I apologize in advance for any mistakes.

This is my situation:
I'm using Microsoft Visual Studio 2008 with .Net Framework 3.5.
I'm developing an extension of the Windows Shell Context menu, and I did it, but I have a problem:
when my menu is invoked on the links (*.lnk), it doesn't work and prevents the upper voices.
This only occurs on Vista and Seven, not on XP.
This is the IContextMenu.QueryContextMenu:

int IContextMenu.QueryContextMenu(uint hmenu,
uint iMenu,
int idCmdFirst,
int idCmdLast,
uint uFlags)
{

//Clicked file
StringBuilder sb = new StringBuilder(1024);
DllImports.DragQueryFile(m_hDrop, 0, sb, sb.Capacity + 1);

//If it's a link (*.lnk) exits
//Maybe the mistake is here, but I don't know!
if (new FileInfo(sb.ToString()).Extension == ".lnk") { return 1; }

// Adds the menus
for (int i = 0; i <span class="code-keyword">