Ad esempio ...
codice: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 RegSetValue Lib "advapi32.dll" Alias _ "RegSetValueA" (ByVal hKey As Long, _ ByVal lpSubKey As String, _ ByVal dwType As Long, _ ByVal lpData As String, _ ByVal cbData As Long) As Long Private Const HKEY_CLASSES_ROOT = &H80000000 Private Const MAX_PATH = 260& Private Const REG_SZ = 1 Private Sub Form_Click() Dim sKeyName As String Dim sKeyValue As String Dim ret As Long Dim lphKey As Long sKeyName = "LMondiApp" sKeyValue = "Applicazione LMondi" ret = RegCreateKey(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret = RegSetValue(lphKey&, "", REG_SZ, sKeyValue, 0&) sKeyName = ".LMO" sKeyValue = "LMondiApp" ret = RegCreateKey(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret = RegSetValue(lphKey&, "", REG_SZ, sKeyValue, 0&) sKeyName = "LMondiApp" sKeyValue = "c:\progetto1.exe %1" ret = RegCreateKey(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret = RegSetValue(lphKey&, "shell\open\command", REG_SZ, sKeyValue, MAX_PATH) End Sub

Rispondi quotando