Skip to content

Instantly share code, notes, and snippets.

@danilobatistaqueiroz
Last active May 18, 2019 23:48
Show Gist options
  • Select an option

  • Save danilobatistaqueiroz/a80fe41c95e4f49d9fab361e5b226084 to your computer and use it in GitHub Desktop.

Select an option

Save danilobatistaqueiroz/a80fe41c95e4f49d9fab361e5b226084 to your computer and use it in GitHub Desktop.
autohotkey scripts

Always on top:

+^a::  Winset, Alwaysontop, , A

Feature similar to that found on Ubuntu to toggle visibility of hidden files
This script flags files/folders starting with . with hidden attribute
Press WinKey + H

#h::
{
    SetRegView 64
	ConfigHidden := 0
	;MsgBox, Inicio %ConfigHidden%
	RegRead, ConfigHidden, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
	;MsgBox, Antes dos Ifs %ConfigHidden%
	if ConfigHidden = 0
	{
		ConfigHidden := 1
	}
	else
	{
		ConfigHidden := 0
	}

	WinGetTitle, Title, A
	FileSetAttrib, +H, %Title%\.*, 1

	;MsgBox, Apos ifs %ConfigHidden%
	RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, %ConfigHidden%
	Send {F5}
	Return
}

Script for AutoIt snipping tool

; Windows-Key + s

; this script opens the snipping tool with a shortcut

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force  ; Ensures that only the last executed instance of script is running
;}

; HOTKEYS
;{-----------------------------------------------
;
#s::	; <-- Open/Activate/Minimize Windows Snipping Tool
{
	Run, "C:\Windows\Sysnative\SnippingTool.exe" 
	return
}

Auto Hide Windows Bar (using Control+Shift+W)
https://autohotkey.com/board/topic/25932-trying-to-toggle-autohide-taskbar-with-keystroke-in-vista/page-3

VarSetCapacity(APPBARDATA, A_PtrSize=4 ? 36:48)

+^w::
	NumPut(DllCall("Shell32\SHAppBarMessage", "UInt", 4 ; ABM_GETSTATE
											, "Ptr", &APPBARDATA
											, "Int")
	? 2:1, APPBARDATA, A_PtrSize=4 ? 32:40) ; 2 - ABS_ALWAYSONTOP, 1 - ABS_AUTOHIDE
	, DllCall("Shell32\SHAppBarMessage", "UInt", 10 ; ABM_SETSTATE
										, "Ptr", &APPBARDATA)
		KeyWait, % A_ThisHotKey
		Return
; this script changes the default behavior of renaming files
#IfWinActive, ahk_class CabinetWClass
F2::Send {F2}^a
#IfWinActive
; this script paste a text with the Window Key + c
#!c::
SendInput, [email protected]
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment