Using Delete key to end process in Chrome Task Manager Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
iamMG
Posts: 28
Joined: 12 Nov 2017, 11:32

Using Delete key to end process in Chrome Task Manager

24 Mar 2019, 05:25

Hi everyone. I want to use the Delete key to end a process in the Task Manager in Chrome. Both, the Task Manager and normal Google Chrome windows, have the same ahk_class (Chrome_WidgetWin_1),ahk_exe (chrome.exe) and ahk_pid (12080). So to differentiate between them I made use of WinTitle.

Here is a screenshot: https i.imgur.com /xxi6fcU.png Broken Link for safety
This is the script I made to accomplish this:

Code: Select all

if WinActive(Task Manager - Google Chrome)	; Chrome Task Manager
	Del::
		Send {Tab}
		Send {Enter}
		Send {Tab}
		return
However, the code gets executed even when I press Delete key in normal Google Chrome windows. Am I missing something? Please help.
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Using Delete key to end process in Chrome Task Manager

24 Mar 2019, 06:49

You need the #

Code: Select all

#if WinActive... ; start of #if block
Del::
.
.
.
.
#if ; End of #if block
Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Using Delete key to end process in Chrome Task Manager  Topic is solved

24 Mar 2019, 07:45

I assume, Task Manager - Google Chrome is meant as a literal string - you will have to wrap it into quotation marks in an expression.

Code: Select all

#If WinActive("Task Manager - Google Chrome")	; Chrome Task Manager
Or, use #IfWinActive instead.
iamMG
Posts: 28
Joined: 12 Nov 2017, 11:32

Re: Using Delete key to end process in Chrome Task Manager

24 Mar 2019, 13:22

Scr1pter wrote:
24 Mar 2019, 06:49
You need the #
Thanks but this did not work. Sorry.
gregster wrote:
24 Mar 2019, 07:45
I assume, Task Manager - Google Chrome is meant as a literal string - you will have to wrap it into quotation marks in an expression.
This worked. Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], JensHaglof, MrHue, tabr3 and 104 guests