Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

VS 2012 Shell Context Menu - How to exclude or handle shortcut (.lnk) files?

$
0
0
Hi,

I have added application shortcut to windows context menu in HKEY_CLASSESS_ROOT\*\shell for all files types with this sample value: "C:\myvbapp.exe" "%1"

On myvbapp form load coding (as shown below), I have created a simple alert which shows the directory and the filename whenever user right click on any files in the operating system.

Code:

Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
        For i As Integer = 0 To CommandLineArgs.Count - 1
            MessageBox.Show(CommandLineArgs(i))
        Next

Currently there is no response for all the shortcut files (.lnk) based on the coding above. But for normal file extension, it is able to prompt the directory and filename without any issue.

May I know is it possible to exclude shortcut files (.lnk) in the windows context menu?

Or there is something I can add in the registry or coding to handle the shortcut files (.lnk) as well?

Please advise.

Thanks.

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>