Lyle Kopnicky wrote:

> Hi folks,
> 
> I'm having trouble getting the Tk::Widget method beep() to work on 
> Win2K.  It works fine on NT4.  I'm using ActivePerl 5.8.4.  If it makes 
> any difference, I'm also connecting to the server via an RDP session, 
> both cases.
> 
> If I open a console window on the Win2K server, through an RDP session, 
> and type some Ctrl-Gs, and hit enter, my local PC beeps.  Since those 
> beeps are being sent across properly, the terminal server doesn't seem 
> to be the problem.
> 
> But when I run a program calling beep(), I don't hear anything.
> 
> On NT4, beep() works fine.  Any ideas?

Here's an alternative if you can't get it going using API:

use strict;
use warnings;
use Win32::API;

use constant DEFAULT => 0xFFFFFFFF;             # Std speaker beep
use constant MB_OK => 0x00000000;               # SystemDefault
use constant MB_ICONHAND => 0x00000010;         # SystemHand
use constant MB_ICONQUESTION => 0x00000020;     # SystemQuestion
use constant MB_ICONEXCLAMATION => 0x00000030;  # SystemExclamation
use constant MB_ICONASTERISK => 0x00000040;     # SystemAsterisk

Win32::API->Import('user32', 'BOOL MessageBeep (UINT uType)') or
  die "import MessageBeep: $! ($^E)";

# loop through the various beeps

for (DEFAULT, MB_OK, MB_ICONHAND, MB_ICONQUESTION, MB_ICONEXCLAMATION,
  MB_ICONASTERISK) {
        my $ret = MessageBeep ($_);
        sleep 1;
}

__END__
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to