Open/close window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SimPlayer
Posts: 128
Joined: 01 Apr 2016, 05:57

Open/close window

07 Dec 2017, 12:44

Hi all,

just another stupid question;

I would like to open a window in max mode by a key press,

and

I would like to close the same window with another key press,

just can´t seem be able to do this simple thing...sorry guys :(

SimPlayer
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Open/close window

07 Dec 2017, 14:54

Do you mean like this?

Code: Select all

F1::Run, notepad.exe, , Max
F2::WinClose, ahk_exe notepad.exe
SimPlayer
Posts: 128
Joined: 01 Apr 2016, 05:57

Re: Open/close window

08 Dec 2017, 10:30

Hi, and thanks for the answer, it works!

But, that doesn´t mean that I understand it....what does the "ahk_exe mean on row two??

Then, the thing is this:

I would like to put up a "sign" like "over" the softvare im runnig, the softvare like goes in pause untill the user does something.

Notepad is not the best softvare to do this in, is it possible to have a jpg file (maybe a PrtSc) to "call on" (in this case) pressing F1,
and then close on pressing F2??
If I put the file on the desktop, how would the code look like?

thanks..
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Open/close window

08 Dec 2017, 13:39

Adding "ahk_exe" before it means "match any window belonging to the following executable." In this case, it'll close notepad.exe regardless of the title of the window (i.e. regardless of the document opened in it).

I'm not really following your second request. If you want to be able to pause and unpause the script by pressing a key, you can create a hotkey for it.
SimPlayer
Posts: 128
Joined: 01 Apr 2016, 05:57

Re: Open/close window

08 Dec 2017, 15:34

Ok, thanks
I will try to explain better,
I'm running a game, and in a certain part of the game it will pause, and the screen freezes.
At that moment an AHK script will run a jpg fullscreen info window over the game view,
and after a while the script will exit the info window (jpg picture) and the game will start running again.
It could also be a "GAME OVER" info screen, depending on the game ofcourse.

I got I working with the run command where I first run the software and secondly place the path to the jpg file. But, it was the wrong software, it should not show any menus or anything, just the jpg file.
Do You know of a light software (no editing what so ever needed) that would show jpg in fullscreen with window in Max??

thanks.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Open/close window

08 Dec 2017, 16:09

Well, you can display a splash image with AutoHotkey. I haven't used it. Look up SplashImage in the help file.
SimPlayer
Posts: 128
Joined: 01 Apr 2016, 05:57

Re: Open/close window

09 Dec 2017, 13:30

Hi again.

Thanks, works perfectly!

A simple code like this:
F1::SplashImage, C:\LFS\GameOver.jpg, b
F2::SplashImage, Off

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], mikeyww, Sarhad and 284 guests