This is a wake up alarm application. This application is developed using VB.NET.
You can download both the Setup and the sample source code for this application. For the Setup, you first need to
download and install .NET Framework 1.1. You can download it from here:
installing the application, you can run the setup. Using this application you
can set alarm whenever needed. This application uses Timer control, NotifyIcon with Context Menu, and
playing a sound file.
I was searching for a morning wake-up alarm software in the internet. And I
thought I could created my own using VB.NET.
Using the code
This code has a SimpleSound.vb class file for playing and stopping a sound
file. Most users do not have a clear idea about Notify Icon. This code
in detail the use of NotifyIcon.
// This is to Play the Sound
Public Shared Sub Play(ByVal Name As String, ByVal [Loop] As Boolean)
If Not m_hgData.Equals(IntPtr.Zero) Then
Dim strNameSpace As String = _
Dim st As Stream = _
strNameSpace + "." + Name)
If st Is Nothing Then Exit Sub
Dim intLength As Integer = CInt(st.Length)
Dim abyt(intLength - 1) As Byte
st.Read(abyt, 0, intLength)
m_hgData = Marshal.AllocHGlobal(intLength)
Marshal.Copy(abyt, 0, m_hgData, intLength)
Dim Flags As Int32 = SND_MEMORY Or SND_ASYNC
If [Loop] Then
Flags = Flags Or SND_LOOP
Points of Interest
I learnt about playing sounds and using NotifyIcon in the System tray.