Thank you both for your replies, I have now got it working in a suitable way.
I have a button in my app which opens the properties page of a PDF file using the following code (found here - https://www.daniweb.com/programming/software-development/threads/389833/open-properties-window-of-files-programmatically)
Private Sub btnChoose_Click(sender As Object, e As EventArgs) Handles btnChoose.Click
Dim sp As New SHOW_PROPS(System.IO.Path.Combine(My.Application.Info.DirectoryPath, "Resources\USER GUIDE.pdf"), CType(Me.Handle, IntPtr))
End Sub
Public Class SHOW_PROPS
Public Const SW_SHOW As Short = 5
Public Const SEE_MASK_INVOKEIDLIST As Short = 12
Private m_fileName As String
Private m_handle As IntPtr
Public Sub New(ByVal fileName As String, ByRef hndl As IntPtr)
m_fileName = fileName
m_handle = hndl
Call ShowProperties()
End Sub
Public Structure SHELLEXECUTEINFO
Public cbSize As Integer
Public fMask As Integer
Public hwnd As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpVerb As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpFile As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpParameters As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String
Dim nShow As Integer
Dim hInstApp As IntPtr
Dim lpIDList As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpClass As String
Public hkeyClass As IntPtr
Public dwHotKey As Integer
Public hIcon As IntPtr
Public hProcess As IntPtr
End Structure
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
End Function
Private Sub ShowProperties()
Dim sei As New SHELLEXECUTEINFO
sei.cbSize = Marshal.SizeOf(sei)
sei.lpVerb = "properties"
sei.lpFile = m_fileName
sei.nShow = SW_SHOW
sei.fMask = SEE_MASK_INVOKEIDLIST
sei.hwnd = m_handle
Try
ShellExecuteEx(sei)
Catch ex As Exception
MsgBox(ex.ToString & vbCrLf & ex.StackTrace.ToString)
End Try
End Sub
End Class
I have added my app to the registry at the following location so it appears in the "choose your app" dialog
[HKEY_CLASSES_ROOT\Applications\myapp.exe\shell\open\command]
@="\"C:\\myapp.exe\" \"%1\""
So it works as below which is perfect, as it doesn't need admin rights and gives the user the choice as to whether to see my tool or another tool as the default for PDF files