How To Register an Extension

Friday, May 16, 2008

How to Register an Extension in VB 6.0 ?


Public Sub RegisterRJVExtension()

On Error Resume Next

Dim reg As Registry

Set reg = New Registry

Call reg.UpdateKey(REGToolRootTypes.HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.rjv", "Application", "RJVOpener.exe")

Call reg.UpdateKey(REGToolRootTypes.HKEY_CLASSES_ROOT, "Applications\RJVOpener.exe\Shell\open\command", "", App.Path & "\RJVOpener.exe %1")

Set reg = Nothing

End Sub


How to register an extension in vb.net?
Public Sub RegExtension() Dim reg As Microsoft.Win32.Registry Dim regkey As Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser regkey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lux", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree) regkey.SetValue("Application", "ShowMessage.exe", Microsoft.Win32.RegistryValueKind.String) Dim regkey1 As Microsoft.Win32.RegistryKey regkey1 = Microsoft.Win32.Registry.ClassesRoot regkey1 = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("Applications\ShowMessage.exe\Shell\open\command", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree) regkey1.SetValue("", Application.StartupPath & "\ShowMessage.exe %1", Microsoft.Win32.RegistryValueKind.String)
End Sub

0 comments

Post a Comment