Hiding an always-on-top window

Ask gaming related questions (AHK v1.1 and older)
MasterBlaster
Posts: 2
Joined: 06 Jun 2021, 08:34

Hiding an always-on-top window

06 Jun 2021, 09:05

I have a game that runs in windowed mode for a few seconds, then automatically changes to exclusive fullscreen.

I want to hide the initial window so the game isn't visible until it enters fullscreen. It's tricky because the game runs in an always-on-top window and there's no way to change this behavior in the game itself.

Here's what I've tried:
  1. Draw GUI: I used AHK's GUI function to draw an always-on-top overlay to hide the game window. However, the game window took priority over my GUI.
  2. Modify Game Window: I used AHK to remove the always-on-top property from my game window. Problem is, this doesn't take effect right away, so the window still flashes on the screen.
It would be great if I could remove the always-on-top property from the game window before the window opens, but I don't think this is possible.

Another option is to use AHK to turn off my monitor before the game launches, then turn it back on once the game enters fullscreen mode. Is there a better way to approach this?
doubledave22
Posts: 343
Joined: 08 Jun 2019, 17:36

Re: Hiding an always-on-top window

06 Jun 2021, 09:53

Hi, have you tried the run command with minimized or hidden?

Code: Select all

Run, prog.exe, , Hide
Run, prog.exe, , Min
I'm not sure all programs respond to this but worth a shot. Also in the shortcut for the program you can go to properties -> shortcut -> run -> minimized then have your script wait a few seconds and restore it.

I'm not sure your exact goal but you could also try to have the program run on a separate monitor in windowed mode then move it and full screen on your main monitor possibly.

All just ideas!
MasterBlaster
Posts: 2
Joined: 06 Jun 2021, 08:34

Re: Hiding an always-on-top window

09 Jun 2021, 09:14

Thanks for the suggestions! I tried hide/min as well as the shortcut, but the game still displays the window.

I'm only using one monitor (the game runs in an arcade cabinet). Is there a way to simulate a second display even if I don't physically have one?
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: Hiding an always-on-top window

09 Jun 2021, 16:58

try this

Code: Select all

WinWait, ahk_exe notepad.exe
Sleep, 250
WinMove, ahk_exe notepad.exe,, % A_ScreenWidth, 0, 0, 0
Sleep, 2000
WinMove, ahk_exe notepad.exe,, 0, 0, 500, 400
:wave: There is always more than one way to solve a problem. ;)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: lone_lynx and 31 guests