Let your program be listed in the right-mouse-click for a particular file type. You program can then be run with a simple click
Inputs
The filetype you want to add to. Your program's path & filename.
Assumes
This program only adds the regisrty key. It can be removed by running regedit then manually deleting the key. The location can be seen in the code.
Returns
Adds a registry key
Side Effects
Playing with the registry can be dangerous. I have run this on my computer and it works fine. I take no responsibility for any mishaps that occur.
API DeclarationsConst REG_SZ = 1
Const HKEY_LOCAL_MACHINE = &H80000002
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long