Article View: news.software.readers
Article #113019Re: [Dialog] Play sound on new email?
From: Juergen Haible
Date: Thu, 31 Oct 2002 21:07
Date: Thu, 31 Oct 2002 21:07
53 lines
2688 bytes
2688 bytes
Bob Frank:
> On Thu, 31 Oct 2002 01:30:47 GMT, Tarkus wrote:
>
>> I have Dialog automatically checking for email now. I assume there's a
>> way to play a sound if you get new email, but I haven't figured it out.
Did not find a built-in sound, but you can use the "OnEmailChecked"
event script to make your own. It might look like this one, which also
shows a message box:
program OnEmailChecked;
function MessageBox( hWnd: LongWord; lpText, lpCaption: PChar;
uType: LongWord ): Integer;
external 'MessageBoxA@user32.dll stdcall';
function PlaySound( Filename: PChar; Options: LongWord ): Boolean;
external 'sndPlaySoundA@winmm.dll stdcall';
procedure OnEmailChecked(Identity:string; FetchedCount,
TotalOnServerBefore, TotalOnServerAfter: integer);
var s: String;
begin
if FetchedCount = 0 then exit; // no new mails
PlaySound( 'c:\windows\media\tada.wav', 1 );
s := 'Still none from Meg Ryan, but '
+ inttostr(FetchedCount) + ' from others!';
MessageBox( 0, s, 'You''ve Got Mail!', $40 );
end;
begin
end.
> It would be nice to be able to play a different sound depending on which
> Identity had mail.
There's an "Identity" parameter in above event script, so you can use it
to select the wanted file, e. g.:
if Identity = 'this' then
PlaySound( 'this.wav', 1 )
else if Identity = 'that' then
PlaySound( 'that.wav', 1 )
else
PlaySound( 'others.wav' );
-jh-
Technical Details
Message-ID:
<1b86vltb2bgby.dlg@freebee.dyndns.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mailReferences:
<g2h1gd3esoq5$.dlg@karnevil9.com> <1nybhcrvq9noy.1ft73aedaay0q$.dlg@40tude.net>Show Full Headers
Complete Article Headers
Message-ID: <1b86vltb2bgby.dlg@freebee.dyndns.org> Subject: Re: [Dialog] Play sound on new email? Date: Thu, 31 Oct 2002 22:07:28 +0100 From: Juergen Haible <juergen.haible@t-online.de> References: <g2h1gd3esoq5$.dlg@karnevil9.com> <1nybhcrvq9noy.1ft73aedaay0q$.dlg@40tude.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Newsgroups: news.software.readers Organization: T-Online Lines: 52 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1036098411 04 8305 eSV+bxSTSqHxoF 021031 21:06:51 X-Complaints-To: abuse@t-online.com X-Sender: 073813357-0002@t-dialin.net User-Agent: 40tude_Dialog/2.0.2.1 (309f4a66.36.62) Hamster-Pg/1.5