JScript: How to give focus to popup window

javascript, popup, window, wsh

Solution

Perhaps this would help:

WScript.Shell.Popup has an undocumented value for the nType parameter which causes the resulting dialogs/popups to “stay on top” / in foreground, meaning that they cannot be hidden by other windows or dialogs: 4096.

WScript.CreateObject("WScript.Shell").Popup("Message", 0, "Title", 4096);

Problem

I'm making new window this way: ``` var WSHShell = WScript.CreateObject("WScript.Shell"); WSHShell.Popup("This is popup."); ``` But window appears under another ones. How can I move it to the front?

Original source