Skip to content

Instantly share code, notes, and snippets.

@jimpea
jimpea / lambdas.txt
Last active May 4, 2024 07:46
Some usefull Excel Lambda functions
/*
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
@Uberi
Uberi / Speech Recognition.ahk
Created August 18, 2013 20:29
Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts. Inspired by some [prototype code](http://www.autohotkey.com/board/topic/24490-voice-recognition-com/) made a long time ago.
#NoEnv
#Warn All
#Warn LocalSameAsGlobal, Off
#Persistent
/*
Speech Recognition
==================
A class providing access to Microsoft's SAPI. Requires the SAPI SDK.
@anonymous1184
anonymous1184 / GetUrl.ahk
Last active April 15, 2024 23:24
GetUrl()
#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)
@anonymous1184
anonymous1184 / README.md
Last active January 19, 2024 04:58
WinHttpRequest.ahk

WinHttpRequest Wrapper

Usage and information: https://redd.it/mcjj4s

AutoHotkey v2.0

  • [WinHttpRequest.ahk]

AutoHotkey v1.1


; 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!")
@anonymous1184
anonymous1184 / Acc.ahk
Last active January 8, 2024 14:50
Acc.ahk
#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")
}
@anonymous1184
anonymous1184 / Message.ahk
Last active January 8, 2024 14:49
WM_COPYDATA Messaging

; 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
@anonymous1184
anonymous1184 / Alert.ahk
Last active January 8, 2024 14:49
MsgBox customization

; 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 := ""
}
@anonymous1184
anonymous1184 / UI Access.md
Last active December 29, 2023 20:14
Run scripts with UI Access (UIA)

UI Access (UIA)

What's UI Access?

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.

Why would I want UIA?

@jjeffery
jjeffery / ComWithoutRegistering.cs
Created January 6, 2012 02:25
COM without registering
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);