Need help with clicking through Firewall screen

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LeroyJenkins608
Posts: 7
Joined: 01 Apr 2019, 08:45

Need help with clicking through Firewall screen

01 Apr 2019, 08:54

Hello
I'm a n00b to AutoHotKey, and I see it's usefulness in automating software installations to make them silent.

I'm trying to have an AHC script that clicks through this Firewall window. I've tried a number of combinations but with no luck. Ultimately, I just need the script to simulate clicking 'Allow Access' on the Windows Security Alert screen.

I'm getting stuck on ControlClick (I think its the best command for this job?). I don't see it ever sending any clicks to the window.

Here is my script:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#NoTrayIcon
;#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#Persistent
SetControlDelay, -1

WinWaitActive Windows Security Alert ahk_class #32770 ahk_exe rundll32.exe
if ErrorLevel
{
	MsgBox, Timed out.
	return
}
else
	Send !a
	ControlClick, &Allow access, Windows Security Alert,,,, NA
Here is Window Spy along with the window I'm trying to click through.
Image Broken Link for safety
Imgur: https imgur.com /a/26OkdLN
Can anyone offer some suggestions as to what I might be doing wrong to click 'Allow access' on this window?
Last edited by LeroyJenkins608 on 01 Apr 2019, 09:17, edited 1 time in total.
User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: Need help with clicking through Firewall screen

01 Apr 2019, 09:14

Are you able to obtain a handle for the control when the window exists?

Code: Select all

ControlGet, hWnd, hWnd, , &Allow Access, Windows Security Alert
MsgBox %	hWnd
LeroyJenkins608
Posts: 7
Joined: 01 Apr 2019, 08:45

Re: Need help with clicking through Firewall screen

01 Apr 2019, 09:16

I am not. the MsgBox comes back blank
User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: Need help with clicking through Firewall screen

01 Apr 2019, 09:21

If you run WinGet while the window is open, does it produce the control list?

Code: Select all

WinGet, cList, ControlList, Windows Security Alert
MsgBox %	cList
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Need help with clicking through Firewall screen

01 Apr 2019, 10:29

I don't think windows will let you issue synthetic input while at a security type screen.
If you wish to issue non-synthetic input, you could use AutoHotInterception (see link in sig).
AHI *can* move the mouse, but only via "Raw" signals - there is no such thing as MouseMove (To specific on-screen coordinates) in AHI
LeroyJenkins608
Posts: 7
Joined: 01 Apr 2019, 08:45

Re: Need help with clicking through Firewall screen

01 Apr 2019, 12:54

sinkfaze wrote:
01 Apr 2019, 09:21
If you run WinGet while the window is open, does it produce the control list?

Code: Select all

WinGet, cList, ControlList, Windows Security Alert
MsgBox %	cList
I believe it does. When I ran your code, I got a window with a listing of 24 different entries:
Static1
Static2
Static3
Static4
Edit1
Static5
Edit2
Static6
Edit3
Static7
Edit4
Static8
Static9
Button1
Button2
Static10
Button3
Button4
Button5
SysLink1
Static11
Button6
Button7
User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: Need help with clicking through Firewall screen

01 Apr 2019, 14:24

Do you know the actual name of the button from that list?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], peter_ahk and 368 guests