Best way to get a window's dimensions and position

Reading the docs, I could find two ways to get a window’s dimensions (or properties in general): overwolf.windows.getCurrentWindow and overwolf.windows.getDeclaredWindow.

Is there a recommended way to get a window’s properties (one of the above or maybe a third one)?

Specifically, something which reliably gives me the window’s height, width, top and left properties, right after it was moved and/or resized via overwolf.windows.changePosition and/or overwolf.windows.changeSize.

Top and left relative to a game window of course.

Thanks

PS: it’d be nice if overwolf.windows.changePosition and/or overwolf.windows.changeSize callbacks returned the window’s new (top, left) and (width, height) respectivelly (or maybe a reference to the entire window object with the updated values).

Hi,

I will answer your questions later today. Thanks.

Friendly reminder :slight_smile:.

Hi and sorry about the delay.

We are planning to make some internal enhancements soon to the Windows API. So maybe we will have better options from today.

Meanwhile, depending on your scenario, you should use the available events (for example, onScreenPropertyChanged when you want to “catch” when the window is moved between monitors) or functions like getCurrentWindow() that gives you the current dimensions.

Also, note that you should take into consideration some DPI issues. We added this table on the last two days: Windows Resolution Size and Position · Overwolf

This table gives you some more info about the different windows functions and their relation to DPI scaling.

Thanks