console: add API to get underlying gui window ID