Jump to content
LaunchBox Community Forums

Windows game EXE fullscreen (Alt+Enter)


5thWolf

Recommended Posts

@5thWolf Another good option is Borderless Gaming. It works well for this type of case where there's no command line option to go full screen.

Install and open it, Select Options->Run At Startup. Launch the game. Then in Borderless Gaming select the game from the list of open applications and hit the right arrow to move it to your favorites. From then on the game should launch in full screen mode.

https://github.com/Codeusa/Borderless-Gaming/releases/download/9.5.6/BorderlessGaming9.5.6_admin_setup.exe

Link to comment
Share on other sites

11 hours ago, 5thWolf said:

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. 

Since you can exit the game by other means, take out the Escape sequence in the script.

Because the game takes so long to load, I added a literal reference in WinWaitActive.  Also added a single instance force which would alleviate the message you were getting.  Though with removing the escape sequence, it shouldn't be needed.   But also doesn't hurt to be in there.  This should also fix the issue with 'only worked the very first launch'.

#SingleInstance force
SetWorkingDir %A_ScriptDir%
Run, Z2TAOL_P03.exe
WinWaitActive, ahk_exe Z2TAOL_P03.exe
Sleep, 1000
Send, f

 

Using @superrob3000's suggestion (Borderless Gaming), you could eliminate the script (and the AHK 'emulator') altogether and just point the game directly to the exe.  The only "issue" (that's not really much of an issue) is having another app constantly running in the background.  And that could be taken care of by setting up Additional Apps to run before (start Borderless Gaming) and run after (close Borderless Gaming) the game.  But if using it for other games as well, probably better to just leaving it running.

  • Like 1
Link to comment
Share on other sites

16 hours ago, 5thWolf said:

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.

If a hotkey is present in a script, the script is considered persistent. In other words, doesn't terminate unless explicitly told to. so if you close the game without hitting escape, the script continues to run. This is as designed. The escape hotkey in the script not only closes the game, but also closes the script with the ExitApp command. So when the game closes by other means the ExitApp line never runs and script goes on until you close it another way (taskbar/tray icon, task manager, etc)

 

 

 

3 hours ago, JoeViking245 said:

Since you can exit the game by other means, take out the Escape sequence in the script.

It can still be left in, if it's desirable, but change the flow with a goto once the came closes by other means to make sure the ExitApp line executes.

#SingleInstance force
SetWorkingDir %A_ScriptDir%
Run, Z2TAOL_P03.exe
WinWaitActive, ahk_exe Z2TAOL_P03.exe
Sleep, 1000
Send, f
WinWaitClose, ahk_exe Z2TAOL_P03.exe
Goto, CloseScript

$Esc::
 Send, !{F4}
CloseScript:
 ExitApp

 

 

If they say the script still doesn't work I'm about ready to download this game myself and see wtf is going on. Surely sending a fullscreen key shouldn't be this troublesome. Call me a hater, but I just don't like Zelda II, otherwise I would have already done this to test it out lol

  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, skizzosjt said:

It can still be left in, if it's desirable, but change the flow with a goto once the came closes by other means to make sure the ExitApp line executes.

Nice addition!!  Thanks.

4 minutes ago, skizzosjt said:

If they say the script still doesn't work I'm about ready to download this game myself and see what is going on.

JoeViking tested and JoeViking approved.  ;)  Actually, I tested it before, and it worked then too.  But I only ever pressed Escape to exit the game.  I think your addition now makes it complete.  It'll also help it with the Shutdown theme showing properly.

  • Like 3
Link to comment
Share on other sites

So I did @skizzosjt's script and it works!!! So I tried it a few times over and over just to test... few of the times it randomly looks like it goes to fullscreen then immediately goes back to windowed. I can't tell if it's Win11 doing its screen set back or the script. Maybe I need to give more time in between launches? Giving time for AHK in background to shut down properly? 

Link to comment
Share on other sites

Been following this thread as it is a good learning experience. End goal is to have even 20% the knowledge of @JoeViking245 and @skizzosjt

So setting up AHK as an emulator and testing using the scripts provided I am seeing the same thing as @5thWolf. With the last one skizzosjt posted I get the same thing 5thWolf is showing in the video. Without fail and it does it on a couple machines. 

I modified a bit and so far no issues. It launches numerous times flawlessly. What is odd is if I change the Send line to read Send, f it reverts back to what happens in the video. Even if I add the sleep timer in it. For some reason it does not like sending f.

Any ides why that would matter? Or is this just case of some stupid fluke with this particular game?

SetWorkingDir %A_ScriptDir%   
#SingleInstance, Force
Run, Z2TAOL_P03.exe

WinWaitActive, ahk_exe Z2TAOL_P03.exe
Send {Alt Down}{Enter}{Alt Up}

$Esc::
 Send, !{F4}
ExitApp

Return

 

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

42 minutes ago, Retro808 said:

I modified a bit and so far no issues. It launches numerous times flawlessly. What is odd is if I change the Send line to read Send, f it reverts back to what happens in the video. Even if I add the sleep timer in it. For some reason it does not like sending f.

Any ides why that would matter? Or is this just case of some stupid fluke with this particular game?

I was sure I tried it several times (launch, exit, launch, exit...).  But it's quite possible I just launched the game, pretended to play, then exited. Never looking back.

Subsequent testing this morning on both my main PC and cab, I discovered the darndest thing...  It remembers its last screen size.  i.e.  Exit fullscreen, it'll start fullscreeen.  So what was happening, Send, f was toggling the fullscreen.  (Homer's catch phrase is ringing loud in my head... "DOH!!")

Further investigation found this file:  C:\Users\Joe\AppData\Local\Z2TAOL_P03\_Game_Preferences01  (no file extension) which looks like this (when formatted as json):

{
    "_volume_sound": 5.0,
    "_Indicate_Spell_Active": 1.0,
    "_Background_Flashing": 1.0,
    "_Window_Scale": 3.0,
    "_Torch_Lighting": 1.0,
    "_Overworld_Mark_Acquired": 0.0,
    "_Overworld_Mark_Hidden_Exit": 0.0,
    "_Fullscreen": 1.0,
    "_Input_Preferences": "{ }",
    "_Music_Set": "_Default",
    "_Frenzy_Stab": 0.0,
    "_Screen_Shake": 1.0,
    "_Rando_Enemy": 1.0,
    "_Map_Show_Key": 0.0,
    "_Rando_Palette": 2.0,
    "_Cucco_Spell02_Preference": 1.0,
    "_HUD_Type": 2.0,
    "_volume_music": 5.0
}

The key line being "_Fullscreen": 1.0,   ("1.0" = true.  "0.0" = false)

Now, you might be able to adjust some other goodies in here. But as I don't ever plan to play the game, didn't study it.

 

My final script:

#SingleInstance force
SetWorkingDir %A_ScriptDir%
RunWait, Z2TAOL_P03.exe
ExitApp

$Esc::
 Send, !{F4}

RunWait will launch the game and 'hang out' until it's no longer running.

  • When you press Escape, it'll exit the game, making it no longer running.
  • If you press Alt+F4, it'll exit the game, making it no longer running.

And when the game is no longer running, the script will exit (ExitApp).

  • Like 2
  • Unusual Gem 1
Link to comment
Share on other sites

Posted (edited)
2 hours ago, JoeViking245 said:
{
    "_volume_sound": 5.0,
    "_Indicate_Spell_Active": 1.0,
    "_Background_Flashing": 1.0,
    "_Window_Scale": 3.0,
    "_Torch_Lighting": 1.0,
    "_Overworld_Mark_Acquired": 0.0,
    "_Overworld_Mark_Hidden_Exit": 0.0,
    "_Fullscreen": 1.0,
    "_Input_Preferences": "{ }",
    "_Music_Set": "_Default",
    "_Frenzy_Stab": 0.0,
    "_Screen_Shake": 1.0,
    "_Rando_Enemy": 1.0,
    "_Map_Show_Key": 0.0,
    "_Rando_Palette": 2.0,
    "_Cucco_Spell02_Preference": 1.0,
    "_HUD_Type": 2.0,
    "_volume_music": 5.0
}

No this is awesome!!!! I tested the fullscreen here and its perfect!!
Only thing that sucks is it remembering that last screen state when you leave the game like @JoeViking245 mentioned.
So I wonder..... Maybe somehow utilize options.ini in the main directory to get what we want?

Edited by 5thWolf
Link to comment
Share on other sites

27 minutes ago, 5thWolf said:

Only thing that sucks is it remembering that last screen state when you leave the game

Wait.  What?????????

 

Your original post:

Quote

So I am trying to get  a Windows game that starts out windowed to start in full screen. 

 

I'm guessing maybe you're swapping windows while playing the game and may exit the game not fullscreen? 

I suppose you could try making "_Game_Preferences01" ReadOnly.

  • Like 1
Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

Subsequent testing this morning on both my main PC and cab, I discovered the darndest thing...  It remembers its last screen size.  i.e.  Exit fullscreen, it'll start fullscreeen.  So what was happening, Send, f was toggling the fullscreen.  (Homer's catch phrase is ringing loud in my head... "DOH!!")

lol yea these are the little quirks I hate to find when I don't have the actual game or app or whatever someone might be asking about. I figured there is no way a game that clearly has docs stating F goes into fullscreen would be so difficult to manipulate with AHK. In fairness to us, no one knew the window remembered the screen size/position
either way, good find Joe!

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

I was just restating what you said that it remembers its last size. When I go to exit the game, sometimes not through Launchbox, hitting Esc kills fullscreen, then you exit it remembers its last state as windowed. You have to go back into the game_pref file and tell it to be 1/fullscreen again.

However making it read-only may be a great idea.

Link to comment
Share on other sites

22 minutes ago, 5thWolf said:

When I go to exit the game, sometimes not through Launchbox, hitting Esc kills fullscreen, then you exit it remembers its last state as windowed. You have to go back into the game_pref file and tell it to be 1/fullscreen again.

It'd be easier just to press "f" next you start it. ;) 

 

Final, Final-Script - With failsafe

  • Run the exe
  • Wait 'til it's actually active
  • Get the window 'Style' of the exe's window and save them to the variable 'style'
  • If within the 'style' contains "Title Bar"  (when the game is not fullscreen, it has a Title Bar.  aka "WS_CAPTION". aka "0xC00000")
    • Press "f".  And to be safe, make sure you send it to the exe's window.
  • "hang out until it's no longer running."
#SingleInstance force
SetWorkingDir %A_ScriptDir%
Run, Z2TAOL_P03.exe
WinWaitActive, ahk_exe Z2TAOL_P03.exe
WinGet, style, Style, ahk_exe Z2TAOL_P03.exe
if(style & 0xC00000)
   ControlSend,,f,ahk_exe Z2TAOL_P03.exe
WinWaitClose, ahk_exe Z2TAOL_P03.exe
ExitApp

$Esc::
   Send, !{F4}

 

  • Unusual Gem 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...