Option Explicit Dim lang As String Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long Private Sub Form_Load() Dim LocaleID As Long LocaleID = GetSystemDefaultLCID Select Case LocaleID Case &H404 MsgBox "当前系统为:中文繁体", , "语言" Case &H804 MsgBox "当前系统为:中文简体", , "语言" lang = "1" Case &H409 MsgBox "当前系统为:英文", , "语言" lang = "2" End Select End Sub
Option Explicit Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long Private Declare Function sndPlaySoundFromMemory Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long Public Const SND_ASYNC = &H1& Public Const SND_MEMORY = &H4& Private Sub Command5_Click() 注释:播放 WAV 文件 Dim bArr() As Byte bArr = LoadResData(102, "WAVE") sndPlaySoundFromMemory bArr(0), SND_ASYNC Or SND_MEMORY