Ce Script joue un son quand l?écran de veille de Webshots se met en route
Source / Exemple :
'declaration des constantes
Const FichierSon = "C:\WINDOWS\Media\Windows XP Appel entrant.wav"
'declaration des objets
Set WSShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Do
'on regarde si Webshots est chargé
Set colProcesses = objWMIService.ExecQuery( _
"Select * from Win32_Process Where Name = 'webshots.scr'")
If colProcesses.Count Then
'demarage du Magnétophone
WSShell.Run "sndrec32 /play /Close " & chr(34) & FichierSon & chr(34), vbHide
'on attend que le Magnétophone est terminer
Set colProcesses = objWMIService.ExecQuery( _
"Select * from Win32_Process Where Name = 'sndrec32.exe'")
While colProcesses.Count
Set colProcesses = objWMIService.ExecQuery( _
"Select * from Win32_Process Where Name = 'sndrec32.exe'")
Wend
End If
Loop