This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import subprocess | |
import re | |
from ctypes import * | |
class ahkexec(sublime_plugin.TextCommand): | |
# SET YOUR SETTINGS HERE | |
# Specify a 'key'(name it whatever you want) and assign it | |
# a 'value'(string) containing the path to the AHK executable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
_________________________________________________________________________________________ | |
FUNCTION: SetButtonF | |
DESCRIPTION: Set a button control to call a function instead of a label subroutine | |
PARAMETER(s): | |
hButton := Button control's handle | |
FunctionName := Name of fucntion to associate with button | |
USAGE: | |
Setting a button: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inObj(obj, ss, cs:=false, bv:=true) { | |
r := false | |
if (!cs && !bv) | |
return ObjHasKey(obj, ss) | |
for a, b in obj | |
if (r := !r ? (cs ? (ss == (bv ? b : a)) : (ss = b)) : r) | |
break ; stop loop if found | |
return r ? a : r | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LV_MoveRow(up=true) { | |
if (up && LV_GetNext() == 1) | |
|| (!up && LV_GetNext() == LV_GetCount()) | |
|| (LV_GetNext() == 0) | |
return | |
pos := LV_GetNext() | |
, xpos := up ? pos-1 : pos+1 | |
Loop,% LV_GetCount("Col") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; I added a feather field instead of a new func. | |
Gui, Show, w500 h500 | |
; By: Sjc1000 | |
; http://www.autohotkey.com/board/topic/90132-class-sc-cutwindow-easily-cut-windows-into-shapes/ | |
Class SC_CutWindow | |
{ | |
Square( Window_Name, X1, Y1, X2, Y2, Feather, Invert) | |
{ If ( X1 > X2 || Y1 > Y2 ) | |
Return 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
By Toralf: | |
Forum thread: http://www.autohotkey.com/forum/topic59407.html | |
Basic idea for SIFT3 code by Siderite Zackwehdex | |
http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html | |
Took idea to normalize it to longest string from Brad Wood | |
http://www.bradwood.com/string_compare/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Prevent "sizing arrow" cursor when hovering over window border | |
WM_SETCURSOR(wParam, lParam) { ; WM_SETCURSOR := 0x0020 | |
; standard arrow cursor | |
static HARROW := DllCall("LoadCursor", "Ptr", 0, "Ptr", 32512, "UPtr") | |
HTCODE := lParam & 0xFFFF | |
if (HTCODE > 9) && (HTCODE < 19) { ; cursor is on a border | |
DllCall("SetCursor", "Ptr", HARROW) ; show arrow cursor | |
return true ; prevent further processing | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
range(stop, start:=0, step:=1) { | |
r := [] | |
Loop | |
v := start+step*(A_Index-1) | |
, r[v] := v | |
until (stop<0 ? v<=stop-step : v>=stop-step) | |
return r | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Function: Anchor | |
Defines how controls should be automatically positioned relative to the new dimensions of a window when resized. | |
Parameters: | |
cl - a control HWND, associated variable name or ClassNN to operate on | |
a - (optional) one or more of the anchors: 'x', 'y', 'w' (width) and 'h' (height), | |
optionally followed by a relative factor, e.g. "x h0.5" | |
r - (optional) true to redraw controls, recommended for GroupBox and Button types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
derived from Getfree's parseJson function | |
http://www.autohotkey.com/board/topic/93300-what-format-to-store-settings-in/#entry588268 | |
credits to Getfree | |
*/ | |
JSON_parse(jsonStr) { | |
SC := ComObjCreate("ScriptControl") | |
SC.Language := "JScript" | |
ComObjError(false) | |
jsCode = |
OlderNewer