Jump to content

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...