View Single Post
Old 05-24-2019, 09:26 AM   #482
Human being with feelings
mespotine's Avatar
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,901

Originally Posted by DaveKeehl View Post
Hi, I just started coding some scripts in lua for reaper and I don't understand what HWND means (for example in reaper.GetMainHwnd). Can someone explain it to me?
It's an object, that reflects a window or a gui-element in a window.

For instance GetMainHwnd returns the object of Reaper's main window(the one with the arrangeview in it) and you can manipulate it using appropriate functions.
If you use the most recent version of SWS and/or the js-extension, there are functions, who allow you to do that, like getting/changing position, title, scrollstate of the window, etc.

When I say, gui-element: not all Gui-elements in Reaper have a hwnd, only the ones that are system-dialogs/elements. For instance, all elements in the Render to File-dialog have hwnds, the solo button of a track has not(afaik)

Edit: try experimenting with JS_Window_SetTitle to get an idea.

Needs the js-extension-plugin, which you can get here:
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote