Simple question about WinClose Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Simple question about WinClose

04 Aug 2023, 14:07

Or any other commands using the same parameters.

Hello there, a long time autohotkey user here never had to ask for help because of internet :) Now I have my first question and don't find the answer. I posted in v2 but I think it's related to v1 and 2.

I use the command WinClose, ahk_class xxx ahk_exe xxx to close a specific window. Now I just saw another window getting closed because parameters are the same.

Is there any way to combine ahk_class ahk_exe and window title to only close that one window? Or would it be the only way to use window title without ahk_class ahk_exe?

Thank you all, autohotkey is awesome :)
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Re: Simple question about WinClose

05 Aug 2023, 04:49

mikeyww wrote:
05 Aug 2023, 03:29
Hello,

Answer provided for you here: https://www.autohotkey.com/docs/v2/misc/WinTitle.htm#multi
I exactly did this without reading

Code: Select all

WinWait "My File.txt ahk_class Notepad"
In my case:

Code: Select all

WinClose, "Gesponserte Sitzung ahk_class #32770"
I also tried:

Code: Select all

WinClose, "Gesponserte Sitzung ahk_class #32770 ahk_exe TeamViewer.exe"
Maybe WinClose really does not work this way :?:
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Re: Simple question about WinClose  Topic is solved

05 Aug 2023, 04:57

Okay this seems a v1 - v2 issue difference. I just fixed the script to be completely v2 and now it works fine

Code: Select all

WinClose "Gesponserte Sitzung ahk_class #32770 ahk_exe TeamViewer.exe"
Edit: I don't really get it, just tried v1 again and also works now. But I tried exactly this line already. Whatever

Code: Select all

WinClose Gesponserte Sitzung ahk_class #32770 ahk_exe TeamViewer.exe

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Shikoweno, songdg and 39 guests