Option Explicit
Private Const SND_APPLICATION = &H80 ' look for application specific association
Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND_SYNC = &H0 ' play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
Dim i As Long
Dim j As Long
List4.Clear
For i = 0 To List3.ListCount - 1
For j = 0 To List4.ListCount - 1
If List3.List(i) = List4.List(j) Then
List4.ItemData(j) = List4.ItemData(j) + 1
Exit For
End If
Next j
If j = List4.ListCount Then
List4.AddItem List3.List(i)
List4.ItemData(List4.NewIndex) = 1
End If
Next i
For j = 0 To List4.ListCount - 1
List4.List(j) = List4.List(j) & " - " & List4.ItemData(j)
Next j
End Sub
Private Sub Command2_Click()
' On Error Resume Next
Dim j As Long
Dim f() As String
If Check1.Value = 1 Then
For j = 0 To List4.ListCount - 1
f = Split(List4.List(j), " - ")
If f(1) / 10 = Int(f(1) / 10) Then ' play sound only when count is exactly 10, 20, 30, etc..., remove this check if you want to play when count is just greater than 10
If Int(f(1) / 10) >= 1 And Int(f(1) / 10) <= 25 Then
If f(0) = "(IP Engelli)" Then
PlayWarnSound "ipengelli.wav"
ElseIf f(0) = "(Alanlar Boþ)" Then
PlayWarnSound "alanlarbos.wav"
ElseIf f(0) = "(Þifre Basit)" Then
PlayWarnSound "sifrebasit.wav"
ElseIf f(0) = "(K.Adý Ayný)" Then
PlayWarnSound "kullaniciadiayni.wav"
End If
End If
End If
Next
End If
List4.Clear
End Sub
Private Sub PlayWarnSound(strFile As String)
PlaySound App.Path & "\" & strFile, ByVal 0&, SND_FILENAME Or SND_ASYNC
MsgBox "You exceeded the limit. Alarm plays."
End Sub
Private Sub Command3_Click()
List3.AddItem "(IP Engelli)"
List3.AddItem "(IP Engelli)"
End Sub
Private Sub Command4_Click()
List3.AddItem "(Alanlar Boþ)"
List3.AddItem "(Alanlar Boþ)"
End Sub
Private Sub Command5_Click()
List3.AddItem "(Þifre Basit)"
List3.AddItem "(Þifre Basit)"
End Sub
Private Sub Command6_Click()
List3.AddItem "(K.Adý Ayný)"
List3.AddItem "(K.Adý Ayný)"
End Sub