audio333
10/30/2017 - 5:55 AM

AHK: always on top / hotstrings

AHK: always on top / hotstrings

#InstallKeybdHook
#SingleInstance force
/*
Hotkeys:
Alt-A: make window always on top

Alt-W: make window less transparent
Alt-S: make window more transparent

Alt-X: make window clickthoughable
Alt-Z: make window under mouse unclickthroughable
*/

#q::
WinGet, currentWindow, ID, A
WinGet, ExStyle, ExStyle, ahk_id %currentWindow%
if (ExStyle & 0x8)  ; 0x8 is WS_EX_TOPMOST.
{
	Winset, AlwaysOnTop, off, ahk_id %currentWindow%
	SplashImage,, x0 y0 b fs12, OFF always on top.
	Sleep, 1500
	SplashImage, Off
}
else
{
	WinSet, AlwaysOnTop, on, ahk_id %currentWindow%
	SplashImage,,x0 y0 b fs12, ON always on top.
	Sleep, 1500
	SplashImage, Off
}
return

#w::
WinGet, currentWindow, ID, A
if not (%currentWindow%)
{
	%currentWindow% := 255
}
if (%currentWindow% != 255)
{
	%currentWindow% += 5
	WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
}
SplashImage,,w100 x0 y0 b fs12, % %currentWindow%
SetTimer, TurnOffSI, 1000, On
Return

#s::
SplashImage, Off
WinGet, currentWindow, ID, A
if not (%currentWindow%)
{
	%currentWindow% := 255
}
if (%currentWindow% != 5)
{
	%currentWindow% -= 5
	WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
}
SplashImage,, w100 x0 y0 b fs12, % %currentWindow%
SetTimer, TurnOffSI, 1000, On
Return

#x::
WinGet, currentWindow, ID, A
WinSet, ExStyle, +0x80020, ahk_id %currentWindow%
return

#z::
MouseGetPos,,, MouseWin ; Gets the unique ID of the window under the mouse
WinSet, ExStyle, -0x80020, ahk_id %currentWindow%
Return

TurnOffSI:
SplashImage, off
SetTimer, TurnOffSI, 1000, Off
Return





!t::
	WinExist("ahk_class Shell_TrayWnd")

	t := !t

	If (t = "1") {
		WinHide, ahk_class Shell_TrayWnd
		WinHide, Start ahk_class Button
	} Else {
		WinShow, ahk_class Shell_TrayWnd
		WinShow, Start ahk_class Button
	}


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

#b::
   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

     ; Hotstring

     :*:chromeahk::
     	Run, chrome.exe
     Return


     :*:devjobahk::
     	Run, chrome.exe https://www.google.com.ph/search?dcr=0&source=hp&q=web+developer+job+hiring+ph&oq=web+developer+job+hiring+ph&gs_l=psy-ab.3..35i39k1l2j0j0i22i30k1l5.2841.12337.0.12608.36.30.1.0.0.0.485.4287.0j5j7j4j1.17.0....0...1.1.64.psy-ab..18.16.4020.0..0i67k1j0i20i263k1j0i13k1j0i13i30k1j0i8i13i30k1j0i8i13i10i30k1j0i22i10i30k1j33i22i29i30k1.0.MZGcXgDiXZA
     Return

     ; autosave
     #;::
		Send, `;
     	Sleep, 300
     	Send, ^s
	Sleep, 1000
     	Send, ^s
     Return

     #Tab::
      Send, {Esc}
      Sleep, 100
     	Send, `t
     	Sleep, 300
     	Send, ^s
	    Sleep, 1000
     	Send, ^s
     Return

     ^!r::Reload

   /*
   :*:test::
   DoMsg("chrome.exe", " www.youtube.com")
   return

   DoMsg(App, Sitename)
   {
      Run, %App%, %Sitename%
   }
   */