دوستان چه جوری میتون دستور بدم وقتی فلان کلید رو میزنی این موزیک پخش بشه
و چه جوری میتونم تابعی تعریف کنم که بتونه از 1 تا 50 یه عدد رندوم بهم بده (تابع rnd)
ممنون از همه دوستان:10:
Printable View
دوستان چه جوری میتون دستور بدم وقتی فلان کلید رو میزنی این موزیک پخش بشه
و چه جوری میتونم تابعی تعریف کنم که بتونه از 1 تا 50 یه عدد رندوم بهم بده (تابع rnd)
ممنون از همه دوستان:10:
با
The sndPlaySound function plays a waveform sound specified either by a filename or by an entry in the registry or the WIN.INI file. This function offers a subset of the functionality of the PlaySound function; sndPlaySound is being maintained for backward compatibility.
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
این هم یک نمونه
کد:'This project needs :
'- a common dialog box, named CDbox
' (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
' and select Microsoft Common Dialog control)
'-a button
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Private Sub Command1_Click()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Get the number of installed waveout devices
ret& = waveOutGetNumDevs
If ret& > 0 Then
'Set the CommonDialogBox' filter
CDBox.Filter = "Wave-files (*.wav)|*.wav|All Files (*.*)|*.*"
'Set the CommonDialogBox' title
CDBox.DialogTitle = "Choose your wave-file ..."
'Show the 'Open File'-dialog
CDBox.ShowOpen
'Play the selected sound
sndPlaySound CDBox.filename, SND_ASYNC Or SND_NODEFAULT
Else
MsgBox "No soundcard detected !"
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "Load WAV"
End Sub
دوست من ممنوننقل قول:
ولی من نه رشتم کامپیوتره نه ریاضی خوندم
علاقه مند شدم به این برنامه تازه دارم یه برنامه مینویسم
به قوله خودمونی فرق کوکو و جلبکو نمیدونم میشه یکمی زیره دیپلم توضیح بدی اونایی رو که بالا گفتی ؟:31:
بازم ممنون
در مورد توابع api جستجو کنید