Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[3.149.213.209] |
|
Сообщ.
#1
,
|
|
|
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 ERROR_SUCCESS = 0& Private Const ERROR_BADDB = 1& Private Const ERROR_BADKEY = 2& Private Const ERROR_CANTOPEN = 3& Private Const ERROR_CANTREAD = 4& Private Const ERROR_CANTWRITE = 5& Private Const ERROR_OUTOFMEMORY = 6& Private Const ERROR_INVALID_PARAMETER = 7& Private Const ERROR_ACCESS_DENIED = 8& Private Const HKEY_CLASSES_ROOT = &H80000000 Private Const MAX_PATH = 260& Private Const REG_SZ = 1 Private Sub Command1_Click() Dim sKeyName As String Dim sKeyValue As String Dim ret& Dim lphKey& 'Создание ключа "MyApp". sKeyName = "MyApp" sKeyValue = "My Application" ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&) 'Создание ключа, связанного с "MyApp". sKeyName = ".РАСШИРЕНИЕ" sKeyValue = "MyApp" ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&) 'Коммандная линия для приложения"MyApp". sKeyName = "MyApp" sKeyValue = "ПРОГА %1" ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&) ret& = RegSetValue&(lphKey&, "shell\open\command", REG_SZ, sKeyValue, MAX_PATH) End Sub |