flieassociation.bas
来自「OCX DLL注册工具 OCX DLL注册工具」· BAS 代码 · 共 27 行
BAS
27 行
Attribute VB_Name = "Module4"
Option Explicit
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey 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
Const HKEY_CLASSES_ROOT = &H80000000
Const REG_DWORD As Long = 4
Const REG_SZ As Long = 1
Public Sub Association()
Dim hKey As Long
hKey = HKEY_CLASSES_ROOT
Dim ret1 As Long
RegSetValue hKey, "Ocx", REG_SZ, "Ocx", 7
RegSetValue hKey, "OcxFile", REG_SZ, "OcxFile", 9
RegSetValue hKey, "OcxFile" & "\shell", REG_SZ, "open", 5
RegSetValue hKey, "OcxFile" & "\shell\open\command", REG_SZ, (App.Path & "\" & App.EXEName & ".exe %1"), LenB(StrConv((App.Path & "\" & App.EXEName & ".exe %1"), vbFromUnicode)) + 1
RegSetValue hKey, "OcxFile" & "\DefaultIcon", REG_SZ, (App.Path & "\" & App.EXEName & ".exe,0"), LenB(StrConv((App.Path & "\" & App.EXEName & ".exe,0"), vbFromUnicode)) + 1
RegCloseKey hKey
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?