2013-04-15 4 views
1

Je viens d'écrire un script de base pour un gadget Windows qui s'exécute tranquillement jusqu'à ce qu'il reconnaisse un changement. Le seul problème que je rencontre est que je veux fantaisie le gadget et avoir des bords incurvés. J'ai essayé d'utiliser une image png avec les coins enlevés mais cela ne fonctionne pas, il apparaît toujours comme une boîte carrée. J'ai aussi essayé de le faire par CSS mais je n'arrive pas à le comprendre.HTA - Arêtes arrondies du gadget Windows

Est-ce que quelqu'un sait comment créer des arêtes courbes dans HTA/CSS/VBScript? Je ne suis pas sûr d'où cela devrait arriver, c'est un gadget.

Merci beaucoup.

// EDIT

Voici le code entier:

<html> 
<head> 
<title>Chrome Version Checker</title> 
<HTA:APPLICATION 
APPLICATIONNAME="Chrome Version Checker" 
ID="ChromeCheck" 
VERSION="1.0.0.0" 
BORDER="thin" 
BORDERSTYLE="complex" 
ICON="chrome_updater_256px.ico" 
SCROLL="no" 
SINGLEINSTANCE="yes" 
CONTEXTMENU="no" 
NAVIGABLE="yes" 
SELECTION="no"/> 
<script language="vbscript"> 
Dim timerID, CurrentTime 
Sub Window_OnLoad 
    timerID = window.setInterval("RefreshTime", 360000) 'milliseconds 
    RefreshTime 
End Sub 
self.ResizeTo 190,194 
</script> 
<style type="text/css"> 
body 
{ 
    margin: 0; 
width: 130px; 
height: 134px; 
} 
span 
{ text-align:center; 
font-family: arial; 
font-weight: bold; 
font-size: 12px; 
} 
</style> 
</head> 
<body> 
<table align="center"> 
<tr> 
<td> 
<span>Installed File</span> 
<br /> 
<span id = "InstallFile"></span> 
</td> 
</tr> 
<tr> 
<td colspan="2"> 
<hr> 
</td> 
</tr> 
<tr> 
<td> 
<span>Remote File</span> 
<br /> 
<span id = "RemoteFile"></span> 
</td> 
</tr> 
<tr> 
<td colspan="2"> 
<br /><span id = "StatusMSG"></span> 
</td> 
</tr> 
</table> 
</body> 
<html> 
<SCRIPT LANGUAGE="VBScript"> 
Sub RefreshTime 
set xmlhttp = createobject ("msxml2.xmlhttp.3.0") 
xmlhttp.open "get", "http://en.wikipedia.org/wiki/Google_Chrome", false 
xmlhttp.send 
strOutput = split(xmlhttp.responseText,"Stable release</a>")(1) 
strOutput = split(strOutput," <small>")(0) 
strOutput = replace(replace(strOutput,vbcr,""),vblf,"") 
strOutput = split(strOutput,"<p>")(1) 
    Dim File 
    set FSO = CreateObject("Scripting.FileSystemObject")  
    File = FSO.GetFileVersion("C:\Program Files\Google\Chrome\Application\chrome.exe") 
    if File = strOutput Then 
     InstallFile.InnerHTML = File 
     RemoteFile.InnerHTML = strOutput 
     StatusMSG.InnerHTML = "Up to date" 
     document.body.background="tick.png" 
     document.body.style.backgroundPosition = "center" 
     document.body.style.backgroundRepeat = "no-repeat" 
    else 
     InstallFile.InnerHTML = File 
     RemoteFile.InnerHTML = strOutput 
     StatusMSG.InnerHTML = "Not up to date" 
     document.body.background="cross.jpg" 
     ' --------------------------------------- 
     Set xmlDoc = CreateObject("Microsoft.XMLDOM") 
     xmlDoc.load "\\s007\Global\IT\ChromeStandaloneSetup.xml" 
     xmlDoc.Async = "False" 
     Set nNode = xmlDoc.selectsinglenode ("//ChromeUpdater/Config/Version") 
     nNode.text = strOutput 
     strResult = xmldoc.save("\\s007\Global\IT\ChromeStandaloneSetup.xml") 
     ' ---------------------------------------   
     Dim iURL 
     Dim objShell 
     iURL = "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B8DD6B5B9-54BE-D8AD-7E05-FBA19DDAA0B0%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dtrue%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeStandaloneSetup.exe" 
     set objShell = CreateObject("Shell.Application") 
     ' -------------------------- 
     objShell.ShellExecute "chrome.exe", iURL, "", "", 1 
     '--------------------------- 


     Ret = Msgbox("Do you wish to update now?",VBYesNo,"Update Now") 
     If Ret = 6 then    
      Set objShell = WScript.CreateObject("WScript.Shell") 
      objShell.Run("""C:\Program Files\Chrome Updater\ChromeUpdateV2.exe""") 
      Set objShell = Nothing 

     else  

     End If 
End If 
End Sub 
</SCRIPT> 

Un grand merci

+0

Pouvez-vous éditer votre question pour montrer le code/css que vous avez déjà? –

+0

'' & '' fait l'affaire quand IE> 8 est installé. – Teemu

+0

Merci, je vais probablement utiliser un PNG transparent pour que cela fonctionne? – Hyperjase

Répondre

1

Voici un exemple de la façon dont je tournai les coins dans une HTA en utilisant CSS.

<html> 
<head> 
    <title>Rounded Corners</title> 

    <HTA:APPLICATION 
    APPLICATIONNAME="Rounded Corners" 
    ID="RestoreHta" 
    VERSION="1.0" 
    BORDER="dialog" 
    BORDERSTYLE="complex" 
    INNERBORDER="no" 
    SCROLL="no" 
    CONTEXTMENU="no"/> 

<style type="text/css"> 

    .b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden;display:block;} 
    .b1f {height:1px; background:#ddddbb; margin:0 5px} 
    .b2f {height:1px; background:#ddddbb; margin:0 3px} 
    .b3f {height:1px; background:#ddddbb; margin:0 2px} 
    .b4f {height:2px; background:#ddddbb; margin:0 1px} 
    .cf {background: #ddddbb} 
    .cf div {margin-left: 5px;} 
#DataOptions { 
    background-color: #ddddbb; 
    width: 100%; 
    padding: 1.1em; 
} 

</style> 

<SCRIPT Language="VBScript"> 

Sub Window_Onload 
self.ResizeTo 300,300 
End Sub 


</SCRIPT>  

</head> 

<body> 
<b class="b1f"></b><b class="b2f"></b><b class="b3f"></b><b class="b4f"></b><div class="cf"><div> 
    <div id="DataOptions"> 
     <table width="100%" height="100"> 
      <tr> 
       <td bwidth="100%"><center>Rounded Corners</center></td> 
      </tr> 
     </table> 
    </div> 

    </div></div><b class="b4f"></b><b class="b3f"></b><b class="b2f"></b><b class="b1f"></b> 

</body> 
</html> 
+0

Merci, mais je me rends vite compte que CSS ne fait pas ce dont j'ai besoin, j'ai trouvé que l'utilisation de trois images (haut et bas avec transparence) correspond mieux à la facture, cependant, pour ajouter à la complexité, je J'utilise une image dans un "if else" avec vbscript, qui écrit en arrière-plan. Si je peux utiliser cette image comme arrière-plan qui serait préférable. Le code que j'ai posté ci-dessus est toujours le même. Merci beaucoup. – Hyperjase