说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

VB判断是否在VB5环境下运行

HTML文档下载 WORD文档下载 PDF文档下载
VB判断是否在VB5环境下运行
声明:
Private Declare Function GetModuleFileName Lib "kernel32" Alias _ "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As _ String, ByVal nSize As Long) As Long
函数:
' True 表示在 VB5 环境下运行
Function IsRunUnderVB5() As Boolean
Dim S As String, Length
Length = 256
S = String(Length, 0)
Call GetModuleFileName(0, S, Length)
S = Left(S, InStr(S, Chr(0)) - 1)
IsRunUnderVB5 = UCase(Right(S, 7)) = "VB5.EXE"
End Function

备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘