Usage and information: https://redd.it/mcjj4s
- [WinHttpRequest.ahk]
/* | |
Append two ranges horizontally. | |
Inputs: | |
- range1: the first range | |
- range2: the second range | |
- default: the value entered into missing rows. | |
Return: The merged ranges, with empty rows filled with the default value. Missing | |
value within either of the two ranges filled with zeros (0). The number of rows |
#NoEnv | |
#Warn All | |
#Warn LocalSameAsGlobal, Off | |
#Persistent | |
/* | |
Speech Recognition | |
================== | |
A class providing access to Microsoft's SAPI. Requires the SAPI SDK. |
#Requires AutoHotkey v2.0 | |
; Version: 2023.10.05.1 | |
; https://gist.github.com/7cce378c9dfdaf733cb3ca6df345b140 | |
GetUrl() { ; Active Window Only | |
static S_OK := 0, TreeScope_Descendants := 4, UIA_ControlTypePropertyId := 30003, UIA_DocumentControlTypeId := 50030, UIA_EditControlTypeId := 50004, UIA_ValueValuePropertyId := 30045 | |
hWnd := WinGetID("A") | |
IUIAutomation := ComObject("{FF48DBA4-60EF-4201-AA87-54103EEF594E}", "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}") | |
eRoot := ComValue(13, 0) |
Usage and information: https://redd.it/mcjj4s
| |
; Version: 2022.06.30.1 | |
; https://gist.github.com/49a60fb49402c2ebd4d9bc6db03813a1 | |
/* ;region Example | |
now := A_Now | |
junction := A_Desktop "\Junction." now | |
directory := A_Desktop "\Directory." now | |
FileCreateDir % directory | |
FileOpen(directory "\test.txt", 0x1).Write("Hello World!") |
#Requires AutoHotkey v2.0 | |
; Version: 2023.09.22.1 | |
; https://gist.github.com/58d2b141be2608a2f7d03a982e552a71 | |
; Private | |
Acc_Init(Function) { | |
static hModule := DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr") | |
return DllCall("GetProcAddress", "Ptr", hModule, "AStr", Function, "Ptr") | |
} |
| |
; Version: 2023.05.17.1 | |
; https://gist.github.com/cd70e009792fc2eb866f9f5caf1e395a | |
/* | |
Message.Listen(Callback) ; Listen | |
Message.Listen() ; Stop listening | |
Message.Send(Message, Target[, Timeout := 7000ms]) | |
ErrorLevel | |
-1 = Target not found |
| |
; Version: 2022.07.01.1 | |
; Usages and examples: https://redd.it/qplxwo | |
Alert(Options := 0, Title := "", Message := "", Spec := "") | |
{ | |
if !(Options ~= "i)^(0x)?\d+") { | |
Message := Options | |
Options := Title := Spec := "" | |
} |
UIA is the way around UIPI ([User Interface Privilege Isolation][1]) which in simple terms is a way of bypassing the security built into Windows to avoid applications interacting with other applications that have a higher integrity level (security).
In other words, when you run a script it cannot communicate with the system or elevated (running as Administrator) processes; this is to avoid insecure and non-sanctioned interactions.
using System; | |
using System.ComponentModel; | |
using System.Runtime.InteropServices; | |
namespace ComWithoutRegisteringExample | |
{ | |
internal static class ComHelper | |
{ | |
private delegate int DllGetClassObject(ref Guid clsid, ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out IClassFactory classFactory); |