Jump to content
LaunchBox Community Forums

Strange Window Error Message That I only get through Launchbox and Not Through MAME


w00master
Go to solution Solved by JoeViking245,

Recommended Posts

Honestly confused on this.  Never seen this type of error message before.  It doesn't effect the playing of the game, but the error message always takes focus away from it so I end up having to "alt-tab" over to the game.  This happens both in LaunchBox and BigBox.

So here's what's happening.  Anytime, I play Area 51 (for example) through Launchbox, I get this error (see screenshot).

However, if I run the same rom directly in MAME, I don't get this window error.  I believe it may have something to do with the running script I have (this script is standard for this game for anyone that uses Gun4IR):

Run, %COMSPEC% /C echo M3.1 > COM1
Run, %COMSPEC% /C echo M3.1 > COM2

~ESC::
Run, %COMSPEC% /C echo M3.0 > COM1
Run, %COMSPEC% /C echo M3.0 > COM2

ExitApp
return

The error message is only commenting on the bezel art.  (But strangely, when the game loads the bezel art shows up)?  Ultimately, how do I get rid of these windows?  It constatly takes away focus from the game. Any help would be very much appreciated.

 

image.png

Link to comment
Share on other sites

4 minutes ago, w00master said:

The error message is only commenting on the bezel art.  (But strangely, when the game loads the bezel art shows up)?  Ultimately, how do I get rid of these windows? 

In LaunchBox, edit you MAME emulator.  Check the box for Attempt to hide console window on startup/shutdown.

Link to comment
Share on other sites

32 minutes ago, w00master said:

That did get rid of the warning console windows, but unfortunately I still have the "focus" window issue - game loads behind Launchbox, and have to alt-tab over. 

If what I'm thinking is correct, for that you'll need to either start MAME fullscreen or turn off the Startup Screen for the emulator.

Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

If what I'm thinking is correct, for that you'll need to either start MAME fullscreen or turn off the Startup Screen for the emulator.

So, I tried this out, unfortunately I'm still seeing the same issue.  I really believe it's the AHK script that's taking priority over MAME.  I'll post this on AHK forums, but any ideas?  Thanks!

Link to comment
Share on other sites

29 minutes ago, w00master said:

So, I tried this out, unfortunately I'm still seeing the same issue.  I really believe it's the AHK script that's taking priority over MAME.  I'll post this on AHK forums, but any ideas?

I not sure you'll get much help there for this particular situation.  You could try this:

Run, %COMSPEC% /C echo M3.1 > COM1
Run, %COMSPEC% /C echo M3.1 > COM2

Process, Wait, mame.exe
;Sleep 2000
WinActivate

~ESC::
Run, %COMSPEC% /C echo M3.0 > COM1
Run, %COMSPEC% /C echo M3.0 > COM2

ExitApp
return

Try it without the sleep timer.  If it doesn't work, uncomment that line.

Link to comment
Share on other sites

Thanks mate.  Unfortunately, this doesn't work as well.  However, (on the bright side), I did notice it working for me.... once. I moved the script to the top, however - the moment (I believe) the com commands go off, I lose focus.  I tried moving that portion of the script further down, but this didn't take either.

Appreciate the help - I'll keep digging.  It's pretty assuredly something about executing the script (maybe it's the COM commands?  Perhaps someone on here that uses Gun4IR"?  

Thanks!

Link to comment
Share on other sites

  • Solution
1 hour ago, w00master said:

I did notice it working for me.... once.

That's a good sign. :) Try adding a 3 second timer before Process, Wait...  Giving the com commands a few moments to settle in.

If it still doesn't work, move the 1st 2 com commands into their own script and add that as an Additional App for the games and set them to Run Before Main App.  Try it on one or two and if it works, there's a plugin where you can bulk add Additional Apps to all the games [that need it].

Link to comment
Share on other sites

50 minutes ago, JoeViking245 said:

That's a good sign. :) Try adding a 3 second timer before Process, Wait...  Giving the com commands a few moments to settle in.

If it still doesn't work, move the 1st 2 com commands into their own script and add that as an Additional App for the games and set them to Run Before Main App.  Try it on one or two and if it works, there's a plugin where you can bulk add Additional Apps to all the games [that need it].

Thanks so much for your help.  You're correct.  You led me in the right direction.  After your feedback, and learning about IfWinExist as well as those functions REQUIRING some sort of loop, this is what solved for me.  Here's the revised script.  This should work for anyone using Gun4IR and MAME:

(Note: place below script in "Running Scripts" for your MAME Emulator in Launchbox.)

Run, %COMSPEC% /C echo M3.1 > COM1
Run, %COMSPEC% /C echo M3.1 > COM2

SetTitleMatchMode, 2
loop
{
    ifWinExist, ahk_class MAME
    {
        WinActivate ahk_class MAME
WinActivate ahk_class MAME
    }
    Sleep, 100
}
Return

~ESC::
Run, %COMSPEC% /C echo M3.0 > COM1
Run, %COMSPEC% /C echo M3.0 > COM2

ExitApp
return

 

Hope this helps anyone else!

Edit: anyone wanting to use this script, the only thing you need to change in the above are the COM numbers for your Gun4IR. Beyond that, nothing else needs to be changed.

Edited by w00master
  • Game On 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...