Skip to content

Instantly share code, notes, and snippets.

@TLMcode
TLMcode / GUI Options
Last active December 10, 2015 20:08
GUI Options for collaborative project with AHk user guest3456
DetectHiddenWindows, On
SetWorkingDir % A_ScriptDir
IniFile = config.ini
Loop 2 ; << THIS LOOP ONLY CHECKS AND DOWNLOADS THE DEMO PICTURES. IT CAN BE REMOVED!
UrlDownloadToFile, % "http://cwmb.zxq.net/" ( img:=((i:=!i) ? "" : "s_" ) "pic.jpg" )
, % !FileExist( img ) ? img : ""
@TLMcode
TLMcode / AlphaSortEx() AHk
Created January 30, 2013 13:22
Sorts a list of items by alpha and ignores non word characters. Function posted with example.
;___________________
; example
List =
(
New, Agnes
New Jersey
New, Thomas
New York
"New York Dining"
@TLMcode
TLMcode / LVGetCheckedItems()
Last active December 12, 2015 10:18
Returns a list of checked items from a standard ListView Control
LVGetCheckedItems(cN,wN) {
ControlGet, LVItems, List,, % cN, % wN
Item:=Object()
While Pos
Pos:=RegExMatch(LVItems,"`am)(^.*?$)",_,!Pos?(Pos:=1):Pos+StrLen(_)),mCnt:=A_Index-1,Item[mCnt]:=_1
Loop % mCnt {
SendMessage, 0x102c, A_Index-1, 0x2000, % cN, % wN
ChkItems.=(ErrorLevel ? Item[A_Index-1] "`n" : "")
}
Return ChkItems
@TLMcode
TLMcode / CreateExcelLists()
Last active December 15, 2015 17:48
CreateExcelLists() Function to separate value types into 2 lists Strength and Units. Original query: http://ahk4.me/10xyV4j
WorkBook := A_ScriptDir "\book1.xls" ; change this to your workbook location
CreateExcelLists(WorkBook,"A","B",StrengthList,UnitList,"Sheet1")
; optional display
Run Notepad,,, nPid
WinWait, % "ahk_pid " nPid
ControlSetText, Edit1, % "StrengthList:`r`n" StrengthList ; << Strength stored here
. "`r`n" "UnitList:`r`n" UnitList ; << Units stored here
, % "ahk_pid " nPid
;AHK v1
#NoEnv
/*
MsgBox % BinaryToText(Temp1 := TextToBinary("Test")) . "`n" . Temp1
MsgBox % BinaryToNumber(Temp1 := NumberToBinary(1234)) . "`n" . Temp1
*/
TextToBinary(ByRef InputText)
{
@TLMcode
TLMcode / Gdip_PixelateBitmap()
Created May 7, 2013 10:26
Gdip_PixelateBitmap() bitmap header.
Gdip_PixelateBitmap(pBitmap, ByRef pBitmapOut, BlockSize)
{
static PixelateBitmap
if !PixelateBitmap
{
MCode_PixelateBitmap := "83EC388B4424485355568B74245C99F7FE8B5C244C8B6C2448578BF88BCA894C241C897C243485FF0F8E2E0300008B44245"
. "499F7FE897C24448944242833C089542418894424308944242CEB038D490033FF397C2428897C24380F8E750100008BCE0FAFCE894C24408DA4240000"
. "000033C03BF08944241089442460894424580F8E8A0000008B5C242C8D4D028BD52BD183C203895424208D3CBB0FAFFE8BD52BD142895424248BD52BD"
. "103F9897C24148974243C8BCF8BFE8DA424000000008B5C24200FB61C0B03C30FB619015C24588B5C24240FB61C0B015C24600FB61C11015C241083C1"
. "0483EF0175D38B7C2414037C245C836C243C01897C241475B58B7C24388B6C244C8B5C24508B4C244099F7F9894424148B44245899F7F9894424588B4"
@TLMcode
TLMcode / GenRndStr()
Last active December 17, 2015 15:40
GenRndStr(), creates random strings from arrays
Array := ["a","b","c","d","e","f"]
MsgBox % GenRndStr( Array, 3 ) "," GenRndStr( Array, 3 ) "," GenRndStr( Array, 3 )
Return
GenRndStr( Array, Length ) {
For i in Array
{
String .= Array[i] ","
}
Sort, String, Random D`,
@TLMcode
TLMcode / CSVDLL.ahk
Last active December 19, 2015 10:19
CSV to DDL at script execution
SetWorkingDir % A_ScriptDir
csvfile = testvars.csv
TestVar2 = ServerVariable1|| ServerVaraible2| ServerVariable3|
; Gui, 1: +AlwaysOnTop
Gui, 1: Font, S9
Gui, 1: Add, Text, CDefault, Select Var1
Gui, 1: Add, DDL, vDDL1, % CSVtoDDL(csvfile)
@TLMcode
TLMcode / CSVDDLbutton.ahk
Last active December 19, 2015 10:28
CSV to DDL on button press
SetWorkingDir % A_ScriptDir
csvfile = testvars.csv
TestVar2 = ServerVariable1|| ServerVaraible2| ServerVariable3|
; Gui, 1: +AlwaysOnTop
Gui, 1: Font, S9
Gui, 1: Add, Text, CDefault, Select Var1
Gui, 1: Add, DDL, vDDL1
@TLMcode
TLMcode / MicMeter.ahk
Last active December 19, 2015 10:29
Microphone Meter
DetectHiddenWindows, On
OnExit, Exit
If !(A_OSVersion~="WIN_(\d|\w{5})\b")
{
Msgbox, 0x10, Whoops!, Cannot run on this version of Windows!`nThe script will now exit.
ExitApp
}
Else If !FileExist(A_WinDir "\System32\" srcd := "SoundRecorder.exe")
{