PDA

View Full Version : stop audio from external window


thesven
06-26-2003, 12:47 PM
I have a project built that loads and audio file when it open and external application (because the app doesn't support audio), everything runs fine but when you close the external app the audio continues to play, how does one stop this audio when it returns to am4?

thanks

Worm
06-26-2003, 12:57 PM
Use Window.Find
and Window.Close

thesven
06-26-2003, 01:09 PM
thanks but the application I am calling doesn't show a title bar to search on as it is windowless

thesven
06-26-2003, 01:16 PM
I would even settle for simply auto launching the application and launching the mp3 file then when closing the app to shut down the audio, as a last resort........can't seem to do this either because the window has no title.....I am calling a borderless .exe file

any clues?

Worm
06-26-2003, 01:19 PM
When the app you want to shutdown is running, set something within your AMS app up so you can get the titles of all windows. Look throught the windows, and chances are you'll be able to figure out the name of the window to close down.


%WndTitles% = Window.GetTitles
%Result% = Dialog.MessageBox ("Title", "%WndTitles%", Ok, Question)

thesven
06-26-2003, 01:35 PM
sorry for being so dense here but where to I plug in the
%Result% = Dialog.MessageBox ("Title", "%WndTitles%", Ok, Question)

I can add the %WndTitles% from the existing menu pick actions but I don't see where to add in the second in of code?

will there be a dialog box showing me the titled windows when they run?

thanks

Worm
06-26-2003, 01:44 PM
Put it anywhere you want. Once you've launched the external app, click the Label/Image or whatever you choose to put the code behind to get the list of windows currently open.

thesven
06-26-2003, 02:20 PM
ok, I have a screenshot of the data

http://www.promomeals.com/am4/whichwindow.jpg

how do I decipher the window name? it is the window right behind the dialog box as shown.

this is a learning experience.......

thesven
06-26-2003, 02:30 PM
the program name is "test" if that helps

Worm
06-26-2003, 02:32 PM
Close Down all the windows you can so that there aren't as many Window Titles to choose from. From there, its going to be a guessing game. Just try closing windows until you get the right one.

thesven
06-26-2003, 02:47 PM
ahhhhh....ok.... a simple task /ubbthreads/images/icons/frown.gif

as a test I tried closing the standard AutoMedia Application window (as the name states) and it says it can't find it.......that doesn't sound good........

thanks

TJ_Tigger
06-27-2003, 06:35 AM
There is a built in variable for the AMS window %MenuHWnd%. If your window does not have a border, you should still be able to find the name of the window by looking at the Start Bar. That should show you the title of the window there.