在启动应用程序,exe文件之前显示无边框的图像? [英] display Image with no border before starting an app,exe file?

查看:42
本文介绍了在启动应用程序,exe文件之前显示无边框的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以有些工具,一些转换工具,可以在启动转换后的应用程序之前和完成之后显示图像! 这是我非常想知道的非常有趣的事情, 所以问题是这样的: 您如何-使用vbs,js,html,hta,css ...-显示图像(基本上不在默认的Windows图像查看器中,您知道我在说什么)?

ok so some tools , some converting tools, give the ability to display an image before starting the converted application, and after done ! that is something very interesting i definitely want to know about, so the question is this : how can you -using vbs,js,html,hta,css...- display an image (basically not in default windows image viewer you know what i'm talking about) ?

首先,我要以该图像为背景并且没有边框,但是尝试后该图像仍然具有较小的边框.

i first tough it's hta with that image as a background and no border but after trying it the image still have small borders.

有什么主意!!?希望有

any ideas, !? hope there is

推荐答案

尝试仅在 windows 7

注意:此示例不适用于Windows XP

[VBS/HTA]弹出一个在后台播放歌曲的图像

Option Explicit
Dim URL,ws,fso,Srcimage,Temp,PathOutPutHTML,fhta,stRep,stFichier,oShell,oFolder,oFichier,Dimensions
Dim arrSize,intLength,intHorizontalSize,intVerticalSize,Tab
URL = "http://www.animatedimages.org/data/media/902/animated-tunisia-flag-image-0023.gif"
Set ws = CreateObject("wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Temp = WS.ExpandEnvironmentStrings("%Temp%")
PathOutPutHTML = Temp & "\image.hta"
Set fhta = fso.OpenTextFile(PathOutPutHTML,2,True)
stRep = Temp
Tab = split(url,"/")
stFichier = Tab(UBound(Tab))
Srcimage = stRep & "\" & stFichier
If Not fso.FileExists(Srcimage) Then
   Call DownloadingFile(URL,Srcimage)
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace(stRep)
Set oFichier = oFolder.Items.Item(stFichier)
Dimensions = oFolder.GetDetailsOf(oFichier,31)
arrSize = Split(Dimensions,"x")
'***************************************Important à savoir **********************************************
'Instead, we ended up retrieving item 31, which gave us the total dimensions of the picture,
'using an output format similar to this: ?150 x 354?
'http://blogs.technet.com/b/heyscriptingguy/archive/2008/05/16/how-can-i-search-a-folder-for-all-the-image-files-that-are-not-a-specified-height-and-width.aspx
'Un grand merci à omen999 ==>
'http://www.developpez.net/forums/d1504644/autres-langages/general-visual-basic-6-vbscript/vbscript/passage-variables-procedure/#post8163406
intLength = Len(arrSize(0))
intHorizontalSize = Right(arrSize(0),intLength -1)
intLength = Len(arrSize(1))
intVerticalSize = Left(arrSize(1),intLength - 1)
'***************************************Important à savoir **********************************************
   Call LoadImage(Srcimage,intHorizontalSize,intVerticalSize,Timeout(51))
   ws.run "mshta.exe " & PathOutPutHTML
Else
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace(stRep)
Set oFichier = oFolder.Items.Item(stFichier)
Dimensions = oFolder.GetDetailsOf(oFichier,31)
arrSize = Split(Dimensions,"x")
intLength = Len(arrSize(0))
intHorizontalSize = Right(arrSize(0),intLength -1)
intLength = Len(arrSize(1))
intVerticalSize = Left(arrSize(1),intLength - 1)
   Call LoadImage(Srcimage,intHorizontalSize,intVerticalSize,Timeout(51))
   ws.run "mshta.exe " & PathOutPutHTML
End If
'********************************************************************************************************
Function TimeOut(T)
   TimeOut = T * 1000
End Function
'********************************************************************************************************
Sub LoadImage(Srcimage,intHorizontalSize,intVerticalSize,TimeOut)
   fhta.WriteLine "<html>"
   fhta.WriteLine "   <hta:application id=""oHTA"" "
   fhta.WriteLine "     border=""none"" "
   fhta.WriteLine "     caption=""no"" "
   fhta.WriteLine "     contextmenu=""no"" "
   fhta.WriteLine "     innerborder=""no"" "
   fhta.WriteLine "     scroll=""no"" "
   fhta.WriteLine "     showintaskbar=""no"" "
   fhta.WriteLine "   />"
   fhta.WriteLine "<style>"
   fhta.WriteLine "{ margin: 0; padding: 0; }"
   fhta.WriteLine "body {background: url(" & DblQuote(Srcimage) & ") no-repeat center center fixed;}"
   fhta.WriteLine "</style>"
   fhta.WriteLine "   <script language=""VBScript"">"
   fhta.WriteLine "     Sub Window_OnLoad()"
   fhta.WriteLine "       width = " & intHorizontalSize
   fhta.WriteLine "       height = " & intVerticalSize
   fhta.WriteLine "       window.resizeTo width, height"
   fhta.WriteLine "       window.moveTo screen.availWidth\2 - width\2, screen.availHeight\2 - height\2"
   fhta.WriteLine "       idTimer = window.setTimeout(""vbscript:window.close"","& TimeOut &")"
   fhta.WriteLine "        window.setInterval ""setfocus()"",100"
   fhta.WriteLine "     End Sub"
   fhta.WriteLine "     Function setfocus"
   fhta.WriteLine "       Window.Focus()"
   fhta.WriteLine "     End Function"
   fhta.WriteLine "   </script>"
   fhta.WriteLine "<body>"
   fhta.WriteLine "<bgsound src=""http://upload.wikimedia.org/wikipedia/commons/2/23/Humat_al-Hima.ogg"">"
   fhta.WriteLine "</body>"
   fhta.WriteLine "</html>"
End Sub
'**********************************************************************************************
Function DblQuote(Str)
   DblQuote = Chr(34) & Str & Chr(34)
End Function
'**********************************************************************************************
Sub DownloadingFile(URL,strHDLocation)
Dim Titre,objFSO,Ws,objXMLHTTP,PathScript,Tab,objADOStream,Command,Start,File
Dim MsgTitre,MsgAttente,StartTime,DurationTime,ProtocoleHTTP
Set objFSO = Createobject("Scripting.FileSystemObject")
Set Ws = CreateObject("wscript.Shell")
ProtocoleHTTP = "http://"
If Left(URL,7) <> ProtocoleHTTP Then
URL = ProtocoleHTTP & URL
End if
Tab = split(url,"/")
File =  Tab(UBound(Tab))
File = Replace(File,"%20"," ")
File = Replace(File,"%28","(")
File = Replace(File,"%29",")")
   Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
   strHDLocation = PathScript & "\" & File
   On Error Resume Next
  objXMLHTTP.open "GET",URL,false
   objXMLHTTP.send()
If Err.number <> 0 Then
  MsgBox err.description,16,err.description
  Exit Sub
  Else
  If objXMLHTTP.Status = 200 Then
  strHDLocation = Temp & "\" & File
  Set objADOStream = CreateObject("ADODB.Stream")
  objADOStream.Open
  objADOStream.Type = 1 'adTypeBinary
  objADOStream.Write objXMLHTTP.ResponseBody
  objADOStream.Position = 0  'Set the stream position to the start
  objADOStream.SaveToFile strHDLocation,2 '2=adSaveCreateOverWrite
  objADOStream.Close
  Set objADOStream = Nothing
  End If
End if
Set objXMLHTTP = Nothing
End Sub

这篇关于在启动应用程序,exe文件之前显示无边框的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆