overwolf.windows API
Use this API to create, interact with and modify your app’s windows.
Please make sure to read our guide on how to use Overwolf windows, to learn everything about Overwolf app windows, and how to use them properly and efficiently in your app.
Methods Reference
- overwolf.windows.getMainWindow()
- overwolf.windows.getCurrentWindow()
- overwolf.windows.obtainDeclaredWindow()
- overwolf.windows.obtainDeclaredWindow()
- overwolf.windows.obtainDeclaredWindow()
- overwolf.windows.getWindow()
- overwolf.windows.dragMove()
- overwolf.windows.dragResize()
- overwolf.windows.dragResize()
- overwolf.windows.dragResize()
- overwolf.windows.changeSize()
- overwolf.windows.changeSize()
- overwolf.windows.changePosition()
- overwolf.windows.close()
- overwolf.windows.minimize()
- overwolf.windows.maximize()
- overwolf.windows.restore()
- overwolf.windows.restore()
- overwolf.windows.hide()
- overwolf.windows.getWindowState()
- overwolf.windows.getWindowsStates()
- overwolf.windows.openOptionsPage()
- overwolf.windows.setDesktopOnly()
- overwolf.windows.setRestoreAnimationsEnabled()
- overwolf.windows.setTopmost()
- overwolf.windows.sendToBack()
- overwolf.windows.sendMessage()
- overwolf.windows.setWindowStyle()
- overwolf.windows.removeWindowStyle()
- overwolf.windows.getOpenWindows()
- overwolf.windows.setMute()
- overwolf.windows.muteAll()
- overwolf.windows.isMuted()
- overwolf.windows.isWindowVisibleToUser()
- overwolf.windows.requestOverlayFocus()
- overwolf.windows.requestOverlayFocus()
- overwolf.windows.bringToFront()
- overwolf.windows.bringToFront()
- overwolf.windows.bringToFront()
- overwolf.windows.bringToFront()
- overwolf.windows.setPosition()
- overwolf.windows.setPosition()
- overwolf.windows.displayMessageBox()
- overwolf.windows.isAccelreatedOSR()
- overwolf.windows.setMinSize()
- overwolf.windows.flash()
- overwolf.windows.setZoom()
- overwolf.windows.setWidgetStyle()
- overwolf.windows.removeWidgetStyle()
Events Reference
- overwolf.windows.onMainWindowRestored
- overwolf.windows.onStateChanged
- overwolf.windows.onMessageReceived
- overwolf.windows.onAltF4Blocked
- overwolf.windows.onScreenPropertyChanged
Types Reference
- overwolf.windows.WindowProperties Object
- overwolf.windows.RelativeTo Object
- overwolf.windows.SetWindowPositionProperties Object
- overwolf.windows.MessageBoxParams Object
- overwolf.windows.ODKRect Object
- overwolf.windows.enums.MessagePromptIcon Enum
- overwolf.windows.enums.WindowDragEdge Enum
- overwolf.windows.enums.WindowStyle Enum
- overwolf.windows.enums.FlashBehavior Enum
- overwolf.windows.onScreenPropertyChangedEvent Object
- overwolf.windows.WindowStateChangedEvent Object
- overwolf.windows.WindowResult Object
- overwolf.windows.WindowInfo Object
- overwolf.windows.enums.WindowStateEx Enum
- overwolf.windows.DragMovedResult Object
- overwolf.windows.DragResizeResult Object
- overwolf.windows.WindowIdResult Object
- overwolf.windows.GetWindowStateResult Object
- overwolf.windows.GetWindowStatesResult Object
- overwolf.windows.IsMutedResult Object
- overwolf.windows.IsWindowVisibleToUserResult Object
- overwolf.windows.DisplayMessageBoxResult Object
- overwolf.windows.MessageReceivedEvent Object
- overwolf.windows.AltF4BlockedEvent Object
- overwolf.windows.widgetStyleObject Object
getMainWindow()
Version added: 0.113
Returns a window object of the index page.
This function allows you to get direct access to your main index page (which should be a controller/background page) and it’s HTML Window object (and thus any JS function or DOM element), which is also guaranteed to exist when calling this method from any other window (unlike the getOpenWindows()).
If you hold one global "manager" object in your background, then all other windows have a single object to interact with. This is why we recommend the getMainWindow() approach.
overwolf.windows.sendMessage performs object copying, so it might be a bit less efficient - depending on your use-case
Read more in the "Communication between windows" section.