<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>www.ritlabs.com [Topic: How to setup sound notification for IMAP ?]</title>
		<link>http://www.ritlabs.com</link>
		<description>New posts in How to setup sound notification for IMAP ? of  forum at www.ritlabs.com [www.ritlabs.com]</description>
		<language>en</language>
		<docs>http://backend.userland.com/rss2</docs>
		<lastBuildDateTag>Mon, 01 Jun 2015 20:09:40 +0300</lastBuildDateTag>		<item>
			<title>How to setup sound notification for IMAP ?</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum4/topic11233/message42161/">How to setup sound notification for IMAP ?</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum4/">The Bat! - Configuring the E-mail Client</a>. <br />
			I really love <I>The Bat!</I> and this is the only very little nuisance that I always thought could use fixing. Since I was really bored the other day I wrote myself a program that will play a notification sound that can be set up as an incoming filter. It addresses the problem Warner mentioned so it will only play the notification sound once if you get multiple new emails.<br /><br />To set it up, create a new filter for <B>any message </B>and run it as external action like so
====code====
<pre>C:&#92;Program Files (x86)&#92;The Bat!&#92;batsound.exe "C:&#92;Windows&#92;Media&#92;notify.wav"</pre>
=============
If you drop the path to the wav file, the program will play the default mail beep of the active Windows sound theme.<br /><br />You can download the program <noindex><a href="http://s000.tinyupload.com/index.php?file_id=81634720584204418596" target="_blank" rel="nofollow">here</a></noindex>.<br /><br />If you prefer to build it yourself, here's the source code:<br />
====code====
<pre>#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif // !_CRT_SECURE_NO_WARNINGS
#include &#60;time.h&#62;
#include &#60;stdio.h&#62;
#include &#60;tchar.h&#62;
#include &#60;Windows.h&#62;

#pragma comment (lib, "winmm.lib")

#define DEFAULT_TIMEOUT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10
#define PROGRAM_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_T("F343833A-CC2D-4F9B-A619-AEA408E0CC2C")
#define SND_MAILBEEP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_T("MAILBEEP")

int _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR lpCmdLine, int nCmdShow)
{
&nbsp;&nbsp;&nbsp;HANDLE hMutex = CreateMutex(NULL, TRUE, PROGRAM_GUID);
&nbsp;&nbsp;&nbsp;if (GetLastError() == ERROR_ALREADY_EXISTS) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CloseHandle(hMutex);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;time_t last;
&nbsp;&nbsp;&nbsp;FILE *fp;
&nbsp;&nbsp;&nbsp;int timeout = __argc &#62; 2 ?_tstoi(__targv&#91;2&#93;) : DEFAULT_TIMEOUT;
&nbsp;&nbsp;&nbsp;TCHAR szTmpDir&#91;MAX_PATH&#93;, szFile&#91;MAX_PATH + _MAX_FNAME&#93;;
&nbsp;&nbsp;&nbsp;GetTempPath(sizeof(szTmpDir), szTmpDir);
&nbsp;&nbsp;&nbsp;_stprintf_s(szFile, _T("%s&#92;&#92;%s"), szTmpDir, PROGRAM_GUID);
&nbsp;&nbsp;&nbsp;if (fp = _tfopen(szFile, _T("r+"))) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(EOF != _ftscanf(fp, _T("%lli"), &#38;last)) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time_t diff = time(NULL) - last;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (diff &#60; timeout)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!(fp = _tfopen(szFile, _T("w"))))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;if (__argc &#62; 1)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PlaySound(__targv&#91;1&#93;, NULL, SND_FILENAME);
&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PlaySound(SND_MAILBEEP, NULL, SND_ALIAS);
&nbsp;&nbsp;&nbsp;fseek(fp, 0, SEEK_SET);
&nbsp;&nbsp;&nbsp;_ftprintf(fp, _T("%lli"), time(NULL));
&nbsp;&nbsp;&nbsp;fclose(fp);
&nbsp;&nbsp;&nbsp;CloseHandle(hMutex);
&nbsp;&nbsp;&nbsp;return 0;
}
</pre>
============= <br />
			<i>01 June 2015 20:09:40, <a href="http://www.ritlabs.com/en/forums/">mtg</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum4/topic11233/message42161/</link>
			<guid>http://www.ritlabs.com/en/forums/forum4/topic11233/message42161/</guid>
			<pubDate>Mon, 01 Jun 2015 20:09:40 +0300</pubDate>
			<category>The Bat! - Configuring the E-mail Client</category>
		</item>
		<item>
			<title>How to setup sound notification for IMAP ?</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum4/topic11233/message38221/">How to setup sound notification for IMAP ?</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum4/">The Bat! - Configuring the E-mail Client</a>. <br />
			Well, that works, but instead of playing the sound once when I receive a bunch of new emails all at once, it plays the sound once for each new email. &nbsp;If I get 16 new emails, it sits there and plays the notification sound 16 times, which is kind of ridiculous. <br />
			<i>20 November 2013 23:35:09, <a href="http://www.ritlabs.com/en/forums/">Warner Young</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum4/topic11233/message38221/</link>
			<guid>http://www.ritlabs.com/en/forums/forum4/topic11233/message38221/</guid>
			<pubDate>Wed, 20 Nov 2013 23:35:09 +0200</pubDate>
			<category>The Bat! - Configuring the E-mail Client</category>
		</item>
		<item>
			<title>How to setup sound notification for IMAP ?</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum4/topic11233/message38105/">How to setup sound notification for IMAP ?</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum4/">The Bat! - Configuring the E-mail Client</a>. <br />
			Try an incoming filter that plays a sound. <br />
			<i>15 November 2013 01:01:12, <a href="http://www.ritlabs.com/en/forums/">Roelof Otten</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum4/topic11233/message38105/</link>
			<guid>http://www.ritlabs.com/en/forums/forum4/topic11233/message38105/</guid>
			<pubDate>Fri, 15 Nov 2013 01:01:12 +0200</pubDate>
			<category>The Bat! - Configuring the E-mail Client</category>
		</item>
		<item>
			<title>How to setup sound notification for IMAP ?</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum4/topic11233/message38104/">How to setup sound notification for IMAP ?</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum4/">The Bat! - Configuring the E-mail Client</a>. <br />
			I have the same question for The Bat v5.8.8. &nbsp;Sound notification works for my POP3 accounts, but I can't even find an option or setting for the IMAP account. <br />
			<i>15 November 2013 00:33:59, <a href="http://www.ritlabs.com/en/forums/">Warner Young</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum4/topic11233/message38104/</link>
			<guid>http://www.ritlabs.com/en/forums/forum4/topic11233/message38104/</guid>
			<pubDate>Fri, 15 Nov 2013 00:33:59 +0200</pubDate>
			<category>The Bat! - Configuring the E-mail Client</category>
		</item>
		<item>
			<title>How to setup sound notification for IMAP ?</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum4/topic11233/message37902/">How to setup sound notification for IMAP ?</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum4/">The Bat! - Configuring the E-mail Client</a>. <br />
			How to setup sound notification for IMAP ? <br />
			<i>30 October 2013 12:22:56, <a href="http://www.ritlabs.com/en/forums/">Piotr P</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum4/topic11233/message37902/</link>
			<guid>http://www.ritlabs.com/en/forums/forum4/topic11233/message37902/</guid>
			<pubDate>Wed, 30 Oct 2013 12:22:56 +0200</pubDate>
			<category>The Bat! - Configuring the E-mail Client</category>
		</item>
	</channel>
</rss>
