Skip to content

Instantly share code, notes, and snippets.

@math0ne
Created March 8, 2015 22:46
Show Gist options
  • Save math0ne/26d7aebb32d6d9fb035e to your computer and use it in GitHub Desktop.
Save math0ne/26d7aebb32d6d9fb035e to your computer and use it in GitHub Desktop.
#Persistent
;;Menu, Tray, Icon , C:\Users\math0ne\Dropbox\[config]\blzos_tray_icons_by_blazezone\skype.ico
Menu, tray, NoStandard
Menu, Tray, Add, Exit, Exit
;;Menu, Tray, Add, LeftLarge, LeftLarge
;;Menu, Tray, Add, RightSmall, RightSmall
GetTaskBarLocation()
{
RegRead, TaskBarSettings, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2, Settings
if (SubStr(TaskBarSettings, 26, 1) = 0)
{
TaskBarLocation := "LEFT"
return TaskBarLocation
}
if (SubStr(TaskBarSettings, 26, 1) = 1)
{
TaskBarLocation := "TOP"
return TaskBarLocation
}
if (SubStr(TaskBarSettings, 26, 1) = 2)
{
TaskBarLocation := "RIGHT"
return TaskBarLocation
}
if (SubStr(TaskBarSettings, 26, 1) = 3)
{
TaskBarLocation := "BOTTOM"
return TaskBarLocation
}
}
ResizeWinMine(Width = 0,Height = 0, MyLeft = 0, MyTop = 0)
{
If(WinActive("ahk_exe emacs.exe")){
} else {
if (GetTaskBarLocation() = "BOTTOM"){
MyTop := MyTop - 35
}
WinGetPos,X,Y,W,H,A
If %Width% = 0
Width := W
If %Height% = 0
Height := H
WinMove,A,,%MyLeft%,%MyTop%,%Width%,%Height%
}
}
ResizeWinMineEmacs(Width = 0,Height = 0, MyLeft = 0, MyTop = 0)
{
If(WinActive("ahk_exe emacs.exe")){
WinGetPos,X,Y,W,H,A
if (GetTaskBarLocation() = "BOTTOM"){
MyTop := MyTop - 35
}
If %Width% = 0
Width := W
If %Height% = 0
Height := H
WinMove,A,,%MyLeft%,%MyTop%,%Width%,%Height%
} else {
WinGetPos,X,Y,W,H,A
MyTop := MyTop + 4
Height := Height - 4
if (GetTaskBarLocation() = "BOTTOM"){
MyTop := MyTop - 35
}
MyLeft := MyLeft + 6
Width := Width - 6
If %Width% = 0
Width := W
If %Height% = 0
Height := H
WinMove,A,,%MyLeft%,%MyTop%,%Width%,%Height%
}
}
;; Left Large
;; #q::ResizeWin(1224,1050, 1)
#q::ResizeWinMineEmacs(1200,1031, 4, 40)
;; Right Small
;;#w::ResizeWin(696,1050, 2)
#w::ResizeWinMine(696,1027, 1213, 44)
;; Right Top Small
#e::ResizeWinMine(696,498, 1213, 44)
;; Right Bot Small
#d::ResizeWinMine(696,520, 1213, 551)
Exit:
ExitApp
;;LeftLarge:
;;ResizeWin(1224,1050, 1)
;;return
;;RightSmall:
;;ResizeWin(696,1050, 2)
;;return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment