WFC does not provide built-in keyboard shortcuts for customizing rules in the Notification Dialogue, so I have spent many hours trying and failing to explicitly control WFC dialogue boxes via AHK. The current inelegant solution is to use {Tab xx} and {Space} a lot. The script must also be run as an Administrator.
The Notification Dialogue below appears automatically when an application tries to make an outbound connection, where no firewall rule exists to allow the connection:
AHK Window Spy only shows the following, regardless of cursor position within the dialogue:
Here is an example of the simplest code I have tried:
Code: Select all
#NoEnv
#InstallKeybdHook
#InstallMouseHook
#MaxThreadsPerHotkey 1
#MaxThreadsBuffer Off
#KeyHistory 1000
#MaxHotKeysPerInterval 200
SetTitleMatchMode 2
SetTitleMatchMode Slow
SendMode Input
DetectHiddenWindows, On
#IfWinExist,Outgoing connection blocked ahk_exe wfc.exe
^#a::
WinActivate,Outgoing connection blocked ahk_exe wfc.exe
WinWaitActive,Outgoing connection blocked ahk_exe wfc.exe
ControlClick,Customize this rule before creating it,Outgoing connection blocked
ControlClick,x117 y200,Outgoing connection blocked
Click,117 230 ; This will interact with the dialogue, but obviously not a good solution to interrupt the mouse position.
Return
#IfWinExist
Code: Select all
How found: Mouse move (2850,808)
hwnd=0x0000000000031A0E 64bit class="HwndWrapper[wfc.exe;;c8f19e49-76ba-475c-9eb9-63f6d605095b]" style=0x16CC0000 ex=0x108
Name: "Customize this rule before creating it"
ControlType: UIA_ButtonControlTypeId (0xC350)
LocalizedControlType: "button"
BoundingRectangle: {l:2634 t:797 r:2900 b:817}
IsEnabled: true
IsOffscreen: false
IsKeyboardFocusable: true
HasKeyboardFocus: true
AcceleratorKey: ""
AccessKey: ""
ProcessId: 17128
RuntimeId: [7.42E8.1D62D32]
AutomationId: ""
FrameworkId: "WPF"
ClassName: "Button"
IsControlElement: true
IsContentElement: true
ProviderDescription: "[pid:17128,providerId:0x0 Main(parent link):Unidentified Provider (managed:MS.Internal.Automation.ElementProxy, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)]"
IsPassword: false
ItemStatus: ""
ItemType: ""
IsRequiredForForm: false
HelpText: ""
ClickablePoint: {x:2767 y:807}
Orientation: 0
LegacyIAccessible.ChildId: 0
LegacyIAccessible.DefaultAction: "Press"
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: "Customize this rule before creating it"
LegacyIAccessible.Role: push button (0x2B)
LegacyIAccessible.State: focused,focusable (0x100004)
LegacyIAccessible.Value: ""
IsAnnotationPatternAvailable: false
IsDragPatternAvailable: false
IsDockPatternAvailable: false
IsDropTargetPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: true
IsItemContainerPatternAvailable: false
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsObjectModelPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollItemPatternAvailable: false
IsScrollPatternAvailable: false
IsSelectionItemPatternAvailable: false
IsSelectionPatternAvailable: false
IsSpreadsheetItemPatternAvailable: false
IsSpreadsheetPatternAvailable: false
IsStylesPatternAvailable: false
IsSynchronizedInputPatternAvailable: true
IsTableItemPatternAvailable: false
IsTablePatternAvailable: false
IsTextChildPatternAvailable: false
IsTextEditPatternAvailable: false
IsTextPatternAvailable: false
IsTextPattern2Available: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsTransform2PatternAvailable: false
IsValuePatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsWindowPatternAvailable: false
IsCustomNavigationPatternAvailable: false
FirstChild: "Customize this rule before creating it" text
LastChild: "Customize this rule before creating it" text
Next: "" button
Previous: "Public" check box
Other Props: Object has no additional properties
Children: "Customize this rule before creating it" text
Ancestors: "Outgoing connection blocked - 14:30:07" window
"Desktop 1" pane
[ No Parent ]
Thank you very much in advance.