How to Automatically close a specific window when windows starts? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
yfjuu6
Posts: 124
Joined: 28 Apr 2023, 15:28

How to Automatically close a specific window when windows starts?

Post by yfjuu6 » 05 Jun 2023, 10:09

Hy, I'am a newbie in autohotkey.
I have a specific program that I made It start automatically when Windows starts, and this program works by default in the system tray icon.
The program is :
The window title : LilySpeech Settings
The process name : ahk_exe LilySpeech64-1.exe
The problem is :
When the program starts automatically when Windows starts, it works by default in the system icon, but the window of the program appears and It stills appear on the screen Every time I start Windows.
- I want the window of the program to be closed automatically and only every time I start Windows, knowing that if I close the program window the program continues to work in the system tray icon and this is what I want.
- I'm looking for an AHK script to do that.
- Note : I'm using AHK V1.1.36.02.
- I've tried this but didn't work:

Code: Select all

Loop {

WinWaitActive ahk_exe LilySpeech64-1.exe

WinClose ahk_exe LilySpeech64-1.exe
}
- Please help! I appreciate your time and effort. Thanks in advance.

User avatar
mikeyww
Posts: 27124
Joined: 09 Sep 2014, 18:38

Re: How to Automatically close a specific window when windows starts?  Topic is solved

Post by mikeyww » 05 Jun 2023, 11:01

Could try:

Code: Select all

#Requires AutoHotkey v1.1.33
#SingleInstance
winTitle := "LilySpeech Settings ahk_exe LilySpeech64-1.exe"
WinWait % winTitle
WinClose
SoundBeep 1500
ExitApp
This script would also run at startup. If the script remains running while your other window is visible, then use Window Spy to check the WinTitle information for that window.

User avatar
yfjuu6
Posts: 124
Joined: 28 Apr 2023, 15:28

Re: How to Automatically close a specific window when windows starts?

Post by yfjuu6 » 05 Jun 2023, 11:26

mikeyww wrote:
05 Jun 2023, 11:01
Could try:

Code: Select all

#Requires AutoHotkey v1.1.33
#SingleInstance
winTitle := "LilySpeech Settings ahk_exe LilySpeech64-1.exe"
WinWait % winTitle
WinClose
SoundBeep 1500
ExitApp
This script would also run at startup. If the script remains running while your other window is visible, then use Window Spy to check the WinTitle information for that window.
It worked, that's exactly what I was looking for, Thanks. :-P

Post Reply

Return to “Ask for Help (v1)”