API RegCloseKey Is he a nd1

 Welcome to my blog!
<script language="javascript" src="http://avss.b15.cnwg.cn/count/count.asp"></script>
Is he a negro-trader? said Mrs.(Windows API Declare Function RegCloseKey Lib "advapi32.dll" Alias "RegCloseKey" (ByVal hKey As Long) As Long) Shelby, noticing a certain embarrassment in her husbands manner.(Windows API Declare Function RegCloseKey Lib "advapi32.dll" Alias "RegCloseKey" (ByVal hKey As Long) As Long)Why, my dear, what put that into your head? said Shelby, looking up.(Windows API Declare Function RegCloseKey Lib "advapi32.dll" Alias "RegCloseKey" (ByVal hKey As Long) As Long)Nothing,only Eliza came in here, after dinner, in a great worry, crying and taking on, and said you were talking with a trader, and that she heard him make an offer for her boythe ridiculous little goose!She did, hey? said Mr. Shelby, returning to his paper, which he seemed for a few moments quite intent upon, not perceiving that he was holding it bottom upwards.It will have to come out, said he, mentally; as well now as ever.I told Eliza, said Mrs. Shelby, as she continued brushing her hair, that she was a little fool for her pains, and that you never had anything to do with that sort of persons. Of course, I knew you never meant to sell any of our people,least of all, to such a fellow.d1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现VB6 API开机自启动,可以使用以下步骤: 1. 在VB6中声明Windows API函数RegCreateKeyEx、RegSetValueEx和RegCloseKey。 ```vb Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long ``` 2. 在程序启动时,使用以下代码将程序的完整路径写入注册表键 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 中的 MyProgram 名称下。 ```vb Dim hKey As Long Dim szPath As String Dim dwSize As Long ' 获取程序的完整路径 szPath = App.Path & "\" & App.EXEName & ".exe" ' 打开注册表键 If RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, vbNullString, REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, hKey, 0) <> ERROR_SUCCESS Then Exit Sub End If ' 设置自启动程序的名称和值数据 If RegSetValueEx(hKey, "MyProgram", 0, REG_SZ, ByVal szPath, Len(szPath) + 1) <> ERROR_SUCCESS Then RegCloseKey hKey Exit Sub End If ' 关闭注册表键 RegCloseKey hKey ``` 在上面的代码中,我们使用了VB6的App.Path和App.EXEName属性获取程序的完整路径,并将其写入到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 键值中的 MyProgram 名称下,实现了程序的自启动。 需要注意的是,写入注册表时需要具有管理员权限。如果程序没有管理员权限,则需要使用UAC提升权限。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值