Jump to content
LaunchBox Community Forums

Recommended Posts

If you have a black screen when exiting games or BB/LB is unresponsive until you alt - tab back to BB/LB it might be because BB/LB has lost focus.

This plugin will run an ahk script on game exit. The ahk script will then activate BB/LB, bringing it back into focus.

Is compatible with shutdown screens.

I dont have any steam games but Im sure I have seen it mentioned that LB doesn't know when steam games have exited so might not be compatible with steam games or any similar type of games.

 

For LB version 10.11 and below:

Download this: focus 10.11.zip

Unblock it.

Put RegainFocus.ahk in Launchbox/AutoHotkey.

Put AhkOnExit.dll in Launchbox/Plugins.

 

For LB version 10.12 and above:

Download this: focus 10.12.zip

Unblock it.

Put RegainFocus.ahk in Launchbox/ThirdParty/AutoHotkey.

Put AhkOnExit.dll in Launchbox/Plugins.

If you are already using the 10.11 version, which is scattered around these forums somewhere. You will be getting an exemption, on game exit, when you have updated to LB version 10.12. Just replace the AhkOnExit.dll with the 10.12 version.

 

for LB version 11.7(?)

focus.zip

 

Update to the plugin found here:

LaunchScript.zip

Edited by jayjay
  • Thanks 4
  • Game On 2
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
13 hours ago, nohero said:

@jayjay

it happens ( not always ) when exit game BB doesn't respond and I need to click on mouse button.

Do you know how to fix it?

Sometimes when launching from a .exe, that .exe will then launch another .exe at which point LB will assume the game has quit and the plugin will launch the ahk while the game is still running. 

If that's not the case I'm not entirely sure why it isn't working correctly. Activating windows to bring them to the front can be a bit finicky at times.

What game isn't working correctly? Is it a steam or gog game or what? 

Link to comment
Share on other sites

7 hours ago, nohero said:

It's an Arcade game but it works like a PC one. It's Time Crisis 5.

It launches 2 exes.

Looking at time crisis 5 files, I assume it first launches "RSLauncher.exe" then launches "TimeCrisisGame-Win64-Shipping.exe".

At the weekend I'll make a plugin that will attempt to focus BB on game exit when playing a game that launches multiple exes. 

Link to comment
Share on other sites

Iv updated this plugin, I haven't much time to test so it will need some proper testing.

Focus On Game Exit.zip

Download it.

Right click, properties, unblock.

Extract the folder to Launchbox/Plugins.

It has the original focus plugin built in but now has the option to override the original plugin on a per game basis. The focus being on games that uses launcher exe's.

 

Right click on a game and select "Focus On Game Exit".

 

Option 1 - Replace:

Theoretically this should work with shut down screens. But don't hold me to it.

Untitled.thumb.png.7149639de2988385a9e797202d2d22b0.png

Exe1 - this needs to be the 1st .exe the game uses.

Wait - this is the amount of time, in seconds, to wait between... when the 1st exe closes and the 2nd exe launches. Its a delay to give the 2nd exe time to "properly open".

Exe2 - this needs to be the secondary exe.

Make sure Exe1 and Exe2 are spelt exactly the same as the games exe's. Including upper and lower case letters.

IMPORTANT NOTE: this method comes with a major downside. The way this option works is by replacing the  games  launcher exe with an autohotkey script. This means that this option isnt compatible with portable LB setups. It also means that at any point, if you delete this plugin's directory you cannot restore the games original exe path... this path:

220184699_Editwindow.thumb.png.630b28f7797648d8cc978464b5b921f3.png

If you want to remove this plugin but you have added a "Replace" script. Enable the "Focus On Game Exit" badge:

Untitled2.thumb.png.fe264229baf05fa988f1ecd71a992be2.png

This will make it easy to track down games that uses this plugin.

Right click on the game and select "Focus On Game Exit" and press the delete button to restore the "Default Path".

The default path... this:

Untitled.thumb.png.770731c0455a6f872ea779a5c7807b94.png

The ONLY time you need to change this path is if you move the associated game files. Otherwise dont change it at all.

If using this option, you do so at your own risk. 

 

Option 2 - Window;

Wont work with shutdown screens.

Untitled3.thumb.png.7dd2d919e24e24c3738ff4b331707f60.png

Window 1: this is the games launcher window title.

Wait. How many seconds to wait before the 2nd window opens. This is also a timeout (which may need more work). If the 2nd window doesn't open for whatever reason the timeout will elapse and should close the script.

Window 2: the games secondary window title.

Both window options need to be spelt exactly the same as the games window titles.

This hasnt been tested a great deal.

 

Option 3 - EXE:

Wont work with shutdown screens.

This option is the same as option 1 but it will not replace the games path in LB.

The "wait" option, like option 2 is also a time out.

 

To recap:

Option 1 modifies LB data, use at your own risk.

Options 2 and 3, does not modify LB data.

 

Options 2 and 3, the ahk scripts could prob use some work. Can find the scripts in the plugin directory. If anyone has any suggestions for the scripts then let me know.

Consider this a beta, I would suggest not adding the override scripts to a load of games til it has been properly tested.

Edited by jayjay
  • Thanks 1
Link to comment
Share on other sites

@jayjay

I tested it with Time Crisis 5 and it works better than your previous plugin.

I used the Option 3 and both LB and BB have not lost focus.

 

Thank you so much for your magic   :) 

Link to comment
Share on other sites

  • 7 months later...
  • 3 weeks later...

Thank you very much for your solution @jayjay I've not tried it yet but it seems like it can fix my problem with focus and gamepad not waking up after sleep mode.

Using Steam to launch BigBox If I turn off my gamepad and then on or if the gamepad entered in sleep mode and I turn it on, I need to press Alt+tab to select the BigBox window to make BB to recognize it. I'm watching the BigBox screen all the time, so it was difficult to come to the conclusion that BB was losing the focus.



It's weird because the keyboard never gets unresponsive. The problem is only with the gamepad. I swear this didn't happen before? Maybe Windows 10 issues?. @Jason Carr

EDIT: I think I'm starting to know what's going on... seems like gamepad works for a few seconds when I wake it up and then it stops working when the Steam "XBOX Gamepad: Using JuRaSSiCBoY's settings" pop-up appears. So I think its a Steam bug. 🙈 This is not happening with the rest of Steam pop-ups... It doesn't even happen with the initial gamepad setup pop-up (just after loading BigBox).

Edited by JuRaSSiCBoY
Link to comment
Share on other sites

  • 2 years later...

JayJay, I only have one PC game that causes this issue for me in my collection.  I have tried focus scripts you prepared and unable to get focus without a mouse click upon game closure.  I even tried a different approach by using windows task scheduler to run your script when that program terminates.  When running the script manually, it works fine.  Same with with windows task manually.  I can't seem to figure out why the trigger I setup isn't working.  That said, it would be nice if any of the scripts you wrote would just launch at the close of this game alone.  I tried using the latest download you have here which have options to right click and add paths etc..  That felt more promising but I am still facing this issue in BigBox upon closing this one game every time.  Not to revive such an old thread, but if you have any guidance I would appreciate it.

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...