Skip to content

Instantly share code, notes, and snippets.

@TLMcode
TLMcode / Change Display Brightness.ahk
Last active November 18, 2020 21:36
Change Display Brightness using AHk & WMI
; Variables
Increments := 10 ; < lower for a more granular change, higher for larger jump in brightness
CurrentBrightness := GetCurrentBrightNess()
; Hot Keys
F6::ChangeBrightness( CurrentBrightness -= Increments ) ; decrease brightness
F7::ChangeBrightness( CurrentBrightness += Increments ) ; increase brightness
; Functions
ChangeBrightness( ByRef brightness, timeout = 1 )
@TLMcode
TLMcode / Open-Media-Directories.ahk
Created November 13, 2020 17:47
Open Media Directories for AutoHotkey
TopDir := HomeDrive "\Users\" A_UserName
SubDir := "CWD_Cue_Videos"
DirArr := [ "Music", "Pictures", "Videos" ]
For Each, Dir in DirArr
{
run % CurDir := TopDir "\" Dir "\" SubDir,,, DirPid
winwait % CurDir
winactivate % CurDir
@TLMcode
TLMcode / GetDllBitness.ahk
Last active January 17, 2020 15:49
Returns the bitness of a dll file
DllPath := A_ScriptDir "\amf-component-vc-windesktop32.dll" ; point to full path of dll
DllName := (d:=StrSplit( DllPath,"\"))[d.Length()] ; for display purposes only
Bitness := GetDllBitness( DllPath ) ; test call
msgbox % DllName " is " Bitness "Bit"
GetDllBitness( dll, warn:=0 )
{
hM := DllCall( "LoadLibrary", "str", "imagehlp.dll", "ptr" ), VarSetCapacity( LIS, 88, 0 )
@TLMcode
TLMcode / GetBinaryType.ahk
Last active January 13, 2020 19:14
Determines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file.
path := A_ScriptDir "\curl.exe" ; example path to executable
Msgbox % GetBinaryType( path ) ; example call
GetBinaryType( bin, warn:=0 )
{
typeConsts := [ "32BIT_BINARY", "DOS_BINARY", "WOW_BINARY", "PIF_BINARY"
, "POSIX_BINARY", "OS216_BINARY", "64BIT_BINARY" ]
@TLMcode
TLMcode / EnumComMembers.ahk
Last active December 31, 2019 06:34
Enumerate COM Object Members
;;
;; iTypeInfo - Enum Com Members - By jethrow
;;
;; small Mod by Blackholyman to output member Name and Doc string in "UTF-16" and put it in a listview
;;
;; GUI & furthers Mods by TLM
;;
Gui, Add, Text,, Enter COM Object
Gui, Add, Edit, vComObject w200, MSXML2.DOMDocument.6.0 ; , % Format( "{:50}", A_Space )
@TLMcode
TLMcode / Github Webhook Tutorial.md
Created December 29, 2019 08:39 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@TLMcode
TLMcode / DetectExcelCellData.ahk
Created December 16, 2019 03:25
Detect Data in Excel Cells per Row using ComObjectConnect
wbk := ComExcelConnect( "ahk_class XLMAIN" ).Application ; ComObjActive("Excel.Application")
; a::
F1::
; Loop % UsedRows
While ( A_Index <= wbk.ActiveSheet.UsedRange.Rows.Count )
{
CurRow := A_Index, Cols := wbk.Cells( CurRow, 256 ).End( -4159 ).Column
Loop % Cols
@TLMcode
TLMcode / subclass-editcontrol.ahk
Last active December 15, 2019 22:38
subclass edit control to remove balloon/tooltips in autohotkey
Gui Add, Edit, x56 y64 w120 h21 +Number +Password +HwndHED
SubclassControl( HED, "EditSubclass" ) ; placed here to catch preemptive balloontips
Gui, Show, w244 h155, Window
Return
GuiClose:
ExitApp
; ======================================================================================================================
; Add these functions to your script TLM ;)
@TLMcode
TLMcode / launcher-placement.ahk
Created March 10, 2019 23:54
app launcher & screen placement script
if !( SndVolId := WinExist( "ahk_exe SndVol.exe" ) )
{
Run, SndVol.exe,,, SndVolPid
WinWait % "ahk_pid " SndVolPid
SndVolId := WinExist( "ahk_pid " SndVolPid )
}
WinSet AlwaysOnTop, On, % "ahk_id " SndVolId
WinMove, % "ahk_id " SndVolId,, % A_ScreenWidth, % A_ScreenHeight+100
WinGetPos, SndVolX,, SndVolW, SndVolH, % "ahk_id " SndVolId
CoordMode Mouse, Screen
PosArr := []
~LButton::
MouseGetPos, mPosX, mPosY, mPosWin, mPosControl
PosArr.Push( mPosX, mPosY )
return
F1::
for i in PosArr