View Single Post
Old 01-18-2019, 11:59 AM   #196
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

As far as I understood, you can access all windows opened in Windows at least, not only Reaper-windows.

So you can't be sure of what the user does. Opening a gfx-window doesn't necessarily mean, the foreground window is that gfx-window, but can be a texteditor or such.

My code circumvents that. I might add other safety-mechanisms as well to make wrong hwnds even more unlikely.


@juliansader

Quote:
When finding windows by title, it is always safer to use JS_Localize to get the localized title text. I'm not sure if this will solve the problem, but it is worth a try.

Perhaps do a Window_ListAllTop and check the titles of the all the windows in the list?
Good to know. I'm also trying to find a way to get all HWNDs for all Reaper-windows without accidentally getting the wrong one due same-naming and such. So this hopefully helps.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote