asdf246
asked on
API and LoadResData function?
hi
we paste my code,below,please elaborate
when clicking command button ,sound wont play.why?
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Private x() As Byte
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
SendKeys "%+"
SendKeys "%+"
Text1.Visible = True
Text1.SetFocus
x = LoadResData(101, "AA")
ing = sndPlaySound(x(0), SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY)
Text1.Text = ing
End Sub
Private Sub Form_Click()
End
End Sub
Private Sub Timer1_Timer()
a = Int(Rnd * 255)
b = Int(Rnd * 255)
c = Int(Rnd * 255)
Label1.ForeColor = RGB(a, b, c)
Form1.BackColor = RGB(c, a, b)
Label1.FontSize = Int(Rnd * 60) + 10
End Sub
thanks
we paste my code,below,please elaborate
when clicking command button ,sound wont play.why?
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Private x() As Byte
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
SendKeys "%+"
SendKeys "%+"
Text1.Visible = True
Text1.SetFocus
x = LoadResData(101, "AA")
ing = sndPlaySound(x(0), SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY)
Text1.Text = ing
End Sub
Private Sub Form_Click()
End
End Sub
Private Sub Timer1_Timer()
a = Int(Rnd * 255)
b = Int(Rnd * 255)
c = Int(Rnd * 255)
Label1.ForeColor = RGB(a, b, c)
Form1.BackColor = RGB(c, a, b)
Label1.FontSize = Int(Rnd * 60) + 10
End Sub
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=44097&lngWId=1