Jump to content
LaunchBox Community Forums

Windows game EXE fullscreen (Alt+Enter)


5thWolf
Go to solution Solved by JoeViking245,

Recommended Posts

So I am trying to get  a Windows game that starts out windowed to start in full screen. (Not maximized window)
The game full screens with Alt+Enter. I would prefer to just edit the game in Launchbox to go full screen. Command line perimeter maybe?

image.thumb.png.4fed704acfacaee053655c9cd3ef5fa0.png
But will take a .bat command as last resort.


 

Link to comment
Share on other sites

12 hours ago, 5thWolf said:

But will take a .bat command as last resort.

 

Have you tried using a script? You could add something like this (below) to the area where it says "Running Script". However, this only works when editing emulators, and I'm not sure how to use this with a single game

Send {Alt Down}{Enter}{Alt Up}
  • Thanks 1
Link to comment
Share on other sites

@5thWolf the game would need to have built in commands in order to take advantage of them as a command line parameter. likely they simply don't exist.

the script posted by bundangdon would work out just fine. what you need to do is save it as a .ahk fle and have it run as an additional app that launches prior to the game. you should add one more line to make sure it works consistently though. it will need to wait for the window to exist. so you can add a sleep line at the start to wait for X seconds. or use a line to wait for the window to exist. these all achieve the same thing

Sleep, 5000 ;waits 5 seconds
Send {Alt Down}{Enter}{Alt Up}

you can change the sleep time if you need to

 

WinWait, The Legend of Zelda II - Adventures of Link Enhanced
Send {Alt Down}{Enter}{Alt Up}

waits for window to exist. the title must match exactly so make sure to change it, it is case sensitive

 

WinWait, ahk_exe ZeldaII.exe
Send {Alt Down}{Enter}{Alt Up}

also waits, but checks for the process (exe) name instead. this is not case sensitive, but it needs to otherwise match the exe name of the game.

 

all 3 would give the same result. so just pick your preference

 

if none of the above work, then I would replace the 2nd line with this. Being more specific with the keys here

Send {RAlt Down}{Enter down}{Enter up}{RAlt Up}

 

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

52 minutes ago, 5thWolf said:

Awesome guys! I will try and let you know!
Also, just double checking that there is no way to get it through the parameters in Lunchbox then?

Probably not, unless the program itself (Zelda Enhanced) has command line features that could be used. It's made with GameMaker and I don't see any documentation there regarding command line, so you'll have to find another solution like the one @skizzosjt mentioned

  • Thanks 1
Link to comment
Share on other sites

I couldn't get any of it to work. Using ahk nothing would happen. 
Closest I got was doing .bat file by it's self starting the exe, delay 10 seconds then nothing. Just the key never seems to send. I also learned the the game can also utilize just the F key to full screen, to simplify things.
online seems to be many way to send the F key but non of them worked. There has got to be a way to do this with just the .bat alone :P
 

Edited by 5thWolf
Link to comment
Share on other sites

You could make a launcher exe for it to run the game and send the AHK script. 

1. In the game's exe folder right click an empty space and choose New AutoHotKey Script.

2. A new file will appear so give it a name. I called this one "Adventure of Link Enhanced Launcher". Once you rename it open the file with Notepad or Notepad++

3. Write your own/better script or past in the one I  used below. Now save the file.

4. Right click on that ahk file and choose Compile Script. A new exe will be created. 

5. Point LB to that as the game's file. 

I tested this using something JoeViking helped me with a few years ago and it worked without issue. I am sure there is better code/format for this. I have only tinkering knowledge of coding/AHK scripting. So maybe skizzosjt can make better sense of my patchwork. 

For some reason it would only work if I used the name Windows was showing when the app was running. Maybe using the exe name I had a typo, but I was rushing so you can try with the exe name in the WInWait line. 

Run, Z2TAOL_P03.exe

WinWaitActive, GameMaker: Studio
Send {Alt Down}{Enter}{Alt Up}

$Esc::
 Send, !{F4}
ExitApp

Return

 

Screenshot 2023-12-28 at 11.28.31 AM.png

  • Like 1
Link to comment
Share on other sites

Playing off Retro808's script, here's another one.

This assumes the script is in the same folder as the (games) exe file.  WinWaitActive 'knows' to wait for the prior lines Run executable.  The Sleep timer seems to need to be there before send "f".  Also added an Escape sequence to exit the game (and the script).

SetWorkingDir %A_ScriptDir%
Run, Z2TAOL_P03.exe
WinWaitActive
Sleep, 1000
Send, f

$Esc::
 Send, !{F4}
 ExitApp

 

Instead of compiling the script to an exe, you could add an emulator to LB.  Just point it to \LaunchBox\ThirdParty\AutoHotkey\AutoHotkey.exe and add an Associated Platform of any platform. Just don't check the default box.

image.thumb.png.1bd0b83e74804dd9466043195b6d7733.png

 

Then import the .ahk script as a ROM and use the "AutoHotkey" emulator.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

On 12/28/2023 at 11:37 AM, Retro808 said:

4. Right click on that ahk file and choose Compile Script. A new exe will be created.

 

On 12/28/2023 at 12:32 PM, 5thWolf said:

I Only question I have then is how did you make the launcher? I never really used AHK before outside pasting peoples scripts in LB.

 

to clarify this a little deeper, the right click function to compile a script will only appear if you have installed the exe version of AHK. meaning you would have already downloaded their installer from their website and installed it like any average program. as in it also shows up in your installed applications list.

it is also possible to have AHK in a portable install. this is simply unpacking a zip file to any location you want and it runs like that. this is how the AHK exe works that comes included with LaunchBox. if you do things this way you would not have the right click and compile option available.

if you have the portable way setup, you can still compile but need to run Ahk2Exe.exe and in there select the script to compile. Ahk2Exe.exe can be found in the AHK folder that will be unzipped in the Compiler folder

 

image.thumb.png.932ecb09fb6cee4c4e09f526a0bb1ee6.png

 

 

Using Ahk2Exe

-Select your script

-Then select the AHK EXE to use for compiling (I usually use the one selected below)

-Click convert

image.thumb.png.e30ceb7ecfda1dbe2562a0bef09a4e2a.png

  • Like 2
Link to comment
Share on other sites

On 12/28/2023 at 12:42 PM, JoeViking245 said:
SetWorkingDir %A_ScriptDir%
Run, Z2TAOL_P03.exe
WinWaitActive
Sleep, 1000
Send, f

$Esc::
 Send, !{F4}
 ExitApp

I really want to work with this!!! Looks like it should work, but tried it and it didn't do anything. The .bat is in the the same folder as exe. I did copy and past. I just don't see what could be wrong. It looks like it should be perfect!

Link to comment
Share on other sites

Posted (edited)

If I can't get the .bat to work I will explore the AHK option like @JoeViking245 stated. Seems like it would be the overall best solution then dealing with .bat files.
If anyone has a good script for AHK I will try it at the same time.

Edited by 5thWolf
Link to comment
Share on other sites

1 hour ago, 5thWolf said:

I really want to work with this!!! Looks like it should work, but tried it and it didn't do anything. The .bat is in the the same folder as exe. I did copy and past. I just don't see what could be wrong. It looks like it should be perfect!

What .bat file?  All code listed so far is AutoHotkey.  If you take the [good] script that I gave you and save it into a file with a .ahk file extension then do what I described above, not only will it 'should work', it will work. ;) 

 

To reiterate (with a little more description), create a new text file in the games folder.  Edit that text file and paste the code I gave into it. Save and close.  Now rename the file AND file extension to something like (or whatever you want, as long as it has an 'ahk' file extension) JoesWorkingScriptForLOZ2.ahk

Make sure the actual file extension gets changed.  You don't want 'JoesWorkingScriptForLOZ2.ahk.txt'

The 1st one is good, the 2nd is bad.  (the give-away is under Type)

image.png.5b83bc15b89e9d7db1e794fdd9bc6e00.png

Now, in LaunchBox, create the emulator as described.  Then edit the LOZ2 game and set (change) in the Launching section the path to the .ahk file above.  Not the .txt file. ;) 

  • Thanks 1
Link to comment
Share on other sites

Posted (edited)

Ok, I added AHK as an emulator and told it to be used for the game. Created the ahk file with the copy pasted script and made the game exe be the scripted ahk file.. The game launches but doesn't go fullscreen.  😣
Any ideas?

Edited by 5thWolf
Link to comment
Share on other sites

1 hour ago, 5thWolf said:

Ok, I added AHK as an emulator and told it to be used for the game. Created the ahk file with the copy pasted script and made the game exe be the scripted ahk file.. The game launches but doesn't go fullscreen.  😣
Any ideas?

Glad to hear it [almost] works.  No need to frown. ;) 

Set the Sleep timer to longer than 1 second (1000).  Try changing it to 2000 (2 seconds) or 3000 (3 seconds). Or longer?

  • Like 1
Link to comment
Share on other sites

Posted (edited)

It is insanely odd how long it takes this game to show up after clicking it. Between 5 - 10 seconds or so. Will time it and put set it to that and report back in a few.

Edited by 5thWolf
Link to comment
Share on other sites

Posted (edited)

I did it for 5000 and it worked the first time, than after that it doesn't! Esc key always works great.
One odd flaw.... When I exit the game and come back and run it again, I get this message below. Maybe AHK is not shutting down properly?

image.thumb.png.197b8580f56f5b7806586a3973882e63.png

image.png

 

After a few restarts of LB, the message doesn't show up anymore and the game doesn't fullscreen. Esc still works. Experimented with 5000 all the way to 8000.

Edited by 5thWolf
Link to comment
Share on other sites

Posted (edited)

I figured out the message. If I exit the game with any means other then Esc AHK stays running. Otherwise Esc shuts it down properly and no message.

Also tried 1 second intervals from 4000 to 12000 and can't get it to go fullscreen. Only worked the very first launch I tried at 5000, but didn't work putting it back to 5000 after moving the timer around. 

Edited by 5thWolf
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...