We have a script that a few users run daily. It runs continuously and checks for records to appear in a database every few minutes. Then it alerts the user with the Display command and plays a wav file, so they can take action.
The script works exactly as designed, but now they are asking if there is a way that it can alert them without interrupting the active window (while they are typing). For example, in the way that Outlook pops up a "new e-mail" alert without changing the active window.
Does WinBatch have the ability to do this directly, or via some creative coding?
Here is the portion of the script that handles the alert currently.
x=1
While x < 2 ;loop forever
found=0 ;set record count to 0
WoList="---------------------------------------------------------------------------------------------------------------%@crlf%%@crlf%"
Gosub READ
if found > 0 then
WoList = Strcat(WoList,"%@crlf%---------------------------------------------------------------------------------------------------------------")
currentvolume = SoundVolume(-1) ;get current volume setting
if currentvolume < 25 then
SoundVolume( 75 ) ; Sets the speaker volume.
endif
PlayWaveForm("C:\WINDOWS\Media\ringin.wav", 0 ) ; Plays a WAV sound file. Computer should beep if wav file not found.
SoundVolume(currentvolume) ;set volume back to previous level
Display(10,"Workorder in WRQ Status",WoList) ; Displays a message to the user for a specified period of time
endif
delay(delaytime) ;Wait specified delaytime (seconds) before checking file again
end while
Thanks,
Gary