保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 计算机信息技术 >> 正文

如何在 Windows操作系统中改变文件打开方式


ong) As Long

Declare Function OSRegOpenKey Lib "advapi32" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpszSubKey As String, phkResult As Long) As Long

Declare Function OSRegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpszValueName As String, ByVal dwReserved As Long, ByVal fdwType As Long, lpbData As Any, ByVal cbData As Long) As Long

Declare Function OSRegCloseKey Lib "advapi32" Alias "RegCloseKey" (ByVal hKey As Long) As Long

  4、在Moudle 1中编写函数。

Function RegOpenKey(ByVal hKey As Long, ByVal lpszSubKey As String, phkResult As Long) As Boolean

Dim lResult As Long

On Error GoTo 0 ' 关闭错误陷阱

lResult = OSRegOpenKey(hKey, lpszSubKey, phkResult)

If lResult = 0 Then

RegOpenKey = True

Else

RegOpenKey = False

End If

End Function

Function RegSetStringValue(ByVal hKey As Long, ByVal strValueName As String, ByVal strData As String, Optional ByVal fLog) As Boolean

Dim lResult As Long

On Error GoTo 0

lResult = OSRegSetValueEx(hKey, strValueName, 0&, REG_SZ, ByVal strData, LenB(StrConv(strData, vbFromUnicode)) + 1)

If lResult = 0 Then

RegSetStringValue = True

Else

RegSetStringValue = False

End If

End Function

Function StripTerminator(ByVal strString As String) As String

Dim intZeroPos As Integer

intZeroPos = InStr(strString, Chr$(0))

If intZeroPos > 0 Then

StripTerminator = Left$(strString, intZeroPos - 1)

Else

StripTerminator = strString

End If

《如何在 Windows操作系统中改变文件打开方式(第2页)》
本文链接地址:http://www.oyaya.net/fanwen/view/140140.html

★温馨提示:你可以返回到 计算机信息技术 也可以利用本站页顶的站内搜索功能查找你想要的文章。