⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getwindowsdirectory.bas

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 BAS
字号:
Attribute VB_Name = "GetWindowsDirectoryModule"
Option Explicit

Public Const MAX_PATH = 260
Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
'返回Windows的安装目录
Sub GetWindowsDirectory_test()
    Dim S As String, Length As Long
    
    S = String(MAX_PATH, 0)
    Length = GetWindowsDirectory(S, MAX_PATH)
    S = Left(S, InStr(S, Chr(0)) - 1)
    
    MsgBox "Windows 路径=" & S, , "GetWindowsDirectory"
End Sub

Sub Main()
    GetWindowsDirectory_test
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -