[ahk] more mac-like keybindings for windows

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

GroupAdd, ChomeShortcuts, ahk_exe chrome.exe
GroupAdd, TermShortcuts, ahk_exe WindowsTerminal.exe

#IfWinActive ahk_group ChomeShortcuts
!t::
Send, {Ctrl down}t{Ctrl up}
return
!f::
Send, {Ctrl down}f{Ctrl up}
return
#IfWinActive

#IfWinActive ahk_group TermShortcuts
!t::
Send, {Ctrl down}{Shift down}t{Ctrl up}{Shift up}
return
!c::
Send, {Ctrl down}{Shift down}c{Ctrl up}{Shift up}
return
!v::
Send, {Ctrl down}{Shift down}v{Ctrl up}{Shift up}
return
#IfWinActive

!c::
Send, {Ctrl down}c{Ctrl up}
return

!v::
Send, {Ctrl down}v{Ctrl up}
return

!z::
Send, {Ctrl down}z{Ctrl up}
return

!w::
Send, {Ctrl down}w{Ctrl up}
return

!q::
Send, {Alt down}{F4}{Alt up}
return

!+]::
Send, {Ctrl down}{Tab}{Ctrl up}
return

!+[::
Send, {Ctrl down}{Shift down}{Tab}{Ctrl up}{Shift up}
return

Alt & Space::
KeyWait Alt
KeyWait Space
Send, {LWin down}{LWin up}
return

CapsLock::LCtrl
CapsLock Up::
SendInput, {LCtrl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Escape}
}
Else
return
return

Enter::RCtrl
Enter Up::
SendInput, {RCtrl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Enter}
}
Else
return
return

F1::
if WinActive("ahk_class CabinetWClass") {
    WinMinimize, ahk_class CabinetWClass
} else {
    WinActivate, ahk_class CabinetWClass
}
return

F3::
if WinActive("ahk_exe chrome.exe") {
    WinMinimize, ahk_exe chrome.exe
} else {
    WinActivate, ahk_exe chrome.exe
}
return

F4::
if WinActive("ahk_exe WindowsTerminal.exe") {
    WinMinimize, ahk_exe WindowsTerminal.exe
} else {
    WinActivate, ahk_exe WindowsTerminal.exe
}
return

F12::
if WinActive("ahk_exe emacs.exe") {
    WinMinimize, ahk_exe emacs.exe
} else {
    WinActivate, ahk_exe emacs.exe
}
return

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

GroupAdd, ChomeShortcuts, ahk_exe chrome.exe

#IfWinActive ahk_group ChomeShortcuts
!t::
Send, {Ctrl down}t{Ctrl up}
#IfWinActive

!c::
Send, {Ctrl down}c{Ctrl up}
return

!v::
Send, {Ctrl down}v{Ctrl up}
return

!z::
Send, {Ctrl down}z{Ctrl up}
return

!w::
Send, {Ctrl down}w{Ctrl up}
return

CapsLock::LCtrl
Capslock Up::
SendInput, {LControl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Escape}
}
Else
return
return

Enter::RCtrl
Enter Up::
SendInput, {RControl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Enter}
}
Else
return
return

F1::
if WinActive("ahk_class CabinetWClass") {
    WinMinimize, ahk_class CabinetWClass
} else {
    WinActivate, ahk_class CabinetWClass
}
return

F3::
if WinActive("ahk_exe chrome.exe") {
    WinMinimize, ahk_exe chrome.exe
} else {
    WinActivate, ahk_exe chrome.exe
}
return

F4::
if WinActive("ahk_exe WindowsTerminal.exe") {
    WinMinimize, ahk_exe WindowsTerminal.exe
} else {
    WinActivate, ahk_exe WindowsTerminal.exe
}
return

F12::
if WinActive("ahk_exe emacs.exe") {
    WinMinimize, ahk_exe emacs.exe
} else {
    WinActivate, ahk_exe emacs.exe
}
return


ahk: add Alt + h/j/k/l to arrows

ahk: add Alt + h/j/k/l to arrows

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mccgit/dotfiles.git/'


Create MousePos.ahk

Create MousePos.ahk

; Shows Mouse-Coordinates upon pressing Alt+x
!x::
MouseGetPos, xpos, ypos
Msgbox, The cursor is at X%xpos% Y%ypos%.
return

error: pathspec 'Parent2Gem/MousePos.ahk' did not match any file(s) known to git


Create LedKeyboardShortcuts.ahk

Create LedKeyboardShortcuts.ahk

Initial commit

#NoEnv
#SingleInstance force ; only lets one run
SetBatchLines, -1

socket := new Example("ws://192.168.1.33:81") ; replace with the ip address of the mclighting controller

incrementAmount := 10 ; how finely you adjust the color, speed, and brightness per keypress
maxColor := 255
maxMode := 56 ; the maximum mode id number

red := 127
green := 127
blue := 127

brightness := 127
speed := 127
mode := 1

^#Numpad4:: ; switch modes down
	mode := mode - 1
	if(mode < 0)
		mode := maxMode
	cmd = /%mode% ; / is the set effect mode command
	TrayTip, , Mode: %mode%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#Numpad6:: ; switch modes up
	mode := mode + 1
	if(mode > maxMode)
		mode := 0
	TrayTip, , Mode: %mode%
	cmd = /%mode%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#Numpad5:: ; turn off
	TrayTip, , Leds are off
	socket.Send("=off") ; = is the set control command
	return

^#Numpad0:: ; turn on to static color
	TrayTip, , Leds are on
	cmd := "*"+toHexColor(red,green,blue) ; * is the set all command
	socket.Send(cmd) ; = is the set control command
	return

^#NumpadSub:: ; decreases brightness
	brightness := brightness - incrementAmount
	if(brightness < 0)
		brightness := 0
	cmd = `%%brightness% ;  % is the set brightness mode command. ` is the escape character
	TrayTip, , Brightness: %brightness%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#NumpadAdd:: ; increases brightness
	brightness := brightness + incrementAmount
	if(brightness > maxColor)
		brightness := maxColor
	cmd = `%%brightness% ; % is the set brightness mode command
	TrayTip, , Brightness: %brightness%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#NumpadDiv:: ; decreases speed
	speed := speed - incrementAmount
	if(speed < 0)
		speed := 0
	cmd = ?%speed% ;  ? is the set brightness mode command
	TrayTip, , Speed: %speed%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#NumpadMult:: ; increases speed
	speed := speed + incrementAmount
	if(speed > maxColor)
		speed := maxColor
	cmd = ?%speed% ;  ? is the set brightness mode command
	TrayTip, , Speed: %speed%
	socket.Send(cmd)
	; MsgBox %cmd%
	return

^#Numpad7:: ; increase red amount
	red := red + incrementAmount
	if(red > maxColor)
		red := maxColor

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Red: %red%
	socket.Send(cmd)

	return

^#Numpad1:: ; decrease red amount
	red := red - incrementAmount
	if(red < 0)
		red := 0

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Red: %red%
	socket.Send(cmd)

	return

^#Numpad8:: ; increase green amount
	green := green + incrementAmount
	if(green > maxColor)
		green := maxColor

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Green: %green%
	socket.Send(cmd)

	return

^#Numpad2:: ; decrease green amount
	green := green - incrementAmount
	if(green < 0)
		green := 0

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Green: %green%
	socket.Send(cmd)

	return

^#Numpad9:: ; increase blue amount
	blue := blue + incrementAmount
	if(blue > maxColor)
		blue := maxColor

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Blue: %blue%
	socket.Send(cmd)

	return

^#Numpad3:: ; decrease blue amount
	blue := blue - incrementAmount
	if(blue < 0)
		blue := 0

	cmd := "#"+toHexColor(red,green,blue) ; # is the set main color command
	; MsgBox %cmd%
	TrayTip, , Blue: %blue%
	socket.Send(cmd)

	return

toHexColor(r, g, b)
{
	SetFormat, IntegerFast, hex ; To print values as hexadecimal
	colorNum := r*65536 + g*256 + b
	color = 000000%colorNum% ; convert to string and add preceeding zeros
	color := StrReplace(color, "0x") ; replace the 0x from the middle
	color := SubStr( color, -5 ) ; get last 6 characters

	SetFormat, IntegerFast, dec ; sets the print mode back to decimal
	return ""+color ;
}

class Example extends WebSocket
{
	OnOpen(Event)
	{
		TrayTip, ,Connection established to led controller!
		; InputBox, Data, WebSocket, Enter some text to send through the websocket.
		; this.Send(Data)
	}

	OnMessage(Event)
	{
		; MsgBox, % "Received Data: " Event.data
		; this.Close()
	}

	OnClose(Event)
	{
		TrayTip, , Websocket Closed
		this.Disconnect()
	}

	OnError(Event)
	{
		TrayTip, , Websocket Error
	}

	__Delete()
	{
		TrayTip, , Exiting
		ExitApp
	}
}

class WebSocket
{
	__New(WS_URL)
	{
		static wb

		; Create an IE instance
		Gui, +hWndhOld
		Gui, New, +hWndhWnd
		this.hWnd := hWnd
		Gui, Add, ActiveX, vWB, Shell.Explorer
		Gui, %hOld%: Default

		; Write an appropriate document
		WB.Navigate("about:<!DOCTYPE html><meta http-equiv='X-UA-Compatible'"
		. "content='IE=edge'><body></body>")
		while (WB.ReadyState < 4)
			sleep, 50
		this.document := WB.document

		; Add our handlers to the JavaScript namespace
		this.document.parentWindow.ahk_savews := this._SaveWS.Bind(this)
		this.document.parentWindow.ahk_event := this._Event.Bind(this)
		this.document.parentWindow.ahk_ws_url := WS_URL

		; Add some JavaScript to the page to open a socket
		Script := this.document.createElement("script")
		Script.text := "ws = new WebSocket(ahk_ws_url);`n"
		. "ws.onopen = function(event){ ahk_event('Open', event); };`n"
		. "ws.onclose = function(event){ ahk_event('Close', event); };`n"
		. "ws.onerror = function(event){ ahk_event('Error', event); };`n"
		. "ws.onmessage = function(event){ ahk_event('Message', event); };"
		this.document.body.appendChild(Script)
	}

	; Called by the JS in response to WS events
	_Event(EventName, Event)
	{
		this["On" EventName](Event)
	}

	; Sends data through the WebSocket
	Send(Data)
	{
		; MsgBox %Data%
		this.document.parentWindow.ws.send(Data)
	}

	; Closes the WebSocket connection
	Close(Code:=1000, Reason:="")
	{
		this.document.parentWindow.ws.close(Code, Reason)
	}

	; Closes and deletes the WebSocket, removing
	; references so the class can be garbage collected
	Disconnect()
	{
		if this.hWnd
		{
			this.Close()
			Gui, % this.hWnd ": Destroy"
			this.hWnd := False
		}
	}
}

error: pathspec 'clients/AutoHotKey/LedKeyboardShortcuts.ahk' did not match any file(s) known to git


input shift hot key on win10

input shift hot key on win10


Create automute.ahk

Create automute.ahk

# coded by Jahângir (me [at] jahangir [dat] ninja)
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
; #Warn  ; Enable warnings to assist with detecting common errors.
#NoTrayIcon
#InstallKeybdHook
#InstallMouseHook
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#Include %A_ScriptDir%
;~ #Include routines.ahk
#Include VA21/va.ahk

;~ IniRead, tt, %a_scriptdir%/../autohotkey.ini, Timers, automute
;~ tt *= 1000
tt := 30 * 60 * 1000 ; half an hour

activated := false

SetTimer, AutoMute, 1000
return

is_mpc_playing()
{
	if (winexist("ahk_exe mpc-hc64.exe"))
	{
		WinGetText, txt, ahk_exe mpc-hc64.exe
		if (instr(txt, "Playing"))
			return True
	}
	return false
}

all_conditions_meet()
{
	return !is_mpc_playing()
}

AutoMute:
{
if  (activated)
{
	if (A_TimeIdlePhysical  < tt)
	{
		activated := false
		SendInput, {Volume_Mute}
	}
}
else if (A_TimeIdlePhysical  >= tt)
{
	if (!VA_GetMasterMute() && all_conditions_meet())
	{
		activated := true
		SendInput, {Volume_Mute}
	}
}
return
}

error: pathspec 'automute.ahk' did not match any file(s) known to git


Removed hard check for C:/Python27

Removed hard check for C:/Python27

error: pathspec 'Install' did not match any file(s) known to git
error: pathspec 'Dependencies.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

#NoEnv
SetTitleMatchMode, 1  ;matches if title begins with string
DetectHiddenText, off
DetectHiddenWindows, off
WinWait, KC Softwares, Navigation Bar, 30
WinActivate
Send, ^w
ExitApp

error: pathspec 'automatic/_output/sumo/4.1.8.289/tools/sumoInstall.ahk' did not match any file(s) known to git


Lastest of all files

Lastest of all files

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec 'Revised.ahk' did not match any file(s) known to git


Updated on 2015-10-11: qttabbar

Updated on 2015-10-11: qttabbar

; default environment
DetectHiddenWindows, off
SetControlDelay, 20

; modified environment
#NoEnv
#NoTrayIcon
DetectHiddenText, off
SetTitleMatchMode, 2

; variables
winTitleIE = - Internet Explorer ahk_class IEFrame ahk_exe iexplore.exe
winTitleAddons = Manage Add-ons ahk_class #32770 ahk_exe iexplore.exe
winTitleEnable = Enable add-on ahk_class #32770 ahk_exe iexplore.exe

Process, Exist, iexplore.exe
if !ErrorLevel = 0 {
  procExists = 1
  WinActivate,%winTitleIE%
} else {
  procExists = 0
  Run, iexplore, , , pid
;  WinWait, ahk_pid %pid%, Address Bar, 60  ;too quick
;  WinActivate, ahk_pid %pid%, , 10
  WinWait, %winTitleIE%, , 60
  WinActivate, %winTitleIE%, , 60
  Send {ALT Down}x{ALT Up}m
  Sleep 250
}

Send {TAB 2}QTTabBar{ALT Down}e{ALT Up}
Sleep 1000

IfWinActive, %winTitleEnable%
{
  Send {ENTER}
  Send {ALT Down}l{ALT Up}
  CloseIE()
  sleep 10000
  Return
}
IfWinActive, %winTitleAddons%
{
  Send {ALT Down}l{ALT Up}
  CloseIE()
}

CloseIE()
{
  if procExists = 1
  {
    WinActivate,%winTitleIE%,
    Send, ^w
  }
  else
  {
    WinClose, ahk_exe iexplore.exe
  }
}

; File Explorer
Run, explorer
WinWait, ahk_exe explorer.exe, , 60
WinActivate, ahk_exe explorer.exe
Sleep 500
SetKeyDelay 50
Send {ALT}
Send {V}
Send {Y}
Send {DOWN 2}
Send {SPACE}
Send {ALT down}{F4}

error: pathspec 'automatic/_output/qttabbar/1031.0/tools/chocolateyInstall.ahk' did not match any file(s) known to git


add AutoHotkey solution

add AutoHotkey solution

; Install AutoHotkey from https://autohotkey.com/download/

~LWin Up::
{
	Send {Ctrl}
	sleep 50
	Send {Ctrl}
}

error: pathspec 'auto_hot_key_solution.ahk' did not match any file(s) known to git


Update toolkits.ahk

Update toolkits.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mingone/efficiently.git/'


Initial commit.

Initial commit.

; ahk_class PotPlayer

#o::Send,{Media_Play_Pause}


Update Rewrite of 1.4.ahk

Update Rewrite of 1.4.ahk

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec '1.4.ahk' did not match any file(s) known to git


Adding AutoHotKey file for adding dates and times with Ctrl+z or Ctrl+Shift+z.

#z::
FormatTime, CurrentDateTime,, yyyy-MM-dd
SendInput %CurrentDateTime%
return

#+z::
FormatTime, CurrentDateTime,, HH:mm
SendInput %CurrentDateTime%
return

error: pathspec 'Windows/NKO.ahk' did not match any file(s) known to git


Create sitebuild.ahk

Create sitebuild.ahk

Keyboard macros for AutoHotKey for Windows. Useful abbrevations for HTML-CSS-JavaScript development

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Cooty/macros.git/'


Updated on 2015-04-10: github

Updated on 2015-04-10: github

; default environment
DetectHiddenWindows, off
SetControlDelay, 20
SetKeyDelay, 10

; modified environment
#NoEnv
#NoTrayIcon
DetectHiddenText, off
SetTitleMatchMode, RegEx

WinWait, Application Install - Security Warning, Do you want to install this application, 10
WinActivate
ControlClick, &Install, Application Install - Security Warning

; Download progress window is spawned by Microsoft ClickOnce
; If you know how to silence this window, please send a message to maintainer:
;   https://chocolatey.org/packages/GitHub/ContactOwners
WinWait, Installing GitHub, This may take several minutes, 2
WinActivate
WinMinimize, Installing GitHub, This may take several minutes

; 45MB file, wait max of 20 minutes (1 Mbps bandwidth ~= 6 minutes to download)
; Upon completion of download, files are extracted to:
;   $Env:LocalAppData\Apps\2.0\varSysUniq01\varSysUniq02\
; Installer blocked due to being marked a downloaded file:
;   gith..tion_317444273a93ac29_0002.000d_7c798cfff9a06ed4\GitHub.exe
WinWait, Open File - Security Warning ahk_class #32770, , 1200
WinActivate
Send {Tab 4}
Sleep 250
ControlSend, , {Enter}, Open File - Security Warning ahk_class #32770

; GitHub is launched automatically post-install, close it
WinWait, GitHub ahk_class HwndWrapper\[DefaultDomain, , 60
WinActivate
WinClose, GitHub ahk_class HwndWrapper\[DefaultDomain

ExitApp

error: pathspec 'automatic/_output/github/3.0.7.1/tools/githubInstall.ahk' did not match any file(s) known to git


update to 0.9.6.1

update to 0.9.6.1

error: pathspec 'Warlock' did not match any file(s) known to git
error: pathspec 'Bot.ahk' did not match any file(s) known to git


Updated on 2015-05-24: adwcleaner

Updated on 2015-05-24: adwcleaner

#NoEnv
SetTitleMatchMode, RegEx
DetectHiddenText, off
DetectHiddenWindows, off

loop,
{
  Sleep, 250
  IfWinExist, Outdated version, Cancel
  {
    WinActivate
    ControlClick, Button2, Outdated version, Cancel
  }
  IfWinExist, AdwCleaner - Terms of use, I agree
  {
    WinActivate
    ControlClick, Button1, AdwCleaner - Terms of use, I agree,
  }
  IfWinExist, AdwCleaner - v, Scan
  {
    WinClose, AdwCleaner - v, Scan
    ExitApp
  }
}

error: pathspec 'automatic/_output/adwcleaner/5.016/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

error: pathspec 'automatic/_output/sumo/4.1.6.287/tools/sumoInstall.ahk' did not match any file(s) known to git


Delete config window.ahk

Delete config window.ahk

error: pathspec '1.4/config' did not match any file(s) known to git
error: pathspec 'window.ahk' did not match any file(s) known to git


update check time

update check time


Updated on 2015-05-24: adwcleaner

Updated on 2015-05-24: adwcleaner

error: pathspec 'automatic/_output/adwcleaner/5.015/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Create IMG_OCR.ahk

Create IMG_OCR.ahk


Updated on 2015-10-11: qttabbar

Updated on 2015-10-11: qttabbar

error: pathspec 'automatic/_output/qttabbar/1035.0/tools/chocolateyInstall.ahk' did not match any file(s) known to git


update

update

error: unable to create symlink vim.ahk: File name too long


Create 7. Dial Plan Page -One Area Code.ahk

templates/autohotkey_scripts/7. Dial Plan Page -One Area Code.ahk

error: pathspec 'templates/autohotkey_scripts/7.' did not match any file(s) known to git
error: pathspec 'Dial' did not match any file(s) known to git
error: pathspec 'Plan' did not match any file(s) known to git
error: pathspec 'Page' did not match any file(s) known to git
error: pathspec '-One' did not match any file(s) known to git
error: pathspec 'Area' did not match any file(s) known to git
error: pathspec 'Code.ahk' did not match any file(s) known to git


Updated on 2015-05-24: adwcleaner

Updated on 2015-05-24: adwcleaner

error: pathspec 'automatic/_output/adwcleaner/5.018/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Updated on 2015-10-04: irfanview

Updated on 2015-10-04: irfanview

https://chocolatey.org/packages/irfanview

; default environment
DetectHiddenWindows, off
SetControlDelay, 20

; modified environment
#NoEnv
#NoTrayIcon
DetectHiddenText, off
SetTitleMatchMode, 2

; variables
winTitle = IrfanView Uninstall ahk_class #32770

WinWait, %winTitle%, Thank you for using, 180
WinActivate
ControlClick, Button1, , &Yes

WinWait, %winTitle%, IrfanView uninstalled, 180
WinActivate
ControlClick, Button1, , OK

ExitApp

error: pathspec 'automatic/_output/irfanview/4.41/tools/chocolateyUninstall.ahk' did not match any file(s) known to git


Added a script to display a toast

Added a script to display a toast

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

TrayTip %1%, %2%, 3, 1
Sleep 3000   ; Let it display for 3 seconds.
HideTrayTip()

HideTrayTip() {
    if SubStr(A_OSVersion,1,3) = "10." {
        Menu Tray, NoIcon
        Sleep 200  ; It may be necessary to adjust this sleep.
        Menu Tray, Icon
    } else {
		TrayTip
	}
}

error: pathspec 'autohotkey/display_toast.ahk' did not match any file(s) known to git


Create solution.ahk

Create solution.ahk

[2016-06-15] Challenge #271 [Intermediate] Making Waves/solution.ahk

error: pathspec '[2016-06-15]' did not match any file(s) known to git
error: pathspec 'Challenge' did not match any file(s) known to git


Added autohotkey scripts directory, and autohotkey script for SF5 for Win64

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

#MaxHotkeysPerInterval 1000

#IfWinActive StreetFighterV
	space::w ; jump
	delete::b ; light punch
	end::n ; medium punch
	PgDn::m ; heavy punch
	insert::g ; light kick
	home::h ; medium kick
	PgUp::j ; heavy kick
	Esc::ExitApp

Return

error: pathspec 'autohotkey_scripts/sf5_keybinds.ahk' did not match any file(s) known to git


Let's finally get off home row

Let's finally get off home row

; adapted from https://autohotkey.com/board/topic/51959-using-capslock-as-another-modifier-key/

$*Capslock::
Gui, 99:+ToolWindow
Gui, 99:Show, NoActivate, Capslock Is Down
keywait, Capslock
Gui, 99:Destroy
return

#IfWinExist, Capslock Is Down
; vimish
h::Left
j::Down
k::Up
l::Right
; could try to be vimish on these, but can't really do $ with left pinky already on capslock
y::Home
n::End
u::PgUp
m::PgDn
BackSpace::Del
#IfWinExist

error: pathspec 'config/autohotkey/scokeymap.ahk' did not match any file(s) known to git


limit search range

limit search range

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mingone/efficiently.git/'


Delete toolkits.ahk

Delete toolkits.ahk


Add windows autohotkey config

Add windows autohotkey config

#SingleInstance force
CapsLock::Esc
!Space::Send ^{Esc}

error: pathspec 'windows/keys.ahk' did not match any file(s) known to git


Update D2SpaceModifier.ahk

Update D2SpaceModifier.ahk

error: pathspec 'source' did not match any file(s) known to git
error: pathspec 'code/D2SpaceModifier.ahk' did not match any file(s) known to git


更新了pac代理相关的设置项

更新了pac代理相关的设置项

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/solomonxie/Gists.git/'


the only way to use windoze

the only way to use windoze

;The Problem:
; I love the hotcorner(s) in GNOME & KDE, and kept finding myself
; trying to use them since I've been forced to use windows 10 (winshit).

;My solution:
; download & install: https://autohotkey.com/
; save this script with the extension ".ahk"
; click on the script to start it and/or set it to launch automatically.

#Persistent
SetTimer, HotCorners, 0
return

taskOverview := false

HotCorners:
	CoordMode, Mouse, Screen

	; get desktop size
	WinGetPos, X, Y, Xmax, Ymax, Program Manager

	; adjust tolerance value if desired
	T = 2

	MouseGetPos, MouseX, MouseY

	; any of these can be used to have a different hot corner
	Corner := (MouseY < T and MouseX < T)			; top left
	;Corner := (MouseY < T and MouseX > Xmax - T)		; top right
	;Corner := (MouseY > Ymax - T and MouseX < T)		; bottom left
	;Corner := (MouseY > Ymax - T and MouseX > Xmax - T) 	; bottom right

	; top-left hot-corner-hit => send super + tab
	if Corner {

		; press <super> + <tab>
		Send, {LWin down}{tab down}

		taskOverview := !taskOverview

		; move mouse to center of screen towards apps
		if taskOverview {
			;MouseMove, Xmax/2, Ymax/2
		}

		; unpress <super> + <tab>
		Send, {LWin up}{tab up}

		; prevent retriggering
		Sleep, 250

	}

	return

error: pathspec 'hot_corner.ahk' did not match any file(s) known to git


Update and rename Sample/AutoHotkey to Sample/AutoHotkey/ExprSolver.ahk

error: pathspec 'Sample/AutoHotkey/ExprSolver.ahk' did not match any file(s) known to git


Create click.ahk

Create click.ahk

Simple AutoHotKey script to repeatedly click at certain points

;click.ahk
; Simple script to repeatedly click at certain points
; Loops 1000 A_Times
; Started by ctrl-alt-shift-q
; killed by `

^!+q::
Loop, 1000
{
	CoordMode, Mouse, Screen
	MouseMove, 147, 256
	Sleep, 1
	click, right
	MouseMove, 243, 359
	Sleep, 1
	click
	MouseMove, 259, 336
	Sleep, 1
	click
}
return

`::
    ExitApp
Return

error: pathspec 'click.ahk' did not match any file(s) known to git


Delete Testing GUi.ahk

Delete Testing GUi.ahk

error: pathspec '1.4/Testing' did not match any file(s) known to git
error: pathspec 'GUi.ahk' did not match any file(s) known to git


Add PaddyDebug.ahk

Add PaddyDebug.ahk

; https://autohotkey.com/board/topic/59612-simple-debug-console-output/

DebugMessage(str)
{
 global h_stdout
 DebugConsoleInitialize()  ; start console window if not yet started
 str .= "`n" ; add line feed
 ;DllCall("WriteFile", "uint", h_Stdout, "uint", &str, "uint", StrLen(str), "uint*", BytesWritten, "uint", NULL) ; write into the console
 FileAppend %str%, CONOUT$
 WinSet, Bottom,, ahk_id %h_stout%  ; keep console on bottom
}

DebugConsoleInitialize()
{
   global h_Stdout     ; Handle for console
   static is_open = 0  ; toogle whether opened before
   if (is_open = 1)     ; yes, so don't open again
     return

   is_open := 1
   ; two calls to open, no error check (it's debug, so you know what you are doing)
   DllCall("AttachConsole", int, -1, int)
   DllCall("AllocConsole", int)

   dllcall("SetConsoleTitle", "str","Paddy Debug Console")    ; Set the name. Example. Probably could use a_scriptname here
   h_Stdout := DllCall("GetStdHandle", "int", -11) ; get the handle
   WinSet, Bottom,, ahk_id %h_stout%      ; make sure it's on the bottom
   WinActivate,Lightroom   ; Application specific; I need to make sure this application is running in the foreground. YMMV
   return
}

error: pathspec 'lib/PaddyDebug.ahk' did not match any file(s) known to git


add RefreshDashboard.ahk

add RefreshDashboard.ahk

ControlFocus, Internet Explorer_Server14, IBM BigFix Console
Send ^{F5}

error: pathspec 'AutoHotKey/RefreshDashboard.ahk' did not match any file(s) known to git


Added a script to lock the computer

Added a script to lock the computer

#NoTrayIcon
#Persistent
#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

DllCall("user32.dll\LockWorkStation")

error: pathspec 'autohotkey/lock_computer.ahk' did not match any file(s) known to git


Update Rewrite of 1.4.ahk

Update Rewrite of 1.4.ahk

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec '1.4.ahk' did not match any file(s) known to git


Create Core_BlockComment.ahk

Create Core_BlockComment.ahk

EMB_Core_BlockComment(mbsource){
  pair := []
  collection := []
  i := 1
  while i < len(mbsource) {
    i := regexmatch( mbsource, io)%pattern%, oMatch, %i%)
    i := i + oMatch.Len(0)
    loop, Match.Count()
    {
      pair := [Match.Pos(A_index), Match.Len(A_Index)]
      collection.push pair
      i := Match.Pos(A_index) + Match.Len(A_Index)
    }
  }

return mbsource
}

p_EMB_Core_BC_injectCharacter(string,char){
  return
}

error: pathspec 'Research/Block-Commenting/Core_BlockComment.ahk' did not match any file(s) known to git


Create AutoHotKey.ahk

Create AutoHotKey.ahk

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

; Windows 10 虚拟桌面自动切换
!1::
send #^{left}
return
!2::
send #^{right}
return

; Window 10同一应用多窗口切换
!`:: ; Next window
WinGetClass, ActiveClass, A
WinGet, WinClassCount, Count, ahk_class %ActiveClass%
IF WinClassCount = 1
    Return
Else
WinGet, List, List, % "ahk_class " ActiveClass
Loop, % List
{
    index := List - A_Index + 1
    WinGet, State, MinMax, % "ahk_id " List%index%
    if (State <> -1)
    {
        WinID := List%index%
        break
    }
}
WinActivate, % "ahk_id " WinID
return

!^`:: ; Last window
WinGetClass, ActiveClass, A
WinGet, WinClassCount, Count, ahk_class %ActiveClass%
IF WinClassCount = 1
    Return
Else
WinGet, List, List, % "ahk_class " ActiveClass
Loop, % List
{
    index := List - A_Index + 1
    WinGet, State, MinMax, % "ahk_id " List%index%
    if (State <> -1)
    {
        WinID := List%index%
        break
    }
}
WinActivate, % "ahk_id " WinID
return

error: pathspec 'app-config/windows10/AutoHotKey.ahk' did not match any file(s) known to git


Updated on 2015-05-24: adwcleaner

Updated on 2015-05-24: adwcleaner

error: pathspec 'automatic/_output/adwcleaner/5.019/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Create EmeraldIsle.ahk

Create EmeraldIsle.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/FinnAngelo/Tomfoolery.git/'


Add SGBrowser.ahk

Add SGBrowser.ahk

;==============
SGBrowser:
vim.mode("insert","SE_AxControl")
vim.map("<esc>","<Normal_Mode_SE_AxControl>","SE_AxControl")

vim.mode("normal","SE_AxControl")
vim.map("i","<Insert_Mode_SE_AxControl>","SE_AxControl")
;vim.map("<esc>","<Normal_Mode_SE_AxControl>","SE_AxControl")
vim.map("gt","<SG_NextTab>","SE_AxControl")
vim.map("gT","<SG_PrevTab>","SE_AxControl")

vim.comment("<SG_NextTab>","һǩ")
vim.comment("<SG_PrevTab>","ǰһǩ")
return

;================ģʽ,ڼ齹Edit1ؼڼinsertģʽ,normalģʽ

SE_AxControl_CheckMode()
{
    ControlGetFocus,ctrl,AHK_CLASS SE_AxControl
    If RegExMatch(ctrl,"Edit1")
        Return True
    return False
}

<Normal_Mode_SE_AxControl>:
    Send,{Esc}
    vim.Mode("normal","SE_AxControl")
return

<Insert_Mode_SE_AxControl>:
    vim.Mode("insert","SE_AxControl")
return

;============ܴ
<SG_NextTab>:
    SG_Send("^{Tab}")
return

<SG_PrevTab>:
    SG_send("^+{Tab}")
return

SG_Send(Keys){
	Delay := A_KeyDelay
	Setkeydelay,10
	Send,%Keys%
	Setkeydelay,%Delay%
}

error: pathspec 'src/VimDesktop/Include/SGBrowser.ahk' did not match any file(s) known to git


Update toolkits.ahk

Update toolkits.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mingone/efficiently.git/'


Added test fixture for AutoHotkey language.

error: pathspec 'test/fixtures/hello.ahk' did not match any file(s) known to git


Add some device specific keyboard modifications.

#Include, %A_ScriptDir%
#InstallKeybdHook
#SingleInstance, Force

Capslock & ScrollLock:: Send, {ScrollLock}
Capslock & Pause:: Send, {Pause}
ScrollLock::Home
Pause::End

Insert & Backspace::Send, {AppsKey}

error: pathspec 'HpEliteBook820.ahk' did not match any file(s) known to git


[ahk] add keymap file

[ahk] add keymap file

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

GroupAdd, ChomeShortcuts, ahk_exe chrome.exe

#IfWinActive ahk_group ChomeShortcuts
!t::
Send, {Ctrl down}t{Ctrl up}
#IfWinActive

!c::
Send, {Ctrl down}c{Ctrl up}
return

!v::
Send, {Ctrl down}v{Ctrl up}
return

!z::
Send, {Ctrl down}z{Ctrl up}
return

!w::
Send, {Ctrl down}w{Ctrl up}
return

CapsLock::LCtrl
Capslock Up::
SendInput, {LControl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Escape}
}
Else
return
return

Enter::RCtrl
Enter Up::
SendInput, {RControl up}
If A_TimeSincePriorHotkey < 200
{
  SendInput, {Enter}
}
Else
return
return

F1::
if WinActive("ahk_class CabinetWClass") {
    WinMinimize, ahk_class CabinetWClass
} else {
    WinActivate, ahk_class CabinetWClass
}
return

F3::
if WinActive("ahk_exe chrome.exe") {
    WinMinimize, ahk_exe chrome.exe
} else {
    WinActivate, ahk_exe chrome.exe
}
return

F4::
if WinActive("ahk_exe WindowsTerminal.exe") {
    WinMinimize, ahk_exe WindowsTerminal.exe
} else {
    WinActivate, ahk_exe WindowsTerminal.exe
}
return

F12::
if WinActive("ahk_exe emacs.exe") {
    WinMinimize, ahk_exe emacs.exe
} else {
    WinActivate, ahk_exe emacs.exe
}
return

error: pathspec '.autohotkey/keymap.ahk' did not match any file(s) known to git


Create VA.ahk

Create VA.ahk

;
; MASTER CONTROLS
;

VA_GetMasterVolume(channel="", device_desc="playback")
{
    if ! aev := VA_GetAudioEndpointVolume(device_desc)
        return
    if channel =
        VA_IAudioEndpointVolume_GetMasterVolumeLevelScalar(aev, vol)
    else
        VA_IAudioEndpointVolume_GetChannelVolumeLevelScalar(aev, channel-1, vol)
    ObjRelease(aev)
    return Round(vol*100,3)
}

VA_SetMasterVolume(vol, channel="", device_desc="playback")
{
    vol := vol>100 ? 100 : vol<0 ? 0 : vol
    if ! aev := VA_GetAudioEndpointVolume(device_desc)
        return
    if channel =
        VA_IAudioEndpointVolume_SetMasterVolumeLevelScalar(aev, vol/100)
    else
        VA_IAudioEndpointVolume_SetChannelVolumeLevelScalar(aev, channel-1, vol/100)
    ObjRelease(aev)
}

VA_GetMasterChannelCount(device_desc="playback")
{
    if ! aev := VA_GetAudioEndpointVolume(device_desc)
        return
    VA_IAudioEndpointVolume_GetChannelCount(aev, count)
    ObjRelease(aev)
    return count
}

VA_SetMasterMute(mute, device_desc="playback")
{
    if ! aev := VA_GetAudioEndpointVolume(device_desc)
        return
    VA_IAudioEndpointVolume_SetMute(aev, mute)
    ObjRelease(aev)
}

VA_GetMasterMute(device_desc="playback")
{
    if ! aev := VA_GetAudioEndpointVolume(device_desc)
        return
    VA_IAudioEndpointVolume_GetMute(aev, mute)
    ObjRelease(aev)
    return mute
}

;
; SUBUNIT CONTROLS
;

VA_GetVolume(subunit_desc="1", channel="", device_desc="playback")
{
    if ! avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
        return
    VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)
    if channel =
    {
        vol = 0

        Loop, %channel_count%
        {
            VA_IPerChannelDbLevel_GetLevelRange(avl, A_Index-1, min_dB, max_dB, step_dB)
            VA_IPerChannelDbLevel_GetLevel(avl, A_Index-1, this_vol)
            this_vol := VA_dB2Scalar(this_vol, min_dB, max_dB)

            ; "Speakers Properties" reports the highest channel as the volume.
            if (this_vol > vol)
                vol := this_vol
        }
    }
    else if channel between 1 and channel_count
    {
        channel -= 1
        VA_IPerChannelDbLevel_GetLevelRange(avl, channel, min_dB, max_dB, step_dB)
        VA_IPerChannelDbLevel_GetLevel(avl, channel, vol)
        vol := VA_dB2Scalar(vol, min_dB, max_dB)
    }
    ObjRelease(avl)
    return vol
}

VA_SetVolume(vol, subunit_desc="1", channel="", device_desc="playback")
{
    if ! avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
        return

    vol := vol<0 ? 0 : vol>100 ? 100 : vol

    VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)

    if channel =
    {
        ; Simple method -- resets balance to "center":
        ;VA_IPerChannelDbLevel_SetLevelUniform(avl, vol)

        vol_max = 0

        Loop, %channel_count%
        {
            VA_IPerChannelDbLevel_GetLevelRange(avl, A_Index-1, min_dB, max_dB, step_dB)
            VA_IPerChannelDbLevel_GetLevel(avl, A_Index-1, this_vol)
            this_vol := VA_dB2Scalar(this_vol, min_dB, max_dB)

            channel%A_Index%vol := this_vol
            channel%A_Index%min := min_dB
            channel%A_Index%max := max_dB

            ; Scale all channels relative to the loudest channel.
            ; (This is how Vista's "Speakers Properties" dialog seems to work.)
            if (this_vol > vol_max)
                vol_max := this_vol
        }

        Loop, %channel_count%
        {
            this_vol := vol_max ? channel%A_Index%vol / vol_max * vol : vol
            this_vol := VA_Scalar2dB(this_vol/100, channel%A_Index%min, channel%A_Index%max)
            VA_IPerChannelDbLevel_SetLevel(avl, A_Index-1, this_vol)
        }
    }
    else if channel between 1 and %channel_count%
    {
        channel -= 1
        VA_IPerChannelDbLevel_GetLevelRange(avl, channel, min_dB, max_dB, step_dB)
        VA_IPerChannelDbLevel_SetLevel(avl, channel, VA_Scalar2dB(vol/100, min_dB, max_dB))
    }
    ObjRelease(avl)
}

VA_GetChannelCount(subunit_desc="1", device_desc="playback")
{
    if ! avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
        return
    VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)
    ObjRelease(avl)
    return channel_count
}

VA_SetMute(mute, subunit_desc="1", device_desc="playback")
{
    if ! amute := VA_GetDeviceSubunit(device_desc, subunit_desc, "{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
        return
    VA_IAudioMute_SetMute(amute, mute)
    ObjRelease(amute)
}

VA_GetMute(subunit_desc="1", device_desc="playback")
{
    if ! amute := VA_GetDeviceSubunit(device_desc, subunit_desc, "{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
        return
    VA_IAudioMute_GetMute(amute, muted)
    ObjRelease(amute)
    return muted
}

;
; AUDIO METERING
;

VA_GetAudioMeter(device_desc="playback")
{
    if ! device := VA_GetDevice(device_desc)
        return 0
    VA_IMMDevice_Activate(device, "{C02216F6-8C67-4B5B-9D00-D008E73E0064}", 7, 0, audioMeter)
    ObjRelease(device)
    return audioMeter
}

VA_GetDevicePeriod(device_desc, ByRef default_period, ByRef minimum_period="")
{
    defaultPeriod := minimumPeriod := 0
    if ! device := VA_GetDevice(device_desc)
        return false
    VA_IMMDevice_Activate(device, "{1CB9AD4C-DBFA-4c32-B178-C2F568A703B2}", 7, 0, audioClient)
    ObjRelease(device)
    ; IAudioClient::GetDevicePeriod
    DllCall(NumGet(NumGet(audioClient+0)+9*A_PtrSize), "ptr",audioClient, "int64*",default_period, "int64*",minimum_period)
    ; Convert 100-nanosecond units to milliseconds.
    default_period /= 10000
    minimum_period /= 10000
    ObjRelease(audioClient)
    return true
}

VA_GetAudioEndpointVolume(device_desc="playback")
{
    if ! device := VA_GetDevice(device_desc)
        return 0
    VA_IMMDevice_Activate(device, "{5CDF2C82-841E-4546-9722-0CF74078229A}", 7, 0, endpointVolume)
    ObjRelease(device)
    return endpointVolume
}

VA_GetDeviceSubunit(device_desc, subunit_desc, subunit_iid)
{
    if ! device := VA_GetDevice(device_desc)
        return 0
    subunit := VA_FindSubunit(device, subunit_desc, subunit_iid)
    ObjRelease(device)
    return subunit
}

VA_FindSubunit(device, target_desc, target_iid)
{
    if target_desc is integer
        target_index := target_desc
    else
        RegExMatch(target_desc, "(?<_name>.*?)(?::(?<_index>\d+))?$", target)
    ; v2.01: Since target_name is now a regular expression, default to case-insensitive mode if no options are specified.
    if !RegExMatch(target_name,"^[^\(]+\)")
        target_name := "i)" target_name
    r := VA_EnumSubunits(device, "VA_FindSubunitCallback", target_name, target_iid
            , Object(0, target_index ? target_index : 1, 1, 0))
    DllCall("GlobalFree", "uint", callback)
    return r
}

VA_FindSubunitCallback(part, interface, index)
{
    index[1] := index[1] + 1 ; current += 1
    if (index[0] == index[1]) ; target == current ?
    {
        ObjAddRef(interface)
        return interface
    }
}

VA_EnumSubunits(device, callback, target_name="", target_iid="", callback_param="")
{
    VA_IMMDevice_Activate(device, "{2A07407E-6497-4A18-9787-32F79BD0D98F}", 7, 0, deviceTopology)
    VA_IDeviceTopology_GetConnector(deviceTopology, 0, conn)
    ObjRelease(deviceTopology)
    VA_IConnector_GetConnectedTo(conn, conn_to)
    VA_IConnector_GetDataFlow(conn, data_flow)
    ObjRelease(conn)
    if !conn_to
        return ; blank to indicate error
    DllCall(NumGet(NumGet(conn_to+0)), "ptr", conn_to, "ptr", VA_GUID(IID_IPart,"{AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9}"), "ptr*", part) != 0 ? part:=0 : ""
    ObjRelease(conn_to)
    if !part
        return
    r := VA_EnumSubunitsEx(part, data_flow, callback, target_name, target_iid, callback_param)
    ObjRelease(part)
    return r ; value returned by callback, or zero.
}

VA_EnumSubunitsEx(part, data_flow, callback, target_name="", target_iid="", callback_param="")
{
    r := 0

    VA_IPart_GetPartType(part, type)

    if type = 1 ; Subunit
    {
        VA_IPart_GetName(part, name)

        ; v2.01: target_name is now a regular expression.
        if RegExMatch(name, target_name)
        {
            if target_iid =
                r := %callback%(part, 0, callback_param)
            else
                if VA_IPart_Activate(part, 7, target_iid, interface) = 0
                {
                    r := %callback%(part, interface, callback_param)
                    ; The callback is responsible for calling ObjAddRef()
                    ; if it intends to keep the interface pointer.
                    ObjRelease(interface)
                }

            if r
                return r ; early termination
        }
    }

    if data_flow = 0
        VA_IPart_EnumPartsIncoming(part, parts)
    else
        VA_IPart_EnumPartsOutgoing(part, parts)

    VA_IPartsList_GetCount(parts, count)
    Loop %count%
    {
        VA_IPartsList_GetPart(parts, A_Index-1, subpart)
        r := VA_EnumSubunitsEx(subpart, data_flow, callback, target_name, target_iid, callback_param)
        ObjRelease(subpart)
        if r
            break ; early termination
    }
    ObjRelease(parts)
    return r ; continue/finished enumeration
}

; device_desc = device_id
;               | ( friendly_name | 'playback' | 'capture' ) [ ':' index ]
VA_GetDevice(device_desc="playback")
{
    if ( r:= DllCall("ole32\CoCreateInstance"
                , "ptr", VA_GUID(CLSID_MMDeviceEnumerator, "{BCDE0395-E52F-467C-8E3D-C4579291692E}")
                , "ptr", 0, "uint", 21
                , "ptr", VA_GUID(IID_IMMDeviceEnumerator, "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
                , "ptr*", deviceEnumerator)) != 0
        return 0

    device := 0

    ; deviceEnumerator->GetDevice(device_id, [out] device)
    if DllCall(NumGet(NumGet(deviceEnumerator+0)+5*A_PtrSize), "ptr", deviceEnumerator, "wstr", device_desc, "ptr*", device) = 0
        goto VA_GetDevice_Return

    if device_desc is integer
    {
        m2 := device_desc
        if m2 >= 4096 ; Probably a device pointer, passed here indirectly via VA_GetAudioMeter or such.
            return m2, ObjAddRef(m2)
    }
    else
        RegExMatch(device_desc, "(.*?)\s*(?::(\d+))?$", m)

    if m1 in playback,p
        m1 := "", flow := 0 ; eRender
    else if m1 in capture,c
        m1 := "", flow := 1 ; eCapture
    else if (m1 . m2) = ""  ; no name or number specified
        m1 := "", flow := 0 ; eRender (default)
    else
        flow := 2 ; eAll

    if (m1 . m2) = ""   ; no name or number (maybe "playback" or "capture")
    {   ; deviceEnumerator->GetDefaultAudioEndpoint(dataFlow, role, [out] device)
        DllCall(NumGet(NumGet(deviceEnumerator+0)+4*A_PtrSize), "ptr",deviceEnumerator, "uint",flow, "uint",0, "ptr*",device)
        goto VA_GetDevice_Return
    }

    ; deviceEnumerator->EnumAudioEndpoints(dataFlow, stateMask, [out] devices)
    DllCall(NumGet(NumGet(deviceEnumerator+0)+3*A_PtrSize), "ptr",deviceEnumerator, "uint",flow, "uint",1, "ptr*",devices)

    ; devices->GetCount([out] count)
    DllCall(NumGet(NumGet(devices+0)+3*A_PtrSize), "ptr",devices, "uint*",count)

    if m1 =
    {   ; devices->Item(m2-1, [out] device)
        DllCall(NumGet(NumGet(devices+0)+4*A_PtrSize), "ptr",devices, "uint",m2-1, "ptr*",device)
        goto VA_GetDevice_Return
    }

    index := 0
    Loop % count
        ; devices->Item(A_Index-1, [out] device)
        if DllCall(NumGet(NumGet(devices+0)+4*A_PtrSize), "ptr",devices, "uint",A_Index-1, "ptr*",device) = 0
            if InStr(VA_GetDeviceName(device), m1) && (m2 = "" || ++index = m2)
                goto VA_GetDevice_Return
            else
                ObjRelease(device), device:=0

VA_GetDevice_Return:
    ObjRelease(deviceEnumerator)
    if devices
        ObjRelease(devices)

    return device ; may be 0
}

VA_GetDeviceName(device)
{
    static PKEY_Device_FriendlyName
    if !VarSetCapacity(PKEY_Device_FriendlyName)
        VarSetCapacity(PKEY_Device_FriendlyName, 20)
        ,VA_GUID(PKEY_Device_FriendlyName :="{A45C254E-DF1C-4EFD-8020-67D146A850E0}")
        ,NumPut(14, PKEY_Device_FriendlyName, 16)
    VarSetCapacity(prop, 16)
    VA_IMMDevice_OpenPropertyStore(device, 0, store)
    ; store->GetValue(.., [out] prop)
    DllCall(NumGet(NumGet(store+0)+5*A_PtrSize), "ptr", store, "ptr", &PKEY_Device_FriendlyName, "ptr", &prop)
    ObjRelease(store)
    VA_WStrOut(deviceName := NumGet(prop,8))
    return deviceName
}

;
; HELPERS
;

; Convert string to binary GUID structure.
VA_GUID(ByRef guid_out, guid_in="%guid_out%") {
    if (guid_in == "%guid_out%")
        guid_in :=   guid_out
    if  guid_in is integer
        return guid_in
    VarSetCapacity(guid_out, 16, 0)
	DllCall("ole32\CLSIDFromString", "wstr", guid_in, "ptr", &guid_out)
	return &guid_out
}

; Convert binary GUID structure to string.
VA_GUIDOut(ByRef guid) {
    VarSetCapacity(buf, 78)
    DllCall("ole32\StringFromGUID2", "ptr", &guid, "ptr", &buf, "int", 39)
    guid := StrGet(&buf, "UTF-16")
}

; Convert COM-allocated wide char string pointer to usable string.
VA_WStrOut(ByRef str) {
    str := StrGet(ptr := str, "UTF-16")
    DllCall("ole32\CoTaskMemFree", "ptr", ptr)  ; FREES THE STRING.
}

VA_dB2Scalar(dB, min_dB, max_dB) {
    min_s := 10**(min_dB/20), max_s := 10**(max_dB/20)
    return ((10**(dB/20))-min_s)/(max_s-min_s)*100
}

VA_Scalar2dB(s, min_dB, max_dB) {
    min_s := 10**(min_dB/20), max_s := 10**(max_dB/20)
    return log((max_s-min_s)*s+min_s)*20
}

;
; INTERFACE WRAPPERS
;   Reference: Core Audio APIs in Windows Vista -- Programming Reference
;       http://msdn2.microsoft.com/en-us/library/ms679156(VS.85).aspx
;

;
; IMMDevice : {D666063F-1587-4E43-81F1-B948E807363F}
;
VA_IMMDevice_Activate(this, iid, ClsCtx, ActivationParams, ByRef Interface) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "ptr", VA_GUID(iid), "uint", ClsCtx, "uint", ActivationParams, "ptr*", Interface)
}
VA_IMMDevice_OpenPropertyStore(this, Access, ByRef Properties) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint", Access, "ptr*", Properties)
}
VA_IMMDevice_GetId(this, ByRef Id) {
    hr := DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "uint*", Id)
    VA_WStrOut(Id)
    return hr
}
VA_IMMDevice_GetState(this, ByRef State) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "uint*", State)
}

;
; IDeviceTopology : {2A07407E-6497-4A18-9787-32F79BD0D98F}
;
VA_IDeviceTopology_GetConnectorCount(this, ByRef Count) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "uint*", Count)
}
VA_IDeviceTopology_GetConnector(this, Index, ByRef Connector) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint", Index, "ptr*", Connector)
}
VA_IDeviceTopology_GetSubunitCount(this, ByRef Count) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "uint*", Count)
}
VA_IDeviceTopology_GetSubunit(this, Index, ByRef Subunit) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "uint", Index, "ptr*", Subunit)
}
VA_IDeviceTopology_GetPartById(this, Id, ByRef Part) {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "uint", Id, "ptr*", Part)
}
VA_IDeviceTopology_GetDeviceId(this, ByRef DeviceId) {
    hr := DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "uint*", DeviceId)
    VA_WStrOut(DeviceId)
    return hr
}
VA_IDeviceTopology_GetSignalPath(this, PartFrom, PartTo, RejectMixedPaths, ByRef Parts) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "ptr", PartFrom, "ptr", PartTo, "int", RejectMixedPaths, "ptr*", Parts)
}

;
; IConnector : {9c2c4058-23f5-41de-877a-df3af236a09e}
;
VA_IConnector_GetType(this, ByRef Type) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int*", Type)
}
VA_IConnector_GetDataFlow(this, ByRef Flow) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "int*", Flow)
}
VA_IConnector_ConnectTo(this, ConnectTo) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "ptr", ConnectTo)
}
VA_IConnector_Disconnect(this) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this)
}
VA_IConnector_IsConnected(this, ByRef Connected) {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "int*", Connected)
}
VA_IConnector_GetConnectedTo(this, ByRef ConTo) {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "ptr*", ConTo)
}
VA_IConnector_GetConnectorIdConnectedTo(this, ByRef ConnectorId) {
    hr := DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "ptr*", ConnectorId)
    VA_WStrOut(ConnectorId)
    return hr
}
VA_IConnector_GetDeviceIdConnectedTo(this, ByRef DeviceId) {
    hr := DllCall(NumGet(NumGet(this+0)+10*A_PtrSize), "ptr", this, "ptr*", DeviceId)
    VA_WStrOut(DeviceId)
    return hr
}

;
; IPart : {AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9}
;
VA_IPart_GetName(this, ByRef Name) {
    hr := DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "ptr*", Name)
    VA_WStrOut(Name)
    return hr
}
VA_IPart_GetLocalId(this, ByRef Id) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint*", Id)
}
VA_IPart_GetGlobalId(this, ByRef GlobalId) {
    hr := DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "ptr*", GlobalId)
    VA_WStrOut(GlobalId)
    return hr
}
VA_IPart_GetPartType(this, ByRef PartType) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "int*", PartType)
}
VA_IPart_GetSubType(this, ByRef SubType) {
    VarSetCapacity(SubType,16,0)
    hr := DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "ptr", &SubType)
    VA_GUIDOut(SubType)
    return hr
}
VA_IPart_GetControlInterfaceCount(this, ByRef Count) {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "uint*", Count)
}
VA_IPart_GetControlInterface(this, Index, ByRef InterfaceDesc) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "uint", Index, "ptr*", InterfaceDesc)
}
VA_IPart_EnumPartsIncoming(this, ByRef Parts) {
    return DllCall(NumGet(NumGet(this+0)+10*A_PtrSize), "ptr", this, "ptr*", Parts)
}
VA_IPart_EnumPartsOutgoing(this, ByRef Parts) {
    return DllCall(NumGet(NumGet(this+0)+11*A_PtrSize), "ptr", this, "ptr*", Parts)
}
VA_IPart_GetTopologyObject(this, ByRef Topology) {
    return DllCall(NumGet(NumGet(this+0)+12*A_PtrSize), "ptr", this, "ptr*", Topology)
}
VA_IPart_Activate(this, ClsContext, iid, ByRef Object) {
    return DllCall(NumGet(NumGet(this+0)+13*A_PtrSize), "ptr", this, "uint", ClsContext, "ptr", VA_GUID(iid), "ptr*", Object)
}
VA_IPart_RegisterControlChangeCallback(this, iid, Notify) {
    return DllCall(NumGet(NumGet(this+0)+14*A_PtrSize), "ptr", this, "ptr", VA_GUID(iid), "ptr", Notify)
}
VA_IPart_UnregisterControlChangeCallback(this, Notify) {
    return DllCall(NumGet(NumGet(this+0)+15*A_PtrSize), "ptr", this, "ptr", Notify)
}

;
; IPartsList : {6DAA848C-5EB0-45CC-AEA5-998A2CDA1FFB}
;
VA_IPartsList_GetCount(this, ByRef Count) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "uint*", Count)
}
VA_IPartsList_GetPart(this, INdex, ByRef Part) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint", Index, "ptr*", Part)
}

;
; IAudioEndpointVolume : {5CDF2C82-841E-4546-9722-0CF74078229A}
;
VA_IAudioEndpointVolume_RegisterControlChangeNotify(this, Notify) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "ptr", Notify)
}
VA_IAudioEndpointVolume_UnregisterControlChangeNotify(this, Notify) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "ptr", Notify)
}
VA_IAudioEndpointVolume_GetChannelCount(this, ByRef ChannelCount) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "uint*", ChannelCount)
}
VA_IAudioEndpointVolume_SetMasterVolumeLevel(this, LevelDB, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "float", LevelDB, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_SetMasterVolumeLevelScalar(this, Level, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "float", Level, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_GetMasterVolumeLevel(this, ByRef LevelDB) {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "float*", LevelDB)
}
VA_IAudioEndpointVolume_GetMasterVolumeLevelScalar(this, ByRef Level) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "float*", Level)
}
VA_IAudioEndpointVolume_SetChannelVolumeLevel(this, Channel, LevelDB, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+10*A_PtrSize), "ptr", this, "uint", Channel, "float", LevelDB, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_SetChannelVolumeLevelScalar(this, Channel, Level, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+11*A_PtrSize), "ptr", this, "uint", Channel, "float", Level, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_GetChannelVolumeLevel(this, Channel, ByRef LevelDB) {
    return DllCall(NumGet(NumGet(this+0)+12*A_PtrSize), "ptr", this, "uint", Channel, "float*", LevelDB)
}
VA_IAudioEndpointVolume_GetChannelVolumeLevelScalar(this, Channel, ByRef Level) {
    return DllCall(NumGet(NumGet(this+0)+13*A_PtrSize), "ptr", this, "uint", Channel, "float*", Level)
}
VA_IAudioEndpointVolume_SetMute(this, Mute, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+14*A_PtrSize), "ptr", this, "int", Mute, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_GetMute(this, ByRef Mute) {
    return DllCall(NumGet(NumGet(this+0)+15*A_PtrSize), "ptr", this, "int*", Mute)
}
VA_IAudioEndpointVolume_GetVolumeStepInfo(this, ByRef Step, ByRef StepCount) {
    return DllCall(NumGet(NumGet(this+0)+16*A_PtrSize), "ptr", this, "uint*", Step, "uint*", StepCount)
}
VA_IAudioEndpointVolume_VolumeStepUp(this, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+17*A_PtrSize), "ptr", this, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_VolumeStepDown(this, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+18*A_PtrSize), "ptr", this, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioEndpointVolume_QueryHardwareSupport(this, ByRef HardwareSupportMask) {
    return DllCall(NumGet(NumGet(this+0)+19*A_PtrSize), "ptr", this, "uint*", HardwareSupportMask)
}
VA_IAudioEndpointVolume_GetVolumeRange(this, ByRef MinDB, ByRef MaxDB, ByRef IncrementDB) {
    return DllCall(NumGet(NumGet(this+0)+20*A_PtrSize), "ptr", this, "float*", MinDB, "float*", MaxDB, "float*", IncrementDB)
}

;
; IPerChannelDbLevel  : {C2F8E001-F205-4BC9-99BC-C13B1E048CCB}
;   IAudioVolumeLevel : {7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}
;   IAudioBass        : {A2B1A1D9-4DB3-425D-A2B2-BD335CB3E2E5}
;   IAudioMidrange    : {5E54B6D7-B44B-40D9-9A9E-E691D9CE6EDF}
;   IAudioTreble      : {0A717812-694E-4907-B74B-BAFA5CFDCA7B}
;
VA_IPerChannelDbLevel_GetChannelCount(this, ByRef Channels) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "uint*", Channels)
}
VA_IPerChannelDbLevel_GetLevelRange(this, Channel, ByRef MinLevelDB, ByRef MaxLevelDB, ByRef Stepping) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint", Channel, "float*", MinLevelDB, "float*", MaxLevelDB, "float*", Stepping)
}
VA_IPerChannelDbLevel_GetLevel(this, Channel, ByRef LevelDB) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "uint", Channel, "float*", LevelDB)
}
VA_IPerChannelDbLevel_SetLevel(this, Channel, LevelDB, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "uint", Channel, "float", LevelDB, "ptr", VA_GUID(GuidEventContext))
}
VA_IPerChannelDbLevel_SetLevelUniform(this, LevelDB, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "float", LevelDB, "ptr", VA_GUID(GuidEventContext))
}
VA_IPerChannelDbLevel_SetLevelAllChannels(this, LevelsDB, ChannelCount, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "uint", LevelsDB, "uint", ChannelCount, "ptr", VA_GUID(GuidEventContext))
}

;
; IAudioMute : {DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}
;
VA_IAudioMute_SetMute(this, Muted, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int", Muted, "ptr", VA_GUID(GuidEventContext))
}
VA_IAudioMute_GetMute(this, ByRef Muted) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "int*", Muted)
}

;
; IAudioAutoGainControl : {85401FD4-6DE4-4b9d-9869-2D6753A82F3C}
;
VA_IAudioAutoGainControl_GetEnabled(this, ByRef Enabled) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int*", Enabled)
}
VA_IAudioAutoGainControl_SetEnabled(this, Enable, GuidEventContext="") {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "int", Enable, "ptr", VA_GUID(GuidEventContext))
}

;
; IAudioMeterInformation : {C02216F6-8C67-4B5B-9D00-D008E73E0064}
;
VA_IAudioMeterInformation_GetPeakValue(this, ByRef Peak) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "float*", Peak)
}
VA_IAudioMeterInformation_GetMeteringChannelCount(this, ByRef ChannelCount) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint*", ChannelCount)
}
VA_IAudioMeterInformation_GetChannelsPeakValues(this, ChannelCount, PeakValues) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "uint", ChannelCount, "ptr", PeakValues)
}
VA_IAudioMeterInformation_QueryHardwareSupport(this, ByRef HardwareSupportMask) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "uint*", HardwareSupportMask)
}

;
; IAudioClient : {1CB9AD4C-DBFA-4c32-B178-C2F568A703B2}
;
VA_IAudioClient_Initialize(this, ShareMode, StreamFlags, BufferDuration, Periodicity, Format, AudioSessionGuid) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int", ShareMode, "uint", StreamFlags, "int64", BufferDuration, "int64", Periodicity, "ptr", Format, "ptr", VA_GUID(AudioSessionGuid))
}
VA_IAudioClient_GetBufferSize(this, ByRef NumBufferFrames) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "uint*", NumBufferFrames)
}
VA_IAudioClient_GetStreamLatency(this, ByRef Latency) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "int64*", Latency)
}
VA_IAudioClient_GetCurrentPadding(this, ByRef NumPaddingFrames) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "uint*", NumPaddingFrames)
}
VA_IAudioClient_IsFormatSupported(this, ShareMode, Format, ByRef ClosestMatch) {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "int", ShareMode, "ptr", Format, "ptr*", ClosestMatch)
}
VA_IAudioClient_GetMixFormat(this, ByRef Format) {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "uint*", Format)
}
VA_IAudioClient_GetDevicePeriod(this, ByRef DefaultDevicePeriod, ByRef MinimumDevicePeriod) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "int64*", DefaultDevicePeriod, "int64*", MinimumDevicePeriod)
}
VA_IAudioClient_Start(this) {
    return DllCall(NumGet(NumGet(this+0)+10*A_PtrSize), "ptr", this)
}
VA_IAudioClient_Stop(this) {
    return DllCall(NumGet(NumGet(this+0)+11*A_PtrSize), "ptr", this)
}
VA_IAudioClient_Reset(this) {
    return DllCall(NumGet(NumGet(this+0)+12*A_PtrSize), "ptr", this)
}
VA_IAudioClient_SetEventHandle(this, eventHandle) {
    return DllCall(NumGet(NumGet(this+0)+13*A_PtrSize), "ptr", this, "ptr", eventHandle)
}
VA_IAudioClient_GetService(this, iid, ByRef Service) {
    return DllCall(NumGet(NumGet(this+0)+14*A_PtrSize), "ptr", this, "ptr", VA_GUID(iid), "ptr*", Service)
}

;
; IAudioSessionControl : {F4B1A599-7266-4319-A8CA-E70ACB11E8CD}
;
/*
AudioSessionStateInactive = 0
AudioSessionStateActive = 1
AudioSessionStateExpired = 2
*/
VA_IAudioSessionControl_GetState(this, ByRef State) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int*", State)
}
VA_IAudioSessionControl_GetDisplayName(this, ByRef DisplayName) {
    hr := DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "ptr*", DisplayName)
    VA_WStrOut(DisplayName)
    return hr
}
VA_IAudioSessionControl_SetDisplayName(this, DisplayName, EventContext) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "wstr", DisplayName, "ptr", VA_GUID(EventContext))
}
VA_IAudioSessionControl_GetIconPath(this, ByRef IconPath) {
    hr := DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "ptr*", IconPath)
    VA_WStrOut(IconPath)
    return hr
}
VA_IAudioSessionControl_SetIconPath(this, IconPath) {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "wstr", IconPath)
}
VA_IAudioSessionControl_GetGroupingParam(this, ByRef Param) {
    VarSetCapacity(Param,16,0)
    hr := DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "ptr", &Param)
    VA_GUIDOut(Param)
    return hr
}
VA_IAudioSessionControl_SetGroupingParam(this, Param, EventContext) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "ptr", VA_GUID(Param), "ptr", VA_GUID(EventContext))
}
VA_IAudioSessionControl_RegisterAudioSessionNotification(this, NewNotifications) {
    return DllCall(NumGet(NumGet(this+0)+10*A_PtrSize), "ptr", this, "ptr", NewNotifications)
}
VA_IAudioSessionControl_UnregisterAudioSessionNotification(this, NewNotifications) {
    return DllCall(NumGet(NumGet(this+0)+11*A_PtrSize), "ptr", this, "ptr", NewNotifications)
}

;
; IAudioSessionManager : {BFA971F1-4D5E-40BB-935E-967039BFBEE4}
;
VA_IAudioSessionManager_GetAudioSessionControl(this, AudioSessionGuid) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "ptr", VA_GUID(AudioSessionGuid))
}
VA_IAudioSessionManager_GetSimpleAudioVolume(this, AudioSessionGuid, StreamFlags, ByRef AudioVolume) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "ptr", VA_GUID(AudioSessionGuid), "uint", StreamFlags, "uint*", AudioVolume)
}

/*
    INTERFACES REQUIRING WINDOWS 7 / SERVER 2008 R2
*/

;
; IAudioSessionControl2 : {bfb7ff88-7239-4fc9-8fa2-07c950be9c6d}
;   extends IAudioSessionControl
;
VA_IAudioSessionControl2_GetSessionIdentifier(this, ByRef id) {
    hr := DllCall(NumGet(NumGet(this+0)+12*A_PtrSize), "ptr", this, "ptr*", id)
    VA_WStrOut(id)
    return hr
}
VA_IAudioSessionControl2_GetSessionInstanceIdentifier(this, ByRef id) {
    hr := DllCall(NumGet(NumGet(this+0)+13*A_PtrSize), "ptr", this, "ptr*", id)
    VA_WStrOut(id)
    return hr
}
VA_IAudioSessionControl2_GetProcessId(this, ByRef pid) {
    return DllCall(NumGet(NumGet(this+0)+14*A_PtrSize), "ptr", this, "uint*", pid)
}
VA_IAudioSessionControl2_IsSystemSoundsSession(this) {
    return DllCall(NumGet(NumGet(this+0)+15*A_PtrSize), "ptr", this)
}
VA_IAudioSessionControl2_SetDuckingPreference(this, OptOut) {
    return DllCall(NumGet(NumGet(this+0)+16*A_PtrSize), "ptr", this, "int", OptOut)
}

;
; IAudioSessionManager2 : {77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}
;   extends IAudioSessionManager
;
VA_IAudioSessionManager2_GetSessionEnumerator(this, ByRef SessionEnum) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "ptr", this, "ptr*", SessionEnum)
}
VA_IAudioSessionManager2_RegisterSessionNotification(this, SessionNotification) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "ptr", this, "ptr", SessionNotification)
}
VA_IAudioSessionManager2_UnregisterSessionNotification(this, SessionNotification) {
    return DllCall(NumGet(NumGet(this+0)+7*A_PtrSize), "ptr", this, "ptr", SessionNotification)
}
VA_IAudioSessionManager2_RegisterDuckNotification(this, SessionNotification) {
    return DllCall(NumGet(NumGet(this+0)+8*A_PtrSize), "ptr", this, "ptr", SessionNotification)
}
VA_IAudioSessionManager2_UnregisterDuckNotification(this, SessionNotification) {
    return DllCall(NumGet(NumGet(this+0)+9*A_PtrSize), "ptr", this, "ptr", SessionNotification)
}

;
; IAudioSessionEnumerator : {E2F5BB11-0570-40CA-ACDD-3AA01277DEE8}
;
VA_IAudioSessionEnumerator_GetCount(this, ByRef SessionCount) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "ptr", this, "int*", SessionCount)
}
VA_IAudioSessionEnumerator_GetSession(this, SessionCount, ByRef Session) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "ptr", this, "int", SessionCount, "ptr*", Session)
}

error: pathspec 'VA21/VA.ahk' did not match any file(s) known to git


Delete Serialmacroimgsearch.ahk

Delete Serialmacroimgsearch.ahk

error: pathspec '1.31b/Old' did not match any file(s) known to git
error: pathspec 'Files/Serialmacroimgsearch.ahk' did not match any file(s) known to git


A simple AutoHotKey Script to either execute directly or compile as a standalone .exe to make a window always stay on top by Hitting Ctrl + Space when the window is active.

To make the window behave normally again, simply Ctrl + Space again while the window is active.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

^SPACE::  Winset, Alwaysontop, , A

error: pathspec 'AutoHotKey/AlwaysOnTop.ahk' did not match any file(s) known to git


vim.ahk, from darwin16

vim.ahk, from darwin16

error: unable to create symlink vim.ahk: File name too long


modified common sends

modified common sends

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tqphan/ahk.git/'


demo.ahk

demo.ahk

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.

; map PrintScreen to ctrl+F8
PrintScreen::
    Keywait, PrintScreen
    Send ^{F8}
Return

; map ctrl+j to movement of the mouse to 1024, 500 and getting back to initial position
^j::
CoordMode, Mouse, Screen
  MouseGetPos, xpos, ypos
  Click 1024, 500
  MouseMove, xpos, ypos
Return

error: pathspec 'demo.ahk' did not match any file(s) known to git


Create 0. master.ahk

Create 0. master.ahk

error: pathspec 'templates/autohotkey_scripts/0.' did not match any file(s) known to git
error: pathspec 'master.ahk' did not match any file(s) known to git


Add ahk folder

Add ahk folder

; Source https://www.reddit.com/r/OneNote/comments/l2wv8i/horizontal_scrolling/

If WinActive("ahk_exe ONENOTE.EXE") ; If OneNote is active

; Shift + Wheel for horizontal scrolling
+WheelDown::WheelRight
+WheelUp::WheelLeft

#IfWinActive ; Do Nothing. Here to prevent the following hotkeys to get grouped under OneNote active condition

error: pathspec 'autohotkey/onenote_horizontal_scroll.ahk' did not match any file(s) known to git


removed my name from source

removed my name from source

error: pathspec 'samples/ahk/hello' did not match any file(s) known to git
error: pathspec 'world.ahk' did not match any file(s) known to git


Got the combine to work with standard formatting

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec '1.4.ahk' did not match any file(s) known to git


* ahk bind

* ahk bind

+!Right::
   Run, c:\bb_devel\bbcli.exe -c "(SwitchVertexViaEdge ""right"")"
Return

+!Left::
   Run, c:\bb_devel\bbcli.exe -c "(SwitchVertexViaEdge ""left"")"
Return

!F1::
   Run, c:\bb_devel\bbcli.exe -c "(SetCurrentVertexId ""f1"")"
Return

+!e::
   Run, Explorer.exe
Return

+!t::
   Run, c:\totalcmd\totalcmd64.exe
Return

+!d::
   Run, C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico /bin/bash -
Return

+!r::
	shell:=ComObjCreate("Shell.Application")
	#R::shell.FileRun()
Return

error: pathspec 'cfg/blackbox.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

https://chocolatey.org/packages/sumo

#NoEnv
SetTitleMatchMode, 1  ;matches if title begins with string
DetectHiddenText, off
DetectHiddenWindows, off
WinWait, KC Softwares, Navigation Bar, 30
WinActivate
Send, ^w
ExitApp

error: pathspec 'automatic/_output/sumo/4.2.2.295/tools/sumoInstall.ahk' did not match any file(s) known to git


Create emterMoney-3.1.ahk

Create emterMoney-3.1.ahk


Update toolkits.ahk

Update toolkits.ahk


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

error: pathspec 'automatic/_output/sumo/4.1.7.288/tools/sumoInstall.ahk' did not match any file(s) known to git


Fixed Refresh issue and searches

Fixed Refresh issue and searches

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec 'Revised.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

error: pathspec 'automatic/_output/sumo/4.2.0.292/tools/sumoInstall.ahk' did not match any file(s) known to git


Delete serial macro decomplied.ahk

Delete serial macro decomplied.ahk

00_Effectivity macro v1.2/serial macro decomplied.ahk

error: pathspec '00_Effectivity' did not match any file(s) known to git
error: pathspec 'macro' did not match any file(s) known to git
error: pathspec 'v1.2/serial' did not match any file(s) known to git
error: pathspec 'macro' did not match any file(s) known to git
error: pathspec 'decomplied.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo


updated timing for searchend and refreshrrate


Updated update check code

Updated update check code


Create 10. SQL Server Page.ahk

Create 10. SQL Server Page.ahk

templates/autohotkey_scripts/10. SQL Server Page.ahk

error: pathspec 'templates/autohotkey_scripts/10.' did not match any file(s) known to git
error: pathspec 'SQL' did not match any file(s) known to git
error: pathspec 'Server' did not match any file(s) known to git
error: pathspec 'Page.ahk' did not match any file(s) known to git


Update D2SpaceModifier.ahk

Update D2SpaceModifier.ahk

error: pathspec 'source' did not match any file(s) known to git
error: pathspec 'code/D2SpaceModifier.ahk' did not match any file(s) known to git


Updated on 2015-05-24: adwcleaner

Updated on 2015-05-24: adwcleaner

https://chocolatey.org/packages/adwcleaner

#NoEnv
SetTitleMatchMode, RegEx
DetectHiddenText, off
DetectHiddenWindows, off

loop,
{
  Sleep, 250
  IfWinExist, Outdated version, Cancel
  {
    WinActivate
    ControlClick, Button2, Outdated version, Cancel
  }
  IfWinExist, AdwCleaner - Terms of use, I agree
  {
    WinActivate
    ControlClick, Button1, AdwCleaner - Terms of use, I agree,
  }
  IfWinExist, AdwCleaner - v, Scan
  {
    WinClose, AdwCleaner - v, Scan
    ExitApp
  }
}

error: pathspec 'automatic/_output/adwcleaner/5.023/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Delete FormatSerials.ahk

Delete FormatSerials.ahk

error: pathspec '1.31b/Old' did not match any file(s) known to git
error: pathspec 'Files/FormatSerials.ahk' did not match any file(s) known to git


Create 24. Configure the IC User Accounts Page.ahk

templates/autohotkey_scripts/24. Configure the IC User Accounts Page.ahk

error: pathspec 'templates/autohotkey_scripts/24.' did not match any file(s) known to git
error: pathspec 'Configure' did not match any file(s) known to git
error: pathspec 'the' did not match any file(s) known to git
error: pathspec 'IC' did not match any file(s) known to git
error: pathspec 'User' did not match any file(s) known to git
error: pathspec 'Accounts' did not match any file(s) known to git
error: pathspec 'Page.ahk' did not match any file(s) known to git


Update toolkits.ahk

Update toolkits.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mingone/efficiently.git/'


Create 21. SIP Lines and the Default Registration Group Page.ahk

templates/autohotkey_scripts/21. SIP Lines and the Default Registration Group Page.ahk

error: pathspec 'templates/autohotkey_scripts/21.' did not match any file(s) known to git
error: pathspec 'SIP' did not match any file(s) known to git
error: pathspec 'Lines' did not match any file(s) known to git
error: pathspec 'and' did not match any file(s) known to git
error: pathspec 'the' did not match any file(s) known to git
error: pathspec 'Default' did not match any file(s) known to git
error: pathspec 'Registration' did not match any file(s) known to git
error: pathspec 'Group' did not match any file(s) known to git
error: pathspec 'Page.ahk' did not match any file(s) known to git


Update BJC-demo-1.0.ahk

Update BJC-demo-1.0.ahk


add line bot acceptance testing, close #50

; win+s 開始測試
#s::
    ; 簡單指令正面
    Send, 指令{Enter}
    Sleep, 2000

    Send, 清單{Enter}
    Sleep, 2000

    ; 簡單指令反面
    Send, 指{Enter}
    Sleep, 2000

    ; 新增正面
    Send, 新增 gossiping 問卦{Enter}
    Sleep, 2000

    Send, 新增 gossiping 問卦,爆卦,ＦＢ{Enter}
    Sleep, 2000

    Send, 新增 gossiping 新聞，公告，協尋{Enter}
    Sleep, 2000

    Send, 清單{Enter}
    Sleep, 2000

    ; 新增反面
    ; 新增版名錯誤
    Send, 新增 gossping 問卦{Enter}
    Sleep, 2000

    ; 新增多個版名
    Send 新增 gossiping,lol 問卦{Enter}
    Sleep, 2000

    ; 新增關鍵字分隔錯誤
    Send, 新增 gossiping 新聞, 公告{Enter}
    Sleep, 2000

    Send, 清單{Enter}
    Sleep, 2000

    ; 刪除反面
    ; 刪除版名錯誤
    Send, 刪除 gossping 問卦{Enter}
    Sleep, 2000

    ; 刪除多個版名
    Send 刪除 gossiping,lol 問卦{Enter}
    Sleep, 2000

    ; 刪除關鍵字分隔錯誤
    Send, 刪除 gossiping 新聞, 公告{Enter}
    Sleep, 2000

    Send, 清單{Enter}
    Sleep, 2000

    ; 刪除正面
    Send, 刪除 gossiping 新聞，公告{Enter}
    Sleep, 2000

    Send, 刪除 gossiping 爆卦,ＦＢ{Enter}
    Sleep, 2000

    Send, 刪除 gossiping 協尋{Enter}
    Sleep, 2000

    Send, 清單{Enter}
    Sleep, 2000

Escape::
ExitApp
Return

error: pathspec 'testing/linebot.ahk' did not match any file(s) known to git


delete some personal infomation

delete some personal infomation

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/solomonxie/Gists.git/'


Add files via upload

Add files via upload

Config file for keyboard shortcut operation.. Needs wget

; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script has a special filename and path because it is automatically
; launched when you run the program directly.  Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it.  You can have as many .ahk
; files as you want, located in any folder.  You can also run more than
; one .ahk file simultaneously and each will get its own tray icon.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.

~^Numpad7:: Run wget --spider -q -T 1 Http://192.168.5.11/ajax_inputs/d1=1
~^Numpad4:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d1=2
~^Numpad1:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d1=3
~^Numpad8:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d2=1
~^Numpad5:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d2=2
~^Numpad2:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d2=3
~^Numpad9:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d3=1
~^Numpad6:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d3=2
~^Numpad3:: Run wget --spider -T 1 Http://192.168.5.11/ajax_inputs/d3=3

; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded.  So feel free to customize it to suit your needs.

; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks.  It also explains more about hotkeys.

error: pathspec 'AutoHotkey.ahk' did not match any file(s) known to git


add ahk script for focusing Intellij projects

<#w::
  WinActivate, tunfor-web
return

<#s::
  WinActivate, tunfor-service
return

error: pathspec 'conf/autohotkey/svv-focus-intellij.ahk' did not match any file(s) known to git


Delete keycall.ahk

Delete keycall.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/VHAINNOVATIONS/Mental-Health-eScreening.git/'


Adds autohotkey script that demo-s all hotkeys and commands

#persistent
MsgNum := DllCall("RegisterWindowMessage", Str, "VIRTUALDESKTOPGRIDSWITCHER_COMMAND")

; All commands
GO_UP := 1
GO_LEFT := 2
GO_RIGHT := 3
GO_DOWN := 4
MOVE_UP := 5
MOVE_LEFT := 6
MOVE_RIGHT := 7
MOVE_DOWN := 8
TOGGLE_ALWAYS_ON_TOP := 9
TOGGLE_STICKY := 10
return

; Return an HWND that will receive our commands.
GetTargetHwnd() {
    DetectHiddenWindows, On
    WinGet, a, List, ahk_exe VirtualDesktopGridSwitcher.exe
    Loop, %a% {
        id := a%A_Index%
        WinGetClass, cls, ahk_id %id%
        ; Skip the "GDI+" window
        If(RegExMatch(cls, "^GDI") = 0) {
            return id
        }
    }
}

; Send a command to VirtualDesktopGridSwitcher
SendCommand(cmd) {
    ; All variables are global unless declared to be local
    global
    local id
    id := GetTargetHwnd()
    PostMessage, %MsgNum%, %cmd%, 0, , ahk_id %id%
}

;;;;;;;
; Hotkeys.  Customize these to your liking.

^#Left::SendCommand(GO_LEFT)
^#Right::SendCommand(GO_RIGHT)
^#Down::SendCommand(GO_DOWN)
^#Up::SendCommand(GO_UP)
#!Left::SendCommand(MOVE_LEFT)
#!Right::SendCommand(MOVE_RIGHT)
#!Down::SendCommand(MOVE_DOWN)
#!Up::SendCommand(MOVE_UP)
^#A::SendCommand(TOGGLE_ALWAYS_ON_TOP)
^#S::SendCommand(TOGGLE_STICKY)

error: pathspec 'autohotkey/virtual-desktop-hotkeys.ahk' did not match any file(s) known to git


Got single Prefix to Combine

Got single Prefix to Combine

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec '1.4.ahk' did not match any file(s) known to git


utilize startup ahk script

utilize startup ahk script

;##### startup.ahk
Loop Files, %A_ScriptDir%\*.ahk
{
  If (A_LoopFileName != A_ScriptName)
  {
    Run, %A_LoopFileName%
  }
}
ExitApp

error: pathspec 'ahk/startup.ahk' did not match any file(s) known to git


Changed it up at work

Changed it up at work

Need to start with rebuilding from scratch the functions to get the data from the macro window. Then move onto the next part etc.

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec 'Revised.ahk' did not match any file(s) known to git


Activate Wurm Unlimited Window before executing any commands to prevent mouse position errors

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sourcedog/Wurm-Unlimited-Bot.git/'


Multi tab working

Multi tab working

need to work on the single tab refresh slowness
Also tweak as needed


add new ahk file

add new ahk file

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/youdonghai/dotfiles.git/'


Fixed bug for Getting Doc title for update check.

ALso found out that wb.quit needs to be followed with wb:=""


exit performance

exit performance


Fixed Auto Engineer detect

Fixed Auto Engineer detect

Got the Auto detect dual engeering to work correctly. Need to start on the Bad Serials


add some autohotkey things I use a lot

add some autohotkey things I use a lot

; Things I always want to be running.

#SingleInstance force
#Persistent

; Windows+V -- parse clipboard as plaintext         (the same that Ctrl-Shift-V does in a few applications, but this works everywhere)
#v::
    _clipboard := Clipboard
    _clipboard := RegExReplace(_clipboard, "\r", "")
    _clipboard := RegExReplace(_clipboard, "s)^([^\n]*)\n+$", "$1")     ; If it's just a single line, trim off the newline(s) from the end
    if (RegExMatch(_clipboard, "s)^[^\n]*$")) {
        _clipboard := RegExReplace(_clipboard, "\s+$", "")      ; If it's just a single line, trim off the spaces from the end
    }
    SendRaw, %_clipboard%
    Return

error: pathspec 'autohotkey/always.ahk' did not match any file(s) known to git


Update toolkits.ahk

Update toolkits.ahk


Changed code a lil

Changed code a lil

got the searchend to work. need to find a way to make it work faster with the searching. Maybe searchend search a few times, then issue search?


WIP: Add ahk-script to duplicate window width (useful with vertical monitors)

+#Up::
  WinGetActiveTitle, Title
  WinRestore, %Title%
  SysGet, X1, 76
  SysGet, Y1, 77
  SysGet, Width, 78
  SysGet, Height, 79
  WinMove, %Title%,, X1, Y1, Width, Height
return

error: pathspec 'conf/autohotkey/duplicate-window-width.ahk' did not match any file(s) known to git


Delete Version_check_serialmacro.ahk

Delete Version_check_serialmacro.ahk

error: pathspec '1.31b/Old' did not match any file(s) known to git
error: pathspec 'Files/Version_check_serialmacro.ahk' did not match any file(s) known to git


Delete Effectivity macro.ahk

Delete Effectivity macro.ahk

error: pathspec '1.31b/Effectivity' did not match any file(s) known to git
error: pathspec 'macro.ahk' did not match any file(s) known to git


prep main file

prep main file

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

;// examples from https://autohotkey.com/boards/viewtopic.php?f=7&t=4588

;activex gui - test  joedf - 2014/07/04
#SingleInstance, off
OnExit,OnExit

MYAPP_PROTOCOL:="myapp"

HTML_page =
( Ltrim Join
<!DOCTYPE html>

Lorem Ipsum

Welcome!

The standard Lorem Ipsum passage, used since the 1500s

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

			Click me for a MsgBox -
			Click me for nothing -
			Click me for a ding sound!

)

Gui Add, ActiveX, x0 y0 w640 h480 vWB, Shell.Explorer  ; The final parameter is the name of the ActiveX component.
WB.silent := true ;Surpress JS Error boxes
Display(WB,HTML_page)
ComObjConnect(WB, WB_events)  ; Connect WB's events to the WB_events class object.
Gui Show, w640 h480
return

GuiClose:
ExitApp

OnExit:
	FileDelete,%A_Temp%\*.DELETEME.html ;clean tmp file
ExitApp

class WB_events
{
	;for more events and other, see http://msdn.microsoft.com/en-us/library/aa752085

	NavigateComplete2(wb) {
		wb.Stop() ;blocked all navigation, we want our own stuff happening
	}
	DownloadComplete(wb, NewURL) {
		wb.Stop() ;blocked all navigation, we want our own stuff happening
	}
	DocumentComplete(wb, NewURL) {
		wb.Stop() ;blocked all navigation, we want our own stuff happening
	}

	BeforeNavigate2(wb, NewURL)
	{
		wb.Stop() ;blocked all navigation, we want our own stuff happening
		;parse the url
		global MYAPP_PROTOCOL
		if (InStr(NewURL,MYAPP_PROTOCOL "://")==1) { ;if url starts with "myapp://"
			what := SubStr(NewURL,Strlen(MYAPP_PROTOCOL)+4) ;get stuff after "myapp://"
			if InStr(what,"msgbox/hello")
				MsgBox Hello world!
			else if InStr(what,"soundplay/ding")
				SoundPlay, %A_WinDir%\Media\ding.wav
		}
		;else do nothing
	}
}

Display(WB,html_str) {
	Count:=0
	while % FileExist(f:=A_Temp "\" A_TickCount A_NowUTC "-tmp" Count ".DELETEME.html")
		Count+=1
	FileAppend,%html_str%,%f%
	WB.Navigate("file://" . f)
}

;activex gui 2 - test  joedf - 2014/09/19
#SingleInstance, off
OnExit,OnExit

HTML_page =
( Ltrim Join
<!DOCTYPE html>

Hello World

		<textarea rows="4" cols="70" id="MyTextBox">1234567890-=\ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$^&*()_+|~</textarea>

			<input type="button" id="MyButton1" value="Show Content in AHK MsgBox">
			<input type="button" id="MyButton2" value="Change Content with AHK">
			<input type="button" id="MyButton3" value="Greetings from AHK">

)

Gui Add, ActiveX, x0 y0 w640 h480 vWB, Shell.Explorer  ; The final parameter is the name of the ActiveX component.
WB.silent := true ;Surpress JS Error boxes
Display(WB,HTML_page)

;Wait for IE to load the page, before we connect the event handlers
while WB.readystate != 4 or WB.busy
	sleep 10

;Use DOM access just like javascript!
MyButton1 := wb.document.getElementById("MyButton1")
MyButton2 := wb.document.getElementById("MyButton2")
MyButton3 := wb.document.getElementById("MyButton3")
ComObjConnect(MyButton1, "MyButton1_") ;connect button events
ComObjConnect(MyButton2, "MyButton2_")
ComObjConnect(MyButton3, "MyButton3_")
Gui Show, w640 h480
return

GuiClose:
ExitApp
OnExit:
	FileDelete,%A_Temp%\*.DELETEME.html ;clean tmp file
ExitApp

; Our Event Handlers
MyButton1_OnClick() {
	global wb
	MsgBox % wb.Document.getElementById("MyTextBox").Value
}
MyButton2_OnClick() {
	global wb
	FormatTime, TimeString, %A_Now%, dddd MMMM d, yyyy HH:mm:ss
	data := "AHK Version " A_AhkVersion " - " (A_IsUnicode ? "Unicode" : "Ansi") " " (A_PtrSize == 4 ? "32" : "64") "bit`nCurrent time: " TimeString
	wb.Document.getElementById("MyTextBox").value := data
}
MyButton3_OnClick() {
	MsgBox Hello world!
}
;------------------
Display(WB,html_str) {
	Count:=0
	while % FileExist(f:=A_Temp "\" A_TickCount A_NowUTC "-tmp" Count ".DELETEME.html")
		Count+=1
	FileAppend,%html_str%,%f%
	WB.Navigate("file://" . f)
}

error: pathspec 'Webapp.ahk' did not match any file(s) known to git


Shows Mouse Coordinates

Shows Mouse Coordinates

; Shows Mouse-Coordinates upon pressing Alt+x

!x::
MouseGetPos, xpos, ypos
Msgbox, The cursor is at X%xpos% Y%ypos%.
return

error: pathspec 'MousePos.ahk' did not match any file(s) known to git


Create 8. Reporting Page.ahk

Create 8. Reporting Page.ahk

error: pathspec 'templates/autohotkey_scripts/8.' did not match any file(s) known to git
error: pathspec 'Reporting' did not match any file(s) known to git
error: pathspec 'Page.ahk' did not match any file(s) known to git


simple auto exit

simple auto exit

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mingone/efficiently.git/'


Create ConvertiTunesToPlex.ahk

Create ConvertiTunesToPlex.ahk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/philosowaffle/NewDeviceSetup.git/'


Updated on 2015-10-11: qttabbar

Updated on 2015-10-11: qttabbar

https://chocolatey.org/packages/qttabbar

; default environment
DetectHiddenWindows, off
SetControlDelay, 20

; modified environment
#NoEnv
#NoTrayIcon
DetectHiddenText, off
SetTitleMatchMode, 2

; variables
winTitleIE = - Internet Explorer ahk_class IEFrame ahk_exe iexplore.exe
winTitleAddons = Manage Add-ons ahk_class #32770 ahk_exe iexplore.exe
winTitleEnable = Enable add-on ahk_class #32770 ahk_exe iexplore.exe

Process, Exist, iexplore.exe
if !ErrorLevel = 0 {
  procExists = 1
  WinActivate,%winTitleIE%
} else {
  procExists = 0
  Run, iexplore, , , pid
;  WinWait, ahk_pid %pid%, Address Bar, 60  ;too quick
;  WinActivate, ahk_pid %pid%, , 10
  WinWait, %winTitleIE%, , 60
  WinActivate, %winTitleIE%, , 60
  Send {ALT Down}x{ALT Up}m
  Sleep 250
}

Send {TAB 2}QTTabBar{ALT Down}e{ALT Up}
Sleep 1000

IfWinActive, %winTitleEnable%
{
  Send {ENTER}
  Send {ALT Down}l{ALT Up}
  CloseIE()
  sleep 10000
  Return
}
IfWinActive, %winTitleAddons%
{
  Send {ALT Down}l{ALT Up}
  CloseIE()
}

CloseIE()
{
  if procExists = 1
  {
    WinActivate,%winTitleIE%,
    Send, ^w
  }
  else
  {
    WinClose, ahk_exe iexplore.exe
  }
}

; File Explorer
Run, explorer
WinWait, ahk_exe explorer.exe, , 60
WinActivate, ahk_exe explorer.exe
Sleep 500
SetKeyDelay 50
Send {ALT}
Send {V}
Send {Y}
Send {DOWN 2}
Send {SPACE}
Send {ALT down}{F4}

error: pathspec 'automatic/_output/qttabbar/1036.0/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Create BJC-demo-1.0.ahk

Create BJC-demo-1.0.ahk


Updated on 2015-10-11: qttabbar

Updated on 2015-10-11: qttabbar

error: pathspec 'automatic/_output/qttabbar/1030.0/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Create Generate CIC license file.ahk

Create Generate CIC license file.ahk

templates/autohotkey_scripts/Generate CIC license file.ahk

error: pathspec 'templates/autohotkey_scripts/Generate' did not match any file(s) known to git
error: pathspec 'CIC' did not match any file(s) known to git
error: pathspec 'license' did not match any file(s) known to git
error: pathspec 'file.ahk' did not match any file(s) known to git


Updated on 2015-05-30: sumo

Updated on 2015-05-30: sumo

error: pathspec 'automatic/_output/sumo/4.1.7.288/tools/sumoInstall.ahk' did not match any file(s) known to git


Updated on 2015-10-11: qttabbar

Updated on 2015-10-11: qttabbar

error: pathspec 'automatic/_output/qttabbar/1033.0/tools/chocolateyInstall.ahk' did not match any file(s) known to git


Create 30. Commit your Choices Page.ahk

Create 30. Commit your Choices Page.ahk

templates/autohotkey_scripts/30. Commit your Choices Page.ahk

error: pathspec 'templates/autohotkey_scripts/30.' did not match any file(s) known to git
error: pathspec 'Commit' did not match any file(s) known to git
error: pathspec 'your' did not match any file(s) known to git
error: pathspec 'Choices' did not match any file(s) known to git
error: pathspec 'Page.ahk' did not match any file(s) known to git


Comments

Comments

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sourcedog/Wurm-Unlimited-Bot.git/'


Updated on 2015-10-11: qttabbar


Update toolkits.ahk

Update toolkits.ahk


faster search screen

faster search screen


add autohotkeys config file

add autohotkeys config file

SetCapsLockState AlwaysOff

!x::
  IfWinActive, Hyper
    Send ^+x
  else
    Send ^x
Return

!c::
  IfWinActive, Hyper
    Send ^+c
  else
    Send ^c
Return

!v::
  IfWinActive, Hyper
    Send ^+v
  else
    Send ^v
Return

CapsLock & b::Send {Left}
CapsLock & f::Send {Right}
CapsLock & p::Send {Up}
CapsLock & n::Send {Down}
CapsLock & a::Send {Home}
CapsLock & e::Send {End}

CapsLock & c::Send ^c
CapsLock & u::Send ^u
CapsLock & d::Send ^d
CapsLock & w::Send ^w
CapsLock & v::Send ^v

CapsLock & h::Send ^h
CapsLock & j::Send ^j
CapsLock & k::Send ^k
CapsLock & l::Send ^l

CapsLock & 1::Send ^1
CapsLock & 2::Send ^2
CapsLock & 3::Send ^3
CapsLock & 4::Send ^4
CapsLock & 5::Send ^5
CapsLock & 6::Send ^6
CapsLock & 7::Send ^7
CapsLock & 8::Send ^8
CapsLock & 9::Send ^9
CapsLock & 0::Send ^0

!n::Send ^n
!w::Send ^w
!t::Send ^t
!r::Send ^r
!s::Send ^s
!l::Send ^l
!a::Send ^a
!f::Send ^f
!z::Send ^z

error: pathspec 'windows/mac.ahk' did not match any file(s) known to git


Latest code updates upgrade

Latest code updates upgrade

error: pathspec '1.4/Rewrite' did not match any file(s) known to git
error: pathspec 'of' did not match any file(s) known to git
error: pathspec 'Revised.ahk' did not match any file(s) known to git


Changed update check

Changed update check

auto download file from google drive
Parse and check for update in a window


Delete Gdip_ImageSearch.ahk

Delete Gdip_ImageSearch.ahk

error: pathspec '00_Effectivity' did not match any file(s) known to git
error: pathspec 'macro' did not match any file(s) known to git
error: pathspec 'v1.2/Gdip_ImageSearch.ahk' did not match any file(s) known to git


Added AHK folder

Added AHK folder

Added AutoHotKey folder and script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/oilspillryan/OSCAR.git/'


Updated on 2015-04-10: github

Updated on 2015-04-10: github

; default environment
DetectHiddenWindows, off
SetControlDelay, 20
SetKeyDelay, 10

; modified environment
#NoEnv
#NoTrayIcon
DetectHiddenText, off
SetTitleMatchMode, RegEx

WinWait, Application Install - Security Warning, Do you want to install this application, 10
WinActivate
ControlClick, &Install, Application Install - Security Warning

; Download progress window is spawned by Microsoft ClickOnce
; If you know how to silence this window, please send a message to maintainer:
;   https://chocolatey.org/packages/GitHub/ContactOwners
WinWait, Installing GitHub, This may take several minutes, 2
WinActivate
WinMinimize, Installing GitHub, This may take several minutes

; 45MB file, wait max of 20 minutes (1 Mbps bandwidth ~= 6 minutes to download)
; Upon completion of download, files are extracted to:
;   $Env:LocalAppData\Apps\2.0\varSysUniq01\varSysUniq02\
; Installer blocked due to being marked a downloaded file:
;   gith..tion_317444273a93ac29_0002.000d_7c798cfff9a06ed4\GitHub.exe
WinWait, Open File - Security Warning ahk_class #32770, , 1200
WinActivate
Send {Tab 4}
Sleep 250
ControlSend, , {Enter}, Open File - Security Warning ahk_class #32770

; GitHub is launched automatically post-install, close it
WinWait, GitHub ahk_class HwndWrapper\[DefaultDomain, , 60
WinActivate
WinClose, GitHub ahk_class HwndWrapper\[DefaultDomain

ExitApp

error: pathspec 'automatic/_output/github/3.0.7.1/tools/githubInstall.ahk' did not match any file(s) known to git