View Single Post
Old 04-15-2019, 10:08 AM   #92
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 103
Default

Sexan, It was already in your code, as you found track window, you can also find Envelope window:

Code:
function msg(m)
  reaper.ShowConsoleMsg(tostring(m) .. "\n")
end


env =  reaper.GetSelectedEnvelope(0)


main_wnd = reaper.GetMainHwnd()
retval, found = reaper.JS_Window_ListAllChild(main_wnd)
msg(env)
for adr in found:gmatch("%w+") do
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
      if reaper.JS_Window_GetLongPtr(handl, "USER") == env then 
        
        retval, left, top, right, bottom = reaper.JS_Window_GetRect(handl) 
        
        msg(bottom-top) break
        
      end
    end
nappies is online now   Reply With Quote