Perl Win32 Quick Reference Page 3

ADVERTISEMENT

use Win32;
GetTransports(server, transportRef)
Win32::Sound::Play(SOUND, [FLAGS])
Enumerates the network transports of a computer. If transportRef is an array
Plays the specified sound: SOUND can the be name of a WAV file or one of
use Win32::Process;
reference, it is filled with the transport names. If transportRef is a hash
the following predefined sound names:
Win32::Process::Create($ProcessObj,
reference then a hash of hashes is filled with the data for the transp orts.
"c:\\winnt\\system32\\notepad.exe",
SystemDefault
"notepad temp.txt",
SystemAsterisk
0,
SystemExclamation
LoggedOnUsers(server, userRef)
NORMAL_PRIORITY_CLASS,
SystemExit
Gets an array or hash with the users logged on at the specified computer. If
".");
SystemHand
userRef is a hash reference, the value is a semikolon separated string of
SystemQuestion
username, logon domain and logon server.
$ProcessObj->Suspend();
SystemStart
Additionally, if the named sound could not be found, the function plays the
$ProcessObj->Resume();
system default sound (unless you specify the SND_NODEFAULT flag). If no
$ProcessObj->Wait(INFINITE);
GetServerDisks(server, arrayRef)
Returns an array with the disk drives of the specified server. The array
parameters are given, this function stops the sound actually playing (see also
Win32::Process::Create($obj,$appname,$cmdline,$iflags,$cflags,$curdir)
contains two-character strings (drive letter followed by a colon).
Win32::Sound::Stop).
Creates a new process.
Args:
$obj
container for process object
LocalGroupGetMembers(server, groupName, userArrayRef)
FLAGS can be a combination of the following constants:
Fills userArrayRef with the members of groupName.
SND_ASYNC
$appname
full path name of executable module
The sound is played asynchronously and the function returns immediately
$cmdline
command line args
after beginning the sound (if this flag is not specified, the sound is played
$iflags
flag: inherit calling processes handles or not
Win32::Service
$cflags
flags for creation (see export ed vars below)
synchronously and the function returns when the sound ends).
$curdir
working dir of new process
SND_LOOP
use Win32::Service;
The sound plays repeatedly until it is stopped. You must also specify
Win32::Service::GetServices("", \%ServiceList);
SND_ASYNC flag.
Win32::Process::KillProcess($pid, $exitcode)
while (($key,$value) = each %ServiceList) {
Terminates any process identified by $pid. $exitcode will be set to the exit
print "$key<----->$value\n";
code of the process.
SND_NODEFAULT
}
No default sound is used. If the specified sound cannot be found, the function
returns without playing anything.
$ProcessObj->Suspend()
StartService(hostName, serviceName)
SND_NOSTOP
Suspend the process associated with the $ProcessObj.
StopService(hostName, serviceName)
If a sound is already playing, the function fails. By default, any new call to
PauseService(hostName, serviceName)
the function will stop previously playing sounds.
Start, Stop or Pause the service serviceName on the machine hostName.
$ProcessObj->Resume()
Resume a suspended process.
Win32::Sound::Stop()
GetStatus(hostName, serviceName, status)
Stops the sound currently playing.
$ProcessObj->Kill( $exitcode )
Get the status of a service. The third argument must be a hash reference that
Kill the associated process, have it terminate with exit code $ExitCode.
will be populated with entries corresponding to the SERVICE_STATUS
structure of the Win32 API. See the Win32 Platform SDK documentation for
($L, $R) = Win32::Sound::Volume();
details of this structure.
$ProcessObj->GetPriorityClass($class)
Win32::Sound::Volume(LEFT, [RIGHT])
Get/Sets the wave device volume.
Get the priority class of the process.
GetServices(hostName, hashref)
$ProcessObj->SetPriorityClass( $class )
($hz, $bits, $channels) = Win32::Sound::Format(filename)
Enumerates both active and inactive Win32 services at the specified host. The
Set the priority class of the process (see exported values below for options).
Returns information about the specified WAV file format; the array contains.
hashref is populated with the descriptive service names as keys and the short
names as the values.
@devices = Win32::Sound::Devices();
$ProcessObj->GetProcessAffinitymask( $processAffinityMask,
Returns all the available sound devices.
$systemAffinitymask)
Win32::Sound
Get the process affinity mask. This is a bitvector in which each bit represents
the processors that a process is allowed to run on.
%Info = Win32::Sound::DeviceInfo(DEVICE)
use Win32::Sound;
Returns an associative array of information about the sound device named
Win32::Sound::Volume('100%');
DEVICE.
Win32::Sound::Play("c:/winnt/media/notify.wav");
$ProcessObj->SetProcessAffinitymask( $processAffinityMask )
Set the process affinity mask. Only available on Windows NT.
Win32::Sound::Stop();
Win32::Process

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4