begin process at 2012 02 10 22:05:00
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Date & Heure

 > ALARME/REVEIL

ALARME/REVEIL


 Information sur la source

Note :
6,67 / 10 - par 6 personnes
6,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Date & Heure Classé sous :alarme, réveil Niveau :Débutant Date de création :27/08/2001 Vu / téléchargé :7 774 / 528

Auteur : Steffiaume

Ecrire un message privé
Site perso
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Ce petit programme est une sorte d'alarme ou de réveil qui se déclenchera à l'heure souhaitée et émettra un son pour que vous ne soyez plus en retard.

Placer 2 TextBox Txthlim et Txthactu, 1 Bouton et 2 Timer.
Copier le code suivant dans le form.
Téléchargez le son d'alarme à cette adresse (il est inclu dans le ZIP) http://perso.wanadoo.fr/steffiaume/telechargement/ alarme.wav .

Source

  • 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_LOOP = &H8
  • Private Sub Command1_Click()
  • If Command1.Caption = "Lancer" Then
  • Txthactu.ForeColor = vbBlack
  • Txthlim.ForeColor = vbBlack
  • Command1.Caption = "Désactiver"
  • On Error GoTo erreur
  • Txthlim.Text = CDate(Txthlim.Text)
  • Timer2.Enabled = True
  • Exit Sub
  • erreur:
  • MsgBox "Erreur dans le format d'heure. Veuillez saisir une heure valide.", vbCritical, "Erreur..."
  • Command1.Caption = "Lancer"
  • Timer2.Enabled = False
  • Else
  • Command1.Caption = "Lancer"
  • Timer2.Enabled = False
  • End If
  • End Sub
  • Private Sub Alert()
  • sndPlaySound App.Path & "\alarme.wav", SND_ASYNC ' SND_LOOP Or
  • Txthactu.ForeColor = vbRed
  • Txthlim.ForeColor = vbRed
  • Form1.WindowState = 0
  • MsgBox "Alerte ! ! !", vbCritical, "Alerte"
  • Command1.Caption = "Lancer"
  • End Sub
  • Private Sub Form_Load()
  • With Form1
  • .Width = 3030
  • .Height = 1950
  • .BorderStyle = 1
  • .Caption = "Alarme"
  • End With
  • With Command1
  • .Width = 1095
  • .Height = 375
  • .Top = 1080
  • .Left = 840
  • .Caption = "Lancer"
  • End With
  • With Timer1
  • .Interval = 1000
  • End With
  • With Timer2
  • .Interval = 1000
  • .Enabled = False
  • End With
  • With Txthactu
  • .Width = 1215
  • .Height = 405
  • .Top = 120
  • .Left = 1440
  • .Text = ""
  • .Font.Size = "14"
  • .Enabled = False
  • End With
  • With Txthlim
  • .Width = 1695
  • .Height = 405
  • .Top = 600
  • .Left = 1200
  • .Text = "HH:MM:SS"
  • .MaxLength = 8
  • .Font.Size = "14"
  • End With
  • End Sub
  • Private Sub Timer2_Timer()
  • If Command1.Caption = "Désactiver" Then
  • Dim Hactu As Date, Hlim As Date
  • Hactu = Time
  • Hlim = Txthlim.Text
  • If Hactu > Txthlim.Text Then Alert
  • End If
  • End Sub
  • Private Sub Timer1_Timer()
  • Txthactu.Text = Time
  • End Sub
  • Private Sub Txthlim_Click()
  • With Txthlim
  • .Width = 1215
  • .Height = 405
  • .Left = 1440
  • .Text = ""
  • End With
  • End Sub
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_LOOP = &H8

Private Sub Command1_Click()
If Command1.Caption = "Lancer" Then
Txthactu.ForeColor = vbBlack
Txthlim.ForeColor = vbBlack
Command1.Caption = "Désactiver"
On Error GoTo erreur
Txthlim.Text = CDate(Txthlim.Text)
Timer2.Enabled = True
Exit Sub
erreur:
MsgBox "Erreur dans le format d'heure. Veuillez saisir une heure valide.", vbCritical, "Erreur..."
Command1.Caption = "Lancer"
Timer2.Enabled = False
Else
Command1.Caption = "Lancer"
Timer2.Enabled = False
End If
End Sub


Private Sub Alert()
sndPlaySound App.Path & "\alarme.wav", SND_ASYNC ' SND_LOOP Or
Txthactu.ForeColor = vbRed
Txthlim.ForeColor = vbRed
Form1.WindowState = 0
MsgBox "Alerte ! ! !", vbCritical, "Alerte"
Command1.Caption = "Lancer"
End Sub


Private Sub Form_Load()
With Form1
    .Width = 3030
    .Height = 1950
    .BorderStyle = 1
    .Caption = "Alarme"
End With
With Command1
    .Width = 1095
    .Height = 375
    .Top = 1080
    .Left = 840
    .Caption = "Lancer"
End With
With Timer1
    .Interval = 1000
End With
With Timer2
    .Interval = 1000
    .Enabled = False
End With
With Txthactu
    .Width = 1215
    .Height = 405
    .Top = 120
    .Left = 1440
    .Text = ""
    .Font.Size = "14"
    .Enabled = False
End With
With Txthlim
    .Width = 1695
    .Height = 405
    .Top = 600
    .Left = 1200
    .Text = "HH:MM:SS"
    .MaxLength = 8
    .Font.Size = "14"
End With


End Sub

Private Sub Timer2_Timer()
If Command1.Caption = "Désactiver" Then
    Dim Hactu As Date, Hlim As Date
    Hactu = Time
    Hlim = Txthlim.Text
    If Hactu > Txthlim.Text Then Alert
End If
End Sub

Private Sub Timer1_Timer()
Txthactu.Text = Time
End Sub


Private Sub Txthlim_Click()
With Txthlim
    .Width = 1215
    .Height = 405
    .Left = 1440
    .Text = ""
End With
End Sub 

 Conclusion

N'oubliez pas de visiter mes sites : http://perso.wanadoo.fr/steffiaume/ et http://troccd.ifrance.com/

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

Source avec Zip Source avec une capture ID3TAG XP GESTIONNAIRE DE TAG POUR FICHIERS MP3
Source avec Zip Source avec une capture COMPTEUR INTERNET

 Sources de la même categorie

Source avec Zip Source avec une capture LES FONCTIONS DATE PAR L'EXEMPLE. par pasquet78
Source avec Zip Source avec une capture CALENDRIER, MODE D'EMPLOI par pasquet78
Source avec Zip Source avec une capture Source .NET (Dotnet) HORLOGE DIODE AVEC 3 ALARMES ET REMISE À L'HEURE par EhJoe
Source avec Zip Source avec une capture POINTEUSE HORAIRES PAR SEMAINE par VBNoob13
Source avec Zip Source avec une capture HORLOGE À AIGUILLES SIMPLEMENT DANS UN USERFORM EXCEL par bigbe

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture Source .NET (Dotnet) HORLOGE DIODE AVEC 3 ALARMES ET REMISE À L'HEURE par EhJoe
ALARMES IMBRIQUÉES. par Softmama
Source avec Zip Source avec une capture Source .NET (Dotnet) ALARME PARAMETRABLE par Blodox
UNE BELLE PETITE ALARME...... par The man whit the long hair
Source avec Zip HORLOGE AVEC ALARME par NeoCortex

Commentaires et avis

Commentaire de chahmi le 28/12/2002 12:21:24

chahmi 9/10 merci

Commentaire de gide_x le 31/07/2007 19:29:58

Hello !

Très sympa, mais tu auras un problème si tu veux faire sonner ton alarme le lendemain matin...

Je m'explique:

si il est, admetton 19:00:00 et que tu veux une alarme à 5h00 du mat, ton alarme va sonner immédiatement, car la condition 'Hactu > Txthlim.Text Then Alert' est remplie...

pour contourner ce petit problème (c'est un peu bricole, c'est clair ... et on a un problème si on fixe les seconde à plus de 57 ... mais bon...)

On error resume next
If Hactu > Txthlim.Text And Hactu < Mid$(Txthlim.Text, 1, 6) & Val(Mid$(Txthlim.Text, 7, 2)) + 2 Then Alert

mais quand-même ... 8/10

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

ACPI - Alarme de réveil - Programmer l'heure [ par DanielV37 ] Bonjour, <p class="MsoNormal" style= Repeté larme [ par Jimbo38 ] Bonjour tout le monde, Voila je suis en stage pour apprendre vb, donc j'ai crée une alarme toute simple et je souhaiterai repeté l'alarme tout les (va Alarme sonore dans le VB6.0 [ par erriyadimounir ] Bonjour,salut à tous,c'est mounir du maroc,je veux quand le composant "shape" change son couleur (à travers un timer) un bip sonore indique le changem Programmation PIC [ par mahdouchmehdi ] Bonsoir tout le monde.je suis un étudiant en 5 ème année, je cherche à trouver une solution pour ce problème.j'utilise un PIC 16F877 pour la gestion d alarme sonore classeur excel partagé [ par 11dnsn ] hello,je recherche une méthode pour faire déclencher une alarme sonore ex: un wave du dossier média de windows  ceci pour indiquer à un utilisateur di extraction chaine caractère [ par rescator68 ] bonjour, Je crain de poser une question pour débutant....Mais comme je ne trouve pas de solution.... je me lanceje reçois par un controle winsock par VBA création d'alarme [ par LR64 ] Très très urgent!! problème de dernière minute.Bonsoir, j'ai créée un programme de gestion des stocks. j'ai mis en place une mise en forme conditionne alarme pour habitation avec LCD [ par binhex ] salut a tous je cherche un prog. pour une alarme habitation a base de PIC qui soit aussi gérée par un afficheur LCD 2x16. merci d'avance a ceux qui Deadline sous excel - alarme sous forme de fenetre Windows [ par VoluBill ] Bonjour, Je ne suis pas tres sur d etre dans la bonne rubrique, desole par avance (desole aussi pour l absence d accents dans ce post, clavier oblige


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 7,067 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales