Skip to content

Instantly share code, notes, and snippets.

@grey-code
Created March 1, 2013 15:43
Show Gist options
  • Save grey-code/5065483 to your computer and use it in GitHub Desktop.
Save grey-code/5065483 to your computer and use it in GitHub Desktop.
AutoHotkey: LV_MoveRow()
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") {
LV_GetText(a, pos, A_Index)
LV_GetText(b, xpos, A_Index)
LV_Modify(pos, "Col" A_Index, b)
LV_Modify(xpos, "Col" A_Index, a)
}
LV_Modify(pos, "-Select -Focus")
, LV_Modify(xpos, "Select Focus")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment