2014-03-13 76 views
0

有沒有辦法打開圖片,就像'全屏'中的彈出窗口?VBS打開圖片全屏

這是我的代碼:

intAnswer = _ 
    Msgbox("Do you want to open Welcome.png?", _ 
     vbYesNo, "Open Png?") 

If intAnswer = vbYes Then 
    Msgbox "Opening..." 
    "open %userprofile%/directory/welcome.png in fullscreen" 
Else 
    Msgbox "Not opening..." 
End If 

回答

3

顯示圖片全屏不可能單獨的VBScript。你需要一個應用程序來進行顯示。例如一個HTA將工作:

<head> 
<title>SplashScreen</title> 
<HTA:APPLICATION ID="oHTA" 
    APPLICATIONNAME="SplashScreen" 
    SCROLL="no" 
    SINGLEINSTANCE="yes" 
    WINDOWSTATE="maximize" 
> 
<style type="text/css"> 
* { 
    margin: 0; 
    padding: 0; 
    border: 0; 
} 
</style> 
</head> 

<script language="VBScript"> 
    Sub Window_onLoad 
    document.all.splash.width = document.body.offsetWidth 
    document.all.splash.height = document.body.offsetHeight 
    End Sub 
</script> 

<body> 
<p><img id='splash' src='C:\path\to\your.jpg'></p> 
</body> 

運行它像這樣從你的VBScript:

If intAnswer = vbYes Then 
    Msgbox "Opening..." 
    CreateObject("WScript.Shell").Run "C:\path\to\your.hta", 1, True 
Else 
    Msgbox "Not opening..." 
End If 
+0

不知道這是可能的HTA安斯加爾。真棒! – Rich