From bdee9b19375295270c3c9d5db28d232c6c25fb09 Mon Sep 17 00:00:00 2001 From: gamosoft_cp Date: Tue, 9 Apr 2013 23:09:29 +0000 Subject: [PATCH] Changed cursor of buttons on email alert. Added sound notification to email alert. --- Outlook2013TodoAddIn/NewMailAlert.Designer.cs | 3 ++ .../Outlook2013TodoAddIn.csproj | 1 + Outlook2013TodoAddIn/SoundHelper.cs | 48 +++++++++++++++++++ Outlook2013TodoAddIn/ThisAddIn.cs | 1 + 4 files changed, 53 insertions(+) create mode 100644 Outlook2013TodoAddIn/SoundHelper.cs diff --git a/Outlook2013TodoAddIn/NewMailAlert.Designer.cs b/Outlook2013TodoAddIn/NewMailAlert.Designer.cs index 51cfc81..0e5c75b 100644 --- a/Outlook2013TodoAddIn/NewMailAlert.Designer.cs +++ b/Outlook2013TodoAddIn/NewMailAlert.Designer.cs @@ -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); diff --git a/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj b/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj index 900a68b..82f0451 100644 --- a/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj +++ b/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj @@ -207,6 +207,7 @@ AppointmentsControl.cs + Component diff --git a/Outlook2013TodoAddIn/SoundHelper.cs b/Outlook2013TodoAddIn/SoundHelper.cs new file mode 100644 index 0000000..4ff980e --- /dev/null +++ b/Outlook2013TodoAddIn/SoundHelper.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace Outlook2013TodoAddIn +{ + /// + /// Native calls to play sounds + /// + public class SoundHelper + { + #region "Variables" + + /// + /// SND_NODEFAULT -> 0x0002 + /// + public const uint SND_NODEFAULT = 0x0002; + + /// + /// Mail notification sound + /// + public const string MailBeep = "MailBeep"; + + #endregion "Variables" + + #region "Methods" + + /// + /// Call to play a system sound + /// + /// Eg.: MailBeep + /// + /// + [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 + + + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/ThisAddIn.cs b/Outlook2013TodoAddIn/ThisAddIn.cs index 5010799..4eb7eee 100644 --- a/Outlook2013TodoAddIn/ThisAddIn.cs +++ b/Outlook2013TodoAddIn/ThisAddIn.cs @@ -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); } }