View Single Post
Old 01-25-2020, 01:15 AM   #917
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,907
Default

Quote:
Originally Posted by amagalma View Post
This works great! Thank you very much Edgemeal!
Another possible way, this doesn't change the combo index like the other code. Tested on 'presets' combobox of a floating ReaEQ FX window...

Code:
 floatVST = reaper.JS_Window_FindTop('VST: ReaEQ (Cockos)', false) -- floatng FX window
 if not floatVST then return end
 container = reaper.JS_Window_FindChildByID(floatVST, 0) -- combobox is inside child window
 combobox = reaper.JS_Window_FindChildByID(container, 0x3E8) -- FX 'Presets' combobox
 itemCount = reaper.JS_WindowMessage_Send(combobox, "CB_GETCOUNT", 0,0,0,0)

 for i = 0, itemCount-1 do
   bufSize = reaper.JS_WindowMessage_Send(combobox, "CB_GETLBTEXTLEN", i ,0,0,0) 
   m = reaper.JS_Mem_Alloc(bufSize)
   txt_len = reaper.JS_WindowMessage_Send(combobox, "CB_GETLBTEXT", i, 0, reaper.JS_Window_AddressFromHandle(m) ,0)
   retval, item_txt = reaper.JS_String(m, 0, txt_len)
   reaper.JS_Mem_Free(m)
   reaper.ShowConsoleMsg(item_txt..'\n')
 end
Edgemeal is offline   Reply With Quote