Jump to content
Sign in to follow this  

Triggering an event on a windows program closing help

Recommended Posts


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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.