Changed cursor of buttons on email alert. Added sound notification to email alert.

This commit is contained in:
gamosoft_cp 2013-04-09 23:09:29 +00:00
parent d7f20e1a3d
commit bdee9b1937
4 changed files with 53 additions and 0 deletions

View File

@ -52,6 +52,7 @@
//
this.btnDelete.BackgroundImage = global::Outlook2013TodoAddIn.Properties.Resources.Delete;
this.btnDelete.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnDelete.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDelete.Location = new System.Drawing.Point(50, 66);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(32, 32);
@ -63,6 +64,7 @@
//
this.btnFlag.BackgroundImage = global::Outlook2013TodoAddIn.Properties.Resources.Flag;
this.btnFlag.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnFlag.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnFlag.Location = new System.Drawing.Point(12, 66);
this.btnFlag.Name = "btnFlag";
this.btnFlag.Size = new System.Drawing.Size(32, 32);
@ -74,6 +76,7 @@
//
this.btnEnvelope.BackgroundImage = global::Outlook2013TodoAddIn.Properties.Resources.Envelope;
this.btnEnvelope.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnEnvelope.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnEnvelope.Location = new System.Drawing.Point(19, 5);
this.btnEnvelope.Name = "btnEnvelope";
this.btnEnvelope.Size = new System.Drawing.Size(60, 60);

View File

@ -207,6 +207,7 @@
<Compile Include="AppointmentsControl.Designer.cs">
<DependentUpon>AppointmentsControl.cs</DependentUpon>
</Compile>
<Compile Include="SoundHelper.cs" />
<Compile Include="TodoRibbonAddIn.cs">
<SubType>Component</SubType>
</Compile>

View File

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace Outlook2013TodoAddIn
{
/// <summary>
/// Native calls to play sounds
/// </summary>
public class SoundHelper
{
#region "Variables"
/// <summary>
/// SND_NODEFAULT -> 0x0002
/// </summary>
public const uint SND_NODEFAULT = 0x0002;
/// <summary>
/// Mail notification sound
/// </summary>
public const string MailBeep = "MailBeep";
#endregion "Variables"
#region "Methods"
/// <summary>
/// Call to play a system sound
/// </summary>
/// <param name="pszSound">Eg.: MailBeep</param>
/// <param name="fuSound"></param>
/// <returns></returns>
[System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "sndPlaySoundW")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
public static extern bool sndPlaySoundW([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string pszSound, uint fuSound);
#endregion "Methods"
/// Return Type: BOOL->int
///pszSound: LPCWSTR->WCHAR*
///fuSound: UINT->unsigned int
}
}

View File

@ -67,6 +67,7 @@ namespace Outlook2013TodoAddIn
NewMailAlert nm = new NewMailAlert(newMail, Properties.Settings.Default.DisplayTimeOut);
// Show the popup without stealing focus
nm.ShowPopup();
SoundHelper.sndPlaySoundW(SoundHelper.MailBeep, SoundHelper.SND_NODEFAULT);
}
}