#include #include Global Const $WM_COMMAND = 0x0111, $BM_CLICK = 0x00F5 ;Constant Commands Global Const $PATH = @ScriptDir & "\Images\" ;Sets the ablsolute working path Dim $btn[80], $OSKElements = 0 ;Button creator and OSKElements counter Dim $SItemsOld = 0, $QItemsOld = 0 ;Variables to note changes Dim $SPointer = 0, $SPointerIncreaser = 12 ;SongList Pointer and PointerIncreaser (def. @ 12) Dim $QPointerIncreaser = 12 ;QueueList PointerIncreaser (def. @ 12) ;Declaration of Handles: Dim $WAhandle, $JFhandle, $WSLhandle, $WSBLhandle, _ $WQLhandle, $QUEBhandle, $REMBhandle, $JTFBhandle, _ $MNGBhandle, $CLSBhandle, $MACBhandle, $CLRBhandle, _ $MIUBhandle, $MIDBhandle ;Declaration of GUI Elements: Dim $main, $lstSongs, $lstQueue, $txtSearch, $btnEnter ;Declaration of Variables: Dim $SItems, $QItems, $msg Opt ("WinTitleMatchMode", 4) ;Sets the mode to 'classname=*' titlematch BackEnd() ;Initialize the Backend! (Winamp/Jump to File Dialogue/Handles, etc.) FrontEnd() ;Initialize the Frontend! (All of the GUI related items: Buttons/Listboxes/Textboxes/etc.) $SItems = _GUICtrlListCount($WSLhandle) ;Gets the number of items in JTF's song list SInit() ;MAIN LOOP: While 1 $msg = GUIGetMsg() ;Get the GUI messages ClearCancelState() ;Checks for input text, sets the clear/cancel button accordingly $SItems = _GUICtrlListCount($WSLhandle) ;Gets the number of items in Winamp's song list $QItems = ControlListView ($JFhandle, "", "SysListView321", "GetItemCount") ;Gets the number of items in the queue list If $msg Then ;If the message isn't empty Select Case $msg = $GUI_EVENT_CLOSE ;if 'X' or 'Esc' is pressed, DllCall ("user32.dll", "int", "SendMessage", "hwnd", $CLSBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Click on the Clo&se File button ExitLoop ;exit. Case $msg = $btn[1] ;if 'Play' is pressed, If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Check if there's a selection in lstSongs _GUICtrlListSelectIndex($WSLhandle, $SPointer + _GUICtrlListSelectedIndex($lstSongs)) ;Set the Winamp List Index to the lstSongs' index DllCall ("user32.dll", "int", "SendMessage", "hwnd", $JTFBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Click on the &Jump to File button ClearJF() ClearEC() ClearCancelState() ;shows the Cancel button 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 = $btn[2] ;if 'Queue' is pressed, If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Check if there's a selection in lstSongs _GUICtrlListSelectIndex($WSLhandle, $SPointer + _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(440,150) ;Error: Plays A4 for 150ms EndIf Case $msg = $btn[3] ;if 'Remove' is pressed, Local $QIndex = _GUICtrlListSelectedIndex($lstQueue) ;Gets the number of the item to be removed If $QIndex = -1 Then ;If the queue list is empty Beep(440,150) ;Error: Plays A4 for 150ms Else PrimitiveMove($QIndex) ;Moves the selection to the right place (in Winamp) DllCall ("user32.dll", "int", "SendMessage", "hwnd", $REMBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the &Remove File button WinActivate($main) _GUICtrlListDeleteItem($lstQueue, $QIndex) ;Deletes the item SInit() ;Updates the Song List for the [X] notations If $QIndex<>$QItems-1 Then ;If the item to be removed isn't last in the list, QInit() ;redraw the Queue list Else ;Otherwise, if it's the last, $QItemsOld = $QItems ;just takes note of new changes EndIf EndIf Case $msg = $btn[4] ;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 = $btn[5] ;if 'Clear' is pressed, ClearJF() ;clears the Jump-to-File input box ClearEC() ;clears the External Control input box ClearCancelState() ;shows the Cancel button Case $msg = $btn[6] ;if 'Move After Current' is pressed, If (_GUICtrlListSelectedIndex($lstSongs)>=0) Then ;Check if there's a selection in lstSongs _GUICtrlListSelectIndex($WSLhandle, $SPointer + _GUICtrlListSelectedIndex($lstSongs)) ;Set the Winamp List Index to the lstSongs' index DllCall ("user32.dll", "int", "SendMessage", "hwnd", $MACBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Click on the &Move After Current button Else Beep(440,150) ;Error: Plays A4 for 150ms EndIf Case $msg = $btn[7] ;if 'Clear (Queuelist)' is pressed, DllCall ("user32.dll", "int", "SendMessage", "hwnd", $CLRBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Click on the C&lear (Queuelist) button SInit() QInit() Case $msg = $btn[8] ;if '(Move Item) Up' is pressed, Local $QIndex = _GUICtrlListSelectedIndex($lstQueue) ;Gets the number of the item to be moved If $QIndex = -1 Then ;If the queue list is empty Beep(440,150) ;Error: Plays A4 for 150ms Else PrimitiveMove($QIndex) DllCall ("user32.dll", "int", "SendMessage", "hwnd", $MIUBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the (Move Item) &Up button WinActivate($main) SInit() QInit() EndIf Case $msg = $btn[9] ;if '(Move Item) Down' is pressed, Local $QIndex = _GUICtrlListSelectedIndex($lstQueue) ;Gets the number of the item to be moved If $QIndex = -1 Then ;If the queue list is empty Beep(440,150) ;Error: Plays A4 for 150ms Else PrimitiveMove($QIndex) DllCall ("user32.dll", "int", "SendMessage", "hwnd", $MIDBhandle, "int", $BM_CLICK, "int", 0, "int", 0) ;Clicks on the (Move Item) &Down button WinActivate($main) SInit() QInit() EndIf Case $msg = $btn[11] ;if 'Song List Page Up' is pressed, If $SPointer - $SPointerIncreaser > 0 Then ;If the pointer isn't off the list when scrolling up, Local $SPosition = _GUICtrlListSelectedIndex($lstSongs) ;Get the currently selected item's position $SPointer = $SPointer - $SPointerIncreaser ;Scroll a full screen up SInit() ;Update the list (DO IT!) _GUICtrlListSelectIndex($lstSongs, $SPosition) ;Set the previously selected item's position Else ;If the pointer gets off the list when scrolling up, Local $SPosition = _GUICtrlListSelectedIndex($lstSongs) ;Get the currently selected item's position $SPointer = 0 ;Otherwise, scroll to the very top SInit() ;Update the list (DO IT!) _GUICtrlListSelectIndex($lstSongs, $SPointer) ;Set the selected item to the topmost one EndIf Case $msg = $btn[12] ;if 'Song List Item Up' is pressed, If _GUICtrlListSelectedIndex($lstSongs) <= 0 Then ;If trying to scroll off the list (above the top-most item), If $SPointer - ($SPointerIncreaser - 1) >= 0 Then ;If the pointer isn't off the list, $SPointer = $SPointer - ($SPointerIncreaser - 1) ;Scroll a full screen up SInit() ;Update the list (DO IT!) _GUICtrlListSelectIndex($lstSongs, ($SPointerIncreaser - 1));Select the last visible item Else ;If the pointer is above the topmost item, $SPointer = 0 ;Scroll to the very top SInit() ;Update the list (DO IT!) EndIf Else ;Otherwise, _GUICtrlListSelectIndex($lstSongs, _GUICtrlListSelectedIndex($lstSongs)-1) ;Select the previous item EndIf Case $msg = $btn[13] ;if 'Song List Item Down' is pressed If _GUICtrlListSelectedIndex($lstSongs) >= ($SPointerIncreaser - 1) Then ;If the pointer isn't off the list when scrolling down, If $SPointer + ($SPointerIncreaser - 1) < $SItems Then ;Check if there's enough items without going over $SPointer = $SPointer + ($SPointerIncreaser - 1) ;Scroll a full screen (-1 item) down SInit() ;Update the list (DO IT!) _GUICtrlListSelectIndex($lstSongs, 0) ;Set the previously selected item's position EndIf Else ;If trying to scroll off the list (below the bottom-most item) _GUICtrlListSelectIndex($lstSongs, _GUICtrlListSelectedIndex($lstSongs)+1) ;Select the next item EndIf Case $msg = $btn[14] ;if 'Song List Page Down' is pressed, If $SPointer + $SPointerIncreaser < $SItems Then ;Check if there's enough items without going over Local $SPosition = _GUICtrlListSelectedIndex($lstSongs) ;Get the currently selected item's position $SPointer = $SPointer + $SPointerIncreaser ;Scroll a full screen (-1 item) down SInit() ;Update the list (DO IT!) _GUICtrlListSelectIndex($lstSongs, $SPosition) ;Set the previously selected item's position EndIf Case $msg = $btn[15] ;if 'Queue List Page Up' is pressed, If _GUICtrlListGetTopIndex($lstQueue) - ($QPointerIncreaser - 1) < 0 Then ;If the scroll to item is less than zero, _GUICtrlListSetTopIndex($lstQueue, 0) ;Scroll to the first item Else _GUICtrlListSetTopIndex($lstQueue, _GUICtrlListGetTopIndex($lstQueue) - ($QPointerIncreaser - 1)) ;Otherwise, scroll one page up EndIf _GUICtrlListSelectIndex($lstQueue, _GUICtrlListGetTopIndex($lstQueue)) ;Set the selected item to the top of the list Case $msg = $btn[16] ;if 'Queue List Item Up' is pressed, Local $index = _GUICtrlListSelectedIndex($lstQueue) ;Set $index to the selected item in the local queue list If $index - 1 < 0 Then ;If the item indexed is the first one, _GUICtrlListSelectIndex($lstQueue, 0) ;Select the first item Else ;If the item indexed is not the first one, _GUICtrlListSelectIndex($lstQueue, $index - 1) ;Select the previous item EndIf Case $msg = $btn[17] ;if 'Queue List Item Down' is pressed, Local $index = _GUICtrlListSelectedIndex($lstQueue) ;Set $index to the selected item in the local queue list If $index + 1 > $QItems Then ;If the item indexed is the last one, _GUICtrlListSelectIndex($lstQueue, $QItems) ;Select the last item Else ;If the item indexed is not the last one, _GUICtrlListSelectIndex($lstQueue, $index + 1) ;Select the next item EndIf Case $msg = $btn[18] ;if 'Queue List Page Down' is pressed, If _GUICtrlListGetTopIndex($lstQueue) + ($QPointerIncreaser - 1) > $QItems Then ;If the scroll to item is more than the total items, _GUICtrlListSetTopIndex($lstQueue, $QItems - ($QPointerIncreaser - 1)) ;Scroll so that the last item shows on the bottom Else _GUICtrlListSetTopIndex($lstQueue, _GUICtrlListGetTopIndex($lstQueue) + ($QPointerIncreaser - 1)) ;Otherwise, scroll one page down EndIf _GUICtrlListSelectIndex($lstQueue, _GUICtrlListGetTopIndex($lstQueue)) ;Set the selected item to the top of the visible list Case $msg = $btnEnter ;if 'Enter' (on the keyboard) is pressed, Local $strInput = GUICtrlRead($txtSearch) ;read the text from the search box ClearJF() ;Quickly clear the list (in case backspaces was used) ControlSend($WSBLhandle, "", $WSBLhandle, $strInput) ;Send the whole string to JTFP's Edit Box If _GUICtrlListCount($WSLhandle)>0 Then ;If there's at least one entry, $SItemsOld = $SItems ;Note changes $SPointer = 0 ;Set the pointer to 0, prevents it from crashing! EndIf Case $msg >= $btn[21] AND $msg <= $btn[($OSKElements+20)] ;If any of the OSK buttons are pressed--any button between #21 and any of the OSK elements + 20 (reserved), OSK() ;Call the OSK function EndSelect EndIf If $SItemsOld<>$SItems Then SInit() ;If the song list has been updated, re-list the song list If $QItemsOld<>$QItems Then ;Checks if the queue list has been updated since QInit() SInit() EndIf Wend Func BackEnd() ;Check if Winamp is Running, otherwise exit: If WinExists("classname=Winamp v1.x")=0 Then MsgBox(16, "Fatal Error!", "Winamp has to 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("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("Jump to file", "", 0) If ControlGetHandle($JFhandle, "", 4951)<>"" Then ExitLoop ;<-- Check this statement for functionality! MsgBox(0,"Error","Please be sure you're using the Classic Skin") ;<-- Check this error message for accuracy! 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 $MNGBhandle = ControlGetHandle($JFhandle, "", 4933) ;Gets the Manage Mode Button Handle $CLSBhandle = ControlGetHandle($JFhandle, "", 0002) ;Gets the Close Button Handle $MACBhandle = ControlGetHandle($JFhandle, "", 4920) ;Gets the Move After Current Button Handle $CLRBhandle = ControlGetHandle($JFhandle, "", 4928) ;Gets the Clear List Button Handle $MIUBhandle = ControlGetHandle($JFhandle, "", 4961) ;Gets the (Move Item) Up Button Handle $MIDBhandle = ControlGetHandle($JFhandle, "", 4962) ;Gets the (Move Item) Down Button Handle ClearJF() ;Clear JTFP's input box ;if the list remains empty after clearing, notify of error: If _GUICtrlListCount($WSLhandle)=0 Then MsgBox(0,"Error:","The Playlist is Empty, Please Try Again.") EndFunc Func FrontEnd() ;Main Window: Local $ir = IniReadSection($PATH & "skin.ini","General") If @error Then MsgBox(16, "Fatal Error!", "Section ""[General]"" was not found in file """ & $PATH & "skin.ini""") Exit Else $main = GUICreate("Jump to File Plugin -- External Control v0.99.1b", $ir[1][1], $ir[2][1], 0, 0, $WS_POPUPWINDOW) ;Creates the GUI GUICtrlCreatePic ($PATH & $ir[3][1], 0, 0, $ir[1][1], $ir[2][1], 0, 0) ;Sets the background image GUICtrlSetState(-1,$GUI_DISABLE) ;Disables the background pic -- prevents overlapping EndIf ;Song List: Local $ir = IniReadSection($PATH & "skin.ini","SongList") If @error Then MsgBox(16, "Fatal Error!", "Section ""[SongList]"" was not found in file """ & $PATH & "skin.ini""") Exit Else $lstSongs = GUICtrlCreateList("", $ir[1][1], $ir[2][1], $ir[3][1], $ir[4][1], BitXOR($LBS_SORT, $WS_BORDER, $LBS_NOINTEGRALHEIGHT)) ;Creates the SongList ListBox GUICtrlSetFont($lstSongs, $ir[5][1]) ;Sets the font size GUICtrlSetData($lstSongs, "Temp|Temp2") ;Temporarily write two dummy entires --> to create a rectangle Local $RectangleSize = _GUICtrlListGetItemRect($lstSongs, 1) ;If more than 90% of the last entry is visible If ($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1]) - Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1]))) >= 0.90 Then $SPointerIncreaser = Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1])) + 1 ;Count the item Else ;Otherwise $SPointerIncreaser = Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1])) ;Discount the item EndIf _GUICtrlListClear($lstSongs) ;Clear the dummy entries EndIf ;Queue List: Local $ir = IniReadSection($PATH & "skin.ini","QueueList") If @error Then MsgBox(16, "Fatal Error!", "Section ""[QueueList]"" was not found in file """ & $PATH & "skin.ini""") Exit Else $lstQueue = GUICtrlCreateList("", $ir[1][1], $ir[2][1], $ir[3][1], $ir[4][1], BitXOR($LBS_SORT, $WS_BORDER, $LBS_NOINTEGRALHEIGHT)) ;Creates the SongList ListBox GUICtrlSetFont($lstQueue, $ir[5][1]) ;Sets the font size GUICtrlSetData($lstQueue, "Temp|Temp2") ;Temporarily write two dummy entires --> to create a rectangle Local $RectangleSize = _GUICtrlListGetItemRect($lstQueue, 1) ;If more than 90% of the last entry is visible If ($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1]) - Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1]))) >= 0.90 Then $QPointerIncreaser = Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1])) + 1 ;Count the item Else ;Otherwise $QPointerIncreaser = Int($ir[4][1] / ($RectangleSize[2] - $RectangleSize[1])) ;Discount the item EndIf _GUICtrlListClear($lstQueue) ;Clear the dummy entries EndIf ;Search Text: Local $ir = IniReadSection($PATH & "skin.ini","SearchText") If @error Then MsgBox(16, "Fatal Error!", "Section ""[SearchText]"" was not found in file """ & $PATH & "skin.ini""") Exit Else $txtSearch = GUICtrlCreateInput("", $ir[1][1], $ir[2][1], $ir[3][1], $ir[4][1], BitXOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) ;Creates the Search TextBox GUICtrlSetFont($txtSearch, $ir[5][1]) ;Sets the font size EndIf ;Default 'Enter' Button $btnEnter = GUICtrlCreateButton ("Enter", 0, 0, 1, 1, $BS_DEFPUSHBUTTON) GUICtrlSetState($btnEnter, $GUI_HIDE) ;hide the Enter button ;ONLY OSK + Optional Buttons For $i = 1 to 80 Local $ir = IniReadSection($PATH & "skin.ini", $i) ;Read the section of entry $i If @error==0 Then ;If there are no errors $btn[$i] = GUICtrlCreatePic($PATH & $ir[1][1], $ir[2][1], $ir[3][1], $ir[4][1], $ir[5][1], $SS_NOTIFY) If $i > 20 Then $OSKElements += 1 ;Count only the custom OSK keys (21+) EndIf Next If GUICtrlGetState($btn[5])==80 Then GUICtrlSetState($btn[5], $GUI_HIDE) ;Hides the Clear Button ;Other Initializations: QInit() ;Initializes the Queue List GUISetState (@SW_SHOW, $main) ;Show the GUI WinActivate ($main) ;Focuses on the GUI window GUICtrlSetState ($txtSearch, $GUI_FOCUS);Focuses on the Search Text Box EndFunc Func ClearJF() ControlSend($WSBLhandle, "", $WSBLhandle, "+{HOME}") ;Send SHIFT + HOME to the Edit Box Sleep(100) ;Needed, otherwise it's too fast for JTFP ControlSend($WSBLhandle, "", $WSBLhandle, "{DEL}") ;Send DELETE to the Edit Box EndFunc Func ClearEC() GUICtrlSetData($txtSearch, "") ;Send nothing to Search Box, AKA Clear EndFunc Func PrimitiveMove(ByRef $QRIndex) ;Can Primitive Move work like the Queue button now? Based on index + &Remove (instead of going down???) ControlFocus($WQLhandle, "", $WQLhandle);Reason I ask: now the skin being used is the default skin... Maybe it came with good changes. Send("{HOME}") ;NO! Because the Queue List in the plugin is actually a List VIEW!!! Use GUICtrlCreateListView For $i = 1 to $QRindex Send("{DOWN}") Next EndFunc Func SInit() _GUICtrlListClear($lstSongs) ;Clears the current list Local $SLimiter = $SPointer + $SPointerIncreaser ;Adjust the limiter if the pointer has changed If $SLimiter > $SItems Then $SLimiter = $SItems ;If there are less items than a full list, set the limiter to that. If $SLimiter > 0 Then ;Ensures the list isn't empty If $SItems >= $SLimiter Then ;If the Winamp song list is larger than the pointer to the last item in the song list For $i = $SPointer to ($SLimiter-1) _GUICtrlListAddItem($lstSongs, _GUICtrlListGetText($WSLhandle, $i)) Next Else ;If the pointer to the last item in the song list is larger than the Winamp song list MsgBox(0,"Error:", "SInit(): This isn't supposed to happen!") ;This HAS to be taken care of so that it never happens. EndIf EndIf _GUICtrlListSelectIndex($lstSongs, 0) ;Set the selected item to the top of the list $SItemsOld = $SItems 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 _GUICtrlListSelectIndex($lstQueue, 0) ;Select the top entry in the queue list EndIf $QItemsOld = $QItems ;takes note of new changes EndFunc Func ClearCancelState() ;Swaps between the Cancel and Clear buttons according to the lstSongs and txtSearch selection If GUICtrlGetState($btn[4])==80 AND GUICtrlRead($txtSearch)<>"" Then GUICtrlSetState($btn[4], $GUI_HIDE) GUICtrlSetState($btn[5], $GUI_SHOW) EndIf If GUICtrlGetState($btn[5])==80 AND GUICtrlRead($txtSearch)=="" Then GUICtrlSetState($btn[5], $GUI_HIDE) GUICtrlSetState($btn[4], $GUI_SHOW) EndIf EndFunc Func OSK() For $i = 21 to ($OSKElements + 20) ;Set $i from the beginning of custom keys (21) to the end of the OSK elements + 20 (reserved) If $msg = $btn[$i] Then ;If there is a message from the actual button, Local $ir = IniRead($PATH & "skin.ini", $i, "key", "") ;Look for the text, under "key", under the button's section, in the "skin.ini" file. SendKey($ir) EndIf Next EndFunc Func SendKey(ByRef $str) ;First type to Winamp's JTF search box ;Then type to the txtSearch If ControlGetText($WSBLhandle,"",$WSBLhandle)<>GUICtrlRead($txtSearch) Then ;checks if the Winamp Input Box = to the text in the plugin's input box Local $strInput = GUICtrlRead($txtSearch) ClearJF() ;Quickly clear the Winamp input box (in case backspaces was used) ControlSend($WSBLhandle, "", $WSBLhandle, $strInput) ;Send the whole string to JTFP's Edit Box EndIf ControlSend($WSBLhandle, "", $WSBLhandle, $str) ;Send string to JTFP's Edit Box If StringLen($str)>1 Then ;If $str is Backspace, Space, a multicharacter string, 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, $SItemsOld = $SItems ;Note changes $SPointer = 0 ;Set the selected item to the top of the entire list EndIf EndFunc