开发者

JScript: How to give focus to popup window

开发者 https://www.devze.com 2022-12-19 23:08 出处:网络
I\'m making new window this way: var WSHShell = WScript.CreateObject(\"WScript.Shell\"); WSHShell.Popup(\"This is popup.\");

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?


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);


Using 4096 works for popups to "stay on top"

I'm trying to create Popups in Ruby and Watir Webdriver.

I installed win32ole-pp rubygem

I used this in my Code and it works:

require 'win32ole'

WshShell = WIN32OLE.new("WScript.Shell").Popup("Message", 5, "Title", 4096);

0

精彩评论

暂无评论...
验证码 换一张
取 消