#include #include Dim $SItemsOld = 0, $QItemsOld = 0 ;Variables to note changes Global Const $WM_COMMAND = 0x0111, $BM_CLICK = 0x00F5, $WM_KEYDOWN=0x100 ;Constant Commands $cp = 0 ;TEMP!!! Opt ("WinTitleMatchMode", 4) ;Sets the mode to 'classname=*' titlematch ;Check if Winamp is Running, otherwise exit: If WinExists("classname=Winamp v1.x")=0 Then MsgBox(0, "Error:", "Winamp MUST be on!") Exit EndIf ;Get the main handles: Winamp & Jump-to-File $WAhandle = ControlGetHandle("classname=Winamp v1.x", "", 0) ;Gets the Winamp Handle $JFhandle = ControlGetHandle("classname=Winamp Gen", "Jump to file", 0) ;Gets the JTFP Handle ;If Jump to File isn't on (it shouldn't be): If ControlGetHandle($JFhandle, "", 4951)=="" Then ;Call the 'Jump to file' window DllCall ("user32.dll", "int", "SendMessage", "hwnd", $WAhandle, "int", $WM_COMMAND, "int", 40194, "int", 0) ;Wait until it loads (manually because WinExists doesn't work here) While 1 $JFhandle = ControlGetHandle("classname=Winamp Gen", "Jump to file", 0) If ControlGetHandle($JFhandle, "", 4951)<>"" Then ExitLoop MsgBox(0,"Error","Please be sure you're using the Classic Skin") Wend EndIf ;Get the rest of the handles $WSLhandle = ControlGetHandle($JFhandle, "", 1122) ;Gets the Songs ListBox Handle $WSBLhandle = ControlGetHandle($JFhandle, "", 1206) ;Gets the InputBox Handle $WQLhandle = ControlGetHandle($JFhandle, "", 4951) ;Gets the Queue ListBox Handle $QUEBhandle = ControlGetHandle($JFhandle, "", 4919) ;Gets the Enqueue File Button Handle $REMBhandle = ControlGetHandle($JFhandle, "", 4960) ;Gets the Remove File Button Handle $JTFBhandle = ControlGetHandle($JFhandle, "", 4918) ;Gets the Jump to File Button Handle $CLSBhandle = ControlGetHandle($JFhandle, "", 0002) ;Gets the Close Button Handle ;GUI: $main = GUICreate ("Jump to File Plugin -- External Control v0.91b", 800, 480, 0, 0, $WS_POPUPWINDOW, $WS_EX_TOPMOST) ;Creates the GUI (Always on TOP) GUICtrlCreatePic ("images\background.jpg", 0, 0, 800, 480, 0, 0) ;Sets the background image GUISetState (@SW_SHOW, $main) ;Shows the GUI ;GUI Elements: $txtSearch = GUICtrlCreateInput ("", 11, 268, 292, 22, BitXOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) GUICtrlSetFont($txtSearch, 14) $btnEnter = GUICtrlCreateButton ("Enter", 285, 269, 40, 20, $BS_DEFPUSHBUTTON) GUICtrlSetState($btnEnter, $GUI_HIDE) ;hide the Enter button $lstSongs = GUICtrlCreateList ("", 10, 5, 294, 280, BitXOR($LBS_SORT, $WS_BORDER)) GUICtrlSetFont($lstSongs, 14) ;set listbox font to #12 $lstQueue = GUICtrlCreateList ("", 496, 5, 294, 300, BitXOR($LBS_SORT, $WS_BORDER)) ;475 GUICtrlSetFont($lstQueue, 14) $btnPlay = GUICtrlCreateButton("&Play", 335, 6, 130, 67.5, $BS_BITMAP) GUICtrlSetImage($btnPlay, "Images\btnPlay.bmp") $btnQueue = GUICtrlCreateButton("&Queue -->", 335, 78.5, 130, 67.5, $BS_BITMAP) GUICtrlSetImage($btnQueue, "Images\btnQueue.bmp") $btnRemove = GUICtrlCreateButton("<-- &Remove", 335, 150, 130, 67.5, $BS_BITMAP) GUICtrlSetImage($btnRemove, "Images\btnRemove.bmp") $btnCancel = GUICtrlCreateButton("Cancel", 335, 222.5, 130, 67.5, $BS_BITMAP) GUICtrlSetImage($btnCancel, "Images\btnCancel.bmp") $btnClear = GUICtrlCreateButton("&Clear", 335, 222.5, 130, 67.5, $BS_BITMAP) GUICtrlSetImage($btnClear, "Images\btnClear.bmp") GUICtrlSetState($btnClear, $GUI_HIDE) ;hide the Clear button ;Song List Nav Buttons: $btnSListPU = GUICtrlCreateButton("/\", 304, 6, 25, 67.5, $BS_BITMAP) ;Create Button Song List Page Up GUICtrlSetImage($btnSListPU, "Images\btnPageUp.bmp") $btnSListIU = GUICtrlCreateButton("^",304, 78.5, 25, 67.5, $BS_BITMAP) ;Create Button Song List Item Up GUICtrlSetImage($btnSListIU, "Images\btnUp.bmp") $btnSListID = GUICtrlCreateButton("v", 304, 150, 25, 67.5, $BS_BITMAP) ;Create Button Song List Item Down GUICtrlSetImage($btnSListID, "Images\btnDown.bmp") $btnSListPD = GUICtrlCreateButton("\/", 304, 222.5, 25, 67.5, $BS_BITMAP) ;Create Button Song List Page Down GUICtrlSetImage($btnSListPD, "Images\btnPageDown.bmp") ;Queue List Nav Buttons: $btnQListPU = GUICtrlCreateButton("/\", 471, 6, 25, 67.5, $BS_BITMAP) ;Create Button Queue List Page Up GUICtrlSetImage($btnQListPU, "Images\btnPageUp.bmp") $btnQListIU = GUICtrlCreateButton("^", 471, 78.5, 25, 67.5, $BS_BITMAP) ;Create Button Queue List Page Up GUICtrlSetImage($btnQListIU, "Images\btnUp.bmp") $btnQListID = GUICtrlCreateButton("v", 471, 150, 25, 67.5, $BS_BITMAP) ;Create Button Queue List Page Up GUICtrlSetImage($btnQListID, "Images\btnDown.bmp") $btnQListPD = GUICtrlCreateButton("\/", 471, 222.5, 25, 67.5, $BS_BITMAP) ;Create Button Queue List Page Up GUICtrlSetImage($btnQListPD, "Images\btnPageDown.bmp") ;OSK Elements: ;Row 1: $keyQ = GUICtrlCreateButton("Q", 8, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyQ, "Images\btnQ.bmp") $keyW = GUICtrlCreateButton("W", 66, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyW, "Images\btnW.bmp") $keyE = GUICtrlCreateButton("E", 124, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyE, "Images\btnE.bmp") $keyR = GUICtrlCreateButton("R", 182, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyR, "Images\btnR.bmp") $keyT = GUICtrlCreateButton("T", 240, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyT, "Images\btnT.bmp") $keyY = GUICtrlCreateButton("Y", 298, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyY, "Images\btnY.bmp") $keyU = GUICtrlCreateButton("U", 356, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyU, "Images\btnU.bmp") $keyI = GUICtrlCreateButton("I", 414, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyI, "Images\btnI.bmp") $keyO = GUICtrlCreateButton("O", 472, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyO, "Images\btnO.bmp") $keyP = GUICtrlCreateButton("P", 530, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyP, "Images\btnP.bmp") ;NumPad: $key7 = GUICtrlCreateButton("7", 624, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($key7, "Images\btn7.bmp") $key8 = GUICtrlCreateButton("8", 682, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($key8, "Images\btn8.bmp") $key9 = GUICtrlCreateButton("9", 740, 295, 50, 40, $BS_BITMAP) GUICtrlSetImage($key9, "Images\btn9.bmp") ;Row 2: $keyA = GUICtrlCreateButton("A", 8, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyA, "Images\btnA.bmp") $keyS = GUICtrlCreateButton("S", 66, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyS, "Images\btnS.bmp") $keyD = GUICtrlCreateButton("D", 124, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyD, "Images\btnD.bmp") $keyF = GUICtrlCreateButton("F", 182, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyF, "Images\btnF.bmp") $keyG = GUICtrlCreateButton("G", 240, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyG, "Images\btnG.bmp") $keyH = GUICtrlCreateButton("H", 298, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyH, "Images\btnH.bmp") $keyJ = GUICtrlCreateButton("J", 356, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyJ, "Images\btnJ.bmp") $keyK = GUICtrlCreateButton("K", 414, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyK, "Images\btnK.bmp") $keyL = GUICtrlCreateButton("L", 472, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyL, "Images\btnL.bmp") $keyApostrophe = GUICtrlCreateButton("'", 530, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyApostrophe, "Images\btnApostrophe.bmp") ;NumPad: $key4 = GUICtrlCreateButton("4", 624, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($key4, "Images\btn4.bmp") $key5 = GUICtrlCreateButton("5", 682, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($key5, "Images\btn5.bmp") $key6 = GUICtrlCreateButton("6", 740, 340, 50, 40, $BS_BITMAP) GUICtrlSetImage($key6, "Images\btn6.bmp") ;Row 3: $keyZ = GUICtrlCreateButton("Z", 8, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyZ, "Images\btnZ.bmp") $keyX = GUICtrlCreateButton("X", 66, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyX, "Images\btnX.bmp") $keyC = GUICtrlCreateButton("C", 124, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyC, "Images\btnC.bmp") $keyV = GUICtrlCreateButton("V", 182, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyV, "Images\btnV.bmp") $keyB = GUICtrlCreateButton("B", 240, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyB, "Images\btnB.bmp") $keyN = GUICtrlCreateButton("N", 298, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyN, "Images\btnN.bmp") $keyM = GUICtrlCreateButton("M", 356, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyM, "Images\btnM.bmp") $keyComma = GUICtrlCreateButton(",", 414, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyComma, "Images\btnComma.bmp") $keyHyphen = GUICtrlCreateButton("-", 472, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyHyphen, "Images\btnHyphen.bmp") ;NumPad: $key1 = GUICtrlCreateButton("1", 624, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($key1, "Images\btn1.bmp") $key2 = GUICtrlCreateButton("2", 682, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($key2, "Images\btn2.bmp") $key3 = GUICtrlCreateButton("3", 740, 385, 50, 40, $BS_BITMAP) GUICtrlSetImage($key3, "Images\btn3.bmp") ;Row 4: $keySpace = GUICtrlCreateButton("SPACE", 8, 430, 282, 40, $BS_BITMAP) GUICtrlSetImage($keySpace, "Images\btnSpace.bmp") $keyBackspace = GUICtrlCreateButton("BACKSPACE", 298, 430, 166, 40, $BS_BITMAP) GUICtrlSetImage($keyBackspace, "Images\btnBackspace.bmp") ;$keyLeft = GUICtrlCreateButton("<==", 472, 430, 50, 40) ;$keyRight = GUICtrlCreateButton("==>", 530, 430, 50, 40) ;NumPad: $key0 = GUICtrlCreateButton("0", 624, 430, 110, 40, $BS_BITMAP) GUICtrlSetImage($key0, "Images\btn0.bmp") $keyPeriod = GUICtrlCreateButton(".", 740, 430, 50, 40, $BS_BITMAP) GUICtrlSetImage($keyPeriod, "Images\btnPeriod.bmp") ;Initialize ClearJF() ;Clear JTFP SmartDelay() ;Short delay for JTFP to catch up ;if the list is empty after clearing, notify of error: If _GUICtrlListCount($WSLhandle)=0 Then MsgBox(0,"Error:","Playlist is Empty") WinActivate ($main) ;Focuses on the GUI window GUICtrlSetState ($txtSearch, $GUI_FOCUS) ;Focuses on the Search Text Box QInit() ;Initializes the Queue ListBox While 1 $msg = GUIGetMsg() ;Get GUI messages ClearCancelState() ;Checks for input text, sets the clear/cancel button accordingly OSK($msg) $SItems = _GUICtrlListCount($WSLhandle) ;Gets the number of items in the song list $QItems = ControlListView ($JFhandle, "", "SysListView321", "GetItemCount") ;Gets the number of items in the queue list Select ;Check the GUI messages Case $msg = $GUI_EVENT_CLOSE ;if 'X' or 'Esc' is pressed, exit. DllCall ("user32.dll", "int", "SendMessage", "hwnd", $CLSBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the Clo&se File button ExitLoop Case $msg = $btnCancel ;if 'Cancel' is pressed, exit. DllCall ("user32.dll", "int", "SendMessage", "hwnd", $CLSBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the Clo&se File button ExitLoop Case $msg = $btnClear ClearJF() ;clears the Jump-to-File input box ClearEC() ;clears the External Control input box ClearCancelState() ;shows the Cancel button _GUICtrlListSelectIndex($lstSongs, -1) ;clears the Songs list box #comments-start Case $msg = $btnQueue ;Check the selection If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Write to JTF's input-box, press Alt+Q, and clear the box ;INSTEAD of Alt+Q, press the Queue button ;INSTEAD Write to JTF, match the indexes $QItems = _GUICtrlListCount($lstQueue) ;Gets the number of items in the queue list WinActivate($WSBLhandle) ClearJF() ;Quickly clear the inputbox Send(_GUICtrlListGetText($lstSongs, _GUICtrlListSelectedIndex($lstSongs))) SmartDelay() Send("!q") ;Send Alt+Q to queue ClearJF() ;Quickly clear the inputbox WinActivate("clasname=AutoIt v3 GUI") ;Focuses back on the GUI Window _GUICtrlListAddItem($lstQueue, "0" & $QItems+1 & ") " & _ ControlListView($JFhandle, "", "SysListView321", "GetText", $QItems, 0)) ;ADDS the last item $QItemsOld = $QItems ;takes note of new changes GUICtrlSetState($txtSearch, $GUI_FOCUS) ;Focuses back to the List Box Else Beep(430,150) ;Error: Plays A4 for 150ms EndIf #comments-end Case $msg = $btnQueue If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Check if there's a selection in lstSongs _GUICtrlListSelectIndex($WSLhandle, _GUICtrlListSelectedIndex($lstSongs)) ;Sets the Winamp List Index to the lstSongs' index DllCall ("user32.dll", "int", "SendMessage", "hwnd", $QUEBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the En&queue File button SInit() ;Updates the Song List for the '[X]' notations QInit() ;Updates the Queue List for the '#)' notations Else Beep(430,150) ;Error: Plays A4 for 150ms EndIf Case $msg = $btnRemove ;How it works: Selects the index according to lstQueue ;and presses '&Remove' button. ;It then MUST redraw the QueueList (for the '#)' to work properly) $QIndex = _GUICtrlListSelectedIndex($lstQueue) ;Gets the number of item to be removed If $QIndex = -1 Then Beep(440,150) ;Error: Plays A4 for 150ms Else PrimitiveRemove($QIndex) ;Update the Queue list _GUICtrlListDeleteItem($lstQueue, $QIndex) ;Deletes the item $QItemsOld = $QItems ;takes note of new changes SInit() ;Updates the Song List for the [X] notations If $QIndex<>$QItems-1 Then QInit() ;If the item to be removed isn't last, redraw the Queue list EndIf Case $msg = $btnEnter $strInput = GUICtrlRead($txtSearch) ClearJF() ;Quickly clear the list (in case backspaces was used) ControlSend($WSBLhandle, "", $WSBLhandle, $strInput) ;Send the whole string to JTFP's Edit Box SmartDelay() ;Necessary! Otherwise AutoIt v3 Crashes! If _GUICtrlListCount($WSLhandle)>0 Then ;If there's at least one entry, SInit() ;Redraw the Song List $SItemsOld = $SItems ;Note changes _GUICtrlListSelectIndex($lstSongs, 0) ;Select the top one EndIf Case $msg = $btnPlay If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Check if there's a selection in lstSongs _GUICtrlListSelectIndex($WSLhandle, _GUICtrlListSelectedIndex($lstSongs)) ;Sets the Winamp List Index to the lstSongs' index DllCall ("user32.dll", "int", "SendMessage", "hwnd", $JTFBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the En&queue File button ClearJF() ClearEC() SInit() ;Updates the Song List for the '[X]' notations QInit() ;Updates the Queue List for the '#)' notations Else Beep(440,150) ;Error: Plays A4 for 150ms EndIf Case $msg = $btnSListPD ListPD($lstSongs, $SItems) Case $msg = $btnQListPD ListPD($lstQueue, $QItems) Case $msg = $btnSListPU ListPU($lstSongs) Case $msg = $btnQListPU ListPU($lstQueue) Case $msg = $btnSListID ListID($lstSongs, $SItems) Case $msg = $btnQListID ListID($lstQueue, $QItems) Case $msg = $btnSListIU ListIU($lstSongs) Case $msg = $btnQListIU ListIU($lstQueue) EndSelect If $SItemsOld<>$SItems Then ;Checks if the song list has been updated since SInit() $SItemsOld = $SItems ;takes note of new changes EndIf If $QItemsOld<>$QItems Then ;Checks if the queue list has been updated since QInit() SInit() ;$QItemsOld = $QItems ;takes note of new changes EndIf If ControlListView($JFhandle, "", "SysListView321", "GetText", 0, 0)=="There are no files in the queue" Then _GUICtrlListDeleteItem($lstQueue, 0) EndIf ;ItemSelected? If for the first time, drop it in the text box; otherwise skip. ;If (_GUICtrlListSelectedIndex($lstSongs)>=0) AND _ ;$SSelText<>(_GUICtrlListGetText($lstSongs, _GUICtrlListSelectedIndex($lstSongs))) _ ;Then ; $SSelText = _GUICtrlListGetText($lstSongs, _GUICtrlListSelectedIndex($lstSongs)) ; ;GUICtrlSetData($txtSearch, (_GUICtrlListGetText($lstSongs, _GUICtrlListSelectedIndex($lstSongs)))) ; GUICtrlSetData($txtSearch, $SSelText) ;EndIf Wend Func ClearJF() ControlSend($WSBLhandle, "", $WSBLhandle, "+{HOME}") ;Send SHIFT + HOME to the Edit Box ControlSend($WSBLhandle, "", $WSBLhandle, "{DEL}") ;Send DELETE to the Edit Box EndFunc Func ClearEC() GUICtrlSetData($txtSearch, "") ;Send nothing to Search Box, AKA Clear EndFunc Func SmartDelay() ;INSTEAD: Make it relative to the number of items in the Song List, or any list to that matter... Local $SDSItems = _GUICtrlListCount($WSLhandle) If ($SDSItems/10)>500 Then Sleep($SDSItems/10) Else Sleep(500) EndIf EndFunc Func ClearCancelState() ;Swaps between the Cancel and Clear buttons according to the lstSongs and txtSearch selection If GUICtrlGetState($btnCancel)==80 Then If GUICtrlRead($txtSearch)<>"" OR (_GUICtrlListSelectedIndex($lstSongs)>=0) Then GUICtrlSetState($btnCancel, $GUI_HIDE) GUICtrlSetState($btnClear, $GUI_SHOW) ;MsgBox(0,"Inside:",GUICtrlGetState($btnCancel)) EndIf EndIf If GUICtrlGetState($btnClear)==80 Then If GUICtrlRead($txtSearch)=="" AND (_GUICtrlListSelectedIndex($lstSongs)<0) Then GUICtrlSetState($btnClear, $GUI_HIDE) GUICtrlSetState($btnCancel, $GUI_SHOW) ;MsgBox(0,"","Cancel Show") EndIf EndIf EndFunc Func QInit() ;Redraws the Queue ListBox _GUICtrlListClear($lstQueue) ;Clear the list $QItems = ControlListView ($JFhandle, "", "SysListView321", "GetItemCount") ;Gets the number of items in the queue list If $QItems<>0 AND ControlListView($JFhandle, "", "SysListView321", "GetText", 0, 0)<>"There are no files in the queue" Then For $i = 0 to ($QItems - 1) If ($i+1)<10 then ;if $i+1 is a single digit (1 thru 9) _GUICtrlListAddItem($lstQueue, "0" & $i+1 & ") " & _ ControlListView($JFhandle, "", "SysListView321", "GetText", $i, 0)) ;ADDS the last item Else ;if $i+1 is a double digit (10 thru 99) _GUICtrlListAddItem($lstQueue, $i+1 & ") " & _ ControlListView($JFhandle, "", "SysListView321", "GetText", $i, 0)) ;ADDS the last item EndIf Next EndIf $QItemsOld = $QItems ;takes note of new changes EndFunc Func SInit();ByRef $ISItems) ;Clears the current list _GUICtrlListClear($lstSongs) ;Loop to load all of the entries into an array: Local $ISItems = _GUICtrlListCount($WSLhandle) ;Gets the number of items in the list If $ISItems<>0 Then For $i = 0 to ($ISItems - 1) ;'($ISItems - 1)' eliminates the last '0' entry. _GUICtrlListAddItem($lstSongs, _GUICtrlListGetText($WSLhandle, $i)) ;Writes WA's Song List into lstSongs ;MsgBox(0,"Adding:","Text: " & _GUICtrlListGetText($WSLhandle, $i) & " | Index: " & $i) Next EndIf _GUICtrlListSelectIndex($lstSongs, 0) ;Select the top entry in the list ;Consider adding: $SItemsOld = $SItems EndFunc Func PrimitiveRemove(ByRef $QRIndex) ControlFocus($WQLhandle, "", $WQLhandle) Send("{HOME}") For $i = 1 to $QRindex Send("{DOWN}") Next DllCall ("user32.dll", "int", "SendMessage", "hwnd", $REMBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the &Remove File button WinActivate($main) EndFunc Func OSK(ByRef $k) ;First type to Winamp's JTF search box ;Then type to the txtSearch Select Case $k = $keyQ $s="Q" SendKey($s) Case $k = $keyW $s="W" SendKey($s) Case $k = $keyE $s="E" SendKey($s) Case $k = $keyR $s="R" SendKey($s) Case $k = $keyT $s="T" SendKey($s) Case $k = $keyY $s="Y" SendKey($s) Case $k = $keyU $s="U" SendKey($s) Case $k = $keyI $s="I" SendKey($s) Case $k = $keyO $s="O" SendKey($s) Case $k = $keyP $s="P" SendKey($s) Case $k = $keyA $s="A" SendKey($s) Case $k = $keyS $s="S" SendKey($s) Case $k = $keyD $s="D" SendKey($s) Case $k = $keyF $s="F" SendKey($s) Case $k = $keyG $s="G" SendKey($s) Case $k = $keyH $s="H" SendKey($s) Case $k = $keyJ $s="J" SendKey($s) Case $k = $keyK $s="K" SendKey($s) Case $k = $keyL $s="L" SendKey($s) Case $k = $keyApostrophe $s="'" SendKey($s) Case $k = $keyZ $s="Z" SendKey($s) Case $k = $keyX $s="X" SendKey($s) Case $k = $keyC $s="C" SendKey($s) Case $k = $keyV $s="V" SendKey($s) Case $k = $keyB $s="B" SendKey($s) Case $k = $keyN $s="N" SendKey($s) Case $k = $keyM $s="M" SendKey($s) Case $k = $keyComma $s="," SendKey($s) Case $k = $keyHyphen $s="-" SendKey($s) Case $k = $keySpace $s=" " SendKey($s) Case $k = $keyBackspace $s="{BACKSPACE}" SendKey($s) Case $k = $key0 $s="0" SendKey($s) Case $k = $keyPeriod $s="." SendKey($s) Case $k = $key1 $s="1" SendKey($s) Case $k = $key2 $s="2" SendKey($s) Case $k = $key3 $s="3" SendKey($s) Case $k = $key4 $s="4" SendKey($s) Case $k = $key5 $s="5" SendKey($s) Case $k = $key6 $s="6" SendKey($s) Case $k = $key7 $s="7" SendKey($s) Case $k = $key8 $s="8" SendKey($s) Case $k = $key9 $s="9" SendKey($s) EndSelect EndFunc Func SendKey(ByRef $str) If ControlGetText($WSBLhandle,"",$WSBLhandle)<>GUICtrlRead($txtSearch) Then ;Copied over from Case $msg = $btnEnter $strInput = GUICtrlRead($txtSearch) ClearJF() ;Quickly clear the list (in case backspaces was used) ControlSend($WSBLhandle, "", $WSBLhandle, $strInput) ;Send the whole string to JTFP's Edit Box EndIf ControlSend($WSBLhandle, "", $WSBLhandle, $str) ;Send Key to JTFP's Edit Box SmartDelay() ;Necessary! Otherwise AutoIt v3 Crashes! If StringLen($str)>1 Then ;If $str is BackspaceKey, etc. GUICtrlSetState ($txtSearch, $GUI_FOCUS) ;Focuses on the Search Text Box Send("{END}") ;De-select the text Send($str) ;Less Accurate Else GUICtrlSetData($txtSearch, GUICtrlRead($txtSearch) & $str) ;Send key to Search Box -- More Accurate EndIf If _GUICtrlListCount($WSLhandle)>0 Then ;If there's at least one entry, SInit() ;Redraw the Song List $SItemsOld = $SItems ;Note changes ;MsgBox(0,"CHECK:",_GUICtrlListCount($WSLhandle)) ;_GUICtrlListSelectIndex($lstSongs, 0) ;Select the top entry in the list EndIf EndFunc ;~ Func SListPUD() ;Scrolls the Song List by Page Up or Page Down ;~ Local $mp = 1 ;$mp is the multiplier. ;~ If $msg = $btnSListPU Then $mp = -1 ;inverse the multiplier if going up ;~ EndFunc Func ListPD(ByRef $list, ByRef $items) If _GUICtrlListGetTopIndex($list) + 11 > $items Then ;If the scroll to item is more than the total items _GUICtrlListSetTopIndex($list, $SItems - 11) ;Scroll so that the last item shows on the bottom Else _GUICtrlListSetTopIndex($list, _GUICtrlListGetTopIndex($list) + 11) ;Otherwise, scroll one page down EndIf _GUICtrlListSelectIndex($list, _GUICtrlListGetTopIndex($list)) ;Set the selected item to the top of the list EndFunc Func ListPU(ByRef $list) If _GUICtrlListGetTopIndex($list) - 11 < 0 Then ;If the scroll to item is less than zero _GUICtrlListSetTopIndex($list, 0) ;Scroll to the first item Else _GUICtrlListSetTopIndex($list, _GUICtrlListGetTopIndex($list) - 11) ;Otherwise, scroll one page up EndIf _GUICtrlListSelectIndex($list, _GUICtrlListGetTopIndex($list)) ;Set the selected item to the top of the list EndFunc Func ListID(ByRef $list, ByRef $items) Local $index = _GUICtrlListSelectedIndex($list) If $index + 1 > $items Then _GUICtrlListSelectIndex($list, $items) Else _GUICtrlListSelectIndex($list, $index + 1) EndIf EndFunc Func ListIU(ByRef $list) Local $index = _GUICtrlListSelectedIndex($list) If $index - 1 < 0 Then _GUICtrlListSelectIndex($list, 0) Else _GUICtrlListSelectIndex($list, $index - 1) EndIf EndFunc #comments-start Func SendBackspace() $str = "{BACKSPACE}" If ControlGetText($WSBLhandle,"",$WSBLhandle)<>GUICtrlRead($txtSearch) Then ;Copied over from Case $msg = $btnEnter $strInput = GUICtrlRead($txtSearch) ClearJF() ;Quickly clear the list (in case backspaces was used) ControlSend($WSBLhandle, "", $WSBLhandle, $strInput) ;Send the whole string to JTFP's Edit Box SmartDelay() ;Necessary! Otherwise AutoIt v3 Crashes! If _GUICtrlListCount($WSLhandle)>0 Then ;If there's at least one entry, SInit($SItems) ;Redraw the Song List $SItemsOld = $SItems ;Note changes _GUICtrlListSelectIndex($lstSongs, 0) ;Select the top one EndIf EndIf ControlSend($WSBLhandle, "", $WSBLhandle, $str) EndFunc #comments-end ;Func KeyEnter() ; MsgBox(0,"$msg",$msg) ;EndFunc ;Func KeyEsc() ; MsgBox(0,"$msg",$msg) ; ;MsgBox(0,"",GUICtrlGetState($btnClear)) ;EndFunc