Sign in to follow this  
Followers 0
computergroove

Triggering an event on a windows program closing help

3 posts in this topic

I have a bit of code that plays a video. I need something to replace 'Sleep(1000)'. I have Mplayer.exe set to autoclose after the video has played to the end. What I want to do is make the program wait until mplayer2 closes and then WinActivate("Scan Barcode"). I figure I could do this with a GUIGetPixel but I want to know if there is a way for Autoit to monitor open processes and trigger an event when one closes.

$video_file = (@ScriptDir & "\" & IniRead("barcode.ini", "AviCodes", $user_input, "no entry"))
                Run (@ProgramFilesDir & "\Windows Media Player\mplayer2.exe /play /fullscreen /close "&$video_file&"")
                Sleep (1000)
                WinActivate("Scan Barcode")
                GUICtrlSetData($edit_field, "");erases not successful input

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



Use RunWait instead of simple Run


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Worked. Thanks


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0