zl程序教程

您现在的位置是:首页 >  其他

当前栏目

VB编程:用Shell函数打开记事本-54_彭世瑜_新浪博客

博客编程shell 函数 打开 vb 新浪 54
2023-09-14 09:07:18 时间
VB编程:用Shell函数打开记事本-54


Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Dim strtemp As String * 60

Private Sub Command1_Click()
    Dim L, S
    Dim paths As String

    L = GetSystemDirectory(strtemp, Len(strtemp))
    paths = Left(strtemp, L) & "\NOTEPAD.EXE"
    S = Shell(paths, vbNormalFocus)
End Sub