关闭

自编的VB6.0调用WinAPI的模块(整合了许多函数和过程)

标签: winapivbstringfunctionintegeruser
3445人阅读 评论(4) 收藏 举报
分类:
自编的VB6.0调用WinAPI的模块(整合了许多函数和过程)
通过我的多次实践,在编写了许多软件的基础上,我自编和整合了许多较实用的函数。
注意,以下代码前半部分为WinAPI函数的声明,后半部分为自编函数和过程。
Option Explicit On
'-----------------------------------------------------------------------------------
'       FileName: modCommon.bas
'       Function: 通用的变量、常量声明,自编函数、过程以及API函数声明
'-----------------------------------------------------------------------------------
 
 
'-----------------------     常量声明    -----------------------
 
Public Const User_Pi = 3.1415926            'PI
Public Const User_Golden = 0.618            '黄金分割比例
 
 
 
'-----------------------     WindowAPI 函数声明    -----------------------
 
'设置一个窗口的位置和状态
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'{
'hwnd   欲定位的窗口
'hWndInsertAfter    窗口句柄。在窗口列表中,窗口hwnd会置于这个窗口句柄的后面
Public Const HWND_BOTTOM = 1             '将窗口置于窗口列表底部
Public Const HWND_TOP = 0                '将窗口置于Z序列的顶部;Z序列代表在分级结构中,窗口针对一个给定级别的窗口显示的顺序
Public Const HWND_TOPMOST = -1           '将窗口置于列表顶部,并位于任何最顶部窗口的前面
Public Const HWND_NOTOPMOST = -2         '将窗口置于列表顶部,并位于任何最顶部窗口的后面
'x,y       窗口新的x,y坐标
'cx,cy     指定新的窗口宽度和高度
'wFlags    包含了旗标的一个整数,是下列之一,返回值Long,非零表示成功,零表示失败
Public Const SWP_DRAWFRAME = &H20                   '围绕窗口画一个框
Public Const SWP_HIDEWINDOW = &H80                  '隐藏窗口
Public Const SWP_NOACTIVATE = &H10                  '不激活窗口
Public Const SWP_NOMOVE = &H2                       '保持当前位置(x和y设定将被忽略)
Public Const SWP_NOREDRAW = &H8                     '窗口不自动重画
Public Const SWP_NOSIZE = &H1                       '保持当前大小(cx和cy会被忽略)
Public Const SWP_NOZORDER = &H4                     '保持窗口在列表的当前位置(hWndInsertAfter将被忽略)
Public Const SWP_SHOWWINDOW = &H40                  '显示窗口
Public Const SWP_FRAMECHANGED = &H20                '强迫一条WM_NCCALCSIZE消息进入窗口,即使窗口的大小没有改变
'}
 
 
 
'从指定窗口的结构中取得信息
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
'{
'hwnd           欲为其获取信息的窗口的句柄
'nIndex         欲取回的信息,可以是下述任何一个常数:
Public Const GWL_EXSTYLE = (-20)        '扩展窗口样式
Public Const GWL_STYLE = (-16)          '窗口样式
Public Const GWL_WNDPROC = (-4)         '该窗口的窗口函数的地址
Public Const GWL_HINSTANCE = (-6)       '拥有窗口的实例的句柄
Public Const GWL_HWNDPARENT = (-8)      '该窗口之父的句柄?不要用SetWindowWord来改变这个值
Public Const GWL_ID = (-12)             '对话框中一个子窗口的标识符
Public Const GWL_USERDATA = (-21)       '含义由应用程序规定
Public Const DWL_DLGPROC = 4            '这个窗口的对话框函数地址
Public Const DWL_MSGRESULT = 0          '在对话框函数中处理的一条消息返回的值
Public Const DWL_USER = 8               '含义由应用程序规定
Public Const WS_MINIMIZEBOX = &H20000   '最小化按钮
Public Const WS_MAXIMIZEBOX = &H10000   '最大化按钮
'}
 
 
 
'在窗口结构中为指定的窗口设置信息
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
'{
'返回值Long,指定数据的前一个值
'hwnd       欲为其取得信息的窗口的句柄
'nIndex     请参考GetWindowLong函数的nIndex参数的说明
'dwNewLong 由nIndex指定的窗口信息的新值
'}
 
 
'设置窗体的层次属性
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'{
'hwnd       窗口手柄。当使用CreateWindowEx函数创建窗口时,窗口由WS_EX_LAYERED指定的值创建;
'           或者窗口已经创建后,由SetWindowLong根据WS_EX_LAYERED指定的值改变。
Public Const WS_EX_LAYERED = &H80000
'crKey      指定颜色值。指向一个COLOR值,该值指定一个透明颜色值,当创建窗口时,窗口将使用该值。
'bAlpha     混合函数值该值。用于描述窗口的不透明度。当bAlpha 值为时,窗口完全透明,
'           当bAlpha值为时,窗口完全不透明。
'dwFlags    动作。这个参数可以取一个或多个值。用它我们可以创建一个不规则的窗体。
Public Const LWA_ALPHA = &H2
Public Const LWA_COLORKEY = &H1
'}
 
 
 
'系统栏图标显示
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, ByVal lpData As NOTIFYICONDATA) As Long
'{
'dwMessage
Public Const NIM_ADD = &H0                          '添加图标到系统栏提示区
Public Const NIM_DELETE = &H2                       '删除托盘中的图标
Public Const NIM_MODIFY = &H1                         '修改系统状态栏中的图标
'lpData
Public Const MAX_TOOLTIP As Integer = 64
    Public Type NOTIFYICONDATA
        cbSize           As Long                        '改变结构所占地字节数
        hwnd             As Long                        '接受托盘图标信息的窗体
        uID              As Long                        '为图标设置的ID
        uFlags           As Long                        '设置下面三项是否有效
        uCallbackMessage As Long                        '消息的编号
        hIcon            As Long                        '托盘图标的句柄
        szTip            As String * MAX_TOOLTIP        '鼠标指到托盘图标时显示的提示字符串
    End Type
Public nfIconData As NOTIFYICONDATA                 '定义一个变量nfIconData来记录设置托盘图标的数据
Public Const NIF_ICON = &H2                         '图标
Public Const NIF_MESSAGE = &H1                      '信息
Public Const NIF_TIP = &H4                          '提示
'鼠标事件
Public Const WM_MOUSEMOVE = &H200               '在图标上移动鼠标
Public Const WM_LBUTTONDOWN = &H201             '鼠标左键按下
Public Const WM_LBUTTONUP = &H202               '鼠标左键释放
Public Const WM_LBUTTONDBLCLK = &H203           '双击鼠标左键
Public Const WM_RBUTTONDOWN = &H204             '鼠标右键按下
Public Const WM_RBUTTONUP = &H205               '鼠标右键释放
Public Const WM_RBUTTONDBLCLK = &H206           '双击鼠标右键
Public Const WM_SETHOTKEY = &H32                '响应您定义的热键
'}
 
 
'获取*.Ini文件信息
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
'{
'参数
'lpApplicationName    欲在其中查找条目的小节名称。这个字串不区分大小写。如设为vbNullString,就在lpReturnedString缓冲区内装载这个ini文件所有小节的列表
'lpKeyName            欲获取的项名或条目名。这个字串不区分大小写。如设为vbNullString,就在lpReturnedString缓冲区内装载指定小节所有项的列表
'lpDefault            指定的条目没有找到时返回的默认值。可设为空("")
'lpReturnedString     指定一个字串缓冲区,长度至少为nSize
'nSize                指定装载到lpReturnedString缓冲区的最大字符数量
'lpFileName           初始化文件的名字。如没有指定一个完整路径名,windows就在Windows目录中查找文件
'}
 
 
'写入信息到*.Ini文件
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
'{
'参数
'lpApplicationName    要在其中写入新字串的小节名称。这个字串不区分大小写
'lpKeyName            要设置的项名或条目名。这个字串不区分大小写。用vbNullString可删除这个小节的所有设置项
'lpString             指定为这个项写入的字串值。用vbNullString表示删除这个项现有的字串
'lpFileName           初始化文件的名字。如果没有指定完整路径名,则windows会在windows目录查找文件。如果文件没有找到,则函数会创建它
'}
 
 
'判断系统中存在哪些逻辑驱动器字母
Public Declare Function GetLogicalDrives Lib "kernel32" () As Long
'{
'返回值
'Long,这个结构中的二进制位标志着存在哪些驱动器。其中,位设为表示驱动器A:存在于系统中
'}
 
 
'判断一个磁盘驱动器的类型
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
'{
'nDrive             包含了驱动器根目录路径的一个字串
'返回值
'如驱动器不能识别,则返回零。如指定的目录不存在,则返回.
'如执行成功,则用下述任何一个常数指定驱动器类型:
Public Const DRIVE_CDROM = 5        'CD-ROM驱动器
Public Const DRIVE_FIXED = 3        '固定驱动器
Public Const DRIVE_RAMDISK = 6      '内存驱动器
Public Const DRIVE_REMOTE = 4       '网络驱动器
Public Const DRIVE_REMOVABLE = 2    '可移动驱动器
'}
 
 
 
'获取与一个磁盘卷有关的信息
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, ByVal lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long, ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
'{
'参数表
'lpRootPathName              欲获取信息的那个卷的根路径
'lpVolumeNameBuffer         用于装载卷名(卷标)的一个字串
'nVolumeNameSize            lpVolumeNameBuffer字串的长度
'lpVolumeSerialNumber       用于装载磁盘卷序列号的变量
'lpMaximumComponentLength   指定一个变量,用于装载文件名每一部分的长度。例如,在“c:/component1/component2.ext”的情况下,它就代表component1或component2名称的长度
'lpFileSystemFlags          用于装载一个或多个二进制位标志的变量。对这些标志位的解释如下:
'
'FS_CASE_IS_PRESERVED       文件名的大小写记录于文件系统
'FS_CASE_SENSITIVE          文件名要区分大小写
'FS_UNICODE_STORED_ON_DISK 文件名保存为Unicode格式
'FS_PERSISTANT_ACLS         文件系统支持文件的访问控制列表(ACL)安全机制
'FS_FILE_COMPRESSION        文件系统支持逐文件的进行文件压缩
'FS_VOL_IS_COMPRESSED       整个磁盘卷都是压缩的
'
'lpFileSystemNameBuffer     指定一个缓冲区,用于装载文件系统的名称(如FAT,NTFS以及其他)
'nFileSystemNameSize        lpFileSystemNameBuffer字串的长度
'}
 
 
 
'寻找窗口列表中第一个符合指定条件的顶级窗口
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'{
'返回值为找到窗口的句柄。如未找到相符窗口,则返回零。
'参数表
'lpClassName         指向包含了窗口类名的空中止(C语言)字串的指针;或设为零,表示接收任何类
'lpWindowName        指向包含了窗口文本(或标签)的空中止(C语言)字串的指针;或设为零,表示接收任何窗口标题
'}
 
 
 
'将指针限制到指定区域
Public Declare Function ClipCursor& Lib "user32" (ByVal lpRect As RECT)
'{
'参数表
'lpRect RECT        指定一个矩形,用像素屏幕坐标系统表示,鼠标指针必须在这个区域内运动。
    Public Type RECT
        left As Long
        top As Long
        right As Long
        bottom As Long
    End Type
'}
 
 
'获得整个窗口的范围矩形,窗口的边框、标题栏、滚动条及菜单等都在这个矩形内
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, ByVal lpRect As RECT) As Long
'{
'参数表
'hwnd            想获得范围矩形的那个窗口的句柄
'lpRect RECT     屏幕坐标中随同窗口装载的矩形
'}
 
 
 
'取得一个矩形,用于描述目前为鼠标指针规定的剪切区域;该区域是由SetClipCursor函数定义的
Public Declare Function GetClipCursor Lib "user32" (ByVal lprc As RECT) As Long
'{
'参数表
'lprc RECT       在屏幕坐标系统中随同当前剪切矩形载入的一个矩形。
'                倘若没有活动的剪切,这个矩形会反映出整个显示屏幕的大小
'}
 
 
 
'设置指针的位置
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
'{
'参数表
'x,y        鼠标指针在屏幕像素坐标系统中的X,Y位置
'}
 
 
 
'获得代表整个屏幕的一个窗口(桌面窗口)句柄
Public Declare Function GetDesktopWindow Lib "user32" () As Long
'{
'返回值Long,桌面窗口的句柄
'}
 
 
'控制鼠标的显示
Public Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
'{
'参数
'bShow       TRUE(非零)显示指针,FALSE隐藏
'}
 
 
'设置某一主键的健值
Public 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
'{
'参数
'hKey           一个已打开项的句柄,或指定一个标准项名
'lpSubKey       欲对它的值进行设置的一个子项的名字。如指定vbNullString,表示设置hKey的默认值
'               如指定的子项不存在,则会创建它
'dwType         必须是REG_SZ
'lpData         新值
'cbData         指定lpData的长度,不包括空中止字符
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const REG_SZ = 1
'}
 
 
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As Any, ByVal cbData As Long) As Long
'{
'参数
'hKey Long,一个已打开项的句柄,或指定一个标准项名
'lpValueName String,要设置值的名字
'Reserved Long,未用,设为零
'dwType Long,要设置的数量类型
'lpData Any,包含数据的缓冲区中的第一个字节
'cbData Long,lpData缓冲区的长度
'}
 
 
'创建一个主键
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal phkResult As Long) As Long
'{
'参数
'hKey               要打开项的句柄,或者一个标准项名
'lpSubKey           欲创建的新子项。可同时创建多个项,只需用反斜杠将它们分隔开即可。例如level1/level2/newkey
'phkResult          指定一个变量,用于装载新子项的句柄
'}
 
 
'关闭对注册表主键的操作
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
'{
'参数
'hKey                   要关闭的项
'}
 
 
'删除指定项下方的一个值
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
'{
'参数
'hKey Long,一个已打开项的句柄,或标准项名之一
'lpValueName String,要删除的值名。可设为vbNullString或一个空串,表示删除那个项的默认值
'}
 
 
'打开一个现有的注册表项
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal phkResult As Long) As Long
'{
'参数
'hKey Long,一个已打开项的句柄,或指定一个标准项名
'lpSubKey String,要打开的项名
'phkResult Long,指定一个变量,用于装载(保存)打开注册表项的一个句柄
'}
 
 
 
'-----------------------     自定义函数    -----------------------
 
'获取*.Ini文件信息
Function GetFromIni(ByVal sSection As String, ByVal sKey As String, ByVal sDefault As String, ByVal sFileName As String) As String
    Dim rs As String
    rs = String(255, " ")
    GetPrivateProfileString(sSection, sKey, sDefault, rs, Len(rs) - 1, sFileName)
    rs = left(rs, InStr(rs, Chr(0)) - 1)
    GetFromIni = rs
End Function
 
 
'写入信息到*.Ini文件
Function WriteToIni(ByVal sSection As String, ByVal sKey As String, ByVal sValue As String, ByVal sFileName As String)
    WritePrivateProfileString(sSection, sKey, sValue, sFileName)
End Function
 
 
'加密字符串
Function Encrypt(ByVal PlainStr As String, ByVal Key As String) As String
    Dim n As Integer, every As Integer, word As Integer, pwd As String
    For n = 1 To Len(PlainStr)
        every = Asc(Mid(PlainStr, n, 1)) + n
        word = every + Key
        pwd = pwd & word
    Next n
    Encrypt = pwd
End Function
 
 
'解密字符串
Function Decrypt(ByVal PlainStr As String, ByVal Key As String) As String
    Dim n As Integer, every As Integer, word As Integer, pwd As String
    For n = 1 To Len(PlainStr)
        every = Asc(Mid(PlainStr, n, 1))
        word = (every + Key) - n
        pwd = pwd & word
    Next n
    Decrypt = pwd
End Function
 
 
'根据字符串本身,形成密钥
Function SecretKey(ByVal souKey As String) As Integer
    Dim n As Integer, every As Integer, word As Integer
 
    n = 1
    word = Asc(Mid(souKey, n, 1))
    For n = 2 To Len(souKey)
        every = Asc(Mid(souKey, n, 1))
        word = word Xor every
    Next n
    SecretKey = word
End Function
 
 
'将逻辑驱动器的二进制数据转换为盘符数据
Function BinToWord(ByVal souBin As String) As String
    Dim num As Integer, n As Integer, rs As String, every As String
    n = 1
    For num = Len(souBin) To 1 Step -1
        every = Mid(souBin, num, 1)
        If every = 1 Then
            rs = rs & Chr(65 - 1 + n)
        End If
        n = n + 1
    Next num
    BinToWord = rs
End Function
 
 
'将十进制转换为二进制
Function DecToBin(ByVal souDec As Long) As String
    Dim numMod As Integer, numLeft As Long, rs As String
    Do
        numMod = souDec Mod 2
        numLeft = souDec / 2
        rs = numMod & rs
        souDec = numLeft
    Loop Until (souDec = 0)
    DecToBin = rs
End Function
 
 
'获得逻辑驱动器的序列号
Function GetDriverSn(ByVal strDriver As String) As String
    Dim strLabel As String
    Dim lSerialnum As Long
    Dim strType As String
    GetVolumeInformation(strDriver, strLabel, Len(strLabel), lSerialnum, 0, 0, strType, Len(strType))
    GetDriverSn = Hex(lSerialnum)
End Function
 
 
'判断指定类或窗体是否存在
Function IsProcessOrForm(ByVal sClass As String, ByVal sCaption As String) As Boolean
    Dim winHwnd As Long
    winHwnd = FindWindow(sClass, sCaption)
    If winHwnd = 0 Then
        IsProcessOrForm = False
    Else
        IsProcessOrForm = True
    End If
 
 
End Function
 
 
'查找指定窗体
Function ScanWindow(ByVal sCaption As String) As Boolean
    Dim winHwnd As Long
    Dim RetVal As Long
    winHwnd = FindWindow(vbNullString, sCaption)
    If winHwnd = 0 Then
        ScanWindow = False
    Else
        ScanWindow = True
    End If
End Function
 
 
 
'-----------------------     自定义过程    -----------------------
 
'将窗体置于屏幕中央
Public Sub FormCenter(ByVal souForm As Form)
    souForm.left = (Screen.Width - souForm.Width) / 2
    souForm.top = (Screen.Height - souForm.Height) * (1 - User_Golden)
End Sub
 
 
'将窗体最大化整个屏幕
Public Sub FormMax(ByVal souForm As Form)
    souForm.top = 0
    souForm.left = 0
    souForm.Height = Screen.Height
    souForm.Width = Screen.Width
End Sub
 
 
'将窗体置于顶端
Public Sub FormOnTop(ByVal souForm As Form)
    SetWindowPos(souForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
 
 
'窗体的半透明化处理
Public Sub Translucence(ByVal souForm As Form, ByVal Degree As Integer)
    Dim rtn As Long
    rtn = GetWindowLong(souForm.hwnd, GWL_EXSTYLE)
    rtn = rtn Or WS_EX_LAYERED
    SetWindowLong(souForm.hwnd, GWL_EXSTYLE, rtn)
    SetLayeredWindowAttributes(souForm.hwnd, 0, Degree, LWA_ALPHA)
End Sub
 
 
'在系统栏里添加图标
Public Sub TrayAddIcon(ByVal souForm As Form, ByVal ToolText As String)
    With nfIconData
        .hwnd = souForm.hwnd
        .uID = souForm.Icon
        .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
        .uCallbackMessage = WM_MOUSEMOVE
        .hIcon = souForm.Icon.Handle
        .szTip = ToolText & vbNullChar
        .cbSize = Len(nfIconData)
    End With
    Call Shell_NotifyIcon(NIM_ADD, nfIconData)
End Sub
 
 
'把系统栏中的图标删除
Public Sub TrayDelIcon()
    Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
End Sub
 
 
 
'将鼠标限制在ctl区域内
Public Sub ClipToControl(ByVal ctl As Object)
    Dim hwnd As Long
    Dim t As RECT
    hwnd = ctl.hwnd
    GetWindowRect(hwnd, t)
    SetCursorPos(t.left + (t.right - t.left) / 2, t.top + (t.bottom - t.top) / 2)
    ClipCursor(t)
End Sub
 
 
'解除对鼠标移动的限制
Public Sub ClipToDesktop()
    Dim t As RECT
    GetWindowRect(GetDesktopWindow(), t)
    ClipCursor(t)
End Sub
 
 
'隐藏鼠标
Public Sub HideMouse()
    ShowCursor(0)
End Sub
 
 
'显示鼠标
Public Sub ShowMouse()
    ShowCursor(1)
End Sub
 
 
'将程序加入自动运行
Public Sub RegAddAutorun(ByVal regName As String, ByVal regData As String)
    Dim regHand As Long
    Dim appFileName As String
    appFileName = App.Path & "/lockmanagement.exe"
    RegOpenKey(HKEY_LOCAL_MACHINE, "software/microsoft/windows/currentVersion/run", regHand)
    RegSetValueEx regHand, regName, 0, REG_SZ, ByVal regData, Len(regData)
    RegCloseKey(regHand)
End Sub
 
 
'解除程序的自动运行
Public Sub RegRemoveAutorun(ByVal regName As String)
    Dim regHand As Long
    RegOpenKey(HKEY_LOCAL_MACHINE, "software/microsoft/windows/currentVersion/run", regHand)
    RegDeleteValue(regHand, regName)
    RegCloseKey(regHand)
End Sub
 
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:69958次
    • 积分:917
    • 等级:
    • 排名:千里之外
    • 原创:18篇
    • 转载:3篇
    • 译文:1篇
    • 评论:17条
    最新评论