1,486
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Declare Function LoadString Lib "user32.dll" Alias "LoadStringA" ( _
ByVal hInstance As Long, _
ByVal wID As Long, _
ByVal lpBuffer As String, _
ByVal nBufferMax As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" ( _
ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32.dll" ( _
ByVal hLibModule As Long) As Long
Private Sub Command1_Click()
Dim hIns As Long, lRet As Long, sBuff As String
hIns = LoadLibrary("SHELL32.dll") '加载DLL
If hIns = 0 Then
MsgBox "FALSE"
Exit Sub
End If
sBuff = String(512, Chr(0)) '开缓冲区
lRet = LoadString(hIns, 30390, sBuff, 512) '取字符串资源
Debug.Print Mid(sBuff, 1, lRet), Err.LastDllError '打印出来
Call FreeLibrary(hIns) '释放资源
End Sub
Private Sub Form_Load()
s = "@%SystemRoot%\system32\SHELL32.dll,-8964"
arr = Split(s, ",-")
MsgBox arr(0)
MsgBox arr(1)
End Sub