Windows Scripting Host弹出窗口 - 在其他窗口之上

时间:2016-08-02 14:47:52

标签: javascript windows wsh

我有这个简单的Windows JavaScript,它会每30分钟弹出一次提醒,持续10秒。如何让弹出窗口显示在所有其他窗口的顶部?

var wshShell = WScript.CreateObject("WScript.Shell");
while(1) {
    var value = wshShell.Popup("Reminder text", 10, "Reminder", 0x1);
    if (value == 2) { // Cancel button pressed
        break;  
    }

    WScript.sleep(30 * 60 * 1000); // Every 30 minutes
}

WScript.Echo("Exiting timer!");

1 个答案:

答案 0 :(得分:0)

得到Clackwell’s Weblog

的答案

WScript.Shell.Popup有一个未记录的nType参数值,该值导致生成的对话框/弹出窗口“保持在顶部”/在前台,这意味着它们不能被其他窗口或对话框隐藏:4096。

url: "Students/SearchStudent"

还记录在MSDN