Skip to content

Instantly share code, notes, and snippets.

@anonymous1184
anonymous1184 / TrayRefresh.ahk
Created November 14, 2021 16:30
Remove dead icons from tray
; Version: 2021.11.14.1
TrayRefresh()
{
dhw := A_DetectHiddenWindows
DetectHiddenWindows On
TrayRefresh_Clear("Shell_TrayWnd", 323)
; For hidden icons:
; TrayRefresh_Clear("NotifyIconOverflowWindow", 321)
@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 / 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 / Acc.ahk
Last active August 9, 2024 04:40
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 / Keys Discovery.ahk
Last active July 3, 2024 14:55
Virtual/Scan Codes & Key Names
; Version: 2022.07.01.1
; https://gist.github.com/da81e29517b0ba6dd552f7c6439be032
/* Virtual/Scan Codes & Key Names
Uses a keyboard hook to provide all information of a key pressed.
The idea of the Gui is from SKAN, however his script fails to detect some keys and other info
https://autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/
@anonymous1184
anonymous1184 / d.ahk
Last active January 8, 2024 14:50
Debug print helper

; Version: 2023.01.19.1
; Usage and examples: https://redd.it/pap3c1
;@Ahk2Exe-IgnoreBegin
d(Arguments*) {
static gcl := DllCall("GetCommandLine", "Str")
if (IsObject(Arguments[1])) {
out := d_Recurse(Arguments[1], 1)
} else {
@anonymous1184
anonymous1184 / Volume.ahk
Last active November 17, 2022 06:30
Volume changer + OSD

; Version: 2022.11.17.1
; Usage and examples: https://redd.it/owgn3j
Volume(Offset) {
hWnd := DllCall("FindWindowA", "AStr","NativeHWNDHost", "Ptr",0)
DetectHiddenWindows On
PostMessage 0xC028, 0x0C, 0xA0000,, % "ahk_id" hWnd
SoundSet % Format("{:+d}", Offset)
}
@anonymous1184
anonymous1184 / Brightness.ahk
Last active May 15, 2024 13:57
Brightness changer + OSD

; Version: 2022.11.17.1
; Usage and examples: https://redd.it/owgn3j
Brightness(Offset) {
static last := ""
wmi := ComObjGet("winmgmts:\\.\root\WMI")
if (last = "") {
last := wmi.ExecQuery("SELECT * FROM WmiMonitorBrightness")
.ItemIndex(0)
@anonymous1184
anonymous1184 / README.md
Last active January 3, 2025 18:24
Spotify Keys (APP)
@anonymous1184
anonymous1184 / README.md
Last active November 11, 2022 13:39
Spotify Keys (API)