2016-08-02 80 views
1

我有這個簡單的Windows JavaScript,它將每隔30分鐘彈出一個提醒10秒鐘。如何讓彈出窗口出現在所有其他窗口的頂部?Windows腳本主機彈出 - 在其他窗口之上

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

回答

0

得到了Clackwell’s Weblog

WScript.Shell.Popup答案有導致結果對話框/彈出窗口「留在上面」 /在前臺N型參數的無證值,這意味着他們不能4096

JScript example: 

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

VBScript example: 

WScript.CreateObject(「WScript.Shell」).Popup 「Message」, 0, 「Title」, 4096 

MSDN

還記載:被其他窗口或對話框被隱藏